ObjectModel.h

Go to the documentation of this file.
00001 
00007 /* ---------------------------------------------------------------------------
00008  * Authors:      Tomáš Burian (tburian _AT centrum.cz)            
00009  * Thanks to:    PCJohn (peciva _AT fit.vutbr.cz)
00010  * Contributors: 
00011  *
00012  * THIS SOFTWARE IS NOT COPYRIGHTED
00013  *
00014  * This source code is offered for use in the public domain.
00015  * You may use, modify or distribute it freely.
00016  *
00017  * This source code is distributed in the hope that it will be useful but
00018  * WITHOUT ANY WARRANTY.  ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
00019  * DISCLAIMED.  This includes but is not limited to warranties of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00021  *
00022  * If you find the source code useful, authors will kindly welcome
00023  * if you give them credit and keep their names with their source code,
00024  * but do not feel to be forced to do so.
00025  * ---------------------------------------------------------------------------
00026  */
00027 
00028 #ifndef OBJECT_MODEL__H
00029 #define OBJECT_MODEL__H
00030 
00031 //----------------------------------------------------------------------------
00032 // INCLUDEs
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 // IMPLEMENTATION
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

Generated on Wed May 17 17:27:52 2006 for Shadow Engine by  doxygen 1.4.6-NO