VedaLib3DEngine/Texture3D.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_Texture3D_H
00006 #define COM_M4NKIND_Texture3D_H
00007 
00008 #include "BaseObject.h"
00009 #include "PackObjectReference.h"
00010 #include "PackULong_Flags.h"
00011 #include "VirtualMachine.h"
00012 #include "PackDynamicFloat.h"
00013 /*!
00014     \class  Texture3D
00015     \ingroup BaseObjectInherited_VedaLib3DEngine
00016     \brief  Manages a texture in order to render 3D objects.
00017 */
00018 class Texture3D : public BaseObject
00019 {
00020 /*==================================================================
00021                                 PUBLIC
00022 ==================================================================*/
00023 public:
00024     /*!
00025         \brief  Constructor. There should only be members initialisation there.
00026     */
00027     Texture3D(void);
00028 
00029     /*!
00030         \brief  Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp
00031     */
00032     BASEOBJECT_DEFINE_CLASS(Texture3D);
00033     /*!
00034         \brief  Access to the hardware abstract texture for rendering.
00035         \return the hardware abstract texture.
00036     */
00037     inline  VirtualMachine::InternalTexture *GetVirtualMachineTexture(){ return m_pInternalTexture; };
00038     /*!
00039         \brief  In case of a time-dynamic texture, an update had to be done:
00040         \param  _framedate date in seconds
00041     */
00042     virtual  void   UpdateToFrame(float _framedate);
00043 
00044 #ifdef _ENGINE_EDITABLE_
00045     /*!
00046         \brief  a GUI could need to play, draw, print, or output from any way, a preview of a 
00047                 created object. This is done with this method. sub classes can implement it (or not) in
00048                 any way, to explicit current shape of an object.<br>
00049 
00050         \param  _frameDate a date, in second, which defines the effect cinematic.
00051         \param  _pPreviewViewPort the viewport to render. Can't be 0L.
00052         \param  _pPreviewConfiguration
00053     */
00054     virtual void ProcessPreview(double _frameDate,VirtualMachine::InternalViewPort *_pPreviewViewPort,const PreviewConfiguration *_pPreviewConfiguration);
00055 #endif
00056 /*==================================================================
00057                                 PROTECTED
00058 ==================================================================*/
00059 protected:
00060     //! property flags
00061     PackULong_Flags mSer_Flags;
00062     //! the base RGBA color, which modulates the component to vertex and object base color.
00063     PackDynamicFloat    mSer_BaseColor;
00064     //! the image for texture mapping:
00065     PackObjectReference mSerRef_MappingImage;
00066     //! the image for environment mapping:
00067     PackObjectReference mSerRef_EnvImage;
00068     //! the hardware abstract texture for rendering.
00069     VirtualMachine::InternalTexture     *m_pInternalTexture;
00070     //! the last time the texture was updated.
00071     float   m_LastUpdateDate;
00072 #ifdef _ENGINE_EDITABLE_
00073     //! in edition mode, create a private 3D object buffer to preview the texture.
00074     VirtualMachine::InternalObject3DBuffer *m_pPreviewObject3D;
00075     //! constant for preview 
00076     static const unsigned int       m_MaxNumberOfGridDivisionInWidth=14;
00077     //! constant for preview 
00078     static const unsigned int       m_MaxNumberOfGridDivisionInHeight=14;
00079 #endif
00080         /*!
00081         \brief  Method that really build the object using the serializable parameters.
00082                 Close() should close everything opened by CreateInternal().
00083     */
00084     virtual bool CreateInternal(void);
00085 
00086 #ifdef _ENGINE_EDITABLE_
00087     /*!
00088         \brief  that closes everything. Still, the object exist and can be rebuild the same using Create()
00089     */
00090     virtual void    CloseInternal(void);
00091 #endif
00092 
00093 };
00094 
00095 #endif

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