VedaLib3DEngine/Object3DMesh3D.h

Go to the documentation of this file.
00001 /*! \file 
00002     \author victorien ferry & www.m4nkind.com
00003     \brief This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING.
00004 */
00005 #ifndef COM_M4NKIND_Object3DMesh3D_H
00006 #define COM_M4NKIND_Object3DMesh3D_H
00007 #include "Object3DMeshVirtual.h"
00008 #include "PackFloatByte_Limits.h"
00009 #include "PackList.h"
00010 //#include "PackTreeCell.h"
00011 #include "PackULong_Flags.h"
00012 #include "PackLong_WithLimits.h"
00013 /*!
00014     \class  Object3DMesh3D
00015     \ingroup BaseObjectInherited_VedaLib3DEngine
00016     \brief  Define an object with a list of vertex and polygons.(TODO)
00017 */
00018 
00019 class Object3DMesh3D : public Object3DMeshVirtual
00020 {
00021 /*==================================================================
00022                                 PUBLIC
00023 ==================================================================*/
00024 public:
00025     /*!
00026         \brief  Constructor. There should only be members initialisation there.
00027     */
00028     Object3DMesh3D(void);
00029 
00030     /*!
00031         \brief  Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp
00032     */
00033     BASEOBJECT_DEFINE_CLASS(Object3DMesh3D);
00034 
00035     /*!
00036         \typedef ePolygon
00037         \brief  kind of polygon the list defines.
00038     */
00039     typedef enum {
00040         ePMode_Strips=1,
00041     } ePolygonModeFlags ;
00042     /*!
00043         \class PolygonList
00044         \brief  polygon list serialized shape.
00045     */
00046     class PolygonList : public PackStruct
00047     {
00048     public:
00049         /*!
00050             \brief  constructor
00051         */
00052         PolygonList();
00053         //! ePolygonModeFlags enum to define 
00054         PackULong_Flags     mSer_Flags;
00055         //! number of vertex by polygon.
00056         PackLong_WithLimits mSer_VertPerPoly;
00057         //! vertex reference list in the shape defined by mSer_ListType
00058         PackList        mSer_RefList;
00059     };
00060     /*!
00061         \brief  static method passed to the list to create new elements.
00062         \return a new object.
00063     */
00064     static BaseType *NewPackULong();
00065     /*!
00066         \brief  static method passed to the list to create new elements.
00067         \return a new object.
00068     */
00069     static BaseType *NewPolygonList();
00070 
00071 #ifdef _ENGINE_EDITABLE_
00072     //! ToolMethod enum for ExecuteToolMethod()
00073     typedef enum {
00074         tm_Object3DMesh3D_SetAsCube=tm_BaseObject_FirstInheritageToolMethod,
00075         tm_Object3DMesh3D_LoadLWO,
00076         tm_Object3DMesh3D_FirstInheritageToolMethod,
00077     };
00078     /*!
00079         \brief  Tool Method main entry. In editable mode, the object can register a set of methods identified 
00080                 with an ID number by using RegisterToolMethod(), and throw the methods through a switch in ToolMethod(). 
00081                 Here, It is used to export wave sound format.
00082         \param  _MethodIDToExecute  the tool method ID, greater than 0.
00083     */
00084     virtual void ExecuteToolMethod( unsigned int _MethodIDToExecute ) ;
00085 #endif
00086 #ifdef _ENGINE_EDITABLE_
00087     /*!
00088         \brief  Tool Method
00089     */
00090     void ToolMethod_SetAsCube() ;
00091 #endif
00092 #ifdef _ENGINE_EDITABLE_
00093     /*!
00094         \brief  Tool Method
00095     */
00096     void ToolMethod_LoadLWO() ;
00097 #endif
00098 /*==================================================================
00099                                 PROTECTED
00100 ==================================================================*/
00101 protected:
00102     /*!
00103         \brief  static method passed to the list to create new elements.
00104         \return a new object.
00105     */
00106     static BaseType *NewPackFloatByte_Limits();
00107 
00108     //! 0 means vertex normals are interpolated, others are split. 
00109     PackFloatByte_Limits    mSer_NormalSplit;
00110     //! center of the object
00111     PackFloatByte_Limits    mSer_Pivot;
00112     //! Scale of the object.
00113     PackFloat   mSer_Scale;
00114     //! Subdivision of the polygons
00115     PackLong_WithLimits mSer_Subdivision;
00116     //! general spline curve factor
00117     PackFloatByte_Limits    mSer_SplineFactor;
00118     //! list of serialized vertex in the object. 
00119     PackList        mSer_StaticVertexList;
00120     //! list of polygons of the object.
00121     PackList        mSer_PolygonList;
00122     //! computed Total Number of Vertex
00123     //old, now in Object3DBufferHandler unsigned int    m_TotalNbVertex;
00124     /*!
00125         \brief  Method that really build the object using the serializable parameters.
00126                 Close() should close everything opened by CreateInternal().
00127     */
00128     virtual bool CreateInternal(void);
00129     /*!
00130         \brief  update the shape of the object for this date, during
00131                 the lifetime the object, when it is created.
00132                 by defdault, does nothing, so static object can be created
00133                 with CreateInternal() only.
00134         \param  _newShapeTime the new date.
00135         \param  _shapeIndex the index of the shape to modify.
00136     */
00137     virtual void CreateShape(float _newShapeTime, unsigned int _shapeIndex=0);
00138 };
00139 
00140 #endif

      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/