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 _PO_TRIANGLEMESH2D_
00025 #define _PO_TRIANGLEMESH2D_
00026
00027 #include <MeshViz/nodes/PoMeshProperty.h>
00028 #include <MeshViz/fields/PoSFTriangleMesh2D.h>
00029
00030 class PbMesh;
00031
00040 class PoTriangleMesh2D : public PoMeshProperty {
00041
00042 SO_NODE_HEADER(PoTriangleMesh2D) ;
00043
00044
00045 public:
00046
00047
00048
00052 PoTriangleMesh2D() ;
00053
00057 PoSFTriangleMesh2D mesh;
00058
00062 const PbMesh* getMesh() const { return (const PbMesh*)&mesh.getValue();};
00063
00069 void setGeometry(int numPoints, const float *xPointsField, const float *yPointsField) ;
00070
00075 void setGeometry(int num_nodes, const float *xn, const float *yn,
00076 int num_cells, const int *cell_index);
00077
00082 void setGeometry(int num_nodes, const float *xn, const float *yn, const float *zn,
00083 int num_cells, const int *cell_index);
00084
00085
00086 private:
00087 virtual void doAction(SoAction *action) ;
00088
00089 private:
00090 static void initClass() ;
00091 static void exitClass() ;
00092
00093 private:
00094 const PoSFMesh* getSFieldMesh() const { return &mesh; }
00095 virtual ~PoTriangleMesh2D() ;
00096
00097 } ;
00098
00099
00100
00101
00102 inline void
00103 PoTriangleMesh2D::setGeometry(int num_nodes, const float *xn, const float *yn,
00104 int num_cells, const int *cell_index)
00105 {
00106 mesh.setGeometry(num_nodes, xn,yn, num_cells, cell_index);
00107 }
00108
00109
00110 inline void
00111 PoTriangleMesh2D::setGeometry(int num_nodes, const float *xn, const float *yn, const float *zn,
00112 int num_cells, const int *cell_index)
00113 {
00114 mesh.setGeometry(num_nodes, xn,yn,zn, num_cells, cell_index);
00115 }
00116
00117
00118 inline void
00119 PoTriangleMesh2D::setGeometry(int numPoints, const float *xPointsField, const float *yPointsField)
00120 {
00121 mesh.setGeometry(numPoints, xPointsField, yPointsField) ;
00122 }
00123
00124 #endif
00125
00126