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_TETRAHEDRONMESH3D_
00025 #define _PB_TETRAHEDRONMESH3D_
00026
00027 #include <MeshViz/3Ddata/PbIndexedMesh3D.h>
00028
00029 class PbTetrahedronCell;
00030
00058 class PbTetrahedronMesh3D : public PbIndexedMesh3D {
00059
00060
00061 public:
00062
00066 PbTetrahedronMesh3D(SbBool isDataDuplicate=TRUE) ;
00067
00071 PbTetrahedronMesh3D(const PbTetrahedronMesh3D &mesh);
00072
00077 PbTetrahedronMesh3D(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
00078 int num_tetrahedrons, const int *tetrahedron_index,
00079 SbBool is_data_duplicate=TRUE) ;
00080
00084 ~PbTetrahedronMesh3D() ;
00085
00089 PbTetrahedronMesh3D& operator=(const PbTetrahedronMesh3D &mesh) ;
00090
00094 friend int operator ==(const PbTetrahedronMesh3D &m1, const PbTetrahedronMesh3D &m2);
00095
00099 friend int operator !=(const PbTetrahedronMesh3D &m1, const PbTetrahedronMesh3D &m2)
00100 { return !(m1 == m2); }
00101
00105 virtual void setGeometry(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
00106 int num_tetrahedrons, const int *tetrahedron_index);
00107
00114 virtual void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod,
00115 int &num_tetrahedrons, const int *&tetrahedron_index) const;
00116
00121 virtual void getNodesOwnerCellsInd(const PbArrayOfInt &nod_indices, PbArrayOfInt &owner_cells) const;
00122
00129 virtual const PbCell *getCell(int cell_index) const;
00130
00131 #if 1 SoDEPRECATED
00139 virtual void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod,
00140 int &num_tetrahedrons, const int **&tetrahedron_index) const;
00141
00142 #endif
00144
00145 private:
00146
00147 float getLongestEdgeLength();
00148
00149
00150 void meshCrossSection(PoMeshCrossSection *cross_section) const ;
00151 void mesh3DVec(PoMesh3DVec *mesh_vec) const ;
00152
00153
00154
00155
00156 const PbCell* findContainingCellNaive(const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) ;
00157 const PbCell* findContainingCellNaive(const SbVec3f &point, float tolerance, SbVec3f &pcoord) ;
00158
00159 void print(FILE *fp) const;
00160
00161
00162 virtual const PbCell *getTopoCell(int cell_index) const;
00163
00164 private:
00165 void updateCellBoundingBox() const;
00166 void updateOwnerCellsList() const;
00167
00168 private:
00169 void copy(const PbTetrahedronMesh3D &mesh) ;
00170 void destroy();
00171
00172 mutable PbTetrahedronCell *m_tetrahedron;
00173 };
00174
00175
00176
00177 #endif
00178
00179
00180
00181
00182
00183
00184
00185