MeVisLabToolboxReference
MeVisLab/Standard/Sources/ML/MLWEM/WEMBase/WEMFace.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00011 #ifndef __WEMFace_H
00012 #define __WEMFace_H
00013 
00014 #include "WEMPrimitive.h"
00015 #include "WEMBoundingBox.h"
00016 
00017 
00018 ML_START_NAMESPACE
00019 
00021 
00022 // some forward declarations
00023 class WEMNode;
00024 class WEMEdge;
00025 class WEMTrianglePatch;
00026 
00028 
00030 class MLWEM_EXPORT WEMFace : public WEMPrimitive 
00031 {
00032 
00033 public:
00034 
00036   WEMFace();
00037 
00039   WEMFace(const WEMFace& f);
00040 
00042   virtual ~WEMFace();
00043 
00045   void clone(WEMFace* face);
00046 
00048   inline Vector3 getNormal() const { return _normal; }
00050   inline void setNormal(const Vector3& normal) { _normal = normal; }
00052   virtual void computeNormal() = 0;
00053 
00055   virtual unsigned int getNumNodes() const = 0;      
00057   virtual int getIndex(WEMNode* node) const = 0;
00059   virtual WEMNode* getNodeAt(unsigned int index) = 0;
00061   virtual const WEMNode* getNodeAt(unsigned int index) const = 0;
00063   virtual inline void setNode(unsigned int , WEMNode* ) {}
00065   virtual void replace(WEMNode* orig, WEMNode* replace) = 0;
00067   virtual bool contains(WEMNode* node) const = 0;     
00069   virtual Vector3 getNodePositionAt(unsigned int index) const = 0;
00070 
00072   virtual int getIndex(WEMEdge* edge) const = 0;
00074   virtual inline WEMEdge* getEdgeAt(unsigned int ) { return NULL; }
00076   virtual inline const WEMEdge* getEdgeAt(unsigned int ) const { return NULL; }
00078   virtual inline void setEdge(unsigned int , WEMEdge* ) {}
00080   virtual void replace(WEMEdge* orig, WEMEdge* replace) = 0;
00082   virtual bool contains(WEMEdge* edge) const = 0;
00083 
00085   virtual Vector3 getCentroid() const = 0;
00087   virtual double getPerimeter() const = 0;
00089   virtual double getArea() const = 0;
00091   virtual WEMBoundingBox getBoundingBox() const;
00093   virtual WEMNode* getOther(WEMNode* n1, WEMNode* n2) = 0;
00095   virtual const WEMNode* getOther(WEMNode* n1, WEMNode* n2) const = 0;
00097   virtual WEMEdge* getOther(WEMEdge* e1, WEMEdge* e2) = 0;
00099   virtual const WEMEdge* getOther(WEMEdge* e1, WEMEdge* e2) const = 0;
00101   virtual WEMEdge* getEdgeNotContaining(WEMNode* n) = 0;
00103   virtual const WEMEdge* getEdgeNotContaining(WEMNode* n) const = 0;
00104 
00111   virtual double getQuality() const = 0;
00114   virtual int isConcave() const = 0;
00117   virtual void mirror() = 0;
00118 
00119 protected:
00120 
00122   Vector3 _normal;
00123 };
00124 
00126 
00127 ML_END_NAMESPACE
00128 
00129 #endif // __WEMFace_H