Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PGCullTraverser Class Reference

This is a specialization of CullTraverser for use within the pgui system. More...

#include <pgCullTraverser.h>

Inheritance diagram for PGCullTraverser:

CullTraverser TypedObject List of all members.

Public Member Functions

 PGCullTraverser (PGTop *top, CullTraverser *trav)
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
void set_scene (SceneSetup *scene_setup)
 Sets the SceneSetup object that indicates the initial camera position, etc.

SceneSetupget_scene () const
 Returns the SceneSetup object.

void set_camera_mask (const DrawMask &camera_mask)
 Specifies the visibility mask from the camera viewing the scene.

const DrawMaskget_camera_mask () const
 Returns the visibility mask from the camera viewing the scene.

const TransformStateget_camera_transform () const
 Returns the position of the camera relative to the starting node, without any compensating coordinate-system transforms that might have been introduced for the purposes of rendering.

const TransformStateget_render_transform () const
 Returns the position of the starting node relative to the camera, pretransformed as appropriate for rendering.

void set_initial_state (const RenderState *initial_state)
 Sets the initial RenderState at the top of the scene graph we are traversing.

const RenderStateget_initial_state () const
 Returns the initial RenderState at the top of the scene graph we are traversing, or the empty state if the initial state was never set.

void set_depth_offset_decals (bool flag)
 Sets the depth_offset_decals flag.

bool get_depth_offset_decals () const
 Returns the depth_offset_decals flag.

void set_view_frustum (GeometricBoundingVolume *view_frustum)
 Specifies the bounding volume that corresponds to the view frustum.

GeometricBoundingVolumeget_view_frustum () const
 Returns the bounding volume that corresponds to the view frustum, or NULL if the view frustum is not in use or has not been set.

void set_guard_band (GeometricBoundingVolume *guard_band)
 Specifies the bounding volume to use for detecting guard band clipping.

GeometricBoundingVolumeget_guard_band () const
 Returns the bounding volume that corresponds to the guard band, or NULL if the guard band is not in use or has not been set.

void set_cull_handler (CullHandler *cull_handler)
 Specifies the object that will receive the culled Geoms.

CullHandlerget_cull_handler () const
 Returns the object that will receive the culled Geoms.

void traverse (const NodePath &root)
 Begins the traversal from the indicated node.

void traverse (CullTraverserData &data)
 Traverses from the next node with the given data, which has been constructed with the node but has not yet been converted into the node's space.

void traverse_below (CullTraverserData &data)
 Traverses all the children of the indicated node, with the given data, which been converted into the node's space.

int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.

bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.


Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.


Public Attributes

PGTop_top
int _sort_index

Static Private Attributes

TypeHandle _type_handle

Detailed Description

This is a specialization of CullTraverser for use within the pgui system.

It is substituted in for the normal CullTraverser by the PGTop node. Its purpose is to carry additional data through the traversal so that PGItems can know how to register their regions with the current MouseWatcherGroup.

Definition at line 47 of file pgCullTraverser.h.


Constructor & Destructor Documentation

PGCullTraverser::PGCullTraverser PGTop top,
CullTraverser trav
[inline]
 

Definition at line 32 of file pgCullTraverser.I.


Member Function Documentation

virtual TypeHandle PGCullTraverser::force_init_type void   )  [inline, virtual]
 

Reimplemented from CullTraverser.

Definition at line 66 of file pgCullTraverser.h.

const DrawMask & CullTraverser::get_camera_mask  )  const [inline, inherited]
 

Returns the visibility mask from the camera viewing the scene.

Definition at line 199 of file cullTraverser.I.

References CullTraverser::_guard_band, and INLINE.

const TransformState * CullTraverser::get_camera_transform  )  const [inline, inherited]
 

Returns the position of the camera relative to the starting node, without any compensating coordinate-system transforms that might have been introduced for the purposes of rendering.

Definition at line 68 of file cullTraverser.I.

References CullTraverser::_scene_setup, and INLINE.

Referenced by LODNode::xform().

TypeHandle PGCullTraverser::get_class_type void   )  [inline, static]
 

