00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #pragma once
00034
00035 #include "../MathCore/K3dVector3.h"
00036 #include "K3dLineObj.h"
00037 #include "K3dPolyPlane.h"
00038
00039 class K3dPoly
00040 {
00041 TVertexArray m_vVertex;
00042 TLineArray m_vEdge;
00043 TPolyPlaneArray m_vPlane;
00044 TVertexArray::iterator m_itVertex;
00045 TLineArray::iterator m_itEdge;
00046 TPolyPlaneArray::iterator m_itPlane;
00047 public:
00048 K3dPoly();
00049 ~K3dPoly();
00050
00051 void DeletePoly();
00052
00054 TVertexArray &GetVertexArray()
00055 {
00056 return m_vVertex;
00057 }
00058
00060 void AddVertex ( K3dVertexObj *_pVertex )
00061 {
00062
00063 m_itVertex= find ( m_vVertex.begin(), m_vVertex.end(), _pVertex );
00064 if ( m_itVertex == m_vVertex.end() )
00065 {
00066
00067 m_vVertex.push_back ( _pVertex );
00068 }
00069 }
00070
00072 void DeleteVertex ( K3dVertexObj *_pVertex )
00073 {
00074 m_itVertex = find ( m_vVertex.begin(), m_vVertex.end(), _pVertex );
00075 if ( m_itVertex != m_vVertex.end() )
00076 {
00077 m_vVertex.erase ( m_itVertex );
00078 }
00079 else
00080 {
00081 cerr << "Error - K3dPoly::DeleteVertex() -- Vertex " << _pVertex << " doesn't exists " << endl;
00082 }
00083 }
00084
00086 TLineArray &GetEdgeArray()
00087 {
00088 return m_vEdge;
00089 }
00090
00092 void AddEdge ( K3dLineObj *_pEdge )
00093 {
00094
00095 m_itEdge = find ( m_vEdge.begin(), m_vEdge.end(), _pEdge );
00096 if ( m_itEdge == m_vEdge.end() )
00097 {
00098
00099 m_vEdge.push_back ( _pEdge );
00100 }
00101 }
00102
00104 void DeleteEdge ( K3dLineObj *_pEdge )
00105 {
00106 m_itEdge = find ( m_vEdge.begin(), m_vEdge.end(), _pEdge );
00107 if ( m_itEdge != m_vEdge.end() )
00108 {
00109 m_vEdge.erase ( m_itEdge );
00110 }
00111 else
00112 {
00113 cerr << "K3dPoly::DeleteEdge -- Edge " << _pEdge << " doesn't exists " << endl;
00114 }
00115 }
00116
00118 TPolyPlaneArray &GetPlaneArray()
00119 {
00120 return m_vPlane;
00121 }
00122
00124 void AddPlane ( K3dPolyPlane *_pPlane )
00125 {
00126
00127 m_itPlane = find ( m_vPlane.begin(), m_vPlane.end(), _pPlane );
00128 if ( m_itPlane == m_vPlane.end() )
00129 {
00130
00131 m_vPlane.push_back ( _pPlane );
00132 }
00133 }
00134
00136 void DeletePlane ( K3dPolyPlane *_pPlane )
00137 {
00138 m_itPlane = find ( m_vPlane.begin(), m_vPlane.end(), _pPlane );
00139 if ( m_itPlane != m_vPlane.end() )
00140 {
00141 m_vPlane.erase ( m_itPlane );
00142 }
00143 else
00144 {
00145 cerr << "K3dPoly::DeletePlane -- Plane " << _pPlane << " doesn't exists " << endl;
00146 }
00147 }
00148 };
00149
00150