Panda3D
Classes | Public Member Functions | Static Public Member Functions | List of all members
CullableObject Class Reference

The smallest atom of cull. More...

#include "cullableObject.h"

Public Member Functions

 CullableObject ()
 Creates an empty CullableObject whose pointers can be filled in later. More...
 
 CullableObject (CPT(Geom) geom, CPT(RenderState) state, CPT(TransformState) internal_transform)
 Creates a CullableObject based the indicated geom, with the indicated render state and transform. More...
 
 CullableObject (const CullableObject &copy)
 Copies the CullableObject. More...
 
 CPT (Geom) _geom
 
 CPT (GeomVertexData) _munged_data
 
 CPT (RenderState) _state
 
 CPT (TransformState) _internal_transform
 
void draw (GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread)
 Draws the cullable object on the GSG immediately, in the GSG's current state. More...
 
void draw_callback (GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread)
 Invokes the draw callback, assuming one is set. More...
 
void draw_inline (GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread)
 Draws the cullable object on the GSG immediately, in the GSG's current state. More...
 
bool munge_geom (GraphicsStateGuardianBase *gsg, GeomMunger *munger, const CullTraverser *traverser, bool force)
 Uses the indicated GeomMunger to transform the geom and/or its vertices. More...
 
void operator= (const CullableObject &copy)
 Copies the CullableObject. More...
 
void output (std::ostream &out) const
 
 PT (CallbackObject) _draw_callback
 
bool request_resident () const
 Returns true if all the data necessary to render this object is currently resident in memory. More...
 
void set_draw_callback (CallbackObject *draw_callback)
 Specifies a CallbackObject that will be responsible for drawing this object. More...
 

Static Public Member Functions

static void flush_level ()
 Flushes the PStatCollectors used during traversal. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

The smallest atom of cull.

This is normally just a Geom and its associated state, but it also contain a draw callback.

Definition at line 41 of file cullableObject.h.

Constructor & Destructor Documentation

◆ CullableObject() [1/3]

CullableObject::CullableObject ( )
inline

Creates an empty CullableObject whose pointers can be filled in later.

Definition at line 18 of file cullableObject.I.

References MemoryUsage::record_pointer().

◆ CullableObject() [2/3]

CullableObject::CullableObject ( CPT(Geom geom,
CPT(RenderState state,
CPT(TransformState internal_transform 
)
inline

Creates a CullableObject based the indicated geom, with the indicated render state and transform.

Definition at line 29 of file cullableObject.I.

◆ CullableObject() [3/3]

CullableObject::CullableObject ( const CullableObject copy)
inline

Copies the CullableObject.

Definition at line 44 of file cullableObject.I.

References MemoryUsage::record_pointer().

Member Function Documentation

◆ draw()

void CullableObject::draw ( GraphicsStateGuardianBase gsg,
bool  force,
Thread current_thread 
)
inline

Draws the cullable object on the GSG immediately, in the GSG's current state.

This should only be called from the draw thread.

Definition at line 72 of file cullableObject.I.

References GeomDrawCallbackData::get_lost_state().

Referenced by GeomDrawCallbackData::upcall().

◆ draw_callback()

void CullableObject::draw_callback ( GraphicsStateGuardianBase gsg,
bool  force,
Thread current_thread 
)
inline

Invokes the draw callback, assuming one is set.

Crashes if not.

Definition at line 140 of file cullableObject.I.

References GeomDrawCallbackData::get_lost_state().

Referenced by set_draw_callback().

◆ draw_inline()

void CullableObject::draw_inline ( GraphicsStateGuardianBase gsg,
bool  force,
Thread current_thread 
)
inline

Draws the cullable object on the GSG immediately, in the GSG's current state.

This should only be called from the draw thread. Assumes the GSG has already been set to the appropriate state.

Definition at line 132 of file cullableObject.I.

◆ flush_level()

void CullableObject::flush_level ( )
inlinestatic

Flushes the PStatCollectors used during traversal.

Definition at line 122 of file cullableObject.I.

◆ munge_geom()

bool CullableObject::munge_geom ( GraphicsStateGuardianBase gsg,
GeomMunger munger,
const CullTraverser traverser,
bool  force 
)

Uses the indicated GeomMunger to transform the geom and/or its vertices.

If force is false, this may do nothing and return false if the vertex data is nonresident. If force is true, this will always return true, but it may have to block while the vertex data is paged in.

Definition at line 54 of file cullableObject.cxx.

Referenced by DrawCullHandler::record_object().

◆ operator=()

void CullableObject::operator= ( const CullableObject copy)
inline

Copies the CullableObject.

Definition at line 59 of file cullableObject.I.

◆ request_resident()

bool CullableObject::request_resident ( ) const
inline

Returns true if all the data necessary to render this object is currently resident in memory.

If this returns false, the data will be brought back into memory shortly; try again later.

Definition at line 97 of file cullableObject.I.

◆ set_draw_callback()

void CullableObject::set_draw_callback ( CallbackObject draw_callback)
inline

Specifies a CallbackObject that will be responsible for drawing this object.

Definition at line 114 of file cullableObject.I.

References draw_callback().

Referenced by NodeCullCallbackData::upcall().


The documentation for this class was generated from the following files: