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_PARALCARTESIANGRID2D_
00025 #define _PB_PARALCARTESIANGRID2D_
00026
00027 #include <MeshViz/3Ddata/PbCartesianGrid2D.h>
00028
00029 class PiContouring;
00030 class PoMeshLines;
00031 class PoMeshFilled;
00032 class PoMeshSides;
00033 class SbVec2f;
00034 class PbPixelCell;
00035 class PbQuadrangleCell;
00036
00053 class PbParalCartesianGrid2D : public PbCartesianGrid2D {
00054
00055
00056 public:
00057
00061 PbParalCartesianGrid2D(SbBool isDataDuplicate=TRUE) ;
00062
00066 PbParalCartesianGrid2D(const PbParalCartesianGrid2D &mesh);
00067
00072 PbParalCartesianGrid2D(int num_x, int num_y, const float *x, const float *y, SbBool isDataDuplicate=TRUE) ;
00073
00078 PbParalCartesianGrid2D(int num_x, int num_y, const float *x, const float *y, const float *z, SbBool isDataDuplicate=TRUE) ;
00079
00083 ~PbParalCartesianGrid2D() ;
00084
00088 PbParalCartesianGrid2D& operator=(const PbParalCartesianGrid2D &mesh) ;
00089
00093 friend int operator ==(const PbParalCartesianGrid2D &m1, const PbParalCartesianGrid2D &m2);
00094
00098 friend int operator !=(const PbParalCartesianGrid2D &m1, const PbParalCartesianGrid2D &m2)
00099 { return !(m1 == m2); }
00100
00101 virtual const PbCell* findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) const;
00102
00116 virtual const PbCell* findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord) const;
00117
00124 virtual const PbCell *getCell(int cell_index) const;
00125
00129 virtual SbVec3f getNodeCoord(int nod_index) const;
00130
00134 virtual SbVec3f getNodeCoord(int i, int j) const;
00135
00139 virtual float getArea() const;
00140
00141
00142 private:
00143 void meshLines(PoMeshLines *_PoMeshLines) const;
00144 void meshFilled(PoMeshFilled *_PoMeshFilled) const;
00145 void meshContouring(PiContouring *_PiContouring, const float *z) const;
00146 void mesh2DVec(PoMesh2DVec *mesh_vec) const ;
00147
00148 void getNodesCoord(const float *z, SoMFVec3f &vertices) const;
00149 virtual SbBool hasSidesNormals() const;
00150 virtual void getSidesNormals(SbVec3f *&normals,
00151 const PbArrayOfInt &limitSizes) const;
00152
00153 void print(FILE *fp) const;
00154
00155 private:
00156 void constructXYGeometry(const float *xn, const float *yn, SbBool is_data_duplicate);
00157 void setXYGeometry(int num_x, int num_y, const float *x, const float *y);
00158 void getXYGeometry(const float* &x, const float* &y) const;
00159
00160 private:
00161 float *x, *y;
00162
00163 void updateBoundingBox() const;
00164 void copy(const PbParalCartesianGrid2D &mesh) ;
00165 void destroy();
00166
00167 mutable PbPixelCell *m_pixel;
00168 mutable PbQuadrangleCell *m_quadrangle;
00169 } ;
00170
00171
00172
00173 #endif
00174
00175
00176
00177
00178
00179
00180
00181