renderer.h

Go to the documentation of this file.
00001 
00002 //**************************************************************************/
00003 // Copyright (c) 2008 Autodesk, Inc.
00004 // All rights reserved.
00005 //
00006 // Use of this software is subject to the terms of the Autodesk license
00007 // agreement provided at the time of installation or download, or which
00008 // otherwise accompanies this software in either electronic or hard copy form.
00009 //
00010 //**************************************************************************/
00011 // DESCRIPTION:
00012 // CREATED: October 2008
00013 //**************************************************************************/
00014 
00015 namespace mudbox {
00016 
00029 class MBDLL_DECL MeshRenderer : public TreeNode
00030 {
00031     DECLARE_CLASS;
00032 
00034     virtual void Initialize( void );
00036     virtual void SetMesh( Mesh *pMesh );
00042     virtual void Render( 
00043         const Selector *pSelector = 0, 
00044         bool bSkipMaterials = false, 
00045         const Camera *pCamera = 0, 
00046         const AxisAlignedBoundingBox &bUVFilter = AxisAlignedBoundingBox() 
00047         );
00048 
00050     virtual unsigned int RenderData( const Selector *pSelector, unsigned int iStart, const Camera *pCamera );
00052     virtual void DecodeData( unsigned int iData, unsigned int &iFaceIndex, unsigned int &iVertexIndex );
00053 
00055     virtual void OnVertexPositionChange( unsigned int iVertexIndex, unsigned int iFaceIndex );
00057     virtual void OnVertexStateChange( unsigned int iVertexIndex, unsigned int iFaceIndex );
00059     virtual void OnMeshChange( void );
00060 
00062     virtual void SetLODLevel( float fLevel );
00064     virtual float LODLevel( void ) const;
00065 
00067     virtual const AxisAlignedBoundingBox &ActiveUVArea( void ) const;
00068 
00070     virtual void SetWireFrameMode( bool bMode );
00072     virtual bool WireFrameMode( void ) const;
00074     virtual void SetColorMode( bool bMode );
00076     virtual bool ColorMode( void ) const;
00078     virtual void SetWireLevel( unsigned int iLevel );
00080     virtual unsigned int WireLevel( void ) const;
00082     virtual void SetTextureCoordinateMode( bool bMode );
00084     virtual bool TextureCoordinateMode( void ) const;
00086     virtual void SetTangentMode( bool bMode );
00088     virtual bool TangentMode( void ) const;
00089 
00090     virtual bool ReadyForClientRender() { return true;}
00091 
00093     virtual void SetFacetedMode( bool bMode );
00095     virtual bool FacetedMode( void ) const;
00096 };
00097 
00105 class MBDLL_DECL VertexDataProvider : public TreeNode
00106 {
00107     DECLARE_CLASS;
00108 
00109 public:
00111     struct ComponentDescription
00112     {
00114         enum Type
00115         {
00116             eFloat,
00117             eByte,
00118             eColor,
00119             eShort
00120         } m_eType;
00122         int m_iDimension;
00125         Material::VertexDataUsage m_eUsage;
00126     };
00127 
00129     virtual int ComponentCount( void ) const;
00130 
00132     virtual ComponentDescription Component( 
00133         int iIndex 
00134         ) const;
00135 
00137     virtual const void *VertexData( 
00138         unsigned int iVertexIndex, 
00139         int iComponentIndex 
00140         ) const;
00141 
00151     virtual void SetVertexData(
00152         unsigned int iVertexIndex, 
00153         int iComponentIndex, 
00154         unsigned int iDimensionIndex, 
00155         const void* pValue  
00156     );
00157 
00159     struct DirtyVertex
00160     {
00161         unsigned int m_iVertexIndex;    
00162         unsigned int m_iFaceIndex;      
00163 
00164     };
00165 
00177     virtual QVector<DirtyVertex> &DirtyVertexList( void );
00178 };
00179 
00180 }; // end of namespace mudbox