SoFCMeshNode.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MESHGUI_SOFC_MESH_NODE_H
00024 #define MESHGUI_SOFC_MESH_NODE_H
00025
00026 #include <Inventor/nodes/SoNode.h>
00027 #include <Inventor/nodes/SoShape.h>
00028 #include <Inventor/fields/SoMFVec3f.h>
00029 #include <Inventor/fields/SoMFInt32.h>
00030
00031 namespace Mesh {
00032 class MeshObject;
00033 }
00034
00035 namespace MeshGui {
00036
00037 class MeshGuiExport SoFCMeshNode : public SoShape {
00038 typedef SoShape inherited;
00039
00040 SO_NODE_HEADER(SoFCMeshNode);
00041
00042 public:
00043 static void initClass();
00044 SoFCMeshNode();
00045 void setMesh(const Mesh::MeshObject* mesh);
00046
00047 virtual void write( SoWriteAction* action );
00048 unsigned int MaximumTriangles;
00049
00050 protected:
00051 virtual void GLRender(SoGLRenderAction *action);
00052 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er);
00053 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00054 virtual void generatePrimitives(SoAction *action);
00055 virtual SoDetail * createTriangleDetail(SoRayPickAction * action,
00056 const SoPrimitiveVertex * v1,
00057 const SoPrimitiveVertex * v2,
00058 const SoPrimitiveVertex * v3,
00059 SoPickedPoint * pp);
00060
00061 virtual SbBool readInstance( SoInput* in, unsigned short flags );
00062
00063 private:
00064
00065 virtual ~SoFCMeshNode() {};
00066 virtual void notify(SoNotList * list);
00067
00068 void drawFaces(SbBool needNormals) const;
00069 void drawPoints(SbBool needNormals) const;
00070 unsigned int countTriangles() const;
00071 void createRoughModel(bool simplest);
00072
00073 private:
00074 const Mesh::MeshObject* _mesh;
00075 unsigned int _ctPrimitives;
00076 SoMFVec3f point;
00077 SoMFInt32 coordIndex;
00078 };
00079
00080
00081
00082 class MeshGuiExport SoFCMeshOpenEdge : public SoShape {
00083 typedef SoShape inherited;
00084
00085 SO_NODE_HEADER(SoFCMeshOpenEdge);
00086
00087 public:
00088 static void initClass();
00089 SoFCMeshOpenEdge();
00090 void setMesh(const Mesh::MeshObject* mesh);
00091
00092 protected:
00093 virtual void GLRender(SoGLRenderAction *action);
00094 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er);
00095 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00096 virtual void generatePrimitives(SoAction *action);
00097 private:
00098
00099 virtual ~SoFCMeshOpenEdge() {};
00100 void drawLines() const ;
00101
00102 private:
00103 const Mesh::MeshObject* _mesh;
00104 };
00105
00106 }
00107
00108
00109 #endif // MESHGUI_SOFC_MESH_NODE_H
00110