00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _PB_TRIANGLECELL_
00025 #define _PB_TRIANGLECELL_
00026
00027 #include <MeshViz/3Ddata/PbCell.h>
00028
00029 class PbMesh;
00030
00052 class PbTriangleCell : public PbCell {
00053
00054 public:
00055
00059 PbTriangleCell(const PbMesh *owner_mesh);
00060
00064 PbTriangleCell(const PbTriangleCell &cell);
00065
00069 ~PbTriangleCell();
00070
00074 PbTriangleCell& operator=(const PbTriangleCell &cell);
00075
00079 virtual float getLongestEdgeLength() const;
00080
00084 virtual float getVolume() const { return 0.0; }
00085
00089 virtual float getArea() const;
00090
00095 virtual void getNodesIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
00096
00101 virtual void getNodesIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
00102
00108 virtual void getNodesLocalIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
00109
00115 virtual void getNodesLocalIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
00116
00121 virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const;
00122
00126 virtual void getWeight(const SbVec3f &pcoord, float *weight) const;
00127
00128
00129
00130 private:
00137 SbBool set(int index, int *node_ids, const float *x, const float *y);
00138
00145 SbBool set(int index, int *node_ids, const float *x, const float *y, const float *z);
00146
00147
00148 virtual const int* getNodesLocalIndexOfEdge(int edge) const {
00149 return c_edgeNodes[edge];
00150 }
00151
00152
00153 void print(FILE *fp) const;
00154
00155
00156
00157 private:
00158 virtual unsigned char getIsosurfCaseId(SbBoolVector &nodes_sign) const;
00159
00160 private:
00161
00162 void copy(const PbTriangleCell &cell);
00163 void destroy();
00164 SbBool set(
00165 const float *x, const float *y, const float *z,
00166 const float *xc, const float *yc);
00167 int locatePointOnXY(const SbVec3f &coord, float tolerance, SbVec3f &pcoord,
00168 int indx, int indy) const;
00169
00170 float m_translateXPcoord, m_translateYPcoord;
00171 float m_coordToPcoordMatrixMa, m_coordToPcoordMatrixMb,
00172 m_coordToPcoordMatrixMc, m_coordToPcoordMatrixMd;
00173
00174 SbVec3f m_normal;
00175 SbBool m_2DCell, m_isValid;
00176 int m_ignoredProjCoord;
00177 static int c_edgeNodes[3][2];
00178 };
00179
00180
00181 inline unsigned char
00182 PbTriangleCell::getIsosurfCaseId(SbBoolVector &) const
00183 {
00184 return 0;
00185 }
00186
00187
00188
00189 #endif
00190
00191
00192
00193
00194
00195
00196
00197