This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

74
mdiwin/SEGMENT.BAK Normal file
View File

@@ -0,0 +1,74 @@
#include <mdiwin/segment.hpp>
Segment::Segment()
{
}
Segment::~Segment()
{
}
Segment::Segment(const Point &firstPoint,const Point &secondPoint,WORD vectorIndex)
{
mFirstPoint=firstPoint;
mSecondPoint=secondPoint;
mVectorIndex=vectorIndex;
}
Segment::Segment(const Segment &someSegment)
{
mFirstPoint=someSegment.mFirstPoint;
mSecondPoint=someSegment.mSecondPoint;
mVectorIndex=someSegment.mVectorIndex;
}
WORD Segment::operator==(const Segment &someSegment)const
{
return ((mFirstPoint==someSegment.mFirstPoint &&
mSecondPoint==someSegment.mSecondPoint)||
(mFirstPoint==someSegment.mSecondPoint &&
mSecondPoint==someSegment.mFirstPoint));
}
void Segment::operator=(const Segment &someSegment)
{
mFirstPoint=someSegment.mFirstPoint;
mSecondPoint=someSegment.mSecondPoint;
mVectorIndex=someSegment.mVectorIndex;
}
#if 0
void Segment::drawSegment(HDC hDC,HPEN hPen)const
{
DWORD currentPosition;
HPEN hOldPen(0);
int saveMode;
saveMode=::SetROP2(hDC,R2_NOT);
if(hPen)hOldPen=(HPEN)::SelectObject(hDC,hPen);
currentPosition=::GetCurrentPosition(hDC);
::MoveTo(hDC,mFirstPoint.xPoint(),mFirstPoint.yPoint());
::LineTo(hDC,mSecondPoint.xPoint(),mSecondPoint.yPoint());
::MoveTo(hDC,LOWORD(currentPosition),HIWORD(currentPosition));
if(hOldPen)::SelectObject(hDC,hOldPen);
::SetROP2(hDC,saveMode);
}
#endif
void Segment::drawSegment(HDC hDC,HPEN hPen)const
{
Point currentPosition;
HPEN hOldPen(0);
int saveMode;
saveMode=::SetROP2(hDC,R2_NOT);
if(hPen)hOldPen=(HPEN)::SelectObject(hDC,hPen);
::GetCurrentPositionEx(hDC,(POINT FAR*)&currentPosition);
::MoveToEx(hDC,mFirstPoint.xPoint(),mFirstPoint.yPoint(),(POINT FAR*)&currentPosition);
::LineTo(hDC,mSecondPoint.xPoint(),mSecondPoint.yPoint());
::MoveToEx(hDC,currentPosition.xPoint(),currentPosition.yPoint(),(POINT FAR*)&mSecondPoint);
if(hOldPen)::SelectObject(hDC,hOldPen);
::SetROP2(hDC,saveMode);
}