Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

RmEffect.h

Go to the documentation of this file.
00001 //=============================================================================
00009 //=============================================================================
00011 //=============================================================================
00012 
00013 #ifndef _RM_CORE_EFFECT_H_
00014 #define _RM_CORE_EFFECT_H_
00015 
00016 #include <Core/RmTypes.h>
00017 #include <Core/RmDefines.h>
00018 #include <Core/RmMath.h>
00019 #include <Core/RmMatrix.h>
00020 #include <Core/RmStringToPtr.h>
00021 #include <Core/RmLinkedList.h>
00022 #include <Core/RmArray.h>
00023 #include <Core/RmSurface.h>
00024 #include <Core/RmVolume.h>
00025 
00026 //=============================================================================
00030 //=============================================================================
00031 
00033 class RmMeshModelContainer;
00034 
00035 //=============================================================================
00036 // This structure is used to define a parent / child relationship between nodes.
00037 // It is necessary to use to ensure proper data organization within an effect   
00038 // workspace. Only the main application can modify / set these relationships.   
00039 //=============================================================================
00040 struct RmNodeTypeChildRuleStruct  
00041 {
00042    RmNodeTypeChildRuleStruct() :
00043       pStrNodeTypeChain( NULL ),
00044       nMinNumChildren( 0 ),
00045       nMaxNumChildren( 0 )
00046    {
00047    };
00048 
00049    ~RmNodeTypeChildRuleStruct()
00050    {
00051       if ( pStrNodeTypeChain != NULL )
00052       {
00053          RmStrFreeT( pStrNodeTypeChain );
00054       }
00055 
00056       pStrNodeTypeChain = NULL;
00057    }
00058 
00059    RM_TCHAR  *pStrNodeTypeChain;
00060    int        nMinNumChildren;
00061    int        nMaxNumChildren;
00062 
00063 }; // End of RmNodeTypeChildRuleStruct declaration and definition
00064 
00065 typedef RmLinkedList< RmNodeTypeChildRuleStruct* >       RmNodeTypeChildRuleList;
00066 typedef RmNodeTypeChildRuleList::iterator                RmNodeTypeChildRuleListIterator;
00067 typedef RmNodeTypeChildRuleList::const_iterator          RmNodeTypeChildRuleListConstIterator;
00068 
00069 typedef RmLinkedList< RmNodeTypeChildRuleList* >         RmListOfNodeTypeChildRuleLists;
00070 typedef RmListOfNodeTypeChildRuleLists::iterator         RmListOfNodeTypeChildRuleListsIterator;
00071 typedef RmListOfNodeTypeChildRuleLists::const_iterator   RmListOfNodeTypeChildRuleListsConstIterator;
00072 
00074 class RmNode;
00075 class RmEffectWorkspace;
00076 
00077 typedef RmLinkedList<RmNode *>       RmNodeList;
00078 typedef RmNodeList::iterator         RmNodeListIterator;
00079 typedef RmNodeList::const_iterator   RmNodeListConstIterator;
00080 
00081 //=============================================================================
00088 //=============================================================================
00089 class RM_API RmNode
00090 {     
00091 public:
00092 
00093    //==========================================================================
00097    //==========================================================================
00098    RmNode();
00099 
00100    //==========================================================================
00111    //==========================================================================
00112    RmNode( const RM_TCHAR* strName, bool bHidden = false );
00113 
00114    //==========================================================================
00123    //==========================================================================
00124    RmNode( RmNode* pParentNode, const RM_TCHAR* strName, bool bHidden = false );
00125 
00126    //==========================================================================
00131    //==========================================================================
00132    virtual ~RmNode();
00133 
00134    //==========================================================================
00146    //==========================================================================
00147    virtual void Update( RmNodeUpdateType  nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, 
00148                         RmNode           *pRmUpdateRootNode /* = NULL */ );                      
00149 
00150    //==========================================================================
00162    //==========================================================================
00163    virtual void CopyNode(  RmNode   *pDestinationNode,
00164                            bool     bUnregisterDestinationNode,
00165                            bool     bIncludeLoadedData );
00166 
00167    //==========================================================================
00179    //==========================================================================
00180    virtual void CopyBranch(   RmNode   *pDestinationNode,
00181                               bool     bUnregisterDestinationNode,
00182                               bool     bIncludeLoadedData );
00183 
00184    //==========================================================================
00200    //==========================================================================
00201    void  AddNodeTypeChildRule( const RM_TCHAR *pStrNodeType,
00202                                const int       nMinNumChildren,
00203                                const int       nMaxNumChildren );
00204 
00205    //==========================================================================
00212    //==========================================================================
00213    void  RemoveNodeTypeChildRule( const RM_TCHAR *pStrNodeType );
00214 
00215    //==========================================================================
00232    //==========================================================================
00233    bool  IsValidOwner(  const RM_TCHAR *pStrNodeTypeChain,
00234                         const RM_TCHAR *pStrAPI,
00235                         int            *pMaxNumChildrenOfType = NULL );
00236 
00237    //==========================================================================
00246    //==========================================================================
00247    bool LoadXMLNode( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
00248 
00249    //==========================================================================
00257    //==========================================================================
00258    virtual bool SaveXMLNode( int hDoc, const RM_TCHAR *strXPath )
00259    {
00260       return( SaveXMLNode( hDoc, strXPath, true ) );
00261    }
00262 
00263    //==========================================================================
00274    //==========================================================================
00275    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
00276 
00277    //==========================================================================
00287    //==========================================================================
00288    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
00289 
00290    //==========================================================================
00296    //==========================================================================
00297    virtual RmNode* Clone( bool bIncludeLoadedData );
00298 
00299    //==========================================================================
00300    // \brief Description of the node
00306    //==========================================================================
00307    virtual const RM_TCHAR* GetDescription();
00308 
00309    //==========================================================================
00316    //==========================================================================
00317    virtual void SetDescription( const RM_TCHAR* pStrDescription ) { m_strUserDescription = pStrDescription; };
00318 
00319    //==========================================================================
00327    //==========================================================================
00328    const RmStringT& GetType();
00329 
00330    //==========================================================================
00340    //==========================================================================
00341    const RmStringT& GetTypeChain() const                { return m_strTypeChain; }
00342 
00343    //==========================================================================
00354    //==========================================================================
00355    bool IsKindOf( const RM_TCHAR* pStrType );
00356 
00357    //==========================================================================
00363    //==========================================================================
00364    const RmStringT& GetName()     const                 {  return m_strName;                     }
00365    
00366    //==========================================================================
00374    //==========================================================================
00375    const RmStringT& GetNameChain();
00376 
00377    //==========================================================================
00384    //==========================================================================
00385    virtual void SetName( const RM_TCHAR* strNewName );
00386 
00387    //==========================================================================
00397    //==========================================================================
00398    const RmStringT& GetAPI()  const                {      return m_strAPI;                  }
00399   
00400    //==========================================================================
00407    //==========================================================================
00408    bool  IsHidden();
00409   
00410    //==========================================================================
00416    //==========================================================================
00417    RmNode* GetParent()                             {     return m_pParent;                  }
00418 
00419    //==========================================================================
00425    //==========================================================================
00426    void SetParent( RmNode* pParentNode )           {      m_pParent = pParentNode;          }
00427 
00428    //==========================================================================
00435    //==========================================================================
00436    int GetNumChildren()                               {     return m_childrenList.size();       }
00437 
00438    //==========================================================================
00444    //==========================================================================
00445    bool  IsChild( RmNode* pChild );
00446 
00447    //==========================================================================
00457    //==========================================================================
00458    bool virtual AddChild( RmNode *pChildNode, RmNode *pNextSibling = NULL );
00459 
00460    //==========================================================================
00468    //==========================================================================
00469    void DeleteChild( RmNode *pChildNode );
00470 
00471    //==========================================================================
00478    //==========================================================================
00479    void DeleteAllChildren();
00480 
00481    //==========================================================================
00490    //==========================================================================
00491    void RemoveChild( RmNode *pChildNode );
00492 
00493    //==========================================================================
00502    //==========================================================================
00503    RmNodeList GetDescendantListByType( const RM_TCHAR* strNodeType );
00504 
00505    //==========================================================================
00512    //==========================================================================
00513    RmNodeList GetChildListByType( const RM_TCHAR* strNodeType );
00514 
00515    //==========================================================================
00522    //==========================================================================
00523    RmNode*    GetFirstChildOfType( const RM_TCHAR* strNodeType );
00524 
00525    //==========================================================================
00533    //==========================================================================
00534    RmNode*    GetFirstChildOfTypeNamed( const RM_TCHAR* strNodeType, const RM_TCHAR* strNodeName );
00535 
00536    //==========================================================================
00543    //==========================================================================
00544    RmNode*    GetFirstChildNamed( const RM_TCHAR* strNodeName );
00545 
00546    //==========================================================================
00553    //==========================================================================
00554    RmNode* GetChild( const RM_TCHAR* strChildName );
00555 
00556    //==========================================================================
00563    //==========================================================================
00564    RmNode* GetChild( int nIndex );
00565 
00566    //==========================================================================
00573    //==========================================================================
00574    int GetChildNodeIndex( RmNode *pChildNode );
00575 
00576    //==========================================================================
00583    //==========================================================================
00584    int GetChildNodeIndexByType( RmNode *pChildNode );
00585 
00586    //==========================================================================
00593    //==========================================================================
00594    int   GetNumDescendants();
00595 
00596    //==========================================================================
00603    //==========================================================================
00604    bool IsParentOf( RmNode* pDescendant );
00605 
00606    //==========================================================================
00617    //==========================================================================
00618    bool IsChildOfAncestor( RmNode* pChild );
00619 
00620    //==========================================================================
00633    //==========================================================================
00634    RmNode* GetNodeParent( const RM_TCHAR* strParentType );
00635 
00636    //==========================================================================
00644    //==========================================================================
00645    RmNode* GetDescendant( const RM_TCHAR* strNodeName, bool bUseNameChain = false );
00646 
00647    //==========================================================================
00657    //==========================================================================
00658    RmNode* GetDescendant( const RM_TCHAR* strNodeName, const RM_TCHAR* strType, bool bUseNameChain = false );
00659 
00660    //==========================================================================
00667    //==========================================================================
00668    virtual bool IsArtistEditable()                 { return false; };
00669 
00670    //==========================================================================
00679    //==========================================================================
00680    virtual bool IsNodeValid();
00681 
00682    //==========================================================================
00693    //==========================================================================
00694    virtual bool IsNodeNameValid( RmNode* pParent,
00695                                  const RM_TCHAR* pStrNodeName = NULL,
00696                                  const RM_TCHAR* pStrNodeType = NULL );
00697    
00698    //==========================================================================
00709    //==========================================================================
00710    void UpdateAll        ( RmNodeUpdateType  nodeUpdateType    /* default = RM_NODE_GENERAL_UPDATE */, 
00711                            RmNode           *pRmUpdateRootNode /* default = NULL */ );                      
00712 
00713    //==========================================================================
00721    //==========================================================================
00722    void UpdateAllChildren( RmNodeUpdateType  nodeUpdateType, RmNode *pRmUpdateRootNode );
00723    
00724    //==========================================================================
00732    //==========================================================================
00733    bool CheckAllNodeNames( RmLinkedList<RmStringT> *pStringList );
00734 
00735    //==========================================================================
00743    //==========================================================================
00744    void AutoInitializeNode();
00745    
00746    //==========================================================================
00754    //==========================================================================
00755    void TransferNode( RmNode* pDestinationNode );
00756 
00757    //==========================================================================
00766    //==========================================================================
00767    RmNode* SearchBackForNodeTypeNamed( const RM_TCHAR* strType, const RM_TCHAR* strName );
00768 
00769    //=========================================================================
00777    //==========================================================================
00778    RmNode* SearchBackForNodeType( const RM_TCHAR* strType );
00779 
00780    //==========================================================================
00788    //==========================================================================
00789    RmNode* SearchBackForNodeNamed( const RM_TCHAR* strName );
00790 
00791    //==========================================================================
00797    //==========================================================================
00798    RmNodeID GetNodeID() const    {     return m_nodeID;        };
00799 
00800    //==========================================================================
00807    //==========================================================================
00808    void  SetNodeID( RmNodeID id )           {     m_nodeID = id;          };
00809 
00810    //==========================================================================
00817    //==========================================================================
00818    void  InvalidateNodeID( bool bRecursive );
00819 
00820    //==========================================================================
00826    //==========================================================================
00827    RmNodeListIterator      BeginChildren()       {    return m_childrenList.begin();   };
00828 
00829    //==========================================================================
00835    //==========================================================================
00836    RmNodeListConstIterator BeginChildren() const {    return m_childrenList.begin();   };
00837 
00838    //==========================================================================
00844    //==========================================================================
00845    RmNodeListIterator      EndChildren()         {    return m_childrenList.end();     };
00846 
00847    //==========================================================================
00853    //==========================================================================
00854    RmNodeListConstIterator EndChildren()   const {    return m_childrenList.end();     };
00855 
00856    //==========================================================================
00862    //==========================================================================
00863    RmNodeTypeChildRuleListConstIterator BeginNodeTypeChildRule();
00864 
00865    //==========================================================================
00871    //==========================================================================
00872    RmNodeTypeChildRuleListConstIterator EndNodeTypeChildRule();
00873    
00874    //==========================================================================
00883    //==========================================================================
00884    static RmStringToPtrMap*   GetNodeTypeOrderMap();
00885    
00886    //==========================================================================
00892    //==========================================================================
00893    static void RmInitNodeTypeChildRuleLists();
00894    static void RmUninitializeNodeTypeChildRuleLists();
00895 
00896 protected:
00897 
00898    //==========================================================================
00908    //==========================================================================
00909    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
00910 
00911    //==========================================================================
00918    //==========================================================================
00919    virtual void SetType( const RM_TCHAR* strNewType );
00920 
00921    //==========================================================================
00929    //==========================================================================
00930    void SetAPI( const RM_TCHAR* pStrAPI, bool bOverride = false );
00931 
00932    //==========================================================================
00939    //==========================================================================
00940    void  SetIsHidden( bool bHidden );
00941    
00942    //==========================================================================
00949    //==========================================================================
00950    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList()           {  return( m_pRmNodeChildRuleList );    }
00951    
00952    //==========================================================================
00959    //==========================================================================
00960    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
00961    {
00962       assert( NULL == m_pRmNodeChildRuleList );
00963       assert( NULL != pRmNodeChildRuleList );
00964       
00965       m_pRmNodeChildRuleList = pRmNodeChildRuleList;
00966       
00967    } // End virtual void SetNodeTypeChildRuleList()           
00968    
00969    //==========================================================================
00978    //==========================================================================
00979    const RmNodeTypeChildRuleStruct* GetNodeTypeChildRule( const RM_TCHAR *pStrNodeTypeChain );
00980 
00981    //==========================================================================
00990    //==========================================================================
00991    virtual bool SaveXMLNode( int hDoc, const RM_TCHAR *strXPath, bool bSortChildren );
00992 
00993    //==========================================================================
00999    //==========================================================================
01000    void SortChildren();
01001 
01005 
01006 private:
01007    RmStringT m_strName;            
01008    RmStringT m_strNameChain;       
01009    RmStringT m_strType;            
01010    RmStringT m_strTypeChain;       
01011 
01012 private :
01013 
01014    static RmNodeTypeChildRuleList         *m_pRmNodeChildRuleList;            
01015    static RmListOfNodeTypeChildRuleLists  *m_pRmListOfNodeTypeChildRuleLists; 
01016 
01017 protected:
01018    RmStringT m_strDescription;     
01019    RmStringT m_strUserDescription; 
01020 
01021    RmStringT m_strAPI;             
01022 
01023 
01024 
01025 
01026    bool       m_bHidden;           
01027    RmNodeList m_childrenList;      
01028    RmNode*    m_pParent;           
01029 
01030    RmNodeID   m_nodeID;            
01031 
01032 }; // End of RmNode class definition
01033 
01034 
01035 
01036 //=============================================================================
01042 //=============================================================================
01043 class RM_API RmVariable: public RmNode
01044 {
01045 public:
01046    //==========================================================================
01051    //==========================================================================
01052    RmVariable()
01053    { 
01054       RmNode::SetType( RM_VARIABLE_TYPE );
01055       m_bArtistVar          = false;  
01056       m_strVariableSemantic = _T( "" );
01057       
01058    } // end RmVariable()
01059 
01060    //==========================================================================
01065    //==========================================================================
01066    virtual ~RmVariable()   {};
01067 
01068    //==========================================================================
01074    //==========================================================================
01075    virtual bool IsArtistEditable()           {  return m_bArtistVar;       }
01076    
01077    //==========================================================================
01084    //==========================================================================
01085    void  SetIsArtistEditable( bool bValue )   {  m_bArtistVar = bValue;     }
01086 
01087    //==========================================================================
01096    //==========================================================================
01097    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
01098 
01099    //==========================================================================
01109    //==========================================================================
01110    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
01111 
01112    //==========================================================================
01118    //==========================================================================
01119    virtual const RM_TCHAR* GetVariableSemantic()                              { return( m_strVariableSemantic ); }
01120 
01121    //==========================================================================
01128    //==========================================================================
01129    virtual void SetVariableSemantic( const RM_TCHAR* pStrVariableSemantic )   { m_strVariableSemantic = pStrVariableSemantic; }
01130 
01131    //==========================================================================
01138    //==========================================================================
01139    virtual bool IsPredefinedVariable();
01140 
01141    //==========================================================================
01148    //==========================================================================
01149    virtual bool IsPrelinkedVariable();
01150    
01151 protected:
01152 
01153    //==========================================================================
01161    //==========================================================================
01162    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
01163 
01164    //==========================================================================
01171    //==========================================================================
01172    virtual void SetType( const RM_TCHAR* strNewType )
01173    {
01174       RmNode::SetType( RmStringT( RmStringT( _T("RmVariable.") ) + RmStringT( strNewType ) ) );
01175 
01176    } // End of SetType( const RM_TCHAR* strNewType )
01177 
01178    //==========================================================================
01184    //==========================================================================
01185    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmVariableChildRuleList ); }
01186 
01187    //==========================================================================
01194    //==========================================================================
01195    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
01196    {
01197       assert( NULL == m_pRmVariableChildRuleList );
01198       assert( NULL != pRmNodeChildRuleList );
01199       
01200       m_pRmVariableChildRuleList = pRmNodeChildRuleList;
01201       
01202    } // End virtual void SetNodeTypeChildRuleList()           
01203    
01204 protected:
01205 
01206    bool        m_bArtistVar;           
01207    RmStringT   m_strVariableSemantic;  
01208 
01209 
01210 private :
01211    static RmNodeTypeChildRuleList  *m_pRmVariableChildRuleList; 
01212 
01213 }; // End of RmVariable class definition
01214 
01215 //=============================================================================
01221 //=============================================================================
01222 class RM_API RmDynamicVariable: public RmVariable
01223 {
01224 public:
01225    //==========================================================================
01230    //==========================================================================
01231    enum DynamicVariableType
01232    {
01233       TypeFloat,   
01234       TypeInteger, 
01235       TypeBoolean  
01236       
01237    }; // End enum DynamicVariableType
01238          
01239 public:
01240 
01241    //==========================================================================
01246    //==========================================================================
01247    RmDynamicVariable();
01248 
01249    //==========================================================================
01254    //==========================================================================
01255    virtual ~RmDynamicVariable();
01256 
01257    //==========================================================================
01265    //==========================================================================
01266    virtual void Update( RmNodeUpdateType nodeUpdateType     /* = RM_NODE_GENERAL_UPDATE */, 
01267                         RmNode          *pRmUpdateRootNode  /* = NULL */ );                      
01268 
01269    //==========================================================================
01278    //==========================================================================
01279    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
01280 
01281    //==========================================================================
01291    //==========================================================================
01292    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
01293 
01294    //==========================================================================
01300    //==========================================================================
01301    virtual RmNode* Clone( bool bIncludeLoadedData );
01302 
01303    //==========================================================================
01304    // \brief Description of the node
01310    //==========================================================================
01311    virtual const RM_TCHAR* GetDescription();
01312        
01313    //==========================================================================
01320    //==========================================================================
01321    virtual void SetName( const RM_TCHAR* strNewName );
01322       
01323    //==========================================================================
01330    //==========================================================================
01331    void SetDynamicVariableType( DynamicVariableType dynamicVariableType );
01332 
01333    //==========================================================================
01339    //==========================================================================
01340    DynamicVariableType  GetDynamicVariableType() { return( m_dynamicVariableType ); }
01341 
01342    //==========================================================================
01348    //==========================================================================
01349    int GetDynamicVariableTypeElementSize() { return( GetDynamicVariableTypeElementSize( m_dynamicVariableType ) ); }
01350 
01351    //==========================================================================
01358    //==========================================================================
01359    int GetDynamicVariableTypeElementSize(  DynamicVariableType dynamicVariableType );
01360    
01361    //==========================================================================
01368    //==========================================================================
01369    void SetIsNormalized(  bool bIsNormalized );
01370 
01371    //==========================================================================
01378    //==========================================================================
01379    bool  IsNormalized()    { return( m_bIsNormalized ); }
01380    
01381    //==========================================================================
01387    //==========================================================================
01388    int   GetNumRows()      { return( m_nRows ); };
01389 
01390    //==========================================================================
01396    //==========================================================================
01397    int   GetNumColumns()   { return( m_nColumns ); };
01398    
01399    //==========================================================================
01406    //==========================================================================
01407    void  SetNumRows(    int nRows );
01408 
01409    //==========================================================================
01416    //==========================================================================
01417    void  SetNumColumns( int nColumns );
01418    
01419    //==========================================================================
01426    //==========================================================================
01427    void  SetIsClamped(  bool bIsClamped );
01428 
01429    //==========================================================================
01435    //==========================================================================
01436    bool  IsClamped()    { return( m_bIsClamped ); }
01437       
01438    //==========================================================================
01447    //==========================================================================
01448    void  SetIsFixedSize( bool bIsFixedSize ) { m_bIsFixedSize = bIsFixedSize; }
01449 
01450    //==========================================================================
01457    //==========================================================================
01458    bool  IsFixedSize()     { return( m_bIsFixedSize ); }
01459    
01460    //==========================================================================
01468    //==========================================================================
01469    void  SetFloatMinMax( float fMin, float fMax );
01470 
01471    //==========================================================================
01479    //==========================================================================
01480    void  SetIntegerMinMax( int nMin, int nMax );
01481 
01482    //==========================================================================
01490    //==========================================================================
01491    void  SetBooleanMinMax( BOOL bMin, BOOL bMax );
01492    
01493    //==========================================================================
01501    //==========================================================================
01502    void  GetFloatMinMax( float &fMin, float &fMax );
01503 
01504    //==========================================================================
01512    //==========================================================================
01513    void  GetIntegerMinMax( int &nMin, int &nMax );
01514 
01515    //==========================================================================
01523    //==========================================================================
01524    void  GetBooleanMinMax( BOOL &bMin, BOOL &bMax );
01525    
01526    //==========================================================================
01535    //==========================================================================
01536    void  SetFloatData( int nRow, int nCol, float fData );
01537 
01538    //==========================================================================
01547    //==========================================================================
01548    void  SetIntegerData( int nRow, int nCol, int nData );
01549 
01550    //==========================================================================
01559    //==========================================================================
01560    void  SetBooleanData( int nRow, int nCol, BOOL bData );
01561    
01562    //==========================================================================
01570    //==========================================================================
01571    float GetFloatData( int nRow, int nCol );
01572 
01573    //==========================================================================
01581    //==========================================================================
01582    int   GetIntegerData( int nRow, int nCol );
01583 
01584    //==========================================================================
01592    //==========================================================================
01593    BOOL  GetBooleanData( int nRow, int nCol );
01594    
01595    //==========================================================================
01601    //==========================================================================
01602    float* GetFloatDataBlock();
01603 
01604    //==========================================================================
01610    //==========================================================================
01611    int* GetIntegerDataBlock();
01612 
01613    //==========================================================================
01619    //==========================================================================
01620    BOOL* GetBooleanDataBlock();
01621          
01622 protected:
01623 
01624    //==========================================================================
01632    //==========================================================================
01633    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
01634 
01635    //==========================================================================
01641    //==========================================================================
01642    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmDynamicVariableChildRuleList ); }
01643 
01644    //==========================================================================
01651    //==========================================================================
01652    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
01653    {
01654       assert( NULL == m_pRmDynamicVariableChildRuleList );
01655       assert( NULL != pRmNodeChildRuleList );
01656       
01657       m_pRmDynamicVariableChildRuleList = pRmNodeChildRuleList;
01658       
01659    } // End virtual void SetNodeTypeChildRuleList()           
01660    
01661    //==========================================================================
01671    //==========================================================================
01672    void ConvertDynamicData( void*                pDestData,
01673                             DynamicVariableType  destDataType,
01674                             void*                pSourceData,
01675                             DynamicVariableType  sourceDataType );
01676                               
01677    //==========================================================================
01684    //==========================================================================
01685    int  FloatToInt( float fValue )
01686    {
01687       return( ( fValue >= 0.0f ) ? ( int )( fValue + 0.5f ) : ( int )( fValue - 0.5f ) );
01688       
01689    } // End FloatToInt( float fValue )
01690       
01691    //==========================================================================
01701    //==========================================================================
01702    void* GetDataPointer( void*               pData,
01703                          DynamicVariableType dataType,
01704                          int                 nRowIndex,
01705                          int                 nColumnIndex );
01706 
01707    //==========================================================================
01719    //==========================================================================
01720    void* GetDataPointer( void*               pData,
01721                          DynamicVariableType dataType,
01722                          int                 nRowIndex,
01723                          int                 nColumnIndex,
01724                          int                 nNumRows,
01725                          int                 nNumColumns );
01726    
01727    //==========================================================================
01736    //==========================================================================
01737    bool LoadXMLDataValues( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
01738 
01739 
01740    //==========================================================================
01748    //==========================================================================
01749    bool SaveXMLDataValues( int hDoc, const RM_TCHAR *strXPath );
01750    
01751 protected:
01752    DynamicVariableType  m_dynamicVariableType; 
01753    int                  m_nRows;               
01754    int                  m_nColumns;            
01755    void*                m_pDynamicVariableData; 
01756    bool                 m_bIsFixedSize;         
01757    bool                 m_bIsClamped;           
01758    bool                 m_bIsNormalized;        
01759    void*                m_pDynamicVariableMin;  
01760    void*                m_pDynamicVariableMax;  
01761    
01762 private :
01763    static RmNodeTypeChildRuleList  *m_pRmDynamicVariableChildRuleList; 
01764 
01765 };    // End of RmDynamicVariable class definition
01766 
01767 //=============================================================================
01773 //=============================================================================
01774 class RM_API RmLightVariable: public RmVariable
01775 {
01776 public: 
01777 
01778    //==========================================================================
01784    //==========================================================================
01785    enum LightVariableType
01786    {
01787       TypePositional,  
01788       TypeDirectional, 
01789       TypeSpotlight,   
01790       
01791    }; // End enum LightVariableType
01792 
01793 public:  
01794 
01795    //==========================================================================
01800    //==========================================================================
01801    RmLightVariable();
01802 
01803    //==========================================================================
01808    //==========================================================================
01809    virtual ~RmLightVariable();
01810 
01811    //==========================================================================
01819    //==========================================================================
01820    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
01821 
01822    //==========================================================================
01833    //==========================================================================
01834    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
01835 
01836    //==========================================================================
01846    //==========================================================================
01847    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
01848 
01849    //==========================================================================
01855    //==========================================================================
01856    virtual RmNode* Clone( bool bIncludeLoadedData );
01857 
01858    //==========================================================================
01859    // \brief Description of the node
01865    //==========================================================================
01866    virtual const RM_TCHAR* GetDescription();
01867        
01868    //==========================================================================
01875    //==========================================================================
01876    virtual void SetName( const RM_TCHAR* strNewName );
01877       
01878    //==========================================================================
01884    //==========================================================================
01885    LightVariableType GetLightVariableType()                          { return( m_lightVariableType ); }
01886 
01887    //==========================================================================
01894    //==========================================================================
01895    void SetLightVariableType( LightVariableType lightVariableType )  { m_lightVariableType = lightVariableType; }
01896    
01897    //==========================================================================
01903    //==========================================================================
01904    bool IsEnabled()                                   { return( m_bEnabled ); }
01905 
01906    //==========================================================================
01912    //==========================================================================
01913    void SetIsEnabled( bool bEnabled )                 { m_bEnabled = bEnabled; }
01914    
01915    //==========================================================================
01921    //==========================================================================
01922    const float* GetAmbientColor()                     {     return m_fAmbientColorArray;     }
01923 
01924    //==========================================================================
01930    //==========================================================================
01931    const float* GetDiffuseColor()                     {     return m_fDiffuseColorArray;     }
01932 
01933    //==========================================================================
01939    //==========================================================================
01940    const float* GetSpecularColor()                    {     return m_fSpecularColorArray;    }
01941        
01942    //==========================================================================
01949    //==========================================================================
01950    void SetAmbientColor( float *pfColorArray );
01951 
01952    //==========================================================================
01959    //==========================================================================
01960    void SetDiffuseColor( float *pfColorArray );
01961 
01962    //==========================================================================
01969    //==========================================================================
01970    void SetSpecularColor( float *pfColorArray );
01971    
01972    //==========================================================================
01978    //==========================================================================
01979    const float* GetPosition()                         {  return m_fPositionArray;      }
01980 
01981    //==========================================================================
01987    //==========================================================================
01988    const float* GetDirection()                        {  return m_fDirectionArray;     }
01989   
01990    //==========================================================================
01997    //==========================================================================
01998    void SetPosition( float *pfPositionArray );
01999 
02000    //==========================================================================
02007    //==========================================================================
02008    void SetDirection( float *pfDirectionArray );
02009    
02010    //==========================================================================
02016    //==========================================================================
02017    const float* GetAttenuation()                            {  return m_fAttenuationArray;      }
02018 
02019    //==========================================================================
02026    //==========================================================================
02027    void         SetAttenuation( float *pfAttenuationArray );
02028    
02029    //==========================================================================
02035    //==========================================================================
02036    float GetSpotlightTheta()                          { return( m_fSpotlightTheta );   }        
02037 
02038    //==========================================================================
02044    //==========================================================================
02045    float GetSpotlightPhi()                            { return( m_fSpotlightPhi );     }        
02046    
02047    //==========================================================================
02054    //==========================================================================
02055    void SetSpotlightTheta( float fSpotlightTheta )    { m_fSpotlightTheta = fSpotlightTheta; }        
02056 
02057    //==========================================================================
02064    //==========================================================================
02065    void SetSpotlightPhi( float fSpotlightPhi )        { m_fSpotlightPhi = fSpotlightPhi;     }        
02066    
02067    //==========================================================================
02073    //==========================================================================
02074    float GetRange()                                   { return( m_fRange );      }        
02075 
02076    //==========================================================================
02082    //==========================================================================
02083    float GetFalloff()                                 { return( m_fFalloff );    }        
02084                  
02085    //==========================================================================
02092    //==========================================================================
02093    void SetRange( float fRange )                      { m_fRange = fRange;       }        
02094 
02095    //==========================================================================
02102    //==========================================================================
02103    void SetFalloff( float fFalloff )                  { m_fFalloff = fFalloff;   }        
02104    
02105 protected:  
02106 
02107    //==========================================================================
02115    //==========================================================================
02116    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
02117 
02118    //==========================================================================
02124    //==========================================================================
02125    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmLightVariableChildRuleList ); }
02126    
02127    //==========================================================================
02134    //==========================================================================
02135    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
02136    {
02137       assert( NULL == m_pRmLightVariableChildRuleList );
02138       assert( NULL != pRmNodeChildRuleList );
02139       
02140       m_pRmLightVariableChildRuleList = pRmNodeChildRuleList;
02141       
02142    } // End virtual void SetNodeTypeChildRuleList()           
02143 
02144 protected:  
02145 
02146    LightVariableType m_lightVariableType; 
02147    
02148    bool  m_bEnabled;                      
02149 
02150    float m_fAmbientColorArray[4];         
02151    float m_fDiffuseColorArray[4];         
02152    float m_fSpecularColorArray[4];        
02153    
02154    float m_fPositionArray[3];             
02155    float m_fDirectionArray[3];            
02156    
02157    float m_fAttenuationArray[3];          
02158    
02159    float m_fSpotlightTheta;               
02160    float m_fSpotlightPhi;                 
02161    
02162    float m_fRange;                        
02163    float m_fFalloff;                      
02164    
02165 private :
02166 
02167    static RmNodeTypeChildRuleList  *m_pRmLightVariableChildRuleList; 
02168 
02169 };    // End of RmLightVariable class definition
02170 
02171 //=============================================================================
02177 //=============================================================================
02178 class RM_API RmMaterialVariable: public RmVariable
02179 {
02180 public:  
02181 
02182    //==========================================================================
02187    //==========================================================================
02188    RmMaterialVariable();
02189 
02190    //==========================================================================
02195    //==========================================================================
02196    virtual ~RmMaterialVariable();
02197 
02198    //==========================================================================
02206    //==========================================================================
02207    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
02208 
02209    //==========================================================================
02220    //==========================================================================
02221    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
02222    
02223    //==========================================================================
02233    //==========================================================================
02234    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
02235 
02236    //==========================================================================
02242    //==========================================================================
02243    virtual RmNode* Clone( bool bIncludeLoadedData );
02244 
02245    //==========================================================================
02246    // \brief Description of the node
02252    //==========================================================================
02253    virtual const RM_TCHAR* GetDescription();
02254        
02255    //==========================================================================
02262    //==========================================================================
02263    virtual void SetName( const RM_TCHAR* strNewName );
02264       
02265    //==========================================================================
02271    //==========================================================================
02272    const float* GetAmbientColor()                  {  return m_fAmbientColorArray;     }
02273 
02274    //==========================================================================
02280    //==========================================================================
02281    const float* GetDiffuseColor()                  {  return m_fDiffuseColorArray;     }
02282 
02283    //==========================================================================
02289    //==========================================================================
02290    const float* GetSpecularColor()                 {  return m_fSpecularColorArray;    }
02291 
02292    //==========================================================================
02298    //==========================================================================
02299    const float* GetEmissiveColor()                 {  return m_fEmissiveColorArray;    }
02300   
02301    //==========================================================================
02307    //==========================================================================
02308    float GetSpecularPower()                        { return( m_fSpecularPower ); }
02309          
02310    //==========================================================================
02317    //==========================================================================
02318    void SetAmbientColor(  float *pfColorArray );
02319 
02320    //==========================================================================
02327    //==========================================================================
02328    void SetDiffuseColor(  float *pfColorArray );
02329    
02330    //==========================================================================
02337    //==========================================================================
02338    void SetSpecularColor( float *pfColorArray );
02339 
02340    //==========================================================================
02347    //==========================================================================
02348    void SetEmissiveColor( float *pfColorArray );
02349    
02350    //==========================================================================
02357    //==========================================================================
02358    void SetSpecularPower( float fSpecularPower )   { m_fSpecularPower = fSpecularPower; }
02359    
02360 protected:  
02361 
02362    //==========================================================================
02370    //==========================================================================
02371    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
02372 
02373    //==========================================================================
02379    //==========================================================================
02380    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmMaterialVariableChildRuleList ); }
02381    
02382    //==========================================================================
02389    //==========================================================================
02390    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
02391    {
02392       assert( NULL == m_pRmMaterialVariableChildRuleList );
02393       assert( NULL != pRmNodeChildRuleList );
02394       
02395       m_pRmMaterialVariableChildRuleList = pRmNodeChildRuleList;
02396       
02397    } // End virtual void SetNodeTypeChildRuleList()           
02398 
02399 protected:  
02400 
02401    float m_fAmbientColorArray[4];  
02402    float m_fDiffuseColorArray[4];  
02403    float m_fSpecularColorArray[4]; 
02404    float m_fEmissiveColorArray[4]; 
02405    float m_fSpecularPower;         
02406    
02407 private :
02408    static RmNodeTypeChildRuleList  *m_pRmMaterialVariableChildRuleList; 
02409 
02410 };    // End of RmMaterialVariable class definition
02411 
02412 //=============================================================================
02418 //=============================================================================
02419 class RM_API RmVectorVariable: public RmVariable
02420 {
02421 public:
02422 
02423    //==========================================================================
02429    //==========================================================================
02430    RmVectorVariable();
02431 
02432    //==========================================================================
02439    //==========================================================================
02440    RmVectorVariable( float fX, float fY, float fZ, float fW, bool bClamp, bool bNormalize,
02441                      float fMin = -10.0f, float fMax = 10.0f );
02442 
02443    //==========================================================================
02449    //==========================================================================
02450    RmVectorVariable( float fX, float fY, float fZ, float fW );
02451 
02452    //==========================================================================
02458    //==========================================================================
02459    RmVectorVariable( float fVector[4] );
02460 
02461    //==========================================================================
02466    //==========================================================================
02467    virtual ~RmVectorVariable()     {};
02468 
02469    //==========================================================================
02477    //==========================================================================
02478    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
02479 
02480    //==========================================================================
02491    //==========================================================================
02492    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
02493    
02494    //==========================================================================
02504    //==========================================================================
02505    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
02506 
02507    //==========================================================================
02513    //==========================================================================
02514    virtual RmNode* Clone( bool bIncludeLoadedData );
02515 
02516    //==========================================================================
02517    // \brief Description of the node
02524    //==========================================================================
02525    virtual const RM_TCHAR* GetDescription();
02526        
02527    //==========================================================================
02533    //==========================================================================
02534    virtual void SetName( const RM_TCHAR* strNewName );
02535 
02536    //==========================================================================
02537    // \brief GetData
02542    //==========================================================================
02543    float* GetData()                       {  return m_fValues;         }
02544 
02545    //==========================================================================
02546    // \brief GetValue
02551    //==========================================================================
02552    float  GetValue( int nIndex )          {  return m_fValues[nIndex]; }
02553 
02554    //==========================================================================
02562    //==========================================================================
02563    void SetValue( int nIndex, float fValue );
02564 
02565    //==========================================================================
02575    //==========================================================================
02576    void SetValues( float fX, float fY, float fZ, float fW );
02577 
02578    //==========================================================================
02585    //==========================================================================
02586    void SetValues( float fValues[4] );
02587 
02588    //==========================================================================
02594    //==========================================================================
02595    bool IsClamped()                    {  return m_bClamp;  }
02596 
02597    //==========================================================================
02604    //==========================================================================
02605    void SetIsClamped( bool bClamp );
02606 
02607    //==========================================================================
02613    //==========================================================================
02614    float GetMin()                         {  return m_fMin;      }
02615 
02616    //==========================================================================
02622    //==========================================================================
02623    float GetMax()                         {  return m_fMax;      }
02624 
02625    //==========================================================================
02632    //==========================================================================
02633    void SetMin( float fMin );
02634 
02635    //==========================================================================
02639    //
02642    //==========================================================================
02643    void SetMax( float fMax );
02644 
02645    //==========================================================================
02653    //==========================================================================
02654    void SetMinMax( float fMin, float fMax );
02655 
02656    //==========================================================================
02662    //==========================================================================
02663    bool IsNormalized()                 {   return m_bNormalize;     }
02664 
02665    //==========================================================================
02672    //==========================================================================
02673    void SetIsNormalized( bool bValue );
02674 
02675    //==========================================================================
02681    //==========================================================================
02682    void Normalize();
02683 
02684 protected:
02685 
02686    //==========================================================================
02694    //==========================================================================
02695    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
02696 
02697    //==========================================================================
02703    //==========================================================================
02704    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmVectorVariableChildRuleList ); }
02705 
02706    //==========================================================================
02713    //==========================================================================
02714    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
02715    {
02716       assert( NULL == m_pRmVectorVariableChildRuleList );
02717       assert( NULL != pRmNodeChildRuleList );
02718       
02719       m_pRmVectorVariableChildRuleList = pRmNodeChildRuleList;
02720       
02721    } // End virtual void SetNodeTypeChildRuleList()           
02722 
02723 protected:
02724    
02725    float m_fValues[4];        
02726 
02727    float m_fMin;              
02728    float m_fMax;              
02729 
02730    bool  m_bClamp;            
02731    
02732    bool  m_bNormalize;        
02733 
02734 
02735 
02736 private :
02737    static RmNodeTypeChildRuleList  *m_pRmVectorVariableChildRuleList; 
02738 
02739 };    // End of RmVectorVariable class definition
02740 
02741 
02742 //=============================================================================
02748 //=============================================================================
02749 class RM_API RmMatrixVariable: public RmVariable
02750 {
02751 public:
02752 
02753    //==========================================================================
02758    //==========================================================================
02759    RmMatrixVariable();
02760 
02761    //==========================================================================
02766    //==========================================================================
02767    RmMatrixVariable( float fMatrix[16] );
02768 
02769    //==========================================================================
02774    //==========================================================================
02775    virtual ~RmMatrixVariable() {};
02776 
02777    //==========================================================================
02785    //==========================================================================
02786    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
02787 
02788    //==========================================================================
02799    //==========================================================================
02800    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
02801    
02802    //==========================================================================
02812    //==========================================================================
02813    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
02814     
02815    //==========================================================================
02821    //==========================================================================
02822    virtual RmNode* Clone( bool bIncludeLoadedData );
02823 
02824    //==========================================================================
02825    // \brief Description of the node
02832    //==========================================================================
02833    virtual const RM_TCHAR* GetDescription();
02834           
02835    //==========================================================================
02841    //==========================================================================
02842    float* GetData()        {     return m_fValues;    }
02843 
02844    //==========================================================================
02851    //==========================================================================
02852    float GetValue( int nIndex );
02853 
02854    //==========================================================================
02862    //==========================================================================
02863    float GetValue( int nRowIndex, int nColumnIndex );
02864 
02865    //==========================================================================
02873    //==========================================================================
02874    void SetValue( int nIndex, float fValue );
02875 
02876    //==========================================================================
02885    //==========================================================================
02886    void SetValue( int nRowIndex, int nColumnIndex, float fValue );
02887 
02888    //==========================================================================
02895    //==========================================================================
02896    void SetValues( float fMatrix[16] );
02897 
02898    //==========================================================================
02904    //==========================================================================
02905    int GetNumElements()       {     return 16;     }
02906 
02907 protected:
02908 
02909    //==========================================================================
02917    //==========================================================================
02918    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
02919 
02920    //==========================================================================
02926    //==========================================================================
02927    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmMatrixVariableChildRuleList ); }
02928 
02929    //==========================================================================
02936    //==========================================================================
02937    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
02938    {
02939       assert( NULL == m_pRmMatrixVariableChildRuleList );
02940       assert( NULL != pRmNodeChildRuleList );
02941       
02942       m_pRmMatrixVariableChildRuleList = pRmNodeChildRuleList;
02943       
02944    } // End virtual void SetNodeTypeChildRuleList()           
02945 
02946 protected:
02947 
02948    float m_fValues[16]; 
02949 
02950 private :
02951    static RmNodeTypeChildRuleList  *m_pRmMatrixVariableChildRuleList; 
02952 
02953 };    // End of RmMatrixVariable class definition
02954 
02955 
02956 //=============================================================================
02962 //=============================================================================
02963 class RM_API RmFloatVariable: public RmVariable
02964 {
02965 public:
02966 
02967    //==========================================================================
02972    //==========================================================================
02973    RmFloatVariable();
02974 
02975    //==========================================================================
02981    //==========================================================================
02982    RmFloatVariable( float fValue );
02983 
02984    //==========================================================================
02990    //==========================================================================
02991    RmFloatVariable( float fValue, bool bClamp, float fMin = -1.0f, float fMax = 1.0f );
02992 
02993    //==========================================================================
02998    //==========================================================================
02999    virtual ~RmFloatVariable();
03000 
03001    //==========================================================================
03009    //==========================================================================
03010    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
03011    
03012    //==========================================================================
03023    //==========================================================================
03024    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
03025    
03026    //==========================================================================
03036    //==========================================================================
03037    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
03038    
03039    //==========================================================================
03045    //==========================================================================
03046    virtual RmNode* Clone( bool bIncludeLoadedData );
03047 
03048    //==========================================================================
03049    // \brief Description of the node
03055    //==========================================================================
03056    virtual const RM_TCHAR* GetDescription();
03057        
03058    //==========================================================================
03064    //==========================================================================
03065    virtual void SetName( const RM_TCHAR* strNewName );
03066 
03067    //==========================================================================
03073    //==========================================================================
03074    float GetValue()                       {  return m_fValue;        }
03075 
03076    //==========================================================================
03083    //==========================================================================
03084    void SetValue( float fValue );
03085 
03086    //==========================================================================
03092    //==========================================================================
03093    bool IsClamped()                    {  return m_bClamp;        }
03094 
03095    //==========================================================================
03102    //==========================================================================
03103    void SetIsClamped( bool bClamp )
03104    {  
03105       m_bClamp = bClamp;      
03106       Update( RM_NODE_VALUE_CHANGED_UPDATE, this );
03107    }
03108 
03109    //==========================================================================
03115    //==========================================================================
03116    float GetMin()                         {  return m_fMin;          }
03117 
03118    //==========================================================================
03124    //==========================================================================
03125    float GetMax()                         {  return m_fMax;          }
03126 
03127    //==========================================================================
03134    //==========================================================================
03135    void SetMin( float fMin );
03136 
03137    //==========================================================================
03144    //==========================================================================
03145    void SetMax( float fMax );
03146 
03147    //==========================================================================
03155    //==========================================================================
03156    void SetMinMax( float fMin, float fMax );
03157 
03158 protected:
03159 
03160    //==========================================================================
03168    //==========================================================================
03169    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
03170 
03171    //==========================================================================
03177    //==========================================================================
03178    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmFloatVariableChildRuleList ); }
03179 
03180    //==========================================================================
03187    //==========================================================================
03188    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
03189    {
03190       assert( NULL == m_pRmFloatVariableChildRuleList );
03191       assert( NULL != pRmNodeChildRuleList );
03192       
03193       m_pRmFloatVariableChildRuleList = pRmNodeChildRuleList;
03194       
03195    } // End virtual void SetNodeTypeChildRuleList()           
03196 
03197 protected:
03198 
03199    float m_fValue;         
03200 
03201    float m_fMin;           
03202    float m_fMax;           
03203 
03204    bool  m_bClamp;         
03205 
03206 
03207 private :
03208    static RmNodeTypeChildRuleList  *m_pRmFloatVariableChildRuleList; 
03209 
03210 }; // End of RmFloatVariable class definition
03211 
03212 
03213 //=============================================================================
03219 //=============================================================================
03220 class RM_API RmIntegerVariable: public RmVariable
03221 {
03222 public:
03223 
03224    //==========================================================================
03230    //==========================================================================
03231    RmIntegerVariable();
03232 
03233    //==========================================================================
03240    //==========================================================================
03241    RmIntegerVariable( int nValue );       
03242 
03243    //==========================================================================
03253    //==========================================================================
03254    RmIntegerVariable( int nValue, bool bClamp, int nMin, int nMax );
03255 
03256    //==========================================================================
03261    //==========================================================================
03262    virtual ~RmIntegerVariable();
03263 
03264    //==========================================================================
03272    //==========================================================================
03273    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
03274 
03275    //==========================================================================
03286    //==========================================================================
03287    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
03288    
03289    //==========================================================================
03299    //==========================================================================
03300    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
03301    
03302    //==========================================================================
03308    //==========================================================================
03309    virtual RmNode* Clone( bool bIncludeLoadedData );
03310 
03311    //==========================================================================
03312    // \brief Description of the node
03318    //==========================================================================
03319    virtual const RM_TCHAR* GetDescription();
03320        
03321    //==========================================================================
03327    //==========================================================================
03328    int GetValue()                      {  return m_nValue;  }
03329 
03330    //==========================================================================
03337    //==========================================================================
03338    void SetValue( int nValue );
03339 
03340    //==========================================================================
03346    //==========================================================================
03347    bool IsClamped()                 {  return m_bClamp;   }
03348 
03349    //==========================================================================
03356    //==========================================================================
03357    void SetIsClamped( bool bClamp )
03358    {  
03359       m_bClamp = bClamp;      
03360       Update( RM_NODE_VALUE_CHANGED_UPDATE, this );
03361    }
03362 
03363    //==========================================================================
03369    //==========================================================================
03370    int GetMin()                         {  return m_nMin;  }
03371 
03372    //==========================================================================
03378    //==========================================================================
03379    int GetMax()                         {  return m_nMax;  }
03380 
03381    //==========================================================================
03388    //==========================================================================
03389    void SetMin( int nMin );
03390 
03391    //==========================================================================
03398    //==========================================================================
03399    void SetMax( int nMax );
03400 
03401    //==========================================================================
03409    //==========================================================================
03410    void SetMinMax( int nMin, int nMax );
03411 
03412 protected:
03413 
03414    //==========================================================================
03422    //==========================================================================
03423    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
03424 
03425    //==========================================================================
03431    //==========================================================================
03432    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmIntegerVariableChildRuleList ); }
03433 
03434    //==========================================================================
03441    //==========================================================================
03442    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
03443    {
03444       assert( NULL == m_pRmIntegerVariableChildRuleList );
03445       assert( NULL != pRmNodeChildRuleList );
03446       
03447       m_pRmIntegerVariableChildRuleList = pRmNodeChildRuleList;
03448       
03449    } // End virtual void SetNodeTypeChildRuleList()           
03450 
03451 protected:
03452 
03453    int m_nValue;     
03454 
03455    int m_nMin;       
03456    int m_nMax;       
03457 
03458    bool m_bClamp;    
03459 
03460 private :
03461    static RmNodeTypeChildRuleList  *m_pRmIntegerVariableChildRuleList; 
03462 
03463 }; // End of RmIntegerVariable class definition
03464 
03465 
03466 //=============================================================================
03472 //=============================================================================
03473 class RM_API RmStringVariable: public RmVariable
03474 {
03475 public:
03476 
03477    //==========================================================================
03482    //==========================================================================
03483    RmStringVariable();
03484 
03485    //==========================================================================
03492    //==========================================================================
03493    RmStringVariable( const RM_TCHAR* strValue );
03494 
03495    //==========================================================================
03500    //==========================================================================
03501    virtual ~RmStringVariable();
03502 
03503    //==========================================================================
03511    //==========================================================================
03512    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
03513 
03514    //==========================================================================
03525    //==========================================================================
03526    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
03527    
03528    //==========================================================================
03538    //==========================================================================
03539    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
03540 
03541    //==========================================================================
03547    //==========================================================================
03548    virtual RmNode* Clone( bool bIncludeLoadedData );
03549 
03550    //==========================================================================
03551    // \brief Description of the node
03557    //==========================================================================
03558    virtual const RM_TCHAR* GetDescription();
03559 
03560    //==========================================================================
03566    //==========================================================================
03567    const RmStringT& GetValue()                       { return m_string;  }
03568 
03569    //==========================================================================
03576    //==========================================================================
03577    void SetValue( const RM_TCHAR* strValue );
03578 
03579 protected:
03580 
03581    //==========================================================================
03589    //==========================================================================
03590    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
03591 
03592    //==========================================================================
03598    //==========================================================================
03599    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmStringVariableChildRuleList ); }
03600 
03601    //==========================================================================
03608    //==========================================================================
03609    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
03610    {
03611       assert( NULL == m_pRmStringVariableChildRuleList );
03612       assert( NULL != pRmNodeChildRuleList );
03613       
03614       m_pRmStringVariableChildRuleList = pRmNodeChildRuleList;
03615       
03616    } // End virtual void SetNodeTypeChildRuleList()           
03617 
03618 protected:
03619 
03620    RmStringT m_string;       
03621 
03622 private :
03623    static RmNodeTypeChildRuleList  *m_pRmStringVariableChildRuleList; 
03624 
03625 }; // End of RmStringVariable class definition
03626 
03627 
03628 //=============================================================================
03634 //=============================================================================
03635 class RM_API RmBooleanVariable: public RmVariable
03636 {
03637 public:
03638 
03639    //==========================================================================
03644    //==========================================================================
03645    RmBooleanVariable();
03646 
03647    //==========================================================================
03653    //==========================================================================
03654    RmBooleanVariable( bool bValue );
03655 
03656    //==========================================================================
03661    //==========================================================================
03662    virtual ~RmBooleanVariable();
03663 
03664    //==========================================================================
03672    //==========================================================================
03673    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
03674 
03675    //==========================================================================
03686    //==========================================================================
03687    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
03688    
03689    //==========================================================================
03699    //==========================================================================
03700    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
03701    
03702    //==========================================================================
03708    //==========================================================================
03709    virtual RmNode* Clone( bool bIncludeLoadedData );
03710 
03711    //==========================================================================
03712    // \brief Description of the node
03718    //==========================================================================
03719    virtual const RM_TCHAR* GetDescription();
03720 
03721    //==========================================================================
03727    //==========================================================================
03728    bool GetValue()                        {  return m_bValue;     };
03729 
03730    //==========================================================================
03737    //==========================================================================
03738    void SetValue( bool bValue )        {  m_bValue = bValue;   };
03739 
03740    //==========================================================================
03747    //==========================================================================
03748    void SetValue( int  nValue )        {  m_bValue = ( nValue > 0 ) ? true : false; };
03749 
03750 protected:
03751 
03752    //==========================================================================
03760    //==========================================================================
03761    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
03762 
03763    //==========================================================================
03769    //==========================================================================
03770    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmBooleanVariableChildRuleList ); }
03771 
03772    //==========================================================================
03779    //==========================================================================
03780    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
03781    {
03782       assert( NULL == m_pRmBooleanVariableChildRuleList );
03783       assert( NULL != pRmNodeChildRuleList );
03784       
03785       m_pRmBooleanVariableChildRuleList = pRmNodeChildRuleList;
03786       
03787    } // End virtual void SetNodeTypeChildRuleList()           
03788 
03789 protected:
03790    
03791    bool m_bValue;       
03792 
03793 private :
03794    static RmNodeTypeChildRuleList  *m_pRmBooleanVariableChildRuleList; 
03795 
03796 }; // End of RmBooleanVariable class definition
03797 
03798 
03799 //=============================================================================
03805 //=============================================================================
03806 class RM_API RmTextureVariable: public RmVariable
03807 {
03808 public:
03809    //==========================================================================
03814    //==========================================================================
03815    RmTextureVariable();
03816 
03817    //==========================================================================
03822    //==========================================================================
03823    virtual ~RmTextureVariable();
03824 
03825    //==========================================================================
03833    //==========================================================================
03834    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
03835 
03836    //==========================================================================
03847    //==========================================================================
03848    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
03849    
03850    //==========================================================================
03860    //==========================================================================
03861    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
03862    
03863    //==========================================================================
03869    //==========================================================================
03870    virtual RmNode* Clone( bool bIncludeLoadedData );
03871 
03872    //==========================================================================
03873    // \brief Description of the node
03879    //==========================================================================
03880    virtual const RM_TCHAR* GetDescription();
03881 
03882    //==========================================================================
03888    //==========================================================================
03889    virtual bool IsNodeValid();
03890 
03891    //==========================================================================
03897    //==========================================================================
03898    const RmStringT& GetFileName()     {     return m_strFileName;  }
03899 
03900    //==========================================================================
03906    //==========================================================================
03907    void GetFullFileName( RM_TCHAR* strFullPath, int nSize );
03908    
03909    //==========================================================================
03917    //==========================================================================
03918    void SetFileName( const RM_TCHAR* strFileName, bool bUpdateDatabase = true );
03919 
03920    //==========================================================================
03926    //==========================================================================
03927    virtual bool LoadTexture() { return true; };
03928 
03929    //==========================================================================
03935    //==========================================================================
03936    virtual RmTexture*       GetTexture() { return NULL; };
03937 
03938    //==========================================================================
03944    //==========================================================================
03945    virtual const RmTexture* GetTexture() const { return NULL; };
03946 
03947    //==========================================================================
03955    //==========================================================================
03956    void SetRequestedPixelFormat( RmPixelFormatType format ) { m_requestedPixelFormat = format; };
03957 
03958    //==========================================================================
03964    //==========================================================================
03965    RmPixelFormatType  GetRequestedPixelFormat() const { return m_requestedPixelFormat; };
03966 
03967    //=========================================================================
03973    //=========================================================================
03974    void SetOrigin( RmTextureOrigin textureOrigin ) { m_textureOrigin = textureOrigin; }
03975    
03976    //=========================================================================
03982    //=========================================================================
03983    RmTextureOrigin GetOrigin() { return( m_textureOrigin ); }
03984    
03985 protected:
03986 
03987    //==========================================================================
03995    //==========================================================================
03996    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
03997 
03998    //==========================================================================
04005    //==========================================================================
04006    virtual void SetType( const RM_TCHAR* strNewType )
04007    {
04008       RmVariable::SetType( RmStringT( RmStringT( _T("RmTextureVariable.") ) + RmStringT( strNewType ) ) );
04009 
04010    } // End of SetType( const RM_TCHAR* strNewType )
04011 
04012    //==========================================================================
04018    //==========================================================================
04019    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmTextureVariableChildRuleList ); }
04020 
04021    //==========================================================================
04028    //==========================================================================
04029    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
04030    {
04031       assert( NULL == m_pRmTextureVariableChildRuleList );
04032       assert( NULL != pRmNodeChildRuleList );
04033       
04034       m_pRmTextureVariableChildRuleList = pRmNodeChildRuleList;
04035       
04036    } // End virtual void SetNodeTypeChildRuleList()           
04037 
04038 protected:
04039    
04040    RmStringT            m_strFileName;          
04041    RmPixelFormatType    m_requestedPixelFormat; 
04042 
04043 
04044    RmTextureOrigin      m_textureOrigin;        
04045 
04046    bool                 m_bTextureLoaded;       
04047 
04048 private :
04049    static RmNodeTypeChildRuleList  *m_pRmTextureVariableChildRuleList; 
04050 
04051 }; // End of RmTextureVariable class definition
04052 
04053 
04054 //=============================================================================
04060 //=============================================================================
04061 class RM_API Rm2DTextureVariable: public RmTextureVariable
04062 {
04063 public:
04064 
04065    //==========================================================================
04069    //==========================================================================
04070    Rm2DTextureVariable();
04071 
04072    //==========================================================================
04079    //==========================================================================
04080    Rm2DTextureVariable( const RM_TCHAR* strNodeName, const RM_TCHAR* strFileName = NULL );
04081 
04082    //==========================================================================
04087    //==========================================================================
04088    virtual ~Rm2DTextureVariable();
04089 
04090    //==========================================================================
04096    //==========================================================================
04097    virtual RmNode* Clone( bool bIncludeLoadedData );
04098 
04099    //==========================================================================
04100    // \brief Description of the node
04106    //==========================================================================
04107    virtual const RM_TCHAR* GetDescription();
04108 
04109    //=========================================================================
04115    //=========================================================================
04116    virtual bool IsNodeValid();
04117    
04118    //==========================================================================
04124    //==========================================================================
04125    virtual bool LoadTexture();
04126 
04127    //==========================================================================
04133    //==========================================================================
04134    virtual RmTexture*       GetTexture() { return m_pTexture; };
04135 
04136    //==========================================================================
04142    //==========================================================================
04143    virtual const RmTexture* GetTexture() const { return m_pTexture; };
04144 
04145    //==========================================================================
04151    //==========================================================================
04152    Rm2DTexture*       Get2DTexture() { return m_pTexture; };
04153    
04154    //==========================================================================
04160    //==========================================================================
04161    const Rm2DTexture* Get2DTexture() const { return m_pTexture; };
04162 
04163 protected:
04164    //==========================================================================
04171    //==========================================================================
04172    virtual void SetType( const RM_TCHAR* strNewType )
04173    {
04174       RmTextureVariable::SetType( RmStringT( RmStringT( _T("Rm2DTextureVariable.") ) + RmStringT( strNewType ) ) );
04175 
04176    } // End of SetType( const RM_TCHAR* strNewType )
04177 
04178 private :
04179    Rm2DTexture* m_pTexture; 
04180 }; // End of Rm2DTextureVariable class definition
04181 
04182 
04183 //=============================================================================
04189 //=============================================================================
04190 class RM_API RmCubemapVariable : public RmTextureVariable
04191 {
04192 public:
04193 
04194    //==========================================================================
04198    //==========================================================================
04199    RmCubemapVariable();
04200 
04201    //==========================================================================
04208    //==========================================================================
04209    RmCubemapVariable( const RM_TCHAR* strNodeName, const RM_TCHAR* strFileName = NULL );
04210 
04211    //==========================================================================
04216    //==========================================================================
04217    virtual ~RmCubemapVariable();
04218 
04219    //==========================================================================
04225    //==========================================================================
04226    virtual RmNode* Clone( bool bIncludeLoadedData );
04227 
04228    //==========================================================================
04229    // \brief Description of the node
04235    //==========================================================================
04236    virtual const RM_TCHAR* GetDescription();
04237 
04238    //=========================================================================
04244    //=========================================================================
04245    virtual bool IsNodeValid();
04246    
04247    //==========================================================================
04253    //==========================================================================
04254    virtual bool LoadTexture();
04255 
04256    //==========================================================================
04262    //==========================================================================
04263    virtual RmTexture*       GetTexture() { return m_pCubemap; };
04264 
04265    //==========================================================================
04271    //==========================================================================
04272    virtual const RmTexture* GetTexture() const { return m_pCubemap; };
04273 
04274    //==========================================================================
04280    //==========================================================================
04281    RmCubemap*       GetCubemap() { return m_pCubemap; };
04282 
04283    //==========================================================================
04289    //==========================================================================
04290    const RmCubemap* GetCubemap() const { return m_pCubemap; };
04291 
04292 private :
04293    RmCubemap* m_pCubemap; 
04294 }; // End of RmCubemapVariable class definition
04295 
04296 
04297 //=============================================================================
04303 //=============================================================================
04304 class RM_API Rm3DTextureVariable: public RmTextureVariable
04305 {
04306 public:
04307 
04308    //==========================================================================
04312    //==========================================================================
04313    Rm3DTextureVariable();
04314 
04315    //==========================================================================
04322    //==========================================================================
04323    Rm3DTextureVariable( const RM_TCHAR* strNodeName, const RM_TCHAR* strFileName = NULL );
04324 
04325    //==========================================================================
04330    //==========================================================================
04331    virtual ~Rm3DTextureVariable();
04332 
04333    //==========================================================================
04339    //==========================================================================
04340    virtual RmNode* Clone( bool bIncludeLoadedData );
04341 
04342    //==========================================================================
04343    // \brief Description of the node
04349    //==========================================================================
04350    virtual const RM_TCHAR* GetDescription();
04351 
04352    //=========================================================================
04358    //=========================================================================
04359    virtual bool IsNodeValid();
04360    
04361    //==========================================================================
04367    //==========================================================================
04368    virtual bool LoadTexture();
04369 
04370    //==========================================================================
04376    //==========================================================================
04377    virtual RmTexture*       GetTexture() { return m_pVolumeTexture; };
04378 
04379    //==========================================================================
04385    //==========================================================================
04386    virtual const RmTexture* GetTexture() const { return m_pVolumeTexture; };
04387 
04388    //==========================================================================
04394    //==========================================================================
04395    Rm3DTexture*       Get3DTexture() { return m_pVolumeTexture; };
04396 
04397    //==========================================================================
04403    //==========================================================================
04404    const Rm3DTexture* Get3DTexture() const { return m_pVolumeTexture; };
04405 
04406 private :
04407    Rm3DTexture* m_pVolumeTexture; 
04408 }; // End of Rm3DTextureVariable class definition
04409 
04410 
04411 
04412 //=============================================================================
04418 //=============================================================================
04419 class RM_API RmColorVariable: public RmVariable
04420 {
04421 public:
04422 
04423    //==========================================================================
04428    //==========================================================================
04429    RmColorVariable();
04430 
04431    //==========================================================================
04441    //==========================================================================
04442    RmColorVariable( float fRed, float fGreen, float fBlue, float fAlpha );
04443 
04444    //==========================================================================
04451    //==========================================================================
04452    RmColorVariable( float fColor[4] );
04453 
04454    //==========================================================================
04465    //==========================================================================
04466    RmColorVariable( const RM_TCHAR* strName, float fRed, float fGreen, float fBlue, float fAlpha );
04467 
04468    //==========================================================================
04476    //==========================================================================
04477    RmColorVariable( const RM_TCHAR* strName, float fColor[4] );
04478 
04479    //==========================================================================
04484    //==========================================================================
04485    virtual ~RmColorVariable();
04486 
04487    //==========================================================================
04495    //==========================================================================
04496    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
04497 
04498    //==========================================================================
04509    //==========================================================================
04510    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
04511    
04512    //==========================================================================
04522    //==========================================================================
04523    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
04524    
04525    //==========================================================================
04531    //==========================================================================
04532    virtual RmNode* Clone( bool bIncludeLoadedData );
04533 
04534    //==========================================================================
04535    // \brief Description of the node
04542    //==========================================================================
04543    virtual const RM_TCHAR* GetDescription();
04544        
04545    //==========================================================================
04551    //==========================================================================
04552    float* GetValue()                      {     return m_fColor;     }
04553 
04554    //==========================================================================
04561    //==========================================================================
04562    float GetChannel( int nIndex );
04563 
04564    //==========================================================================
04570    //==========================================================================
04571    float GetR()                           {     return m_fColor[0];  } 
04572 
04573    //==========================================================================
04579    //==========================================================================
04580    float GetG()                           {     return m_fColor[1];  }
04581 
04582    //==========================================================================
04588    //==========================================================================
04589    float GetB()                           {     return m_fColor[2];  }
04590 
04591    //==========================================================================
04597    //==========================================================================
04598    float GetA()                           {     return m_fColor[3];  }
04599 
04600    //==========================================================================
04609    //==========================================================================
04610    void SetValue( int nIndex, float fValue );
04611 
04612    //==========================================================================
04620    //==========================================================================
04621    void SetValues( float fValues[4] );
04622 
04623 protected:
04624 
04625    //==========================================================================
04633    //==========================================================================
04634    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
04635 
04636    //==========================================================================
04642    //==========================================================================
04643    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmColorVariableChildRuleList ); }
04644 
04645    //==========================================================================
04652    //==========================================================================
04653    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
04654    {
04655       assert( NULL == m_pRmColorVariableChildRuleList );
04656       assert( NULL != pRmNodeChildRuleList );
04657       
04658       m_pRmColorVariableChildRuleList = pRmNodeChildRuleList;
04659       
04660    } // End virtual void SetNodeTypeChildRuleList()           
04661 
04662 protected:
04663    
04664    float m_fColor[4];      
04665 
04666 private :
04667    static RmNodeTypeChildRuleList  *m_pRmColorVariableChildRuleList; 
04668 
04669 }; // End of RmColorVariable class definition
04670 
04671 
04672 //.................................................................................
04673 //.................................................................................
04674 //    Stream mapping related classes
04675 //.................................................................................
04676 //.................................................................................
04677 
04678 
04680 class RmStream;
04681 class RmStreamMap;
04682 
04683 //=============================================================================
04692 //=============================================================================
04693 class RM_API RmStreamChannel: public RmNode
04694 {
04695 public:
04696 
04697    //==========================================================================
04702    //==========================================================================
04703    RmStreamChannel();
04704 
04705    //==========================================================================
04709    //==========================================================================
04710    RmStreamChannel( DWORD dwUsage, DWORD dwUsageIndex, DWORD dwRegisterIndex, DWORD dwDataType );
04711       // RmStreamChannel *RmAddStreamChannel(RmStream *node, DWORD usage, DWORD usageIndex, DWORD reg, DWORD chanType)
04712 
04713    //==========================================================================
04718    //==========================================================================
04719    virtual ~RmStreamChannel();
04720 
04721    //==========================================================================
04729    //==========================================================================
04730    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
04731 
04732    //==========================================================================
04743    //==========================================================================
04744    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
04745    
04746    //==========================================================================
04756    //==========================================================================
04757    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
04758 
04759    //==========================================================================
04765    //==========================================================================
04766    virtual RmNode* Clone( bool bIncludeLoadedData );
04767 
04768    //==========================================================================
04769    // \brief Description of the node
04775    //==========================================================================
04776    virtual const RM_TCHAR* GetDescription();
04777 
04778    //==========================================================================
04784    //==========================================================================
04785    unsigned long GetRegister()                        {        return m_ulRegister;       }
04786 
04787    //==========================================================================
04794    //==========================================================================
04795    void SetRegister( unsigned long ulRegister );
04796 
04797    //==========================================================================
04803    //==========================================================================
04804    unsigned long GetDataType()                        {        return m_ulDataType;       }
04805 
04806    //==========================================================================
04812    //==========================================================================
04813    void SetDataType( unsigned long ulType );
04814 
04815    //==========================================================================
04816    // \brief Get size
04821    //==========================================================================
04822    int GetSize()                                      {        return m_nDataSize;        }
04823 
04824    //==========================================================================
04830    //==========================================================================
04831    unsigned long GetUsage()                           {        return m_ulUsage;          }
04832 
04833    //==========================================================================
04840    //==========================================================================
04841    void SetUsage( unsigned long ulUsage );
04842 
04843    //==========================================================================
04849    //==========================================================================
04850    unsigned long GetUsageIndex()                      {        return m_ulUsageIndex;     }
04851 
04852    //==========================================================================
04859    //==========================================================================
04860    void SetUsageIndex( unsigned long ulUsageIndex );
04861 
04862    //==========================================================================
04868    //==========================================================================
04869    const RM_TCHAR* GetUsageString();
04870 
04871    //==========================================================================
04877    //==========================================================================
04878    RmStream* GetParentStream()
04879    {
04880       return (RmStream *) GetParent();
04881    }
04882 
04883 protected:
04884 
04885    //==========================================================================
04893    //==========================================================================
04894    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
04895 
04896    //==========================================================================
04902    //==========================================================================
04903    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmStreamChannelChildRuleList ); }
04904 
04905    //==========================================================================
04912    //==========================================================================
04913    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
04914    {
04915       assert( NULL == m_pRmStreamChannelChildRuleList );
04916       assert( NULL != pRmNodeChildRuleList );
04917       
04918       m_pRmStreamChannelChildRuleList = pRmNodeChildRuleList;
04919       
04920    } // End virtual void SetNodeTypeChildRuleList()           
04921 
04922 protected:
04923    RmStringT        m_strUsage;          
04924 
04925    unsigned long    m_ulRegister;        
04926    unsigned long    m_ulDataType;        
04927    unsigned long    m_ulUsage;           
04928    unsigned long    m_ulUsageIndex;      
04929 
04930    int              m_nDataSize;         
04931 
04932 private :
04933    static RmNodeTypeChildRuleList  *m_pRmStreamChannelChildRuleList; 
04934 
04935 }; // End of RmStreamChannel class definition
04936 
04937 typedef RmLinkedList<RmStreamChannel*>        RmStreamChannelList;
04938 typedef RmStreamChannelList::iterator         RmStreamChannelListIterator;
04939 typedef RmStreamChannelList::const_iterator   RmStreamChannelListConstIterator;
04940 
04941 
04942 //=============================================================================
04948 //=============================================================================
04949 class RM_API RmStream : public RmNode  
04950 {
04951 public:
04952 
04953    //==========================================================================
04958    //==========================================================================
04959    RmStream();
04960 
04961    //==========================================================================
04969    //==========================================================================
04970    RmStream( const RM_TCHAR* strStreamName, bool bInitialize = true );
04971 
04972    //==========================================================================
04977    //==========================================================================
04978    virtual ~RmStream();
04979 
04980    //==========================================================================
04988    //==========================================================================
04989    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
04990 
04991    //==========================================================================
05002    //==========================================================================
05003    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
05004    
05005    //==========================================================================
05015    //==========================================================================
05016    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
05017 
05018    //==========================================================================
05024    //==========================================================================
05025    virtual RmNode* Clone( bool bIncludeLoadedData );
05026 
05027    //==========================================================================
05028    // \brief Description of the node
05034    //==========================================================================
05035    virtual const RM_TCHAR* GetDescription();
05036 
05037    //==========================================================================
05043    //==========================================================================
05044    RmStreamChannelListIterator         BeginChannels()            {     return m_channelList.begin(); }
05045 
05046    //==========================================================================
05052    //==========================================================================
05053    RmStreamChannelListConstIterator    BeginChannels()   const    {     return m_channelList.begin(); }
05054 
05055    //==========================================================================
05061    //==========================================================================
05062    RmStreamChannelListIterator         EndChannels()              {     return m_channelList.end();   }
05063 
05064    //==========================================================================
05070    //==========================================================================
05071    RmStreamChannelListConstIterator    EndChannels()     const    {     return m_channelList.end();   }
05072 
05073    //==========================================================================
05079    //==========================================================================
05080    int GetNumChannels()          {     return m_channelList.size();     }
05081 
05082    //==========================================================================
05090    //==========================================================================
05091    bool AddChannel( RmStreamChannel* pChannel );
05092 
05093    //==========================================================================
05100    //==========================================================================
05101    void DeleteChannel( RmStreamChannel* pChannel );
05102 
05103    //==========================================================================
05109    //==========================================================================
05110    void DeleteAllChannels();
05111 
05112    //==========================================================================
05121    //==========================================================================
05122    void DeleteChannel( unsigned long ulUsage, unsigned long ulUsageIndex, unsigned long ulDataType );
05123 
05124    //==========================================================================
05133    //==========================================================================
05134    RmStreamChannel* GetChannel( unsigned long ulUsage, unsigned long ulUsageIndex, unsigned long ulDataType );
05135 
05136    //==========================================================================
05143    //==========================================================================
05144    RmStreamChannel* GetChannel( const RM_TCHAR* strChannelName );
05145 
05146    //==========================================================================
05153    //==========================================================================
05154    RmStreamChannel* GetChannel( int nIndex );
05155 
05156    //==========================================================================
05162    //==========================================================================
05163    int GetStride()         {     return m_nStride;    }
05164 
05165    //==========================================================================
05171    //==========================================================================
05172    RmStreamMap* GetParentStreamMap()
05173    {
05174       return (RmStreamMap *)GetParent();
05175    }
05176 
05177 protected:
05178 
05179    //==========================================================================
05187    //==========================================================================
05188    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
05189 
05190    //==========================================================================
05196    //==========================================================================
05197    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmStreamChildRuleList ); }
05198 
05199    //==========================================================================
05206    //==========================================================================
05207    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
05208    {
05209       assert( NULL == m_pRmStreamChildRuleList );
05210       assert( NULL != pRmNodeChildRuleList );
05211       
05212       m_pRmStreamChildRuleList = pRmNodeChildRuleList;
05213       
05214    } // End virtual void SetNodeTypeChildRuleList()           
05215 
05216 protected:
05217 
05218    RmStreamChannelList m_channelList;        
05219          
05220    int  m_nStride;                           
05221 
05222 private :
05223    static RmNodeTypeChildRuleList  *m_pRmStreamChildRuleList; 
05224 
05225 }; // End of RmStream class definition
05226 
05227 
05228 typedef RmLinkedList<RmStream *>        RmStreamList;
05229 typedef RmStreamList::iterator          RmStreamListIterator;
05230 typedef RmStreamList::const_iterator    RmStreamListConstIterator;
05231 
05232 
05233 //=============================================================================
05239 //=============================================================================
05240 class RM_API RmStreamMap : public RmNode  
05241 {
05242 public:
05243 
05244    //==========================================================================
05249    //==========================================================================
05250    RmStreamMap();
05251 
05252    //==========================================================================
05260    //==========================================================================
05261    RmStreamMap( const RM_TCHAR* strName, bool bInitialize = true );
05262 
05263    //==========================================================================
05268    //==========================================================================
05269    virtual ~RmStreamMap();
05270 
05271    //==========================================================================
05279    //==========================================================================
05280    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
05281 
05282    //==========================================================================
05293    //==========================================================================
05294    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
05295    
05296    //==========================================================================
05306    //==========================================================================
05307    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
05308 
05309    //==========================================================================
05315    //==========================================================================
05316    virtual RmNode* Clone( bool bIncludeLoadedData );
05317 
05318    //==========================================================================
05319    // \brief Description of the node
05325    //==========================================================================
05326    virtual const RM_TCHAR* GetDescription();
05327 
05328    //==========================================================================
05334    //==========================================================================
05335    virtual bool IsNodeValid()                      { return( !m_streamList.empty() ? RmNode::IsNodeValid() : false ); };
05336    
05337    //==========================================================================
05345    //==========================================================================
05346    bool AddStream( RmStream* pStream );
05347 
05348    //==========================================================================
05355    //==========================================================================
05356    RmStream* GetStream( const RM_TCHAR* strStreamName );
05357 
05358    //==========================================================================
05365    //==========================================================================
05366    RmStream* GetStream( int nIndex );
05367 
05368    //==========================================================================
05375    //==========================================================================
05376    void DeleteStream( RmStream* pStream );
05377 
05378    //==========================================================================
05385    //==========================================================================
05386    void DeleteStream( const RM_TCHAR* strStreamName );
05387 
05388    //==========================================================================
05394    //==========================================================================
05395    int GetNumStreams()              {        return m_streamList.size();      }
05396 
05397    //==========================================================================
05403    //==========================================================================
05404    RmStreamListIterator          BeginStreams()          {     return m_streamList.begin();  }
05405 
05406    //==========================================================================
05412    //==========================================================================
05413    RmStreamListConstIterator     BeginStreams() const    {     return m_streamList.begin();  }
05414 
05415    //==========================================================================
05421    //==========================================================================
05422    RmStreamListIterator          EndStreams()            {     return m_streamList.end();    }
05423 
05424    //==========================================================================
05430    //==========================================================================
05431    RmStreamListConstIterator     EndStreams()   const    {     return m_streamList.end();    }
05432 
05433    //==========================================================================
05440    //==========================================================================
05441    int GetHandle()                  {     return m_nHandle;       }
05442 
05443    //==========================================================================
05451    //==========================================================================
05452    void SetHandle( int nHandle )    {     m_nHandle = nHandle;    }
05453 
05454 protected:
05455 
05456    //==========================================================================
05464    //==========================================================================
05465    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
05466 
05467    //==========================================================================
05473    //==========================================================================
05474    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmStreamMapChildRuleList ); }
05475 
05476    //==========================================================================
05483    //==========================================================================
05484    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
05485    {
05486       assert( NULL == m_pRmStreamMapChildRuleList );
05487       assert( NULL != pRmNodeChildRuleList );
05488       
05489       m_pRmStreamMapChildRuleList = pRmNodeChildRuleList;
05490       
05491    } // End virtual void SetNodeTypeChildRuleList()           
05492 
05493 protected:
05494 
05495    int          m_nHandle;          
05496    RmStreamList m_streamList;       
05497 
05498 private :
05499    static RmNodeTypeChildRuleList  *m_pRmStreamMapChildRuleList; 
05500 
05501 }; // End of RmStreamMap class definition
05502 
05503 //=============================================================================
05511 //=============================================================================
05512 class RM_API RmStreamMapReference : public RmNode  
05513 {   
05514 public:
05515 
05516    //==========================================================================
05521    //==========================================================================
05522    RmStreamMapReference();
05523 
05524    //==========================================================================
05532    //==========================================================================
05533    RmStreamMapReference( RmStreamMap* pStreamMap );
05534 
05535    //==========================================================================
05540    //==========================================================================
05541    virtual ~RmStreamMapReference();
05542 
05543    //==========================================================================
05551    //==========================================================================
05552    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
05553 
05554    //==========================================================================
05565    //==========================================================================
05566    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
05567    
05568    //==========================================================================
05578    //==========================================================================
05579    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
05580 
05581    //==========================================================================
05587    //==========================================================================
05588    virtual RmNode* Clone( bool bIncludeLoadedData );
05589 
05590    //==========================================================================
05591    // \brief Description of the node
05597    //==========================================================================
05598    virtual const RM_TCHAR* GetDescription();
05599 
05600    //==========================================================================
05606    //==========================================================================
05607    virtual bool IsNodeValid()                      { return( ( NULL != m_pStreamMap ) ? RmNode::IsNodeValid() : false ); };
05608 
05609    //==========================================================================
05616    //==========================================================================
05617    void SetReference( RmStreamMap* pStreamMap );
05618 
05619    //==========================================================================
05625    //==========================================================================
05626    RmStreamMap* GetReference()            {        return m_pStreamMap;          }
05627 
05628 protected:
05629 
05630    //==========================================================================
05638    //==========================================================================
05639    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
05640 
05641    //==========================================================================
05647    //==========================================================================
05648    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmStreamMapReferenceChildRuleList ); }
05649 
05650    //==========================================================================
05657    //==========================================================================
05658    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
05659    {
05660       assert( NULL == m_pRmStreamMapReferenceChildRuleList );
05661       assert( NULL != pRmNodeChildRuleList );
05662       
05663       m_pRmStreamMapReferenceChildRuleList = pRmNodeChildRuleList;
05664       
05665    } // End virtual void SetNodeTypeChildRuleList()           
05666 
05667 protected:
05668 
05669    RmStreamMap* m_pStreamMap;       
05670 
05671 private :
05672    static RmNodeTypeChildRuleList  *m_pRmStreamMapReferenceChildRuleList; 
05673 
05674 }; // End of RmStreamMapReference class definition
05675 
05676 
05677 //=============================================================================
05687 //=============================================================================
05688 class RM_API RmShaderConstant: public RmNode
05689 {
05690 public:
05691 
05692    //==========================================================================
05697    //==========================================================================
05698    RmShaderConstant();
05699 
05700    //==========================================================================
05710    //==========================================================================
05711    RmShaderConstant( const RM_TCHAR *strConstantName, const RM_TCHAR* strConstantType, 
05712                      int nRegister );
05713 
05714    //==========================================================================
05722    //==========================================================================
05723    RmShaderConstant( RmNode *pNode, int nRegister );
05724 
05725    //==========================================================================
05730    //==========================================================================
05731    virtual ~RmShaderConstant();
05732 
05733    //==========================================================================
05741    //==========================================================================
05742    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
05743 
05744    //==========================================================================
05755    //==========================================================================
05756    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
05757    
05758    //==========================================================================
05768    //==========================================================================
05769    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
05770 
05771    //==========================================================================
05777    //==========================================================================
05778    virtual RmNode* Clone( bool bIncludeLoadedData );
05779 
05780    //==========================================================================
05781    // \brief Description of the node
05787    //==========================================================================
05788    virtual const RM_TCHAR* GetDescription();
05789 
05790    //==========================================================================
05796    //==========================================================================
05797    virtual bool IsNodeValid()          {     return( ( NULL != m_pNode ) ? RmNode::IsNodeValid() : false ); };
05798 
05799    //==========================================================================
05800    // \brief Get register
05805    //==========================================================================
05806    int GetRegister()                      {     return m_nRegister;        }
05807 
05808    //==========================================================================
05815    //==========================================================================
05816    void SetRegister( int nIndex )      {     m_nRegister = nIndex;      }
05817 
05818    //==========================================================================
05826    //==========================================================================
05827    int GetElementCount();
05828 
05829    //==========================================================================
05835    //==========================================================================
05836    const RmStringT& GetDataType()              {     return m_strConstantType;  }
05837 
05838    //==========================================================================
05844    //==========================================================================
05845    RmNode* GetParameterNode()       {        return m_pNode;         }  
05846 
05847    //==========================================================================
05854    //==========================================================================
05855    void LinkToParameterNode( RmNode *pNode );
05856 
05857 protected:
05858 
05859    //==========================================================================
05867    //==========================================================================
05868    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
05869 
05870    //==========================================================================
05876    //==========================================================================
05877    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmShaderConstantChildRuleList ); }
05878 
05879    //==========================================================================
05886    //==========================================================================
05887    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
05888    {
05889       assert( NULL == m_pRmShaderConstantChildRuleList );
05890       assert( NULL != pRmNodeChildRuleList );
05891       
05892       m_pRmShaderConstantChildRuleList = pRmNodeChildRuleList;
05893       
05894    } // End virtual void SetNodeTypeChildRuleList()           
05895 
05896 protected: 
05897 
05898    int        m_nRegister;         
05899    RmNode*    m_pNode;             
05900    RmStringT  m_strConstantType;   
05901 
05902 private :
05903    static RmNodeTypeChildRuleList  *m_pRmShaderConstantChildRuleList; 
05904 
05905 }; // End of RmShaderConstant class definition
05906 
05907 typedef RmLinkedList<RmShaderConstant*>       RmShaderConstantList;
05908 typedef RmShaderConstantList::iterator       RmShaderConstantListIterator;
05909 typedef RmShaderConstantList::const_iterator RmShaderConstantListConstIterator;
05910 
05911 //=============================================================================
05919 //=============================================================================
05920 class RM_API RmSampler : public RmNode
05921 {
05922 public:
05923 
05924    //==========================================================================
05929    //==========================================================================
05930    RmSampler();
05931 
05932    //==========================================================================
05939    //==========================================================================
05940    RmSampler( const RM_TCHAR *strSamplerName, int nRegister );
05941 
05942    //==========================================================================
05947    //==========================================================================
05948    virtual ~RmSampler();
05949 
05950    //==========================================================================
05958    //==========================================================================
05959    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
05960 
05961    //==========================================================================
05972    //==========================================================================
05973    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
05974    
05975    //==========================================================================
05985    //==========================================================================
05986    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
05987 
05988    //==========================================================================
05994    //==========================================================================
05995    virtual RmNode* Clone( bool bIncludeLoadedData );
05996 
05997    //==========================================================================
05998    // \brief Description of the node
06004    //==========================================================================
06005    virtual const RM_TCHAR* GetDescription();
06006 
06007    //==========================================================================
06013    //==========================================================================
06014    virtual bool IsNodeValid()             {     return( ( NULL != m_pTextureObject ) ? RmNode::IsNodeValid() : false ); };
06015 
06016    //==========================================================================
06022    //==========================================================================
06023    void SetRegister( int nIndex )         {     m_nRegister = nIndex;   }
06024    
06025    //==========================================================================
06031    //==========================================================================
06032    int GetRegister()                      {     return m_nRegister;     }
06033 
06034    //==========================================================================
06040    //==========================================================================
06041    RmNode*       GetTextureObject()       { return m_pTextureObject; };
06042 
06043    //==========================================================================
06049    //==========================================================================
06050    const RmNode* GetTextureObject() const { return m_pTextureObject; };
06051 
06052 protected:
06053 
06054    //==========================================================================
06062    //==========================================================================
06063    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
06064 
06065 protected: 
06066 
06067    int       m_nRegister;        
06068    RmNode   *m_pTextureObject;   
06069 
06070 }; // End of RmSampler class definition
06071 
06072 
06073 typedef RmLinkedList<RmSampler*>        RmSamplerList;
06074 typedef RmSamplerList::iterator        RmSamplerListIterator;
06075 typedef RmSamplerList::const_iterator  RmSamplerListConstIterator;
06076 
06077 //=============================================================================
06087 //=============================================================================
06088 class RM_API RmShader : public RmNode  
06089 {
06090 public:
06091    //==========================================================================
06096    //==========================================================================
06097    RmShader();
06098 
06099    //==========================================================================
06104    //==========================================================================
06105    virtual ~RmShader();
06106 
06107    //==========================================================================
06115    //==========================================================================
06116    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
06117 
06118    //==========================================================================
06129    //==========================================================================
06130    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
06131    
06132    //==========================================================================
06142    //==========================================================================
06143    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
06144 
06145    //==========================================================================
06146    // \brief Description of the node
06152    //==========================================================================
06153    virtual const RM_TCHAR* GetDescription();
06154 
06155    //==========================================================================
06161    //==========================================================================
06162    virtual RmNode* Clone( bool bIncludeLoadedData );
06163 
06164    //==========================================================================
06171    //==========================================================================
06172    virtual bool IsHighLevel()
06173    {
06175       return false;
06176    }
06177 
06178    //==========================================================================
06185    //==========================================================================
06186    virtual void DeleteConstant( int nRegister );
06187 
06188    //==========================================================================
06195    //==========================================================================
06196    virtual void DeleteConstant( const RM_TCHAR *strConstantName );
06197 
06198    //==========================================================================
06204    //==========================================================================
06205    virtual void DeleteAllConstants();
06206 
06207    //==========================================================================
06216    //==========================================================================
06217    virtual bool AddConstant( RmShaderConstant *pConstant );
06218 
06219    //==========================================================================
06227    //==========================================================================
06228    virtual RmShaderConstant* GetConstant( int nRegister );
06229 
06230    //==========================================================================
06237    //==========================================================================
06238    virtual RmShaderConstant* GetConstant( const RM_TCHAR *strConstantName );
06239 
06240    //==========================================================================
06247    //==========================================================================
06248    virtual RmShaderConstant* GetConstantByIndex( int nIndex );
06249 
06250    //==========================================================================
06256    //==========================================================================
06257    virtual int GetNumConstants() const                                     {      return m_constantList.size(); };
06258 
06259    //==========================================================================
06265    //==========================================================================
06266    virtual RmShaderConstantListIterator        BeginConstants()         {     return m_constantList.begin();   }
06267 
06268    //==========================================================================
06274    //==========================================================================
06275    virtual RmShaderConstantListConstIterator   BeginConstants()  const  {     return m_constantList.begin();   }
06276 
06277    //==========================================================================
06283    //==========================================================================
06284    virtual RmShaderConstantListIterator        EndConstants()           {     return m_constantList.end();     }
06285 
06286    //==========================================================================
06292    //==========================================================================
06293    virtual RmShaderConstantListConstIterator   EndConstants()    const  {     return m_constantList.end();     }
06294 
06295    //==========================================================================
06302    //==========================================================================
06303    void  SetCode( const RM_TCHAR* strCode );
06304 
06305    //==========================================================================
06311    //==========================================================================
06312    const RmStringT&  GetShaderCode() const                       {        return m_strCode;       }
06313 
06314    //==========================================================================
06321    //==========================================================================
06322    void GetMaxInstructionInfo( int &nMaxALUInstructions, int &nMaxTexInstructions )
06323    {
06324       nMaxALUInstructions = m_nMaxALUInstructions;
06325       nMaxTexInstructions = m_nMaxTexInstructions;
06326          
06327    } // end void GetMaxInstructionInfo( int &nMaxALUInstructions, int &nMaxTexInstructions )
06328    
06329    //==========================================================================
06336    //==========================================================================
06337    void SetMaxInstructionInfo( int nMaxALUInstructions, int nMaxTexInstructions )
06338    {
06339       m_nMaxALUInstructions   = nMaxALUInstructions;
06340       m_nMaxTexInstructions   = nMaxTexInstructions;
06341          
06342    } // end void SetMaxInstructionInfo( int nMaxALUInstructions, int nMaxTexInstructions )
06343 
06344    //==========================================================================
06350    //==========================================================================
06351    RM_TCHAR* GetFullName();   
06352 
06353    //==========================================================================
06360    //==========================================================================
06361    RM_TCHAR* GetFullNameWithAPI();
06362 
06363    //==========================================================================
06369    //==========================================================================
06370    int GetHandle()                                    {     return m_nHandle;                }
06371 
06372    //==========================================================================
06379    //==========================================================================
06380    void SetHandle( int nHandle )                   {     m_nHandle = nHandle;             }
06381 
06382    //==========================================================================
06388    //==========================================================================
06389    bool IsModified()  const                        {     return m_bModified;     }
06390 
06391    //==========================================================================
06398    //==========================================================================
06399    void SetModified( bool bModified )              {     m_bModified = bModified;   }
06400 
06401    //==========================================================================
06407    //==========================================================================
06408    bool IsPixelShader()                            {     return( m_bPixelShader == true );   }
06409 
06410    //==========================================================================
06416    //==========================================================================
06417    bool IsVertexShader()                           {     return( m_bPixelShader == false );  }
06418 
06419    //==========================================================================
06426    //==========================================================================
06427    void SetIsPixelShader( bool bPixelShader )      {     m_bPixelShader = bPixelShader;      }
06428 
06429 protected:
06430 
06431    //==========================================================================
06439    //==========================================================================
06440    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
06441 
06442    //==========================================================================
06448    //==========================================================================
06449    virtual void SetType( const RM_TCHAR* strNewType )
06450    {
06451       RmNode::SetType( RmStringT( RmStringT( _T("RmShader.") ) + RmStringT( strNewType ) ) );
06452 
06453    } // End of SetType( const RM_TCHAR* strNewType )
06454 
06455    //==========================================================================
06461    //==========================================================================
06462    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmShaderChildRuleList ); }
06463 
06464    //==========================================================================
06471    //==========================================================================
06472    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
06473    {
06474       assert( NULL == m_pRmShaderChildRuleList );
06475       assert( NULL != pRmNodeChildRuleList );
06476       
06477       m_pRmShaderChildRuleList = pRmNodeChildRuleList;
06478       
06479    } // End virtual void SetNodeTypeChildRuleList()           
06480 
06481 protected:
06482 
06483    RmStringT            m_strCode;              
06484    bool                 m_bModified;            
06485    int                  m_nHandle;              
06486    RmShaderConstantList m_constantList;         
06487    bool                 m_bPixelShader;         
06488    int                  m_nMaxALUInstructions;  
06489    int                  m_nMaxTexInstructions;  
06490      
06491 private :
06492    static RmNodeTypeChildRuleList  *m_pRmShaderChildRuleList; 
06493 
06494 }; // End of RmShader class definition
06495 
06496 
06497 
06498 //=============================================================================
06508 //=============================================================================
06509 class RM_API RmHLShader : public RmShader
06510 {
06511 public:
06512    //==========================================================================
06517    //==========================================================================
06518    RmHLShader();
06519 
06520    //==========================================================================
06525    //==========================================================================
06526    virtual ~RmHLShader();
06527 
06528    //==========================================================================
06536    //==========================================================================
06537    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
06538 
06539    //==========================================================================
06550    //==========================================================================
06551    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
06552    
06553    //==========================================================================
06563    //==========================================================================
06564    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
06565 
06566    //==========================================================================
06567    // \brief Description of the node
06573    //==========================================================================
06574    virtual const RM_TCHAR* GetDescription();
06575 
06576    //==========================================================================
06582    //==========================================================================
06583    virtual RmNode* Clone( bool bIncludeLoadedData );
06584 
06585    //==========================================================================
06592    //==========================================================================
06593    virtual bool IsHighLevel()
06594    {
06595       return true;
06596    }
06597 
06598    //==========================================================================
06605    //==========================================================================
06606    virtual RmSampler* GetSampler( const RM_TCHAR *strSamplerName );
06607 
06608    //==========================================================================
06615    //==========================================================================
06616    virtual void DeleteSampler( const RM_TCHAR *strSamplerName );
06617 
06618    //==========================================================================
06626    //==========================================================================
06627    virtual bool AddSampler( RmSampler* pSampler );
06628 
06629    //==========================================================================
06635    //==========================================================================
06636    virtual void DeleteAllSamplers();
06637 
06638    //==========================================================================
06644    //==========================================================================
06645    virtual int  GetNumSamplers() const                               {     return m_samplerList.size(); };
06646 
06647    //==========================================================================
06653    //==========================================================================
06654    virtual RmSamplerListIterator        BeginSamplers()           {     return m_samplerList.begin();   }
06655 
06656    //==========================================================================
06662    //==========================================================================
06663    virtual RmSamplerListConstIterator   BeginSamplers()  const    {     return m_samplerList.begin();   }
06664 
06665    //==========================================================================
06671    //==========================================================================
06672    virtual RmSamplerListIterator        EndSamplers()             {     return m_samplerList.end();     }
06673 
06674    //==========================================================================
06680    //==========================================================================
06681    virtual RmSamplerListConstIterator   EndSamplers()    const    {     return m_samplerList.end();     }
06682 
06683    //==========================================================================
06692    //==========================================================================
06693    virtual void AddParameterDeclaration( RmNode *pParameterNode, int nRegisterIndex )   {};
06694 
06695 
06696 protected:
06697 
06698    //==========================================================================
06706    //==========================================================================
06707    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
06708 
06709    //==========================================================================
06715    //==========================================================================
06716    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmHLShaderChildRuleList ); }
06717    
06718    //==========================================================================
06725    //==========================================================================
06726    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
06727    {
06728       assert( NULL == m_pRmHLShaderChildRuleList );
06729       assert( NULL != pRmNodeChildRuleList );
06730       
06731       m_pRmHLShaderChildRuleList = pRmNodeChildRuleList;
06732       
06733    } // End virtual void SetNodeTypeChildRuleList()           
06734 
06735    //==========================================================================
06742    //==========================================================================
06743    virtual void SetType( const RM_TCHAR* strNewType )
06744    {
06745       RmShader::SetType( RmStringT( RmStringT( _T("RmHLShader.") ) + RmStringT( strNewType ) ) );
06746 
06747    } // End of SetType( const RM_TCHAR* strNewType )
06748 
06749 protected:
06750 
06751    RmSamplerList m_samplerList;      
06752      
06753 private :
06754    static RmNodeTypeChildRuleList  *m_pRmHLShaderChildRuleList; 
06755    
06756 }; // End of RmHLShader class definition
06757 
06758 
06759 //=============================================================================
06766 //=============================================================================
06767 class RM_API RmHLSLShader : public RmHLShader
06768 {
06769 public:
06770    //==========================================================================
06775    //==========================================================================
06776    RmHLSLShader();
06777 
06778    //==========================================================================
06786    //==========================================================================
06787    RmHLSLShader( const RM_TCHAR* strName, bool bPixelShader );
06788 
06789    //==========================================================================
06794    //==========================================================================
06795    virtual ~RmHLSLShader();
06796 
06797    //==========================================================================
06805    //==========================================================================
06806    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
06807 
06808    //==========================================================================
06819    //==========================================================================
06820    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
06821    
06822    //==========================================================================
06832    //==========================================================================
06833    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
06834 
06835    //==========================================================================
06836    // \brief Description of the node
06842    //==========================================================================
06843    virtual const RM_TCHAR* GetDescription();
06844 
06845    //==========================================================================
06851    //==========================================================================
06852    virtual RmNode* Clone( bool bIncludeLoadedData );
06853 
06854    //==========================================================================
06863    //==========================================================================
06864    virtual void AddParameterDeclaration( RmNode *pParameterNode, int nRegisterIndex );
06865 
06866    //==========================================================================
06872    //==========================================================================
06873    RmStringT& GetDisassemblyCode()                                {      return m_strDisassembly;            }
06874 
06875    //==========================================================================
06881    //==========================================================================
06882    void SetDisassemblyCode( RmStringT rstrDisassembly )        {      m_strDisassembly = rstrDisassembly; }
06883 
06884    //==========================================================================
06890    //==========================================================================
06891    void SetDisassemblyCode( const RM_TCHAR* strDisassembly )   {      m_strDisassembly = strDisassembly; }
06892    
06893    //==========================================================================
06900    //==========================================================================
06901    void SetTarget( const RM_TCHAR* strTarget );
06902 
06903    //==========================================================================
06909    //==========================================================================
06910    const RmStringT& GetTarget()                                   {     return m_strTarget;        }
06911    
06912    //==========================================================================
06919    //==========================================================================
06920    void SetEntryPoint( const RM_TCHAR* strEntryPt );
06921 
06922    //==========================================================================
06928    //==========================================================================
06929    const RmStringT& GetEntryPoint()                               {     return m_strEntryPt;       }
06930    
06931 protected:
06932 
06933    //==========================================================================
06941    //==========================================================================
06942    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
06943 
06944    //==========================================================================
06950    //==========================================================================
06951    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmHLSLShaderChildRuleList ); }
06952    
06953    //==========================================================================
06960    //==========================================================================
06961    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
06962    {
06963       assert( NULL == m_pRmHLSLShaderChildRuleList );
06964       assert( NULL != pRmNodeChildRuleList );
06965       
06966       m_pRmHLSLShaderChildRuleList = pRmNodeChildRuleList;
06967       
06968    } // End virtual void SetNodeTypeChildRuleList()           
06969 
06970    //==========================================================================
06977    //==========================================================================
06978    virtual void SetType( const RM_TCHAR* strNewType )
06979    {
06980       RmHLShader::SetType( RmStringT( RmStringT( _T("RmHLSLShader.") ) + RmStringT( strNewType ) ) );
06981 
06982    } // End of SetType( const RM_TCHAR* strNewType )
06983 
06984 private:
06985 
06986    RmStringT m_strTarget;           
06987    RmStringT m_strEntryPt;          
06988    RmStringT m_strDisassembly;      
06989    
06990 private :
06991    static RmNodeTypeChildRuleList  *m_pRmHLSLShaderChildRuleList; 
06992    
06993 };    // End of RmHLSLShader class definition
06994 
06995 
06996 //=============================================================================
07003 //=============================================================================
07004 class RM_API RmGLShader : public RmHLShader
07005 {
07006 public:
07007    //==========================================================================
07012    //==========================================================================
07013    RmGLShader();
07014 
07015    //==================================================================================================
07022    //==================================================================================================
07023    RmGLShader( const RM_TCHAR* strName, bool bPixelShader );   
07024    
07025    //==========================================================================
07030    //==========================================================================
07031    virtual ~RmGLShader();
07032 
07033    //==========================================================================
07041    //==========================================================================
07042    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
07043 
07044    //==========================================================================
07055    //==========================================================================
07056    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
07057    
07058    //==========================================================================
07068    //==========================================================================
07069    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
07070 
07071    //==========================================================================
07072    // \brief Description of the node
07078    //==========================================================================
07079    virtual const RM_TCHAR* GetDescription();
07080 
07081    //==========================================================================
07087    //==========================================================================
07088    virtual RmNode* Clone( bool bIncludeLoadedData );
07089 
07090    //==========================================================================
07099    //==========================================================================
07100    virtual void AddParameterDeclaration( RmNode *pParameterNode, int nRegisterIndex );
07101 
07102 
07103    //======================================================================
07106    //======================================================================
07107 
07108 private:
07110    virtual void                              DeleteConstant( int nRegister );
07111    virtual void                              DeleteConstant( const RM_TCHAR *strConstantName );
07112    virtual void                              DeleteAllConstants();
07113    virtual bool                              AddConstant( RmShaderConstant *pConstant );
07114    virtual RmShaderConstant*                 GetConstant( int nRegister );
07115    virtual RmShaderConstant*                 GetConstant( const RM_TCHAR *strConstantName );
07116    virtual RmShaderConstant*                 GetConstantByIndex( int nIndex );
07117    virtual int                               GetNumConstants() const;
07118    virtual RmShaderConstantListIterator      BeginConstants();
07119    virtual RmShaderConstantListConstIterator BeginConstants()  const;
07120    virtual RmShaderConstantListIterator      EndConstants();
07121    virtual RmShaderConstantListConstIterator EndConstants()    const;
07122 
07124    virtual RmSampler*                  GetSampler( const RM_TCHAR *strSamplerName );
07125    virtual void                        DeleteSampler( const RM_TCHAR *strSamplerName );
07126    virtual bool                        AddSampler( RmSampler* pSampler );
07127    virtual void                        DeleteAllSamplers();
07128    virtual int                         GetNumSamplers() const;
07129    virtual RmSamplerListIterator       BeginSamplers();
07130    virtual RmSamplerListConstIterator  BeginSamplers()  const;
07131    virtual RmSamplerListIterator       EndSamplers();
07132    virtual RmSamplerListConstIterator  EndSamplers()    const;
07133 
07134 
07135 protected:
07136 
07137    //==========================================================================
07145    //==========================================================================
07146    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
07147 
07148    //==========================================================================
07154    //==========================================================================
07155    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmGLShaderChildRuleList ); }
07156    
07157    //==========================================================================
07164    //==========================================================================
07165    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
07166    {
07167       assert( NULL == m_pRmGLShaderChildRuleList );
07168       assert( NULL != pRmNodeChildRuleList );
07169       
07170       m_pRmGLShaderChildRuleList = pRmNodeChildRuleList;
07171       
07172    } // End virtual void SetNodeTypeChildRuleList()           
07173 
07174    //==========================================================================
07181    //==========================================================================
07182    virtual void SetType( const RM_TCHAR* strNewType )
07183    {
07184       RmHLShader::SetType( RmStringT( RmStringT( _T("RmGLShader.") ) + RmStringT( strNewType ) ) );
07185 
07186    } // End of SetType( const RM_TCHAR* strNewType )
07187    
07188 private :
07189    static RmNodeTypeChildRuleList  *m_pRmGLShaderChildRuleList; 
07190    
07191 };    // End of RmGLShader class definition
07192 
07193 
07194 //=============================================================================
07202 //=============================================================================
07203 class RM_API RmModelData : public RmNode  
07204 {
07205 public:
07206 
07207    //==========================================================================
07212    //==========================================================================
07213    RmModelData();
07214 
07215    //=========================================================================
07222    //=========================================================================
07223    RmModelData( const RM_TCHAR* strName, const RM_TCHAR* strFileName );   
07224 
07225    //==========================================================================
07230    //==========================================================================
07231    virtual ~RmModelData();
07232 
07233    //==========================================================================
07241    //==========================================================================
07242    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
07243 
07244    //==========================================================================
07255    //==========================================================================
07256    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
07257    
07258    //==========================================================================
07268    //==========================================================================
07269    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
07270 
07271    //==========================================================================
07277    //==========================================================================
07278    virtual RmNode* Clone( bool bIncludeLoadedData );
07279 
07280    //==========================================================================
07281    // \brief Description of the node
07287    //==========================================================================
07288    virtual const RM_TCHAR* GetDescription();
07289 
07290    //=========================================================================
07296    //=========================================================================
07297    virtual bool IsNodeValid();
07298 
07299    //=========================================================================
07307    //=========================================================================
07308    void SetFileName( const RM_TCHAR* strFileName, bool bUpdateDatabase = true );
07309 
07310    //=========================================================================
07316    //=========================================================================
07317    const RmStringT& GetFileName();
07318 
07319    //=========================================================================
07325    //=========================================================================
07326    void GetFullFileName( RM_TCHAR* strFullPath, int nSize );
07327 
07328    //=========================================================================
07334    //=========================================================================
07335    bool LoadModel();
07336 
07337    //=========================================================================
07343    //=========================================================================
07344    bool CreateMeshModelContainer();
07345 
07346    //=========================================================================
07352    //=========================================================================
07353    RmMeshModelContainer*       GetMeshContainer()        { return m_pModelContainer; };
07354 
07355    //=========================================================================
07361    //=========================================================================
07362    const RmMeshModelContainer* GetMeshContainer() const  { return m_pModelContainer; };
07363 
07364    //=========================================================================
07370    //=========================================================================
07371    void SetOrientation( RmModelOrientation modelOrientation ) { m_modelOrientation = modelOrientation; }
07372    
07373    //=========================================================================
07379    //=========================================================================
07380    RmModelOrientation GetOrientation() { return( m_modelOrientation ); }
07381    
07382 protected:
07383 
07384    //==========================================================================
07392    //==========================================================================
07393    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
07394 
07395    //==========================================================================
07401    //==========================================================================
07402    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmModelDataChildRuleList ); }
07403 
07404    //==========================================================================
07411    //==========================================================================
07412    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
07413    {
07414       assert( NULL == m_pRmModelDataChildRuleList );
07415       assert( NULL != pRmNodeChildRuleList );
07416       
07417       m_pRmModelDataChildRuleList = pRmNodeChildRuleList;
07418       
07419    } // End virtual void SetNodeTypeChildRuleList()           
07420 
07421 protected:
07422 
07423    RmStringT             m_strFileName;       
07424    RmMeshModelContainer *m_pModelContainer;  
07425    bool                  m_bModelLoaded;      
07426    RmModelOrientation    m_modelOrientation;  
07427 
07428 private :
07429    static RmNodeTypeChildRuleList  *m_pRmModelDataChildRuleList; 
07430 
07431 }; // End of RmModelData class definition
07432 
07433 
07434 //=============================================================================
07440 //=============================================================================
07441 class RM_API RmModelReference : public RmNode  
07442 {   
07443 public:
07444 
07445    //==========================================================================
07450    //==========================================================================
07451    RmModelReference();
07452 
07453    //==========================================================================
07459    //==========================================================================
07460    RmModelReference( const RM_TCHAR* strName );
07461 
07462    //==========================================================================
07467    //==========================================================================
07468    virtual ~RmModelReference();
07469 
07470    //==========================================================================
07478    //==========================================================================
07479    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
07480 
07481    //==========================================================================
07492    //==========================================================================
07493    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
07494    
07495    //==========================================================================
07505    //==========================================================================
07506    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
07507 
07508    //==========================================================================
07514    //==========================================================================
07515    virtual RmNode* Clone( bool bIncludeLoadedData );
07516 
07517    //==========================================================================
07518    // \brief Description of the node
07524    //==========================================================================
07525    virtual const RM_TCHAR* GetDescription();   
07526 
07527    //=========================================================================
07533    //=========================================================================
07534    virtual bool IsNodeValid();
07535 
07536    //=========================================================================
07543    //=========================================================================
07544    void SetReference( RmModelData* pModel );
07545 
07546    //=========================================================================
07552    //=========================================================================
07553    RmModelData* GetReference()         
07554    {
07555       return m_pModel;
07556    }
07557 
07558 protected:
07559 
07560    //==========================================================================
07568    //==========================================================================
07569    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
07570 
07571    //==========================================================================
07577    //==========================================================================
07578    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmModelReferenceChildRuleList ); }
07579 
07580    //==========================================================================
07587    //==========================================================================
07588    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
07589    {
07590       assert( NULL == m_pRmModelReferenceChildRuleList );
07591       assert( NULL != pRmNodeChildRuleList );
07592       
07593       m_pRmModelReferenceChildRuleList = pRmNodeChildRuleList;
07594       
07595    } // End virtual void SetNodeTypeChildRuleList()           
07596 
07597 protected:
07598 
07599    RmModelData*         m_pModel;            
07600 
07601 private :
07602    static RmNodeTypeChildRuleList  *m_pRmModelReferenceChildRuleList; 
07603 
07604 }; // End of RmModelReference class definition 
07605 
07607 RM_API RmModelData* RmAddModel( RmNode *node, RM_TCHAR *name, RM_TCHAR *filename );
07608 
07609 
07610 //=============================================================================
07616 //=============================================================================
07617 class RM_API RmRenderableTexture : public Rm2DTextureVariable 
07618 {
07619 public:
07620 
07621    //==========================================================================
07626    //==========================================================================
07627    RmRenderableTexture();
07628 
07629    //==========================================================================
07641    //==========================================================================
07642    RmRenderableTexture( const RM_TCHAR* strName, int nWidth, int nHeight, unsigned int unFormat,
07643                         bool bUseViewportDims, bool bGenerateMipMaps );
07644 
07645    //==========================================================================
07650    //==========================================================================
07651    virtual ~RmRenderableTexture();
07652 
07653    //==========================================================================
07661    //==========================================================================
07662    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
07663 
07664    //==========================================================================
07675    //==========================================================================
07676    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
07677    
07678    //==========================================================================
07688    //==========================================================================
07689    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
07690 
07691    //==========================================================================
07697    //==========================================================================
07698    virtual RmNode* Clone( bool bIncludeLoadedData );
07699 
07700    //==========================================================================
07701    // \brief Description of the node
07707    //==========================================================================
07708    virtual const RM_TCHAR* GetDescription();
07709 
07710    //=========================================================================
07716    //=========================================================================
07717    virtual bool IsNodeValid() { return( RmVariable::IsNodeValid() ); }
07718    
07719    //==========================================================================
07725    //==========================================================================
07726    virtual bool LoadTexture();
07727    
07728    //==========================================================================
07734    //==========================================================================
07735    int   GetWidth()                                   {        return m_nWidth;                 }
07736    
07737    //==========================================================================
07744    //==========================================================================
07745    void  SetWidth( int nWidth )                       {        m_nWidth = nWidth;               }
07746 
07747    //==========================================================================
07753    //==========================================================================
07754    int  GetHeight()                                   {        return m_nHeight;                }
07755 
07756    //==========================================================================
07763    //==========================================================================
07764    void SetHeight( int nHeight )                      {        m_nHeight = nHeight;             }
07765 
07766    //==========================================================================
07772    //==========================================================================
07773    float GetWidthRatio()                              {        return m_fWidthRatio;            }
07774    
07775    //==========================================================================
07782    //==========================================================================
07783    void SetWidthRatio( float fWidthRatio )            {        m_fWidthRatio = fWidthRatio;     }
07784 
07785    //==========================================================================
07791    //==========================================================================
07792    float GetHeightRatio()                             {        return m_fHeightRatio;           }
07793 
07794    //==========================================================================
07801    //==========================================================================
07802    void SetHeightRatio( float fHeightRatio )          {        m_fHeightRatio = fHeightRatio;   }
07803    
07804    //==========================================================================
07810    //==========================================================================
07811    unsigned int GetFormat()                           {        return m_unFormat;               }
07812 
07813    //==========================================================================
07819    //==========================================================================
07820    void SetFormat( unsigned int unFormat )            {        m_unFormat = unFormat;           }
07821 
07822    //==========================================================================
07828    //==========================================================================
07829    bool UseViewportDimensions()                       {        return m_bUseViewportDims;       }
07830 
07831    //==========================================================================
07838    //==========================================================================
07839    void SetUseViewportDimensions( bool bUse )         {        m_bUseViewportDims = bUse;       }
07840 
07841    //==========================================================================
07847    //==========================================================================
07848    bool GenerateMipMaps()                             {        return m_bGenerateMipMaps;       }
07849 
07850    //==========================================================================
07857    //==========================================================================
07858    void SetGenerateMipMaps( bool bValue )             {        m_bGenerateMipMaps = bValue;     }
07859 
07860    //==========================================================================
07866    //==========================================================================
07867    int GetHandle()                                       {        return m_nHandle;             }
07868 
07869    //==========================================================================
07876    //==========================================================================
07877    void SetHandle( int nHandle )                      {        m_nHandle = nHandle;             }
07878 
07879 
07880 protected:
07881 
07882    //==========================================================================
07890    //==========================================================================
07891    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
07892 
07893    //==========================================================================
07899    //==========================================================================
07900    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmRenderableTextureChildRuleList ); }
07901 
07902    //==========================================================================
07909    //==========================================================================
07910    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
07911    {
07912       assert( NULL == m_pRmRenderableTextureChildRuleList );
07913       assert( NULL != pRmNodeChildRuleList );
07914       
07915       m_pRmRenderableTextureChildRuleList = pRmNodeChildRuleList;
07916       
07917    } // End virtual void SetNodeTypeChildRuleList()           
07918 
07919 protected:  
07920 
07921    int          m_nWidth;              
07922    int          m_nHeight;             
07923    unsigned int m_unFormat;            
07924    bool         m_bUseViewportDims;    
07925    float        m_fWidthRatio;         
07926    float        m_fHeightRatio;        
07927    bool         m_bGenerateMipMaps;    
07928 
07929    int          m_nHandle;             
07930 
07931 private:
07932    static RmNodeTypeChildRuleList  *m_pRmRenderableTextureChildRuleList; 
07933 
07934 }; // End of RmRenderableTexture class definition
07935 
07936 typedef RmLinkedList< RmRenderableTexture* >    RmRenderableTextureList;
07937 typedef RmRenderableTextureList::iterator       RmRenderableTextureListIterator;
07938 typedef RmRenderableTextureList::const_iterator RmRenderableTextureListConstIterator;
07939  
07940 //=============================================================================
07946 //=============================================================================
07947 class RM_API RmRenderTarget : public RmNode 
07948 {
07949 public:
07950 
07951    //==========================================================================
07956    //==========================================================================
07957    RmRenderTarget();
07958 
07962    RmRenderTarget( int nIndex );
07963    
07964    //===========================================================================================
07969    //===========================================================================================
07970    RmRenderTarget(   const RM_TCHAR* strName,
07971                      int nIndex,
07972                      DWORD dwClearColor,
07973                      bool bEnableColorClear,
07974                      bool bEnableDepthClear,
07975                      float fDepthClearValue,
07976                      RmRenderableTexture* pTexture = NULL );
07977 
07978    //==========================================================================
07983    //==========================================================================
07984    virtual ~RmRenderTarget();
07985 
07986    //==========================================================================
07994    //==========================================================================
07995    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
07996 
07997    //==========================================================================
08008    //==========================================================================
08009    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
08010    
08011    //==========================================================================
08021    //==========================================================================
08022    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
08023 
08024    //==========================================================================
08030    //==========================================================================
08031    virtual RmNode* Clone( bool bIncludeLoadedData );
08032 
08033    //==========================================================================
08034    // \brief Description of the node
08040    //==========================================================================
08041    virtual const RM_TCHAR* GetDescription();
08042 
08043    //==========================================================================
08045    //==========================================================================
08046    void SetRenderToScreen( bool bRenderToScreen = true ) { m_bRenderToScreen = bRenderToScreen; }
08047    
08048    //==========================================================================
08050    //==========================================================================
08051    bool IsRenderToScreen()                    {         return m_bRenderToScreen;       }
08052 
08053    //==========================================================================
08055    //==========================================================================
08056    void EnableColorClear( bool bClear )        {        m_bColorClear = bClear;       }
08057 
08058    //==========================================================================
08060    //==========================================================================
08061    bool IsColorClearEnabled()                   {        return m_bColorClear;         }
08062 
08063    //==========================================================================
08065    //==========================================================================
08066    bool IsDepthClearEnabled()                   {        return m_bDepthClear;         }
08067 
08068    //==========================================================================
08070    //==========================================================================
08071    void EnableDepthClear( bool bDepthClear )    {        m_bDepthClear = bDepthClear;  }
08072    
08073    //==========================================================================
08075    //==========================================================================
08076    float GetDepthClearValue()                      {        return m_fDepthClear;         }
08077    
08078    //==========================================================================
08080    //==========================================================================
08081    void  SetDepthClearValue( float fDepth )     {        m_fDepthClear = fDepth;       }
08082 
08083    //==========================================================================
08085    //==========================================================================
08086    RM_RGBA GetClearColor()                      {        return m_dwClearColor;        }
08087 
08088    //==========================================================================
08090    //==========================================================================
08091    void SetClearColor( RM_RGBA dwColor )        {        m_dwClearColor = dwColor;     }
08092 
08093    //==========================================================================
08099    //=========================================================================
08100    virtual bool IsNodeValid();
08101 
08102    //==========================================================================
08109    //==========================================================================
08110    void SetRenderableTexture( RmRenderableTexture* pTexture );
08111 
08112    //==========================================================================
08118    //==========================================================================
08119    RmRenderableTexture* GetRenderableTexture()     {        return m_pRTexture;           }
08120 
08121    //==========================================================================
08127    //==========================================================================
08128    int GetIndex()                                           { return m_nIndex;            }
08129 
08130    //==========================================================================
08137    //==========================================================================
08138    void SetIndex( int nIndex )                              { m_nIndex = nIndex;          }  
08139    
08140    //==========================================================================
08147    //==========================================================================
08148    void SetHandle( unsigned int unHandle )      {        m_unHandle = unHandle;        }
08149 
08150    //==========================================================================
08156    //==========================================================================
08157    unsigned int GetHandle()                        {        return m_unHandle;            }
08158 
08159 protected:
08160 
08161    //==========================================================================
08169    //==========================================================================
08170    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
08171 
08172    //==========================================================================
08178    //==========================================================================
08179    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmRenderTargetChildRuleList ); }
08180 
08181    //==========================================================================
08188    //==========================================================================
08189    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
08190    {
08191       assert( NULL == m_pRmRenderTargetChildRuleList );
08192       assert( NULL != pRmNodeChildRuleList );
08193       
08194       m_pRmRenderTargetChildRuleList = pRmNodeChildRuleList;
08195       
08196    } // End virtual void SetNodeTypeChildRuleList()           
08197 
08198 protected:  
08199 
08200    RmRenderableTexture* m_pRTexture; 
08201 
08202    int            m_nIndex;          
08203 
08204    bool           m_bRenderToScreen; 
08205 
08206    bool           m_bColorClear;     
08207    bool           m_bDepthClear;     
08208 
08209    RM_RGBA        m_dwClearColor;    
08210    float          m_fDepthClear;     
08211 
08212    unsigned int   m_unHandle;        
08213 
08214 private:
08215    static RmNodeTypeChildRuleList  *m_pRmRenderTargetChildRuleList; 
08216 
08217 }; // End of RmRenderTarget class definition
08218 
08219 typedef RmLinkedList< RmRenderTarget* >    RmRenderTargetList;
08220 typedef RmRenderTargetList::iterator       RmRenderTargetListIterator;
08221 typedef RmRenderTargetList::const_iterator RmRenderTargetListConstIterator;
08222 
08223 
08224 //=============================================================================
08231 //=============================================================================
08232 class RM_API RmState: public RmNode  
08233 {
08234 public:
08235 
08236    //==========================================================================
08241    //==========================================================================
08242    RmState()
08243    {
08244       SetType( RM_STATE_TYPE );
08245       m_bHidden   = true;
08246       m_ulState   = 0;
08247       m_ulValue   = 0;
08248       m_strUsage  = _T("");
08249    };
08250 
08251    //==========================================================================
08259    //==========================================================================
08260    RmState(unsigned long ulStateType, unsigned long ulStateValue, RM_TCHAR* pStrUsage )
08261    {
08262       SetType( RM_STATE_TYPE );
08263       m_bHidden   = true;
08264       m_ulState   = ulStateType;
08265       m_ulValue   = ulStateValue;
08266       m_strUsage  = pStrUsage;
08267    }
08268 
08269    //==========================================================================
08274    //==========================================================================
08275    virtual ~RmState()    {};
08276 
08277    //==========================================================================
08285    //==========================================================================
08286    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
08287 
08288    //==========================================================================
08299    //==========================================================================
08300    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
08301    
08302    //==========================================================================
08312    //==========================================================================
08313    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
08314 
08315    //==========================================================================
08321    //==========================================================================
08322    virtual RmNode* Clone( bool bIncludeLoadedData );
08323 
08324    //==========================================================================
08325    // \brief Description of the node
08331    //==========================================================================
08332    virtual const RM_TCHAR* GetDescription();
08333 
08334    //==========================================================================
08340    //==========================================================================
08341    unsigned long GetStateType()                       {     return m_ulState;           }
08342 
08343    //==========================================================================
08350    //==========================================================================
08351    void SetStateType( unsigned long ulType )          {     m_ulState = ulType;         }
08352 
08353    //==========================================================================
08359    //==========================================================================
08360    unsigned long GetValue()                           {     return m_ulValue;          }
08361 
08362    //==========================================================================
08368    //==========================================================================
08369    void SetValue( unsigned long nValue )              {     m_ulValue = nValue;        }
08370 
08371    //==========================================================================
08377    //==========================================================================
08378    const RmStringT& GetUsage()                         {     return m_strUsage;          }
08379 
08380    //==========================================================================
08387    //==========================================================================
08388    void SetUsage( const RM_TCHAR* pStrUsage )          {      m_strUsage = RmStringT( pStrUsage );   }
08389 
08390 protected:
08391 
08392    //==========================================================================
08400    //==========================================================================
08401    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
08402 
08403 protected:
08404    unsigned long  m_ulState;        
08405    unsigned long  m_ulValue;        
08406    RmStringT      m_strUsage;       
08407 
08408 private:
08409    static RmNodeTypeChildRuleList  *m_pRmStateChildRuleList; 
08410 
08411 }; // End of RmState class definition
08412 
08413 
08414 typedef RmLinkedList<RmState *>      RmStateList;
08415 typedef RmStateList::iterator       RmStateListIterator;
08416 typedef RmStateList::const_iterator RmStateListConstIterator;
08417 
08418 //=============================================================================
08425 //=============================================================================
08426 class RM_API RmTextureReference : public RmNode  
08427 {
08428 public:
08429 
08430    //==========================================================================
08435    //==========================================================================
08436    RmTextureReference();
08437 
08438    //==========================================================================
08446    //==========================================================================
08447    RmTextureReference( const RM_TCHAR* strTextureName );
08448 
08449    //==========================================================================
08454    //==========================================================================
08455    virtual ~RmTextureReference();
08456 
08457    //==========================================================================
08465    //==========================================================================
08466    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
08467 
08468    //==========================================================================
08479    //==========================================================================
08480    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
08481    
08482    //==========================================================================
08492    //==========================================================================
08493    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
08494 
08495    //==========================================================================
08501    //==========================================================================
08502    virtual RmNode* Clone( bool bIncludeLoadedData );
08503 
08504    //==========================================================================
08505    // \brief Description of the node
08511    //==========================================================================
08512    virtual const RM_TCHAR* GetDescription();
08513 
08514    //=========================================================================
08520    //==========================================================================
08521    virtual bool IsNodeValid();
08522 
08523    //==========================================================================
08529    //==========================================================================
08530    RmNode* GetReference()                             {      return m_pTextureNode;             }
08531 
08532    //==========================================================================
08539    //==========================================================================
08540    void SetReference( RmNode* pTextureVariable );
08541 
08542    //==========================================================================
08548    //==========================================================================
08549    int   GetHandle()                                  {        return m_nHandle;                }
08550 
08551    //=========================================================================
08558    //==========================================================================
08559    void  SetHandle( int nHandle )                  {        m_nHandle = nHandle;             }
08560    
08561 protected:
08562 
08563    //==========================================================================
08571    //==========================================================================
08572    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
08573 
08574    //==========================================================================
08580    //==========================================================================
08581    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmTextureReferenceChildRuleList ); }
08582 
08583    //==========================================================================
08590    //==========================================================================
08591    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
08592    {
08593       assert( NULL == m_pRmTextureReferenceChildRuleList );
08594       assert( NULL != pRmNodeChildRuleList );
08595       
08596       m_pRmTextureReferenceChildRuleList = pRmNodeChildRuleList;
08597       
08598    } // End virtual void SetNodeTypeChildRuleList()           
08599 
08600 protected:     
08601 
08602    RmNode*              m_pTextureNode;         
08603    int                  m_nHandle;              
08604 
08605 private:
08606    static RmNodeTypeChildRuleList  *m_pRmTextureReferenceChildRuleList; 
08607 
08608 }; // End of RmTextureReference class definition
08609 
08610 
08611 //=============================================================================
08618 //=============================================================================
08619 class RM_API RmTextureObject : public RmNode  
08620 {
08621 public:
08622 
08623    //==========================================================================
08628    //==========================================================================
08629    RmTextureObject();
08630 
08631    //==========================================================================
08638    //==========================================================================
08639    RmTextureObject( bool bVertexTexture, int nStageIndex, const RM_TCHAR *pStrAPI );
08640 
08641    //==========================================================================
08646    //==========================================================================
08647    virtual ~RmTextureObject();
08648 
08649    //==========================================================================
08655    //==========================================================================
08656    void Initialize();
08657 
08658    //==========================================================================
08666    //==========================================================================
08667    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
08668 
08669    //==========================================================================
08680    //==========================================================================
08681    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
08682    
08683    //==========================================================================
08693    //==========================================================================
08694    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
08695 
08696    //==========================================================================
08702    //==========================================================================
08703    virtual RmNode* Clone( bool bIncludeLoadedData );
08704 
08705    //==========================================================================
08706    // \brief Description of the node
08712    //==========================================================================
08713    virtual const RM_TCHAR* GetDescription();
08714 
08715    //=========================================================================
08721    //=========================================================================
08722    virtual bool IsNodeValid();
08723 
08724    //=========================================================================
08731    //=========================================================================
08732    bool AddTextureReference( RmTextureReference* pTextureRef );
08733    
08734    //=========================================================================
08741    //=========================================================================
08742    void DeleteTextureReference();
08743 
08744    //=========================================================================
08750    //=========================================================================
08751    RmTextureReference* GetTextureReference()                {     return m_pTextureRef;      }
08752 
08753    //=========================================================================
08760    //=========================================================================
08761    RmState* FindTextureStageState( unsigned long ulType );
08762 
08763    //=========================================================================
08771    //=========================================================================
08772    bool AddTextureStageState( RmState* pTextureState );
08773 
08774    //=========================================================================
08781    //=========================================================================
08782    void DeleteTextureStageState( unsigned long ulType );
08783 
08784    //=========================================================================
08786    //
08790    //=========================================================================
08791    RmState* FindSamplerState( unsigned long ulType );
08792 
08793    //=========================================================================
08801    //=========================================================================
08802    bool AddSamplerState( RmState* pSamplerState );
08803 
08804    //=========================================================================
08811    //=========================================================================
08812    void DeleteSamplerState( unsigned long ulType );
08813 
08814    //=========================================================================
08820    //=========================================================================
08821    int GetStageIndex()                                         {        return m_nStageIndex;            }
08822 
08823    //=========================================================================
08830    //=========================================================================
08831    void SetStageIndex( int nIndex )                         {        m_nStageIndex = nIndex;          }  
08832 
08833    //=========================================================================
08839    //=========================================================================
08840    RmStateListIterator        BeginTextureStageStates()           {     return m_textureStageStates.begin();   }
08841 
08842    //=========================================================================
08848    //=========================================================================
08849    RmStateListConstIterator   BeginTextureStageStates()  const    {     return m_textureStageStates.begin();   }
08850    
08851    //=========================================================================
08857    //=========================================================================
08858    RmStateListIterator        EndTextureStageStates()             {     return m_textureStageStates.end();     }
08859 
08860    //=========================================================================
08866    //=========================================================================
08867    RmStateListConstIterator   EndTextureStageStates()    const    {     return m_textureStageStates.end();     }
08868 
08869    //=========================================================================
08875    //=========================================================================
08876    RmStateListIterator        BeginSamplerStates()                {     return m_samplerStates.begin();        }
08877    
08878    //=========================================================================
08884    //=========================================================================
08885    RmStateListConstIterator   BeginSamplerStates()  const         {     return m_samplerStates.begin();        }
08886    
08887    //=========================================================================
08893    //=========================================================================
08894    RmStateListIterator        EndSamplerStates()                  {     return m_samplerStates.end();          }
08895 
08896    //=========================================================================
08902    //=========================================================================
08903    RmStateListConstIterator   EndSamplerStates()    const         {     return m_samplerStates.end();          }
08904 
08905    //=========================================================================
08911    //=========================================================================
08912    bool IsVertexTexture()                                         {     return m_bVertexTexture; }
08913    
08914 
08915 protected:
08916 
08917    //==========================================================================
08925    //==========================================================================
08926    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
08927 
08928    //==========================================================================
08934    //==========================================================================
08935    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmTextureObjectChildRuleList ); }
08936 
08937    //==========================================================================
08944    //==========================================================================
08945    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
08946    {
08947       assert( NULL == m_pRmTextureObjectChildRuleList );
08948       assert( NULL != pRmNodeChildRuleList );
08949       
08950       m_pRmTextureObjectChildRuleList = pRmNodeChildRuleList;
08951       
08952    } // End virtual void SetNodeTypeChildRuleList()           
08953 
08954 protected:  
08955 
08956    int                 m_nStageIndex;         
08957    RmStateList         m_textureStageStates;  
08958    RmStateList         m_samplerStates;       
08959    RmTextureReference *m_pTextureRef;         
08960    bool                m_bVertexTexture;      
08961 
08962 private:
08963    static RmNodeTypeChildRuleList  *m_pRmTextureObjectChildRuleList; 
08964 
08965 }; // End of RmTextureObject class definition
08966 
08967 typedef RmLinkedList< RmTextureObject* >    RmTextureObjectList;
08968 typedef RmTextureObjectList::iterator       RmTextureObjectListIterator;
08969 typedef RmTextureObjectList::const_iterator RmTextureObjectListConstIterator;
08970 
08971 //=============================================================================
08977 //=============================================================================
08978 class RM_API RmLightReference : public RmNode  
08979 {
08980 public: 
08981 
08982    //==========================================================================
08987    //==========================================================================
08988    RmLightReference();
08989 
08990    //==========================================================================
08996    //==========================================================================
08997    RmLightReference( const RM_TCHAR *strLightName );
08998 
08999    //==========================================================================
09004    //==========================================================================
09005    virtual ~RmLightReference();
09006 
09007    //==========================================================================
09015    //==========================================================================
09016    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
09017 
09018    //==========================================================================
09029    //==========================================================================
09030    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
09031    
09032    //==========================================================================
09042    //==========================================================================
09043    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
09044 
09045    //==========================================================================
09051    //==========================================================================
09052    virtual RmNode* Clone( bool bIncludeLoadedData );
09053 
09054    //==========================================================================
09055    // \brief Description of the node
09061    //==========================================================================
09062    virtual const RM_TCHAR* GetDescription();
09063 
09064    //==========================================================================
09070    //==========================================================================
09071    virtual bool IsNodeValid()                      { return( ( NULL != m_pLightNode ) ? RmNode::IsNodeValid() : false ); };
09072 
09073    //==========================================================================
09079    //==========================================================================
09080    RmNode* GetReference()                             { return m_pLightNode; }
09081 
09082    //==========================================================================
09089    //==========================================================================
09090    void SetReference( RmLightVariable* pRmLightVariable );
09091 
09092 protected: 
09093 
09094    //==========================================================================
09102    //==========================================================================
09103    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
09104 
09105    //==========================================================================
09111    //==========================================================================
09112    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmLightReferenceChildRuleList ); }
09113 
09114    //==========================================================================
09121    //==========================================================================
09122    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
09123    {
09124       assert( NULL == m_pRmLightReferenceChildRuleList );
09125       assert( NULL != pRmNodeChildRuleList );
09126       
09127       m_pRmLightReferenceChildRuleList = pRmNodeChildRuleList;
09128       
09129    } // End virtual void SetNodeTypeChildRuleList()           
09130 
09131 protected: 
09132 
09133    RmLightVariable   *m_pLightNode; 
09134 
09135 private:
09136    static RmNodeTypeChildRuleList  *m_pRmLightReferenceChildRuleList; 
09137 
09138 }; // End of RmLightReference class definition
09139 
09140 //=============================================================================
09146 //=============================================================================
09147 class RM_API RmLightObject : public RmNode  
09148 {
09149 public: 
09150 
09151    //==========================================================================
09156    //==========================================================================
09157    RmLightObject();
09158 
09159    //==========================================================================
09166    //==========================================================================
09167    RmLightObject( int nStageIndex, const RM_TCHAR *pStrAPI );
09168 
09169    //==========================================================================
09174    //==========================================================================
09175    virtual ~RmLightObject();
09176 
09177    //==========================================================================
09183    //==========================================================================
09184    void Initialize();
09185 
09186    //==========================================================================
09194    //==========================================================================
09195     virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
09196 
09197    //==========================================================================
09208    //==========================================================================
09209    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
09210    
09211    //==========================================================================
09221    //==========================================================================
09222    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
09223 
09224    //==========================================================================
09230    //==========================================================================
09231    virtual RmNode* Clone( bool bIncludeLoadedData );
09232 
09233    //==========================================================================
09234    // \brief Description of the node
09240    //==========================================================================
09241    virtual const RM_TCHAR* GetDescription();
09242 
09243    //=========================================================================
09249    //=========================================================================
09250    virtual bool IsNodeValid()                               { return( ( NULL != m_pLightReference ) ? RmNode::IsNodeValid() : false ); };
09251 
09252    //==========================================================================
09260    //==========================================================================
09261    bool AddLightReference( RmLightReference *pLightReference );
09262    
09263    //==========================================================================
09270    //==========================================================================
09271    void DeleteLightReference();
09272    
09273    //==========================================================================
09279    //==========================================================================
09280    RmLightReference* LightReference()                       { return m_pLightReference;   }
09281 
09282    //==========================================================================
09288    //==========================================================================
09289    int GetIndex()                                              { return m_nIndex;            }
09290 
09291    //==========================================================================
09297    //==========================================================================
09298    void SetIndex( int nIndex )                              { m_nIndex = nIndex;          }  
09299 
09300 protected: 
09301 
09302    //==========================================================================
09310    //==========================================================================
09311    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
09312 
09313    //==========================================================================
09319    //==========================================================================
09320    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmLightObjectChildRuleList ); }
09321 
09322    //==========================================================================
09329    //==========================================================================
09330    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
09331    {
09332       assert( NULL == m_pRmLightObjectChildRuleList );
09333       assert( NULL != pRmNodeChildRuleList );
09334       
09335       m_pRmLightObjectChildRuleList = pRmNodeChildRuleList;
09336       
09337    } // End virtual void SetNodeTypeChildRuleList()           
09338 
09339 protected: 
09340 
09341    int               m_nIndex;            
09342    RmLightReference *m_pLightReference;   
09343 
09344 private:
09345    static RmNodeTypeChildRuleList  *m_pRmLightObjectChildRuleList; 
09346 
09347 }; // End of RmLightObject class definition
09348 
09349 typedef RmLinkedList< RmLightObject*>     RmLightObjectList;
09350 typedef RmLightObjectList::iterator       RmLightObjectListIterator;
09351 typedef RmLightObjectList::const_iterator RmLightObjectListConstIterator;
09352 
09353 //=============================================================================
09359 //=============================================================================
09360 class RM_API RmMaterialReference : public RmNode  
09361 {
09362 public: 
09363 
09364    //==========================================================================
09369    //==========================================================================
09370    RmMaterialReference();
09371 
09372    //==========================================================================
09379    //==========================================================================
09380    RmMaterialReference( const RM_TCHAR *strMaterialName );
09381 
09382    //==========================================================================
09387    //==========================================================================
09388    virtual ~RmMaterialReference();
09389 
09390    //==========================================================================
09398    //==========================================================================
09399    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
09400 
09401    //==========================================================================
09412    //==========================================================================
09413    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
09414    
09415    //==========================================================================
09425    //==========================================================================
09426    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
09427 
09428    //==========================================================================
09434    //==========================================================================
09435    virtual RmNode* Clone( bool bIncludeLoadedData );
09436 
09437    //==========================================================================
09438    // \brief Description of the node
09444    //==========================================================================
09445    virtual const RM_TCHAR* GetDescription();
09446 
09447    //=========================================================================
09453    //=========================================================================
09454    virtual bool IsNodeValid()                      { return( ( NULL != m_pMaterialNode ) ? RmNode::IsNodeValid() : false ); };
09455 
09456    //==========================================================================
09462    //==========================================================================
09463    RmNode* GetReference()                             { return m_pMaterialNode; }
09464 
09465    //==========================================================================
09472    //==========================================================================
09473    void SetReference( RmMaterialVariable *pRmMaterialVariable );
09474 
09475 protected: 
09476 
09477    //==========================================================================
09485    //==========================================================================
09486    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
09487 
09488    //==========================================================================
09494    //==========================================================================
09495    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmMaterialReferenceChildRuleList ); }
09496 
09497    //==========================================================================
09504    //==========================================================================
09505    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
09506    {
09507       assert( NULL == m_pRmMaterialReferenceChildRuleList );
09508       assert( NULL != pRmNodeChildRuleList );
09509       
09510       m_pRmMaterialReferenceChildRuleList = pRmNodeChildRuleList;
09511       
09512    } // End virtual void SetNodeTypeChildRuleList()           
09513 
09514 protected: 
09515 
09516    RmMaterialVariable *m_pMaterialNode; 
09517 
09518 private:
09519    static RmNodeTypeChildRuleList  *m_pRmMaterialReferenceChildRuleList; 
09520 
09521 }; // End of RmMaterialReference class definition
09522 
09523 //=============================================================================
09529 //=============================================================================
09530 class RM_API RmMaterialObject : public RmNode  
09531 {
09532 public: 
09533 
09534    //==========================================================================
09539    //==========================================================================
09540    RmMaterialObject();
09541 
09542    //==========================================================================
09549    //==========================================================================
09550    RmMaterialObject( int nStageIndex, const RM_TCHAR *pStrAPI );
09551 
09552    //==========================================================================
09557    //==========================================================================
09558    virtual ~RmMaterialObject();
09559 
09560    //==========================================================================
09566    //==========================================================================
09567    void Initialize();
09568 
09569    //==========================================================================
09577    //==========================================================================
09578    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
09579 
09580    //==========================================================================
09591    //==========================================================================
09592    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
09593    
09594    //==========================================================================
09604    //==========================================================================
09605    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
09606 
09607    //==========================================================================
09613    //==========================================================================
09614    virtual RmNode* Clone( bool bIncludeLoadedData );
09615 
09616    //==========================================================================
09617    // \brief Description of the node
09623    //==========================================================================
09624    virtual const RM_TCHAR* GetDescription();
09625 
09626    //=========================================================================
09632    //=========================================================================
09633    virtual bool IsNodeValid()    { return( ( NULL != m_pMaterialReference ) ? RmNode::IsNodeValid() : false ); };
09634 
09635    //==========================================================================
09643    //==========================================================================
09644    bool AddMaterialReference( RmMaterialReference *pMaterialReference );
09645    
09646    //==========================================================================
09653    //==========================================================================
09654    void DeleteMaterialReference();
09655    
09656    //==========================================================================
09662    //==========================================================================
09663    RmMaterialReference* MaterialReference()                 { return m_pMaterialReference;   }
09664 
09665    //==========================================================================
09671    //==========================================================================
09672    int GetIndex()                                           { return m_nIndex;            }
09673 
09674    //==========================================================================
09681    //==========================================================================
09682    void SetIndex( int nIndex )                              { m_nIndex = nIndex;          }  
09683 
09684 protected: 
09685 
09686    //==========================================================================
09694    //==========================================================================
09695    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
09696 
09697    //==========================================================================
09703    //==========================================================================
09704    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmMaterialObjectChildRuleList ); }
09705 
09706    //==========================================================================
09713    //==========================================================================
09714    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
09715    {
09716       assert( NULL == m_pRmMaterialObjectChildRuleList );
09717       assert( NULL != pRmNodeChildRuleList );
09718       
09719       m_pRmMaterialObjectChildRuleList = pRmNodeChildRuleList;
09720       
09721    } // End virtual void SetNodeTypeChildRuleList()           
09722 
09723 protected: 
09724 
09725    int                  m_nIndex;               
09726    RmMaterialReference *m_pMaterialReference;   
09727 
09728 private:
09729 
09730    static RmNodeTypeChildRuleList  *m_pRmMaterialObjectChildRuleList; 
09731 
09732 }; // End of RmMaterialObject class definition
09733 
09734 typedef RmLinkedList< RmMaterialObject* >    RmMaterialObjectList;
09735 typedef RmMaterialObjectList::iterator       RmMaterialObjectListIterator;
09736 typedef RmMaterialObjectList::const_iterator RmMaterialObjectListConstIterator;
09737 
09738 //=============================================================================
09744 //=============================================================================
09745 class RM_API RmRenderStateBlock : public RmNode  
09746 {
09747 public:
09748 
09749    //==========================================================================
09754    //==========================================================================
09755    RmRenderStateBlock();
09756 
09757    //==========================================================================
09762    //==========================================================================
09763    virtual ~RmRenderStateBlock();
09764 
09765    //==========================================================================
09773    //==========================================================================
09774    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
09775 
09776    //==========================================================================
09787    //==========================================================================
09788    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
09789    
09790    //==========================================================================
09800    //==========================================================================
09801    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
09802 
09803    //==========================================================================
09809    //==========================================================================
09810    virtual RmNode* Clone( bool bIncludeLoadedData );
09811 
09812    //==========================================================================
09813    // \brief Description of the node
09819    //==========================================================================
09820    virtual const RM_TCHAR* GetDescription();
09821 
09822    //==========================================================================
09830    //==========================================================================
09831    RmState* FindRenderState( unsigned long state );
09832 
09833    //==========================================================================
09840    //==========================================================================
09841    bool AddRenderState( RmState* pState );
09842 
09843    //==========================================================================
09850    //==========================================================================
09851    void DeleteRenderState( unsigned long state );
09852 
09853    //==========================================================================
09859    //==========================================================================
09860    RmStateListIterator        BeginRenderStates()        {     return m_stateList.begin();   }
09861 
09862    //==========================================================================
09868    //==========================================================================
09869    RmStateListConstIterator   BeginRenderStates()  const {     return m_stateList.begin();   }
09870 
09871    //==========================================================================
09877    //==========================================================================
09878    RmStateListIterator        EndRenderStates()          {     return m_stateList.end();     }
09879 
09880    //==========================================================================
09886    //==========================================================================
09887    RmStateListConstIterator   EndRenderStates()    const {     return m_stateList.end();     }
09888 
09889 protected:
09890 
09891    //==========================================================================
09899    //==========================================================================
09900    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
09901 
09902    //==========================================================================
09908    //==========================================================================
09909    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmRenderStateBlockChildRuleList ); }
09910 
09911    //==========================================================================
09918    //==========================================================================
09919    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
09920    {
09921       assert( NULL == m_pRmRenderStateBlockChildRuleList );
09922       assert( NULL != pRmNodeChildRuleList );
09923       
09924       m_pRmRenderStateBlockChildRuleList = pRmNodeChildRuleList;
09925       
09926    } // End virtual void SetNodeTypeChildRuleList()           
09927 
09928 protected:  
09929 
09930    RmStateList m_stateList;      
09931 
09932 private:
09933    static RmNodeTypeChildRuleList  *m_pRmRenderStateBlockChildRuleList; 
09934 
09935 }; // End of RmRenderStateBlock class definition
09936 
09937 
09938 //=============================================================================
09946 //=============================================================================
09947 class RM_API RmCamera : public RmNode  
09948 {
09949 public:
09950 
09951    //==========================================================================
09956    //==========================================================================
09957    RmCamera();
09958 
09959    //==========================================================================
09964    //==========================================================================
09965    virtual ~RmCamera() {};
09966 
09967    //==========================================================================
09975    //==========================================================================
09976    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
09977 
09978    //==========================================================================
09989    //==========================================================================
09990    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
09991    
09992    //==========================================================================
10002    //==========================================================================
10003    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
10004 
10005    //==========================================================================
10011    //==========================================================================
10012    virtual RmNode* Clone( bool bIncludeLoadedData );
10013 
10014    //==========================================================================
10015    // \brief Description of the node
10021    //==========================================================================
10022    virtual const RM_TCHAR* GetDescription();
10023 
10024    //==========================================================================
10031    //==========================================================================
10032    void SetPosition( RmVector3D& pNewPosition )
10033    {
10034       m_cameraPosition.x = pNewPosition.x;
10035       m_cameraPosition.y = pNewPosition.y;
10036       m_cameraPosition.z = pNewPosition.z;
10037    }
10038 
10039    //==========================================================================
10048    //==========================================================================
10049    void SetPosition( float x, float y, float z )
10050    {
10051       m_cameraPosition.x = x;
10052       m_cameraPosition.y = y;
10053       m_cameraPosition.z = z;
10054    }
10055 
10056    //==========================================================================
10063    //==========================================================================
10064    void SetLookAt( RmVector3D& pNewLookAt )
10065    {
10066       m_lookAtVector.x = pNewLookAt.x;
10067       m_lookAtVector.y = pNewLookAt.y;
10068       m_lookAtVector.z = pNewLookAt.z;
10069    }
10070 
10071    //==========================================================================
10080    //==========================================================================
10081    void SetLookAt( float x, float y, float z )
10082    {
10083       m_lookAtVector.x = x;
10084       m_lookAtVector.y = y;
10085       m_lookAtVector.z = z;
10086    }
10087    
10088    //==========================================================================
10095    //==========================================================================
10096    void SetUp( RmVector3D& pNewUp )
10097    {
10098       m_upVector.x = pNewUp.x;
10099       m_upVector.y = pNewUp.y;
10100       m_upVector.z = pNewUp.z;
10101    }
10102 
10103    //==========================================================================
10112    //==========================================================================
10113    void SetUp( float x, float y, float z )
10114    {
10115       m_upVector.x = x;
10116       m_upVector.y = y;
10117       m_upVector.z = z;
10118    }
10119 
10120    //==========================================================================
10127    //==========================================================================
10128    void SetFOV( float fFOV )                       { m_fFOV = fFOV; }
10129 
10130    //==========================================================================
10137    //==========================================================================
10138    void SetNearClipPlane( float fNearClipPlane )   { m_fNearClipPlane = fNearClipPlane; }
10139 
10140    //==========================================================================
10147    //==========================================================================
10148    void SetFarClipPlane( float fFarClipPlane )     { m_fFarClipPlane = fFarClipPlane; }
10149 
10150    //==========================================================================
10156    //==========================================================================
10157    RmVector3D  GetPosition()  { return( m_cameraPosition ); }
10158 
10159    //==========================================================================
10165    //==========================================================================
10166    RmVector3D  GetLookAtPosition()    { return( m_lookAtVector ); }
10167 
10168    //==========================================================================
10174    //==========================================================================
10175    RmVector3D  GetUp();
10176    
10177    //==========================================================================
10183    //==========================================================================
10184    RmVector3D  GetLookAt();
10185 
10186    //==========================================================================
10192    //==========================================================================
10193    RmVector3D  GetCross();
10194 
10195    //==========================================================================
10201    //==========================================================================
10202    float GetFOV()             { return m_fFOV; }
10203 
10204    //==========================================================================
10210    //==========================================================================
10211    float GetNearClipPlane()   { return m_fNearClipPlane; }
10212 
10213    //==========================================================================
10219    //==========================================================================
10220    float GetFarClipPlane()    { return m_fFarClipPlane; }
10221 
10222    //==========================================================================
10230    //==========================================================================
10231    void SetCameraParameters( const RmMatrix4x4 &mat, bool bSetLookAt );
10232 
10233    //==========================================================================
10240    //==========================================================================
10241    RmMatrix4x4 GetCameraMatrix();
10242 
10243 protected:
10244 
10245    //==========================================================================
10253    //==========================================================================
10254    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
10255 
10256    //==========================================================================
10262    //==========================================================================
10263    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmCameraChildRuleList ); }
10264 
10265    //==========================================================================
10272    //==========================================================================
10273    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
10274    {
10275       assert( NULL == m_pRmCameraChildRuleList );
10276       assert( NULL != pRmNodeChildRuleList );
10277       
10278       m_pRmCameraChildRuleList = pRmNodeChildRuleList;
10279       
10280    } // End virtual void SetNodeTypeChildRuleList()           
10281 
10282    RmVector3D m_cameraPosition; 
10283    RmVector3D m_lookAtVector;   
10284    RmVector3D m_upVector;       
10285 
10286    float m_fFOV;                
10287    float m_fNearClipPlane;      
10288    float m_fFarClipPlane;       
10289 
10290    RmProjectionMode  m_projectionMode;
10291 
10292 private:
10293    static RmNodeTypeChildRuleList  *m_pRmCameraChildRuleList; 
10294 
10295 }; // End of RmCamera class definition
10296 
10297 //=============================================================================
10303 //=============================================================================
10304 class RM_API RmCameraReference : public RmNode  
10305 {
10306 public:
10307 
10308    //==========================================================================
10313    //==========================================================================
10314    RmCameraReference();
10315 
10316    //==========================================================================
10322    //==========================================================================
10323    RmCameraReference( const RM_TCHAR* strName );
10324 
10325    //==========================================================================
10330    //==========================================================================
10331    virtual ~RmCameraReference();
10332 
10333    //==========================================================================
10341    //==========================================================================
10342    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
10343 
10344    //==========================================================================
10355    //==========================================================================
10356    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
10357    
10358    //==========================================================================
10368    //==========================================================================
10369    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
10370 
10371    //==========================================================================
10377    //==========================================================================
10378    virtual RmNode* Clone( bool bIncludeLoadedData );
10379 
10380    //==========================================================================
10381    // \brief Description of the node
10387    //==========================================================================
10388    virtual const RM_TCHAR* GetDescription();
10389 
10390    //=========================================================================
10396    //=========================================================================
10397    virtual bool IsNodeValid() { return( ( NULL != m_pCamera ) ? RmNode::IsNodeValid() : false ); };
10398 
10399    //==========================================================================
10406    //==========================================================================
10407    void SetReference( RmCamera* pRmCamera );
10408 
10409    //==========================================================================
10415    //==========================================================================
10416    bool IsUseActiveCamera()                           { return( m_bUseActiveCamera ); }
10417 
10418    //==========================================================================
10425    //==========================================================================
10426    void SetUseActiveCamera( bool bUseActiveCamera );
10427 
10428    //==========================================================================
10434    //==========================================================================
10435    RmCamera* GetReference()                           {   return m_pCamera; }
10436 
10437 protected:
10438 
10439    //==========================================================================
10447    //==========================================================================
10448    virtual void CopyNodeData( RmNode *pDestinationNode, bool bIncludeLoadedData );
10449 
10450    //==========================================================================
10456    //==========================================================================
10457    virtual RmNodeTypeChildRuleList* GetNodeTypeChildRuleList() { return( m_pRmCameraReferenceChildRuleList ); }
10458 
10459    //==========================================================================
10466    //==========================================================================
10467    virtual void SetNodeTypeChildRuleList( RmNodeTypeChildRuleList* pRmNodeChildRuleList )
10468    {
10469       assert( NULL == m_pRmCameraReferenceChildRuleList );
10470       assert( NULL != pRmNodeChildRuleList );
10471       
10472       m_pRmCameraReferenceChildRuleList = pRmNodeChildRuleList;
10473       
10474    } // End virtual void SetNodeTypeChildRuleList()           
10475 
10476 protected:
10477 
10478    RmCamera *m_pCamera;             
10479    bool      m_bUseActiveCamera;    
10480 
10481 
10482 private:
10483    static RmNodeTypeChildRuleList  *m_pRmCameraReferenceChildRuleList; 
10484 
10485 }; // End of RmCameraReference class definition
10486 
10487 //=============================================================================
10493 //=============================================================================
10494 class RM_API RmPass : public RmNode  
10495 {
10496 public:
10497    //==========================================================================
10502    //==========================================================================
10503    RmPass(); 
10504 
10505    //==========================================================================
10514    //==========================================================================
10515    RmPass( const RM_TCHAR *strPassName, const int nPassIndex );
10516 
10517    //==========================================================================
10522    //==========================================================================
10523    virtual ~RmPass();
10524 
10525    //==========================================================================
10533    //==========================================================================
10534    bool virtual AddChild( RmNode *pChildNode, RmNode *pNextSibling = NULL );
10535 
10536    //==========================================================================
10544    //==========================================================================
10545    virtual void Update( RmNodeUpdateType nodeUpdateType /* = RM_NODE_GENERAL_UPDATE */, RmNode *pRmUpdateRootNode /* = NULL */ );                      
10546 
10547    //==========================================================================
10558    //==========================================================================
10559    virtual bool LoadXMLData( int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion );
10560    
10561    //==========================================================================
10571    //==========================================================================
10572    virtual bool SaveXMLData( int hDoc, const RM_TCHAR *strXPath );
10573 
10574    //==========================================================================
10580    //==========================================================================
10581    virtual RmNode* Clone( bool bIncludeLoadedData );
10582 
10583    //==========================================================================
10584    // \brief Description of the node
10590    //==========================================================================
10591    virtual const RM_TCHAR* GetDescription();
10592    
10593    //=========================================================================
10599    //=========================================================================
10600    virtual bool IsNodeValid();
10601    
10602    //==========================================================================
10609    //==========================================================================
10610    bool AddVertexShader( RmShader *pVertexShader );
10611 
10612    //==========================================================================
10619    //==========================================================================
10620    bool AddPixelShader( RmShader *pPixelShader );
10621 
10622    //==========================================================================
10628    //==========================================================================
10629    RmShader* GetVertexShader()         {    return m_pVertexShader;     }
10630 
10631    //==========================================================================
10637    //==========================================================================
10638    RmShader* GetPixelShader()          {     return m_pPixelShader;     }
10639 
10640    //==========================================================================
10650    //==========================================================================
10651    RmShader* GetActivePixelShader();
10652 
10653    //==========================================================================
10663    //==========================================================================
10664    RmShader* GetActiveVertexShader();
10665 
10666    //==========================================================================
10673    //==========================================================================
10674    RmShader* GetShader( const RM_TCHAR *strShaderName );
10675 
10676    //==========================================================================
10685    //==========================================================================
10686    bool AddStreamMappingReference( RmStreamMapReference *pStreamMapReference );
10687 
10688    //==========================================================================
10695    //==========================================================================
10696    RmStreamMap* GetStreamMap();
10697 
10698    //==========================================================================
10704    //==========================================================================
10705    RmStreamMapReference* GetStreamMapReference()      {  return m_pStreamMapReference; }   
10706    
10707    //==========================================================================
10715    //==========================================================================
10716    bool AddRenderStateBlock( RmRenderStateBlock *pBlock );
10717 
10718    //==========================================================================
10724    //==========================================================================
10725    RmRenderStateBlock* GetRenderStateBlock()    {     return m_pRenderStateBlock;   }
10726 
10727    //==========================================================================
10733    //==========================================================================
10734    int GetNumTextureObjects()                   {  return m_textureObjectList.size();  }
10735 
10736    //==========================================================================
10742    //==========================================================================
10743    int GetNumVertexTextureObjects()             {  return m_vertexTextureObjectList.size();  }
10744    
10745    //==========================================================================
10751