Reimplemented from CullTraverser.

Definition at line 55 of file pgCullTraverser.h.

References CullTraverser::get_class_type(), and CullTraverser::init_type().

CullHandler * CullTraverser::get_cull_handler  )  const [inline, inherited]
 

Returns the object that will receive the culled Geoms.

Definition at line 343 of file cullTraverser.I.

bool CullTraverser::get_depth_offset_decals  )  const [inline, inherited]
 

Returns the depth_offset_decals flag.

See set_depth_offset_decals().

Definition at line 167 of file cullTraverser.I.

References CullTraverser::_view_frustum, and INLINE.

GeometricBoundingVolume * CullTraverser::get_guard_band  )  const [inline, inherited]
 

Returns the bounding volume that corresponds to the guard band, or NULL if the guard band is not in use or has not been set.

Note that the guard band returned here is always in the coordinate space of the starting node, not the current node, even if it is sampled during a traversal. To get the guard band in the current node's coordinate space, check in the current CullTraverserData.

Definition at line 313 of file cullTraverser.I.

const RenderState * CullTraverser::get_initial_state  )  const [inline, inherited]
 

Returns the initial RenderState at the top of the scene graph we are traversing, or the empty state if the initial state was never set.

Definition at line 131 of file cullTraverser.I.

References CullTraverser::_camera_mask.

const TransformState * CullTraverser::get_render_transform  )  const [inline, inherited]
 

Returns the position of the starting node relative to the camera, pretransformed as appropriate for rendering.

Note that this value is always the position of the starting node, not the current node, even if it is sampled during a traversal. To get the render transform of the current node check in the current CullTraverserData.

Definition at line 97 of file cullTraverser.I.

References CullTraverser::_depth_offset_decals, and INLINE.

SceneSetup * CullTraverser::get_scene  )  const [inline, inherited]
 

Returns the SceneSetup object.

Definition at line 49 of file cullTraverser.I.

References CullTraverser::_scene_setup, and INLINE.

virtual TypeHandle PGCullTraverser::get_type void   )  const [inline, virtual]
 

Reimplemented from CullTraverser.

Definition at line 63 of file pgCullTraverser.h.

int TypedObject::get_type_index  )  const [inline, inherited]
 

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 71 of file typedObject.I.

References TypeHandle::get_name(), TypedObject::get_type(), and INLINE.

GeometricBoundingVolume * CullTraverser::get_view_frustum  )  const [inline, inherited]
 

Returns the bounding volume that corresponds to the view frustum, or NULL if the view frustum is not in use or has not been set.

Note that the view frustum returned here is always in the coordinate space of the starting node, not the current node, even if it is sampled during a traversal. To get the view frustum in the current node's coordinate space, check in the current CullTraverserData.

Definition at line 247 of file cullTraverser.I.

void PGCullTraverser::init_type void   )  [inline, static]
 

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from CullTraverser.

Definition at line 58 of file pgCullTraverser.h.

bool TypedObject::is_exact_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is the indicated type exactly.

Definition at line 101 of file typedObject.I.

Referenced by PT(), and CollisionNode::xform().

bool TypedObject::is_of_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is or derives from the indicated type.

Definition at line 86 of file typedObject.I.

Referenced by EggMaterialCollection::collapse_equivalent_materials(), EggTextureCollection::collapse_equivalent_textures(), DeferredNodeProperty::compose(), AnimBundleMaker::create_s_channel(), CharacterMaker::create_slider(), ProjectionScreen::cull_callback(), DataNode::define_output(), EggNode::determine_draw_order(), CharacterMaker::egg_to_index(), EggGroupUniquifier::EggGroupUniquifier(), EggPoolUniquifier::EggPoolUniquifier(), EggGroupNode::find_textures(), StaticTextFont::get_glyph(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), CharacterJoint::make_copy(), PT(), EggGroupNode::r_flatten_transforms(), EggGroupNode::r_transform_vertices(), EggGroupNode::recompute_polygon_normals(), CollisionLevelState::reserve(), PandaFramework::reset_frame_rate(), PandaFramework::set_texture(), EggGroupNode::steal_children(), and DataGraphTraverser::traverse().

