Mudbox/treenode.h Source File

treenode.h
Go to the documentation of this file.
1 
2 //**************************************************************************/
3 // Copyright (c) 2008 Autodesk, Inc.
4 // All rights reserved.
5 //
6 // Use of this software is subject to the terms of the Autodesk license
7 // agreement provided at the time of installation or download, or which
8 // otherwise accompanies this software in either electronic or hard copy form.
9 //
10 //**************************************************************************/
11 // DESCRIPTION:
12 // CREATED: October 2008
13 //**************************************************************************/
14 
15 namespace mudbox {
16 
18 class MBDLL_DECL TreeNode : virtual public Node
19 {
20 public:
22 
23  TreeNode( void );
24  ~TreeNode( void );
25  virtual void Serialize( Stream &s );
26 
28  virtual void AddChild( TreeNode *pChild, bool bFirst = false ) const;
30  virtual void RemoveChild( TreeNode *pChild ) const;
32  virtual TreeNode *FirstChild( void ) const;
34  virtual TreeNode *Parent( void ) const;
36  virtual TreeNode *NextSibling( void ) const;
38  virtual TreeNode *PrevSibling( void ) const;
40  virtual void MoveChild( TreeNode *pChild, TreeNode *pAfter );
41 
43  virtual TreeNode *ChildByClass( const ClassDesc *pClass, bool bAutoCreate = true ) const;
45  template < typename type >
46  inline type *ChildByClass( bool bAutoCreate = true ) const { return dynamic_cast<type *>( ChildByClass( type::StaticClass(), bAutoCreate ) ); };
48  virtual TreeNode *ChildByClass( const ClassDesc *pClass, unsigned int iIndex = 0 ) const;
50  template < typename type >
51  inline type *ChildByClass( unsigned int iIndex = 0 ) const { return dynamic_cast<type *>( ChildByClass( type::StaticClass(), iIndex ) ); };
53  virtual void DeleteChildByClass( const ClassDesc *pClass );
54 
56  virtual QString Info( void ) const;
58  virtual bool Visible( void ) const;
60  virtual void SetVisible( bool b );
62  virtual bool Locked( void ) const;
64  virtual void SetLocked( bool b );
66  virtual bool HiddenFromUI( void ) const;
68  virtual void SetHiddenFromUI( bool b );
69 
71  virtual void OnLinked( const TreeNode *pOldParent );
72 
74  virtual void CheckValidity( Node::DiagnosticLevel iLevel = dgnLevel2 ) const;
75 
77  QString UniqueChildName(
78  const TreeNode* pChild,
79  const QString& sPrefix = ""
80  ) const;
81 
83  virtual void SetStringID( const QString &sName );
84 
85  virtual void CopyTo( Node *pNode ) const;
86 
87 private:
88  mutable aptr<TreeNode> m_pNext;
89  mutable aptr<TreeNode> m_pPrev;
90  mutable aptr<TreeNode> m_pParent;
91  mutable aptr<TreeNode> m_pChildren;
92  abool m_bVisible, m_bLocked, m_bHiddenFromUI;
93 };
94 
95 }; // end of namespace mudbox
GLuint GLuint GLsizei GLenum type
Definition: GLee.h:872
This is the base class for most classes in the Mudbox SDK.
Definition: node.h:740
type * ChildByClass(bool bAutoCreate=true) const
Same as above, a most confortable version.
Definition: treenode.h:46
This structure represents and describes a class.
Definition: node.h:22
DiagnosticLevel
Indicates the level of validity checking that is performed in CheckValidity()
Definition: node.h:781
GLubyte GLubyte b
Definition: GLee.h:5404
type * ChildByClass(unsigned int iIndex=0) const
Same as above, a most confortable version.
Definition: treenode.h:51
Class: ConvolutionKernel.
Definition: array.h:15
This class is the base of all node types that can be structured in a hierarchy.
Definition: treenode.h:18
Streams are used to read information from a file, or to write it to a file.
Definition: stream.h:39
GLdouble s
Definition: GLee.h:1173
#define MBDLL_DECL
Definition: dllinterface.h:35