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_HEXAHEDRONMESH3D_
00025 #define _PB_HEXAHEDRONMESH3D_
00026
00027 #include <MeshViz/3Ddata/PbIndexedMesh3D.h>
00028
00029 class PbHexahedronCell;
00030
00058 class PbHexahedronMesh3D : public PbIndexedMesh3D {
00059
00060
00061 public:
00062
00066 PbHexahedronMesh3D(SbBool isDataDuplicate=TRUE) ;
00067
00071 PbHexahedronMesh3D(const PbHexahedronMesh3D &mesh);
00072
00077 PbHexahedronMesh3D(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
00078 int num_hexahedrons, const int *hexahedron_index,
00079 SbBool is_data_duplicate=TRUE) ;
00080
00084 ~PbHexahedronMesh3D() ;
00085
00089 PbHexahedronMesh3D& operator=(const PbHexahedronMesh3D &mesh) ;
00090
00094 friend int operator ==(const PbHexahedronMesh3D &m1, const PbHexahedronMesh3D &m2);
00095
00099 friend int operator !=(const PbHexahedronMesh3D &m1, const PbHexahedronMesh3D &m2)
00100 { return !(m1 == m2); }
00101
00105 void setGeometry(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
00106 int num_hexahedrons, const int *hexahedron_index);
00107
00114 void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod,
00115 int &num_hexahedrons, const int *&hexahedron_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
00132
00133 #if 1 SoDEPRECATED
00141 void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod,
00142 int &num_hexahedrons, const int **&hexahedron_index) const;
00143
00144 #endif
00146 private:
00147
00148 float getLongestEdgeLength();
00149
00150
00151 void meshCrossSection(PoMeshCrossSection *cross_section) const ;
00152
00153 void mesh3DVec(PoMesh3DVec *mesh_vec) const ;
00154 void print(FILE *fp) const;
00155
00156
00157 virtual const PbCell *getTopoCell(int cell_index) const;
00158
00159 private:
00160 void updateCellBoundingBox() const;
00161 void updateOwnerCellsList() const;
00162
00163 private:
00164 void copy(const PbHexahedronMesh3D &mesh) ;
00165 void destroy();
00166
00167 mutable PbHexahedronCell *m_hexahedron;
00168 } ;
00169
00170
00171
00172 #endif
00173
00174
00175
00176
00177
00178
00179
00180