void CullTraverser::set_camera_mask const DrawMask camera_mask  )  [inline, inherited]
 

Specifies the visibility mask from the camera viewing the scene.

Any nodes that do not have at least some bits in common with this mask will not be drawn.

Definition at line 184 of file cullTraverser.I.

References CullTraverser::_guard_band, and INLINE.

void CullTraverser::set_cull_handler CullHandler cull_handler  )  [inline, inherited]
 

Specifies the object that will receive the culled Geoms.

This must be set before calling traverse().

Definition at line 328 of file cullTraverser.I.

void CullTraverser::set_depth_offset_decals bool  flag  )  [inline, inherited]
 

Sets the depth_offset_decals flag.

If this is true, decals will be rendered using DepthOffsetAttribs; otherwise, decals will be rendered with a more expensive three-pass system. This is normally set from the corresponding flag in the GSG.

Definition at line 152 of file cullTraverser.I.

References CullTraverser::_view_frustum, and INLINE.

void CullTraverser::set_guard_band GeometricBoundingVolume guard_band  )  [inline, inherited]
 

Specifies the bounding volume to use for detecting guard band clipping.

This is a render optimization for certain cards that support this feature; the guard band is a 2-d area than the frame buffer. If a primitive will appear entirely within the guard band after perspective transform, it may be drawn correctly with clipping disabled, for a small performance gain.

This is the bounding volume that corresponds to the 2-d guard band. If a primitive is entirely within this area, clipping will be disabled on the GSG.

Definition at line 282 of file cullTraverser.I.

void CullTraverser::set_initial_state const RenderState initial_state  )  [inline, inherited]
 

Sets the initial RenderState at the top of the scene graph we are traversing.

If this is not set, the default is the empty state.

Definition at line 114 of file cullTraverser.I.

References CullTraverser::_depth_offset_decals, and INLINE.

void CullTraverser::set_scene SceneSetup scene_setup  )  [inline, inherited]
 

Sets the SceneSetup object that indicates the initial camera position, etc.

This must be called before traversal begins.

Definition at line 36 of file cullTraverser.I.

References CullTraverser::_scene_setup, and INLINE.

void CullTraverser::set_view_frustum GeometricBoundingVolume view_frustum  )  [inline, inherited]
 

Specifies the bounding volume that corresponds to the view frustum.

Any primitives that fall entirely outside of this volume are not drawn.

Definition at line 216 of file cullTraverser.I.

References CullTraverser::_cull_handler, and INLINE.

void CullTraverser::traverse CullTraverserData data  )  [inherited]
 

Traverses from the next node with the given data, which has been constructed with the node but has not yet been converted into the node's space.

Definition at line 109 of file cullTraverser.cxx.

References NULL.

void CullTraverser::traverse const NodePath root  )  [inherited]
 

Begins the traversal from the indicated node.

Definition at line 86 of file cullTraverser.cxx.

References CullTraverser::_camera_mask, CullTraverserData::apply_transform_and_state(), PandaNode::get_effects(), RenderEffects::has_show_bounds(), CullTraverserData::is_in_view(), CullTraverserData::node(), and CullTraverser::show_bounds().

Referenced by CollisionNode::combine_with().

void CullTraverser::traverse_below CullTraverserData data  )  [inherited]
 

Traverses all the children of the indicated node, with the given data, which been converted into the node's space.

Definition at line 159 of file cullTraverser.cxx.

Referenced by PGTop::has_cull_callback().


Member Data Documentation

int PGCullTraverser::_sort_index
 

Definition at line 52 of file pgCullTraverser.h.

Referenced by PGItem::has_cull_callback().

PGTop* PGCullTraverser::_top
 

Definition at line 51 of file pgCullTraverser.h.

TypeHandle PGCullTraverser::_type_handle [static, private]
 

Reimplemented from CullTraverser.

Definition at line 24 of file pgCullTraverser.cxx.


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:53:21 2003 for Panda by doxygen1.3