Gizmo3D

gzGroup.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 // File         : gzGroup.h
00003 // Module       : 
00004 // Description  : Class definition of the gzGroup class
00005 // Author       : Anders Modén      
00006 // Product      : Gizmo3D 2.1.1
00007 //      
00008 // Copyright © 2003- Saab Training Systems AB, Sweden   
00009 //          
00010 // NOTE:    Gizmo3D is a high performance 3D Scene Graph and effect visualisation 
00011 //          C++ toolkit for Linux, Mac OS X, Windows (Win32) and IRIX® for  
00012 //          usage in Game or VisSim development.
00013 //
00014 //
00015 // Revision History...                          
00016 //                                  
00017 // Who  Date    Description                     
00018 //                                  
00019 // AMO  981122  Created file    
00020 //
00021 //******************************************************************************
00022 #ifndef __GZ_GROUP_H__
00023 #define __GZ_GROUP_H__
00024 
00030 #include "gzNode.h"
00031 
00032 enum { 
00033         GZ_GROUP_SORT_Z,
00034         GZ_GROUP_SORT_STATE
00035     };  
00036 
00037 //******************************************************************************
00038 // Class    : gzGroup
00039 //                                  
00040 // Purpose  : -
00041 //                                  
00042 // Notes    : - 
00043 //                                  
00044 // Revision History...                          
00045 //                                  
00046 // Who  Date    Description                     
00047 //                                  
00048 // AMO  981122  Created 
00049 //                                  
00050 //******************************************************************************
00051 class gzGroup : public gzNode
00052 {
00053 public:
00054 
00055     enum{ GZ_CHILD_NOT_IN_LIST=1000001 };
00056 
00057     GZ_GRAPH_EXPORT gzGroup(const gzString & name=GZ_EMPTY_STRING);
00058     GZ_GRAPH_EXPORT virtual ~gzGroup();
00059     GZ_GRAPH_EXPORT gzGroup(const gzGroup &copy);
00060     GZ_GRAPH_EXPORT gzGroup & operator=(const gzGroup &copy);
00061 
00062     GZ_DECLARE_TYPE_INTERFACE_EXPORT(GZ_GRAPH_EXPORT);  // typed interface
00063 
00064 
00065     // ---------- Clone interface ---------------------------------------
00066     GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00067     GZ_GRAPH_EXPORT virtual gzVoid  setCopyMode(gzCopyMode mode);
00068 
00069 
00070     // ---------- Common graph functions --------------------------------
00071 
00072     GZ_GRAPH_EXPORT virtual gzVoid updateNode();
00073 
00074     // ---------- group interface ---------------------------------------
00075 
00076     GZ_GRAPH_EXPORT gzULong     getNumberOfNodes();
00077 
00078     GZ_GRAPH_EXPORT gzNode      *getNode( gzULong childIndex );
00079 
00080     GZ_GRAPH_EXPORT gzNode      *getFirstNode();
00081 
00082     GZ_GRAPH_EXPORT gzULong     getNodeIndex( gzNode *child );
00083 
00084     GZ_GRAPH_EXPORT gzVoid      addNode( gzNode *child , gzLong index = -1 );
00085 
00086     GZ_GRAPH_EXPORT gzVoid      addNodeSorted( gzNode *child , const gzDouble & sortVal ,gzBool preInsert=FALSE);
00087 
00088     GZ_GRAPH_EXPORT gzBool      removeNode(gzNode *child,gzListIterator<gzNode> *iterator=NULL);
00089 
00090     GZ_GRAPH_EXPORT gzVoid      removeAllNodes();
00091 
00092     GZ_GRAPH_EXPORT gzVoid      addGroupNodes( const gzGroup *parent );
00093 
00094     GZ_GRAPH_EXPORT virtual gzNode  *   find(const gzString &path,gzBool recursive=TRUE);
00095     GZ_GRAPH_EXPORT virtual gzBool      hasSiblingNode(gzNode *child);
00096 
00097     GZ_GRAPH_EXPORT virtual gzVoid  updateNodeData(gzBool force=FALSE);
00098 
00099     GZ_GRAPH_EXPORT virtual gzBool  isTraversable( gzTraverseAction *action , gzNode *node , gzULong index , gzContext *context ) { return TRUE; }
00100 
00101     GZ_GRAPH_EXPORT virtual gzBool  isGroupNode() { return TRUE; }  // Speed up RTTI
00102 
00103     GZ_GRAPH_EXPORT virtual gzVoid  sortNodes(gzULong sortCriteria, gzBool recursive=FALSE);
00104 
00105     GZ_GRAPH_EXPORT gzRefList<gzNode> & getNodeList();
00106 
00107     GZ_GRAPH_EXPORT virtual gzBool  isChildOrderDependant();    // Default behaviour is false
00108 
00109     // ---------- Debug function ----------------------------------------
00110     GZ_GRAPH_EXPORT virtual gzVoid  debugOutput(gzString base , gzString anchor , gzDebugFlags features);
00111     GZ_GRAPH_EXPORT virtual gzVoid  debugOutputTraverse(gzString base , gzString anchor , gzDebugFlags features);
00112 
00113     // ---------- Serializing -------------------------------------------
00114 
00115     GZ_GRAPH_EXPORT virtual gzVoid write(gzSerializeAdapter *adapter);
00116     GZ_GRAPH_EXPORT virtual gzVoid read(gzSerializeAdapter *adapter);
00117     GZ_GRAPH_EXPORT virtual gzULong getDataSize(gzSerializeAdapter *adapter) const;
00118 
00119 protected:
00120 
00121     friend class gzTraverseAction;
00122 
00123     gzRefList<gzNode> m_childList;
00124 };
00125 
00126 // Declare smart pointer type
00127 GZ_DECLARE_REFPTR(gzGroup);
00128 
00129 //******************************************************************************
00130 // Class    : gzDummyBoundary
00131 //                                  
00132 // Purpose  : To add a dummy boundary update to tree in e.g. a skinned model
00133 //                                  
00134 // Notes    : - 
00135 //                                  
00136 // Revision History...                          
00137 //                                  
00138 // Who  Date    Description                     
00139 //                                  
00140 // AMO  040803  Created 
00141 //                                  
00142 //******************************************************************************
00143 class gzDummyBoundary : public gzGroup
00144 {
00145 public:
00146 
00147     GZ_GRAPH_EXPORT gzDummyBoundary(const gzString & name=GZ_EMPTY_STRING);
00148     GZ_GRAPH_EXPORT virtual ~gzDummyBoundary(){};
00149 
00150     GZ_DECLARE_TYPE_INTERFACE_EXPORT(GZ_GRAPH_EXPORT);  // typed interface
00151 
00152     // ---------- Actual action is not to continue rendering of dummy
00153     GZ_GRAPH_EXPORT virtual gzBool isTraversable( gzTraverseAction *action , gzNode *node , gzULong index, gzContext *context){ return FALSE; }
00154 
00155     // ---------- Clone interface ---------------------------------------
00156     GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00157 };
00158 
00159 #endif

Documentation for Gizmo3D generated at Wed Feb 20 11:54:05 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond