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_VirtualEquationSpline_H 00006 #define COM_M4NKIND_VirtualEquationSpline_H 00007 00008 #include "VirtualEquation.h" 00009 #include "PackFloat_FixedPoint.h" 00010 #include "PackULong_Flags.h" 00011 #include "PackList_TimeTrack.h" 00012 00013 class PackResource; 00014 00015 /*! 00016 \class VirtualEquationSpline 00017 \ingroup BaseObjectInherited_VedaLibMath BaseObjectInheritedDocGroup 00018 \brief Spline function virtual model, with no defined dimension depth. 00019 */ 00020 class VirtualEquationSpline : public VirtualEquation 00021 { 00022 /*================================================================== 00023 PUBLIC 00024 ==================================================================*/ 00025 public: 00026 /*! 00027 \brief Constructor. There should only be members initialisation there. 00028 */ 00029 VirtualEquationSpline(); 00030 00031 /*! 00032 \brief Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp 00033 */ 00034 BASEOBJECT_DEFINE_VIRTUALCLASS(VirtualEquationSpline); 00035 00036 /*! 00037 \brief Compute 1,2,3 or 4 value according to a parameter list (X,Y,Z,D). 00038 An equation can manage one or more dimensions on input and output. 00039 the result is <b>added</b> over the outgoing parameter table, 00040 and unused output parameters are left untouch, so you 00041 must init _OutgoingParameterTable before, with default values you will choose. 00042 \param _OutgoingParameterTable result table. result is added over the table values. 00043 \param _IncomingParameterTable. float table, the (X,Y,Z,D) parameters. 00044 */ 00045 virtual void Compute( float _OutgoingParameterTable[4] , const float _IncomingParameterTable[4] ); 00046 00047 00048 /*! 00049 \class SplineElement 00050 \brief Nested class that describes a reference to an object3D, used as element in the list. 00051 */ 00052 class SplineElement : public PackList_TimeTrack::TimeTrackElement 00053 { 00054 public: 00055 //! the vector, it can be X,XY or XYZ according to the constructor init. 00056 PackFloat_FixedPoint mSer_Vector; 00057 //! \brief constructor . It registers the members 00058 SplineElement( PackFloat::VectorDimension _dim) : TimeTrackElement() 00059 ,mSer_Vector(_dim,PackFloat::m_1Div64) // fix the serialized floating point precision. 00060 { 00061 REGISTER_MEMBER_PACKFLOAT(mSer_Vector ,"Vector", 0.0f ); 00062 }; 00063 }; 00064 #ifdef _ENGINE_EDITABLE_ 00065 /*! 00066 \brief a GUI could need to play, draw, print, or output from any way, a preview of a 00067 created object. This is done with this method. sub classes can implement it (or not) in 00068 any way, to explicit current shape of an object.<br> 00069 00070 \param _frameDate a date, in second, which defines the effect cinematic. 00071 \param _pPreviewViewPort the viewport to render. Can't be 0L. 00072 \param _pPreviewConfiguration 00073 */ 00074 virtual void ProcessPreview(double _frameDate,VirtualMachine::InternalViewPort *_pPreviewViewPort,const PreviewConfiguration *_pPreviewConfiguration); 00075 #endif 00076 /*================================================================== 00077 PROTECTED 00078 ==================================================================*/ 00079 protected: 00080 #define splf_Repeat 1 00081 //! serialized flags 00082 PackULong_Flags mSer_Flags; 00083 //! number of dimension managed. defined by inherited classes. 00084 unsigned int m_nbDim; 00085 00086 //! optimisation in case of multiple calls at same date: 00087 float m_LastComputedDate; 00088 float m_LastResult[4]; 00089 /*! 00090 \brief use CreateInternal() to reset optimisation 00091 00092 */ 00093 virtual bool CreateInternal(void); 00094 /*! 00095 \brief Return a list that manages SplineElement. 00096 \return the list 00097 */ 00098 virtual PackList_TimeTrack *GetList()=0; 00099 00100 }; 00101 #endif
/\/\ 4 N k ! N D _______ _ __ ___ _____ ___ _ _ ____ ___________ __//___ /________ |/ / ___________\_______/ \ / _ _ \/ _ / _ / _/_/____/ _ __ / / / / / / / \ \/ / / \ \ / \\___/___/___/ ¯ _____/_____/ ______\___/_____/\________\\ \________/_ ___ __ l____\ /elD! http://www.m4nkind.com \____/