00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __GZ_RECURSIVE_H__
00023 #define __GZ_RECURSIVE_H__
00024
00029 #include "gzGroup.h"
00030 #include "gzThread.h"
00031
00032 class gzRecursiveData
00033 {
00034 public:
00035
00036 gzRecursiveData():depth(0){};
00037 virtual ~gzRecursiveData(){};
00038
00039 gzReal depth;
00040
00041 gzQueue<gzReal> depthStorage;
00042 };
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 class gzRecursive : public gzGroup
00060 {
00061 public:
00062 GZ_GRAPH_EXPORT gzRecursive(const gzString & name=GZ_EMPTY_STRING);
00063 GZ_GRAPH_EXPORT virtual ~gzRecursive();
00064
00065 GZ_GRAPH_EXPORT gzRecursive(const gzRecursive ©);
00066
00067 GZ_DECLARE_TYPE_INTERFACE_EXPORT(GZ_GRAPH_EXPORT);
00068
00069
00070
00071 GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00072
00073
00074
00075
00076 GZ_GRAPH_EXPORT virtual gzVoid updateNode();
00077
00078 GZ_GRAPH_EXPORT virtual gzVoid updateNodeData(gzBool force=FALSE);
00079
00080
00081
00082 GZ_GRAPH_EXPORT virtual gzVoid preTraverseAction( gzTraverseAction *actionclass , gzContext *context);
00083 GZ_GRAPH_EXPORT virtual gzBool isTraversable( gzTraverseAction *action , gzNode *node , gzULong index, gzContext *context);
00084 GZ_GRAPH_EXPORT virtual gzVoid postTraverseAction( gzTraverseAction *actionclass , gzContext *context);
00085
00086 GZ_GRAPH_EXPORT virtual gzActionStage useActionStage( gzTraverseAction *actionclass , gzContext *context);
00087
00088
00089
00090 GZ_GRAPH_EXPORT gzVoid setMaxDepth( gzReal depth );
00091 GZ_GRAPH_EXPORT gzVoid setTransform(const gzMatrix4 &transform);
00092 GZ_GRAPH_EXPORT gzVoid setMaxDepthNode(gzNode *node);
00093 GZ_GRAPH_EXPORT gzVoid useDistanceDepth(gzBool on);
00094 GZ_GRAPH_EXPORT gzVoid setDistanceDepthEquation(gzReal farDistance=100,gzReal speed=1);
00095
00096
00097
00098 GZ_GRAPH_EXPORT gzVoid renderOnRecursion( gzBool on=FALSE );
00099
00100 GZ_GRAPH_EXPORT gzVoid transferLightStates( gzBool on=FALSE );
00101
00102
00103
00104 GZ_GRAPH_EXPORT virtual gzVoid debugOutputTraverse(gzString base , gzString anchor , gzDebugFlags features);
00105 GZ_GRAPH_EXPORT virtual gzVoid debugOutput(gzString base , gzString anchor , gzDebugFlags features);
00106
00107 GZ_GRAPH_EXPORT virtual gzNode * find(const gzString &path,gzBool recursive=TRUE);
00108 GZ_GRAPH_EXPORT virtual gzBool hasSiblingNode(gzNode *child);
00109
00110
00111
00112 GZ_PROPERTY_EXPORT(gzBool, RelativeSceneTransform, GZ_GRAPH_EXPORT);
00113
00114 protected:
00115
00116 GZ_GRAPH_EXPORT gzReal evaluateMaxDepth(gzContext *context);
00117
00118 gzReal m_maxDepth;
00119 gzLateBindData<gzMatrix4> m_transform;
00120 gzReal m_maxscale;
00121 gzRefPointer<gzNode> m_maxDepthNode;
00122
00123 gzLateBindData<gzRealXY> m_distanceEquation;
00124
00125 gzBool m_renderOnRecursion:1;
00126 gzBool m_transferLightState:1;
00127
00128 gzULong m_id;
00129 static gzUniqueIDManager s_idManager;
00130 };
00131
00132
00133 #endif