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_MESH2D_
00025 #define _PB_MESH2D_
00026
00027 #include <MeshViz/3Ddata/PbMesh.h>
00028 #include <MeshViz/3Ddata/Po3DdataPrivate.h>
00029 #include <MeshViz/3Ddata/PbDefinedValue.h>
00030
00031 #include <Inventor/nodes/SoCoordinate3.h>
00032 #include <cstdio>
00033
00034 class PiContouring;
00035 class PoMesh2D;
00036 class PoMeshLines;
00037 class PoMeshFilled;
00038 class PoMeshSides;
00039 class PoMeshContouring;
00040 class PoMesh2DVec;
00041 class SoMFVec3f;
00042
00054 class PbMesh2D : public PbMesh {
00055
00056
00057 public:
00058
00067 void addVecsSet(int set_index, const SbVec2f *val, const SbString &setName ="");
00068
00073 virtual SbBox2f getBoundingBox() const;
00074
00078 virtual float getVolume() const { return 0.0;}
00079
00083 virtual float getArea() const;
00084
00089 enum ExtrapolationMethod {
00094 USE_ADJACENT_DERIVS,
00099 USE_ADJACENT_VALUES
00100 };
00101
00147 PbMesh2D *getFaultMesh(int num_fault_lines, const int *fault_line_sizes, const SbVec3f *coord,
00148 ExtrapolationMethod extrapol_method, PbDefinedValue &definedValue) const;
00149
00155 PbMesh2D *getFaultMesh(int num_fault_lines, const int *fault_line_sizes, const SbVec3f *coord) const
00156 {
00157 PbDefinedValue definedValue = PbDefinedValue();
00158 return getFaultMesh(num_fault_lines, fault_line_sizes, coord,
00159 PbMesh2D::USE_ADJACENT_DERIVS, definedValue);
00160 }
00161
00162 private:
00163 PbMesh2D(SbBool is_data_duplicate=TRUE);
00164 PbMesh2D(const PbMesh2D &mesh);
00165 ~PbMesh2D();
00166
00167 PbMesh2D& operator=(const PbMesh2D &mesh) ;
00168
00169
00170 void addVecsSet(int set_index, const SbVec3f *val, const SbString &setName = "")
00171 { PbMesh::addVecsSet(set_index,val,setName); };
00172
00173 virtual const float *getZcoord() const;
00174
00175 virtual void meshLines(PoMeshLines *_PoMeshLines) const;
00176 virtual void meshFilled(PoMeshFilled *_PoMeshFilled) const;
00177 virtual void meshContouring(PiContouring *_PiContouring, const float *z) const;
00178 virtual void mesh2DVec(PoMesh2DVec *_PoMesh2DVec) const;
00179
00180 virtual void getNodesCoord(const float *z, SoMFVec3f &vertices) const = 0;
00181
00182 virtual void getLimitIndices(PbArrayOfInt &nodesIndex, PbArrayOfInt &limitSizes) const = 0;
00183 virtual SbBool hasSidesNormals() const;
00184 virtual void getSidesNormals(SbVec3f *&normals,
00185 const PbArrayOfInt &limitSizes) const;
00186
00187 void pushZCoord(int val_index);
00188 void popZCoord();
00189
00190 virtual SbVec3f getFirstCellNormal() const = 0;
00191
00192
00193 void print(FILE *fp) const;
00194 void printInfo() const {print(stdout);};
00195
00196 private:
00197 PbMesh2D(int num_z, const float *z, SbBool is_data_duplicate);
00198 void setZCoord(int num_z, const float *z);
00199 const PbCell* findContainingCellProtected(const SbVec3f &point, float tolerance, SbVec3f &pcoord, PbArrayOfInt &test_cell) const;
00200
00201 float *m_zCoord, *m_zCoordSaved;
00202 int m_numZCoord;
00203 private:
00204
00205 void copy(const PbMesh2D &mesh) ;
00206 void destroy();
00207
00208 void modify_triangle(int32_t *trianglelist, int triangle, int old_node, int new_node) const;
00209
00210 } ;
00211
00212
00213
00214 #endif
00215
00216
00217
00218
00219
00220
00221
00222