15 #ifndef SCENEGRAPHREDUCER_H 16 #define SCENEGRAPHREDUCER_H 18 #include "pandabase.h" 19 #include "transformState.h" 20 #include "renderAttrib.h" 21 #include "renderState.h" 22 #include "accumulatedAttribs.h" 23 #include "geomTransformer.h" 24 #include "pStatCollector.h" 25 #include "pStatTimer.h" 26 #include "typedObject.h" 27 #include "pointerTo.h" 28 #include "graphicsStateGuardianBase.h" 46 INLINE ~SceneGraphReducer();
51 TT_color_scale = 0x004,
52 TT_tex_matrix = 0x008,
53 TT_clip_plane = 0x010,
55 TT_apply_texture_color = 0x040,
59 enum CombineSiblings {
61 CS_within_radius = 0x002,
66 enum CollectVertexData {
79 CVD_transform = 0x004,
85 CVD_avoid_dynamic = 0x008,
89 CVD_one_node_only = 0x010,
100 CVD_usage_hint = 0x040,
104 CVD_animation_type = 0x080,
107 enum MakeNonindexed {
111 MN_composite_only = 0x001,
116 MN_avoid_animated = 0x002,
120 MN_avoid_dynamic = 0x004,
127 INLINE
void set_combine_radius(PN_stdfloat combine_radius);
128 INLINE PN_stdfloat get_combine_radius()
const;
130 INLINE
void apply_attribs(
PandaNode *node,
int attrib_types = ~(TT_clip_plane | TT_cull_face | TT_apply_texture_color));
134 int flatten(
PandaNode *root,
int combine_siblings_bits);
136 int remove_column(
PandaNode *root,
const InternalName *column);
138 int make_compatible_state(
PandaNode *root);
140 INLINE
int make_compatible_format(
PandaNode *root,
int collect_bits = ~0);
143 INLINE
int collect_vertex_data(
PandaNode *root,
int collect_bits = ~0);
144 INLINE
int make_nonindexed(
PandaNode *root,
int nonindexed_bits = ~0);
145 void unify(
PandaNode *root,
bool preserve_order);
146 void remove_unused_vertices(
PandaNode *root);
149 bool check_live_flatten(
PandaNode *node);
156 int combine_siblings_bits);
157 int flatten_siblings(
PandaNode *parent_node,
158 int combine_siblings_bits);
160 bool consider_child(
PandaNode *grandparent_node,
165 bool do_flatten_child(
PandaNode *grandparent_node,
176 int r_remove_column(
PandaNode *node,
const InternalName *column,
181 int r_collect_vertex_data(
PandaNode *node,
int collect_bits,
183 int r_make_nonindexed(
PandaNode *node,
int collect_bits);
184 void r_unify(
PandaNode *node,
int max_indices,
bool preserve_order);
192 PN_stdfloat _combine_radius;
206 #include "sceneGraphReducer.I" A basic node of the scene graph or data graph.
An interface for simplifying ("flattening") scene graphs by eliminating unneeded nodes and collapsing...
A lightweight class that represents a single element that may be timed and/or counted via stats...
This class is used by the SceneGraphReducer to maintain and accumulate the set of attributes we have ...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...