00001 #ifndef __CPolygon__ 00002 #define __CPolygon__ 00003 00004 #include "../Collections/TCountedPointerArray.hpp" 00005 #include "CPoint.hpp" 00006 00007 // =========================================================================== 00008 00009 using Exponent::Collections::TCountedPointerArray; 00010 using Exponent::MathTools::CPoint; 00011 00012 // =========================================================================== 00013 00014 namespace Exponent 00015 { 00016 namespace MathTools 00017 { 00035 class CPolygon : public CCountedObject 00036 { 00038 EXPONENT_CLASS_DECLARATION; 00041 // =========================================================================== 00042 00043 public: 00044 00045 // =========================================================================== 00046 00051 CPolygon(const long numberOfPoints); 00052 00057 CPolygon(const CPolygon &polygon); 00058 00062 CPolygon(); 00063 00067 virtual ~CPolygon(); 00068 00069 // =========================================================================== 00070 00076 virtual CPolygon &operator = (const CPolygon &polygon); 00077 00083 virtual bool operator == (const CPolygon &polygon); 00084 00085 // =========================================================================== 00086 00092 void setPoint(const CPoint &point, const long index); 00093 00099 CPoint *getPoint(const long index); 00100 00105 const TCountedPointerArray<CPoint> *getPointArray() const { return m_pointArray; } 00106 00111 TCountedPointerArray<CPoint> *getMutablePointArray() const { return m_pointArray; } 00112 00117 void initialiseArray(const long numberOfPoints); 00118 00123 long getNumberOfPoints() const; 00124 00129 void offset(const CPoint &point); 00130 00131 // =========================================================================== 00132 00133 protected: 00134 00135 // =========================================================================== 00136 00137 TCountedPointerArray<CPoint> *m_pointArray; 00138 }; 00139 } 00140 } 00141 #endif // End of CPolygon.hpp