Initial
This commit is contained in:
97
mesh/segment.hpp
Normal file
97
mesh/segment.hpp
Normal file
@@ -0,0 +1,97 @@
|
||||
#ifndef _MESH_SEGMENT_HPP_
|
||||
#define _MESH_SEGMENT_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_GDIPOINT_HPP_
|
||||
#include <common/gdipoint.hpp>
|
||||
#endif
|
||||
|
||||
class PureDevice;
|
||||
|
||||
class Segment
|
||||
{
|
||||
public:
|
||||
Segment(void);
|
||||
Segment(const GDIPoint &firstPoint,const GDIPoint &secondPoint,WORD vectorIndex);
|
||||
Segment(const Segment &someSegment);
|
||||
virtual ~Segment(void);
|
||||
WORD operator==(const Segment &someSegment)const;
|
||||
void operator=(const Segment &someSegment);
|
||||
void drawSegment(PureDevice &displayDevice,HPEN hPen=0,bool setROP=true)const;
|
||||
WORD vectorIndex(void)const;
|
||||
WORD xFirst(void)const;
|
||||
WORD xSecond(void)const;
|
||||
WORD yFirst(void)const;
|
||||
WORD ySecond(void)const;
|
||||
const GDIPoint &firstPoint(void)const;
|
||||
const GDIPoint &secondPoint(void)const;
|
||||
void firstPoint(const GDIPoint &somePoint);
|
||||
void secondPoint(const GDIPoint &somePoint);
|
||||
GDIPoint leadingPoint(void)const;
|
||||
private:
|
||||
GDIPoint mFirstPoint;
|
||||
GDIPoint mSecondPoint;
|
||||
WORD mVectorIndex;
|
||||
};
|
||||
|
||||
inline
|
||||
WORD Segment::xFirst(void)const
|
||||
{
|
||||
return mFirstPoint.x();
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Segment::xSecond(void)const
|
||||
{
|
||||
return mSecondPoint.x();
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Segment::yFirst(void)const
|
||||
{
|
||||
return mFirstPoint.y();
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Segment::ySecond(void)const
|
||||
{
|
||||
return mSecondPoint.y();
|
||||
}
|
||||
|
||||
inline
|
||||
const GDIPoint &Segment::firstPoint(void)const
|
||||
{
|
||||
return mFirstPoint;
|
||||
}
|
||||
|
||||
inline
|
||||
const GDIPoint &Segment::secondPoint(void)const
|
||||
{
|
||||
return mSecondPoint;
|
||||
}
|
||||
|
||||
inline
|
||||
void Segment::firstPoint(const GDIPoint &somePoint)
|
||||
{
|
||||
mFirstPoint=somePoint;
|
||||
}
|
||||
|
||||
inline
|
||||
void Segment::secondPoint(const GDIPoint &somePoint)
|
||||
{
|
||||
mSecondPoint=somePoint;
|
||||
}
|
||||
|
||||
inline
|
||||
GDIPoint Segment::leadingPoint(void)const
|
||||
{
|
||||
return (mFirstPoint.y()<mSecondPoint.y()?mSecondPoint:mFirstPoint);
|
||||
}
|
||||
|
||||
inline
|
||||
WORD Segment::vectorIndex(void)const
|
||||
{
|
||||
return mVectorIndex;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user