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_QUADRANGLEMESH2D_
00025 #define _PB_QUADRANGLEMESH2D_
00026
00027 #include <MeshViz/3Ddata/PbIndexedMesh2D.h>
00028 class PiContouring;
00029 class PbQuadrangleCell;
00030
00058 class PbQuadrangleMesh2D : public PbIndexedMesh2D {
00059
00060
00061 public:
00062
00066 PbQuadrangleMesh2D(SbBool isDataDuplicate=TRUE) ;
00067
00071 PbQuadrangleMesh2D(const PbQuadrangleMesh2D &mesh);
00072
00077 PbQuadrangleMesh2D(int num_nodes, const float *x_nod, const float *y_nod,
00078 int num_quadrangles, const int32_t *quadrangle_index,
00079 SbBool isDataDuplicate=TRUE) ;
00080
00085 PbQuadrangleMesh2D(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
00086 int num_quadrangles, const int32_t *quadrangle_index,
00087 SbBool isDataDuplicate=TRUE) ;
00088
00092 ~PbQuadrangleMesh2D();
00093
00097 PbQuadrangleMesh2D& operator=(const PbQuadrangleMesh2D &mesh) ;
00098
00102 friend int operator ==(const PbQuadrangleMesh2D &m1, const PbQuadrangleMesh2D &m2);
00103
00107 friend int operator !=(const PbQuadrangleMesh2D &m1, const PbQuadrangleMesh2D &m2)
00108 { return !(m1 == m2); }
00109
00113 void setGeometry(int num_nodes, const float *x_nod, const float *y_nod,
00114 int num_quadrangles, const int *quadrangle_index);
00115
00119 void setGeometry(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
00120 int num_quadrangles, const int *quadrangle_index);
00121
00127 void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod,
00128 int &num_quadrangles, const int32_t *&quadrangle_index) const;
00129
00135 void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod,
00136 int &num_quadrangles, const int32_t *&quadrangle_index) const;
00137
00143 void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod,
00144 int &num_quadrangles, const int32_t **&quadrangle_index) const;
00145
00151 void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod,
00152 int &num_quadrangles, const int32_t **&quadrangle_index) const;
00153
00157 virtual void getNodesOwnerCellsInd(const PbArrayOfInt &nod_indices, PbArrayOfInt &owner_cells) const;
00158
00165 virtual const PbCell *getCell(int cell_index) const;
00166
00175 virtual void setElemOrientation(ElemOrientation elem_orient);
00176
00177
00178 private:
00179
00180 void meshLines(PoMeshLines *_PoMeshLines) const;
00181 void meshFilled(PoMeshFilled *_PoMeshFilled) const;
00182 void meshContouring(PiContouring *_PiContouring, const float *z) const;
00183 void mesh2DVec(PoMesh2DVec *mesh_vec) const ;
00184
00185 virtual void getLimitIndices(PbArrayOfInt &nodesIndex, PbArrayOfInt &limitSizes) const;
00186
00187 void print(FILE *fp) const;
00188
00189 private:
00190 virtual const PbCell* findContainingCellProtected(const SbVec3f &point, float tolerance, SbVec3f &pcoord, PbArrayOfInt &test_cell) const;
00191 void updateCellBoundingBox() const;
00192 void updateOwnerCellsList() const;
00193
00194 private:
00195 void constructXYGeometry(int num_nodes, const float *x_nod, const float *y_nod,
00196 int num_quadrangles, const int32_t *quadrangle_index,
00197 SbBool is_data_duplicate);
00198 void setXYGeometry(int num_nodes, const float *x_nod, const float *y_nod,
00199 int num_quadrangles, const int *quadrangle_index);
00200
00201 int32_t **quadrangleIndex;
00202
00203 void copy(const PbQuadrangleMesh2D &mesh) ;
00204 void destroy();
00205
00206 mutable PbQuadrangleCell *m_quadrangle;
00207 } ;
00208
00209
00210
00211 #endif
00212
00213
00214
00215
00216
00217
00218
00219