29 CallbackNode(
const std::string &name) :
32 PandaNode::set_cull_callback();
93 if (cbobj !=
nullptr) {
123 if (pgraph_cat.is_spam()) {
125 <<
"Found " << *
this <<
" in state " << *data._state
126 <<
" draw_mask = " << data._draw_mask <<
"\n";
133 if (cbobj !=
nullptr) {
136 data.get_internal_transform(trav));
149 PandaNode::output(out);
182 node->fillin(scan, manager);
193 PandaNode::fillin(scan, manager);
202 return new CData(*
this);
209 void CallbackNode::CData::
217 void CallbackNode::CData::
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
CullHandler * get_cull_handler() const
Returns the object that will receive the culled Geoms.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_draw_callback
Returns the CallbackObject set by set_draw_callback().
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,...
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.
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
A single page of data maintained by a PipelineCycler.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void write_cdata(Datagram &packet, const PipelineCyclerBase &cycler)
Writes out the indicated CycleData object.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
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...
get_cull_callback
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.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
virtual PandaNode * make_copy() const
Returns a newly-allocated Node that is a shallow copy of this one.
The smallest atom of cull.
virtual void record_object(CullableObject *object, const CullTraverser *traverser)
This callback function is intended to be overridden by a derived class.
virtual void output(std::ostream &out) const
Writes a brief description of the node to the indicated output stream.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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().
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,...