00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef OBJECT_MODEL__H
00029 #define OBJECT_MODEL__H
00030
00031
00032
00033
00034
00035 #include <Inventor/nodes/SoSeparator.h>
00036 #include <Inventor/nodes/SoCoordinate3.h>
00037 #include <Inventor/nodes/SoNormal.h>
00038 #include <Inventor/nodes/SoNormalBinding.h>
00039 #include <Inventor/nodes/SoShapeHints.h>
00040 #include <Inventor/nodes/SoIndexedFaceSet.h>
00041 #include <Inventor/nodes/SoMaterial.h>
00042 #include <Inventor/nodes/SoMaterialBinding.h>
00043 #include <Inventor/nodes/SoTranslation.h>
00044 #include <Inventor/nodes/SoMatrixTransform.h>
00045
00046 #include <Inventor/actions/SoCallbackAction.h>
00047
00048 #include <Inventor/SoPrimitiveVertex.h>
00049 #include <Inventor/SbLinear.h>
00050
00051 #include <Inventor/elements/SoShapeHintsElement.h>
00052
00053 #include <Inventor/misc/SoChildList.h>
00054
00055
00056
00057
00058
00059
00068 class CObjectModel
00069 {
00070 private:
00072 SoSeparator * objectModelRoot;
00074 int32_t nTriangles;
00075
00076 static SbVec3f faceNormal(const SbVec3f p1, const SbVec3f p2, const SbVec3f p3);
00077
00078 static void TriangleCB(void * userdata, SoCallbackAction * action,
00079 const SoPrimitiveVertex * v1,
00080 const SoPrimitiveVertex * v2,
00081 const SoPrimitiveVertex * v3);
00082
00083 public:
00085 SoCoordinate3 * modelCoord3;
00087 SoIndexedFaceSet * modelIfs;
00089 SoNormal * modelNormal;
00091 int coord3idx;
00092
00094 static SbVec3f prevNormal;
00095
00096 CObjectModel();
00097 ~CObjectModel();
00098
00099 void createFaceModel(SoSeparator * object);
00100 SoSeparator * getFaceModelNode();
00101 int32_t getTrianglesCount();
00102 };
00103
00104 #endif