15 #include "pandabase.h"
16 #include "callbackNode.h"
17 #include "cullTraverser.h"
18 #include "nodeCullCallbackData.h"
19 #include "cullableObject.h"
20 #include "cullHandler.h"
21 #include "omniBoundingVolume.h"
22 #include "config_pgraph.h"
32 CallbackNode(
const string &name) :
35 PandaNode::set_cull_callback();
150 if (pgraph_cat.is_spam()) {
152 <<
"Found " << *
this <<
" in state " << *data._state
153 <<
" draw_mask = " << data._draw_mask <<
"\n";
163 data.get_internal_transform(trav));
179 PandaNode::output(out);
219 parse_params(params, scan, manager);
220 node->fillin(scan, manager);
234 PandaNode::fillin(scan, manager);
245 return new CData(*
this);
254 void CallbackNode::CData::
265 void CallbackNode::CData::
A basic node of the scene graph or data graph.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual void add_for_draw(CullTraverser *trav, CullTraverserData &data)
Adds the node's contents to the CullResult we are building up during the cull traversal, so that it will be drawn at render time.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
void read_cdata(DatagramIterator &scan, PipelineCyclerBase &cycler)
Reads in the indicated CycleData object.
A single page of data maintained by a PipelineCycler.
Base class for objects that can be written to and read from Bam files.
void write_cdata(Datagram &packet, const PipelineCyclerBase &cycler)
Writes out the indicated CycleData object.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
virtual PandaNode * make_copy() const
Returns a newly-allocated Node that is a shallow copy of this one.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
A special node that can issue arbitrary callbacks to user code, either during the cull or draw traver...
CallbackObject * get_cull_callback() const
Returns the CallbackObject set by set_cull_callback().
virtual void do_callback(CallbackData *cbdata)
This method called when the callback is triggered; it replaces* the original function.
CallbackObject * get_draw_callback() const
Returns the CallbackObject set by set_draw_callback().
The smallest atom of cull.
virtual void output(ostream &out) const
Writes a brief description of the node to the indicated output stream.
virtual void record_object(CullableObject *object, const CullTraverser *traverser)
This callback function is intended to be overridden by a derived class.
CullHandler * get_cull_handler() const
Returns the object that will receive the culled Geoms.
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
This is a generic object that can be assigned to a callback at various points in the rendering proces...
void set_draw_callback(CallbackObject *draw_callback)
Specifies a CallbackObject that will be responsible for drawing this object.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
This is a special kind of GeometricBoundingVolume that fills all of space.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
This kind of CallbackData is passed to the CallbackObject added to CallbackNode:set_cull_callback().
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
static void register_with_read_factory()
Tells the BamReader how to create objects of type CallbackNode.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...