MarSTDv2004: CPoly.h Source File

MarSTDv2004

CPoly.h

Go to the documentation of this file.
00001 #ifndef __Cpoly_h__
00002 #define __Cpoly_h__
00003 
00005 // MarSTD version 2004 - (c)2004 - Marcel Smit                      //
00006 //                                                                  //
00007 // [email protected]                                      //
00008 // [email protected]                                          //
00009 //                                                                  //
00010 // This code may not be used in a commercial product without my     //
00011 // permission. If you redistribute it, this message must remain     //
00012 // intact. If you use this code, some acknowledgement would be      //
00013 // appreciated. ;-)                                                 //
00015 
00017 
00018 
00019 
00020 #include "CEdge.h"
00021 #include "CMatrix.h"
00022 #include "CSphere.h"
00023 
00024 //---------------------------------------------------------------------------
00025 
00027 
00031 class CPoly
00032 {
00033 
00034     public:
00035  
00036         CPoly();
00037         ~CPoly();
00038         
00039     public:
00040  
00041         CEdge* edgeHead;        
00042         CEdge* edgeTail;        
00043         int edgeCount;          
00044         CPlane plane;           
00045         CSphere sphere;
00046         void* data;         
00047         
00048     public:
00049  
00054         CEdge* add(CEdge* edge);
00059         CEdge* addHead(CEdge* edge);
00064         CEdge* addTail(CEdge* edge);
00069         CEdge* unlink(CEdge* edge);
00074         void remove(CEdge* edge);
00078         void clear();
00079 
00080         void copy(CPoly* poly);
00081         CPoly* copy();
00082         
00088         void init();
00094         CSphere calculateSphere();
00098         int onFront(CPlane* plane);
00102         int onBack(CPlane* plane);
00107         CPoly* clip(CPlane* plane);
00111         CPoly* clipFront(CPlane* plane);
00115         void clip(CPlane* plane, CPoly* front, CPoly* back);
00129         void clip(CPoly* poly, CPoly* inside, class CMesh* outside);
00130         
00131         public:
00132         
00133         void reverseWinding();
00134         void triangulate(std::vector<CPoly*>* polyArray);
00135         
00136     public:
00137  
00138         CPoly* prev;    
00139         CPoly* next;    
00140   
00141     public:
00142     
00146         CPoly* unlink();
00147 
00148 };
00149 
00151 
00153 
00157 class CMesh
00158 {
00159 
00160     public:
00161     
00162         CMesh();
00163         ~CMesh();
00164         
00165     public:
00166  
00167         CPoly* polyHead;        
00168         CPoly* polyTail;        
00169         int polyCount;      
00170         void* data;         
00171         
00172     public:
00173     
00178         CPoly* add(CPoly* poly);
00183         CPoly* addHead(CPoly* poly);
00188         CPoly* addTail(CPoly* poly);
00192         CPoly* unlink(CPoly* poly);
00196         void remove(CPoly* poly);
00200         void clear();
00201         void copy(CMesh* mesh);
00202         CMesh* copy();
00203         void triangulate(CMesh* mesh);
00207         void transform(CMatrix* matrix);
00211         void move(CMesh* mesh);
00216         void paint(void* data);
00217 
00218 };
00219 
00220 //---------------------------------------------------------------------------
00221 
00222 #endif

Generated on Tue Feb 8 21:59:02 2005 for MarSTDv2004 by  doxygen 1.4.1