00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __GZ_RENDER_ACTION_H__
00023 #define __GZ_RENDER_ACTION_H__
00024
00031 #include "gzNode.h"
00032 #include "gzCamera.h"
00033 #include "gzMatrix.h"
00034 #include "gzEnvironment.h"
00035
00036 class gzRenderNode
00037 {
00038 public:
00039 gzNode *node;
00040 gzULong stateAttributeIndex;
00041 gzULong transformIndex;
00042 gzULong transformUpdateID;
00043 gzULong transformBaseIndex;
00044 gzULong lightStateIndex;
00045 gzULong clipStateIndex;
00046 gzULong fogStateIndex;
00047 };
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 class gzRenderAction : public gzTraverseAction
00064 {
00065 public:
00066 GZ_DECLARE_TYPE_INTERFACE_EXPORT(GZ_GRAPH_EXPORT);
00067
00068 GZ_GRAPH_EXPORT gzRenderAction();
00069 GZ_GRAPH_EXPORT virtual ~gzRenderAction(){};
00070
00071 GZ_GRAPH_EXPORT gzVoid reset(gzContext *context,gzBool mainLoop);
00072
00073 GZ_GRAPH_EXPORT gzVoid render(gzNode *node ,gzContext *context,gzBool mainLoop);
00074 GZ_GRAPH_EXPORT gzVoid renderGroup(gzGroup *group ,gzContext *context,gzBool mainLoop);
00075 GZ_GRAPH_EXPORT gzVoid executeRenderStages(gzContext *context);
00076
00077
00078 GZ_GRAPH_EXPORT gzVoid addNodeToRenderStage( gzContext *context , gzNode *node , gzActionStage stage);
00079 GZ_GRAPH_EXPORT gzVoid renderStage(gzContext *context , gzActionStage stage);
00080 GZ_GRAPH_EXPORT gzVoid setCamera(gzCamera *camera);
00081
00082
00083 GZ_GRAPH_EXPORT static gzVoid convertToCompiledStages(const gzMatrix4 &inv,gzContext *context);
00084 GZ_GRAPH_EXPORT static gzVoid addReferenceToCompiledStages(gzContext *context);
00085 GZ_GRAPH_EXPORT static gzVoid releaseReferenceToCompiledStages(gzContext *context);
00086 GZ_GRAPH_EXPORT static gzVoid expandMatrixGeometry(gzContext *context);
00087
00088
00089 protected:
00090
00091 GZ_GRAPH_EXPORT virtual gzBool checkBoundary(gzContext *context , gzNode *node);
00092
00093 GZ_GRAPH_EXPORT virtual gzVoid preTraverseAction( gzNode *node , gzContext *context);
00094 GZ_GRAPH_EXPORT virtual gzVoid postTraverseAction( gzNode *node , gzContext *context);
00095 private:
00096
00097 gzCamera *m_camera;
00098 };
00099
00100 #endif