00001 00012 /*************************************************************************** 00013 * Copyright (C) 2007 by Jan Koci * 00014 * honza.koci@email.cz * 00015 * http://kengine.sourceforge.net/tutorial/ 00016 * * 00017 * This program is free software; you can redistribute it and/or modify * 00018 * it under the terms of the GNU General Public License as published by * 00019 * the Free Software Foundation; either version 2 of the License, or * 00020 * (at your option) any later version. * 00021 * * 00022 * This program is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00025 * GNU General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU General Public License * 00028 * along with this program; if not, write to the * 00029 * Free Software Foundation, Inc., * 00030 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00031 ***************************************************************************/ 00032 00033 #pragma once 00034 00035 #include "../MathCore/K3dVector3.h" 00036 #include "K3dPoly.h" 00037 00038 class K3dVorLeaf 00039 { 00040 TVertexArray m_vVertex; 00041 TVertexArray::iterator m_itVertex; 00042 K3dPlaneObj *m_pPlane; 00043 K3dVorLeaf *m_pFrontLeaf; 00044 K3dVorLeaf *m_pBackLeaf; 00045 K3dPolyObj *m_pPoly; 00046 00047 public: 00048 K3dVorLeaf(); 00049 ~K3dVorLeaf(); 00050 00052 TVertexArray &GetVertexArray() 00053 { 00054 return m_vVertex; 00055 } 00056 00058 void AddVertex ( K3dVertexObj *_pVertex ) 00059 { 00060 m_vVertex.push_back ( _pVertex ); 00061 } 00062 00064 void DeleteVertex ( K3dVertexObj *_pVertex ) 00065 { 00066 m_itVertex = find ( m_vVertex.begin(), m_vVertex.end(), _pVertex ); 00067 if ( m_itVertex != m_vVertex.end() ) 00068 { 00069 m_vVertex.erase ( m_itVertex ); 00070 } 00071 else 00072 { 00073 cerr << "K3dPoly::DeleteVertex -- Vertex " << _pVertex << " doesn't exists " << endl; 00074 } 00075 } 00076 00078 K3dPlaneObj *GetPlane() 00079 { 00080 return m_pPlane; 00081 } 00082 00084 void SetPlane ( K3dPlaneObj *_pPlane ) 00085 { 00086 m_pPlane = _pPlane; 00087 } 00088 00090 K3dVorLeaf *GetFrontLeaf() 00091 { 00092 return m_pFrontLeaf; 00093 } 00094 00096 void SetFrontLeaf ( K3dVorLeaf *_pFrontLeaf ) 00097 { 00098 m_pFrontLeaf = _pFrontLeaf; 00099 } 00100 00102 K3dVorLeaf *GetBackLeaf() 00103 { 00104 return m_pBackLeaf; 00105 } 00106 00108 void SetBackLeaf ( K3dVorLeaf *_pBackLeaf ) 00109 { 00110 m_pBackLeaf = _pBackLeaf; 00111 } 00112 00114 K3dPolyObj *GetPoly() 00115 { 00116 return m_pPoly; 00117 } 00118 00120 void SetPoly ( K3dPolyObj *_pPoly ) 00121 { 00122 m_pPoly = _pPoly; 00123 } 00124 }; 00125