renderer.h

Go to the documentation of this file.
00001 
00002 
00003 //**************************************************************************/
00004 
00005 // Copyright (c) 2008 Autodesk, Inc.
00006 
00007 // All rights reserved.
00008 
00009 //
00010 
00011 // Use of this software is subject to the terms of the Autodesk license
00012 
00013 // agreement provided at the time of installation or download, or which
00014 
00015 // otherwise accompanies this software in either electronic or hard copy form.
00016 
00017 //
00018 
00019 //**************************************************************************/
00020 
00021 // DESCRIPTION:
00022 
00023 // CREATED: October 2008
00024 
00025 //**************************************************************************/
00026 
00027 
00028 
00029 namespace mudbox {
00030 
00031 
00032 
00034 
00036 
00038 
00040 
00042 
00044 
00046 
00048 
00050 
00052 
00054 
00056 
00057 class MBDLL_DECL MeshRenderer : public TreeNode
00058 
00059 {
00060 
00061     DECLARE_CLASS;
00062 
00063 
00064 
00066 
00067     virtual void Initialize( void );
00068 
00070 
00071     virtual void SetMesh( Mesh *pMesh );
00072 
00074 
00076 
00078 
00080 
00082 
00083     virtual void Render( 
00084 
00085         const Selector *pSelector = 0, 
00086 
00087         bool bSkipMaterials = false, 
00088 
00089         const Camera *pCamera = 0, 
00090 
00091         const AxisAlignedBoundingBox &bUVFilter = AxisAlignedBoundingBox() 
00092 
00093         );
00094 
00095 
00096 
00098 
00099     virtual unsigned int RenderData( const Selector *pSelector, unsigned int iStart, const Camera *pCamera );
00100 
00102 
00103     virtual void DecodeData( unsigned int iData, unsigned int &iFaceIndex, unsigned int &iVertexIndex );
00104 
00105 
00106 
00108 
00109     virtual void OnVertexPositionChange( unsigned int iVertexIndex, unsigned int iFaceIndex );
00110 
00112 
00113     virtual void OnVertexStateChange( unsigned int iVertexIndex, unsigned int iFaceIndex );
00114 
00116 
00117     virtual void OnMeshChange( void );
00118 
00119 
00120 
00122 
00123     virtual void SetLODLevel( float fLevel );
00124 
00126 
00127     virtual float LODLevel( void ) const;
00128 
00129 
00130 
00132 
00133     virtual const AxisAlignedBoundingBox &ActiveUVArea( void ) const;
00134 
00135 
00136 
00138 
00139     virtual void SetWireFrameMode( bool bMode );
00140 
00142 
00143     virtual bool WireFrameMode( void ) const;
00144 
00146 
00147     virtual void SetColorMode( bool bMode );
00148 
00150 
00151     virtual bool ColorMode( void ) const;
00152 
00154 
00155     virtual void SetWireLevel( unsigned int iLevel );
00156 
00158 
00159     virtual unsigned int WireLevel( void ) const;
00160 
00162 
00163     virtual void SetTextureCoordinateMode( bool bMode );
00164 
00166 
00167     virtual bool TextureCoordinateMode( void ) const;
00168 
00170 
00171     virtual void SetTangentMode( bool bMode );
00172 
00174 
00175     virtual bool TangentMode( void ) const;
00176 
00177 
00178 
00179     virtual bool ReadyForClientRender() { return true;}
00180 
00181 
00182 
00184 
00185     virtual void SetFacetedMode( bool bMode );
00186 
00188 
00189     virtual bool FacetedMode( void ) const;
00190 
00191 };
00192 
00193 
00194 
00196 
00198 
00200 
00202 
00204 
00206 
00208 
00209 class MBDLL_DECL VertexDataProvider : public TreeNode
00210 
00211 {
00212 
00213     DECLARE_CLASS;
00214 
00215 
00216 
00217 public:
00218 
00220 
00221     struct ComponentDescription
00222 
00223     {
00224 
00226 
00227         enum Type
00228 
00229         {
00230 
00231             eFloat,
00232 
00233             eByte,
00234 
00235             eColor,
00236 
00237             eShort
00238 
00239         } m_eType;
00240 
00242 
00243         int m_iDimension;
00244 
00246 
00248 
00249         Material::VertexDataUsage m_eUsage;
00250 
00251     };
00252 
00253 
00254 
00256 
00257     virtual int ComponentCount( void ) const;
00258 
00259 
00260 
00262 
00263     virtual ComponentDescription Component( 
00264 
00265         int iIndex 
00266 
00267         ) const;
00268 
00269 
00270 
00272 
00273     virtual const void *VertexData( 
00274 
00275         unsigned int iVertexIndex, 
00276 
00277         int iComponentIndex 
00278 
00279         ) const;
00280 
00281 
00282 
00284 
00286 
00288 
00290 
00292 
00294 
00296 
00298 
00300 
00301     virtual void SetVertexData(
00302 
00303         unsigned int iVertexIndex, 
00304 
00305         int iComponentIndex, 
00306 
00307         unsigned int iDimensionIndex, 
00308 
00309         const void* pValue  
00310 
00311     );
00312 
00313 
00314 
00316 
00317     struct DirtyVertex
00318 
00319     {
00320 
00321         unsigned int m_iVertexIndex;    
00322 
00323         unsigned int m_iFaceIndex;      
00324 
00326 
00327     };
00328 
00329 
00330 
00332 
00334 
00336 
00338 
00340 
00342 
00344 
00346 
00348 
00350 
00352 
00353     virtual QVector<DirtyVertex> &DirtyVertexList( void );
00354 
00355 };
00356 
00357 
00358 
00359 }; // end of namespace mudbox
00360