64class EXPCL_PANDA_PGRAPH PandaNode :
public TypedWritableReferenceCount,
65 public Namable,
public LinkedListNode {
67 explicit PandaNode(
const std::string &name);
73 PandaNode(
const PandaNode ©);
75 PandaNode &operator = (
const PandaNode ©) =
delete;
91 virtual void xform(
const LMatrix4 &mat);
112 EXTENSION(PT(PandaNode) __copy__()
const);
113 EXTENSION(PyObject *__deepcopy__(PyObject *self, PyObject *memo)
const);
128 void add_child(PandaNode *child_node,
int sort = 0,
132 bool replace_child(PandaNode *orig_child, PandaNode *new_child,
160 INLINE
bool has_attrib(
TypeHandle type)
const;
161 INLINE
bool has_attrib(
int slot)
const;
163 void clear_attrib(
int slot);
167 INLINE
bool has_effect(
TypeHandle type)
const;
188 INLINE
bool has_dirty_prev_transform()
const;
190 MAKE_PROPERTY(prev_transform, get_prev_transform);
192 void set_tag(
const std::string &key,
const std::string &value,
194 INLINE std::string get_tag(
const std::string &key,
196 INLINE
bool has_tag(
const std::string &key,
203 INLINE
size_t get_num_tags()
const;
204 INLINE std::string get_tag_key(
size_t i)
const;
208 MAKE_MAP_KEYS_SEQ(tags, get_num_tags, get_tag_key);
212 EXTENSION(PyObject *get_python_tags());
213 EXTENSION(
void set_python_tag(PyObject *key, PyObject *value));
214 EXTENSION(PyObject *get_python_tag(PyObject *key)
const);
215 EXTENSION(
bool has_python_tag(PyObject *key)
const);
216 EXTENSION(
void clear_python_tag(PyObject *key));
217 EXTENSION(PyObject *get_python_tag_keys()
const);
218 MAKE_PROPERTY(python_tags, get_python_tags);
220 EXTENSION(
int __traverse__(visitproc visit,
void *arg));
222 INLINE
bool has_tags()
const;
224 void list_tags(std::ostream &out,
const std::string &separator =
"\n")
const;
231 enum UnexpectedChange {
234 UC_transform = 0x004,
236 UC_draw_mask = 0x010,
238 void set_unexpected_change(
unsigned int flags);
239 unsigned int get_unexpected_change(
unsigned int flags)
const;
240 void clear_unexpected_change(
unsigned int flags);
242 INLINE
static DrawMask get_overall_bit();
243 INLINE
static DrawMask get_all_camera_mask();
244 INLINE
bool is_overall_hidden()
const;
245 INLINE
void set_overall_hidden(
bool overall_hidden);
246 MAKE_PROPERTY(overall_bit, get_overall_bit);
252 DrawMask clear_mask);
275 virtual void output(std::ostream &out)
const;
276 virtual void write(std::ostream &out,
int indent_level)
const;
278 INLINE
void ls(std::ostream &out,
int indent_level)
const;
309 INLINE
bool is_bounds_stale()
const;
310 MAKE_PROPERTY(bounds_stale, is_bounds_stale);
312 INLINE
void set_final(
bool flag);
323 FB_transform = 0x0001,
327 FB_draw_mask = 0x0020,
328 FB_cull_callback = 0x0040,
333 static PT(
PandaNode) decode_from_bam_stream(vector_uchar data,
BamReader *reader =
nullptr);
340 int get_internal_vertices(
int pipeline_stage,
Thread *current_thread)
const;
343 INLINE
void mark_bounds_stale(
int pipeline_stage,
Thread *current_thread)
const;
345 void force_bounds_stale(
int pipeline_stage,
Thread *current_thread);
346 INLINE
void mark_internal_bounds_stale(
int pipeline_stage,
Thread *current_thread);
348 virtual void r_mark_geom_bounds_stale(
Thread *current_thread);
350 virtual void compute_internal_bounds(CPT(
BoundingVolume) &internal_bounds,
351 int &internal_vertices,
353 Thread *current_thread)
const;
354 virtual void parents_changed();
355 virtual void children_changed();
356 virtual void transform_changed();
357 virtual void state_changed();
358 virtual void draw_mask_changed();
360 typedef pmap<PandaNode *, PandaNode *> InstanceMap;
361 virtual PT(
PandaNode) r_copy_subgraph(InstanceMap &inst_map,
362 Thread *current_thread)
const;
363 virtual void r_copy_children(
const PandaNode *from, InstanceMap &inst_map,
366 void set_cull_callback();
367 void disable_cull_callback();
378 class EXPCL_PANDA_PGRAPH BoundsData :
public CycleData {
381 INLINE BoundsData(
const BoundsData ©);
382 INLINE
void copy_bounds(
const BoundsData ©);
390 int _internal_vertices;
398 INLINE
int do_find_parent(PandaNode *node,
const CData *cdata)
const;
399 bool stage_remove_child(PandaNode *child_node,
int pipeline_stage,
400 Thread *current_thread);
401 bool stage_replace_child(PandaNode *orig_child, PandaNode *new_child,
402 int pipeline_stage, Thread *current_thread);
404 void quick_add_new_child(PandaNode *child_node,
int sort,
405 Thread *current_thread);
407 INLINE
bool verify_child_no_cycles(PandaNode *child_node);
408 void report_cycle(PandaNode *node);
409 bool find_node_above(PandaNode *node);
413 static PT(NodePathComponent) attach(NodePathComponent *parent,
414 PandaNode *child,
int sort,
415 int pipeline_stage, Thread *current_thread);
416 static void detach(NodePathComponent *child,
int pipeline_stage, Thread *current_thread);
417 static void detach_one_stage(NodePathComponent *child,
int pipeline_stage, Thread *current_thread);
418 static bool reparent(NodePathComponent *new_parent,
419 NodePathComponent *child,
int sort,
bool as_stashed,
420 int pipeline_stage, Thread *current_thread);
421 static bool reparent_one_stage(NodePathComponent *new_parent,
422 NodePathComponent *child,
int sort,
423 bool as_stashed,
int pipeline_stage, Thread *current_thread);
424 static PT(NodePathComponent) get_component(NodePathComponent *parent,
426 int pipeline_stage, Thread *current_thread);
427 static PT(NodePathComponent) get_top_component(PandaNode *child,
bool force,
428 int pipeline_stage, Thread *current_thread);
429 PT(NodePathComponent) get_generic_component(
bool accept_ambiguity,
430 int pipeline_stage, Thread *current_thread);
431 PT(NodePathComponent) r_get_generic_component(
bool accept_ambiguity,
432 bool &ambiguity_detected,
433 int pipeline_stage, Thread *current_thread);
434 void delete_component(NodePathComponent *component);
435 static void sever_connection(PandaNode *parent_node, PandaNode *child_node,
436 int pipeline_stage, Thread *current_thread);
437 static void new_connection(PandaNode *parent_node, PandaNode *child_node,
438 int pipeline_stage, Thread *current_thread);
439 void fix_path_lengths(
int pipeline_stage, Thread *current_thread);
440 void r_list_descendants(std::ostream &out,
int indent_level)
const;
442 INLINE
void do_set_dirty_prev_transform();
443 INLINE
void do_clear_dirty_prev_transform();
448 class EXPCL_PANDA_PGRAPH DownConnection {
450 INLINE DownConnection(PandaNode *child,
int sort);
451 INLINE
bool operator < (
const DownConnection &other)
const;
452 INLINE PandaNode *get_child()
const;
454 INLINE
int get_sort()
const;
459 PT(PandaNode) _child;
470 INLINE BamReaderAuxDataDown();
474 return get_class_type();
476 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
477 static TypeHandle get_class_type() {
482 static void init_type() {
483 BamReaderAuxData::init_type();
485 BamReaderAuxData::get_class_type());
489 static TypeHandle _type_handle;
492 class EXPCL_PANDA_PGRAPH UpConnection {
494 INLINE UpConnection(PandaNode *child);
495 INLINE
bool operator < (
const UpConnection &other)
const;
496 INLINE PandaNode *get_parent()
const;
503 typedef ov_set<UpConnection> UpList;
504 typedef CopyOnWriteObj1< UpList, TypeHandle > Up;
510 typedef phash_set<NodePathComponent *, pointer_hash> Paths;
516 LightReMutex _paths_lock;
518 bool _dirty_prev_transform;
519 static PandaNodeChain _dirty_prev_transforms;
523 typedef SimpleHashMap<std::string, std::string, string_hash> TagData;
529 class PythonTagData :
public ReferenceCount {
531 virtual ~PythonTagData() {};
533 PT(PythonTagData) _python_tag_data;
535 unsigned int _unexpected_change_flags = 0;
539 class EXPCL_PANDA_PGRAPH CData :
public BoundsData {
542 CData(
const CData ©);
544 ALLOC_DELETED_CHAIN(CData);
546 virtual CycleData *make_copy()
const;
547 virtual void write_datagram(BamWriter *manager, Datagram &dg)
const;
550 virtual void fillin(DatagramIterator &scan, BamReader *manager);
551 virtual TypeHandle get_parent_type()
const {
552 return PandaNode::get_class_type();
559 NCPT(RenderState) _state;
567 INLINE
void set_fancy_bit(
int bits,
bool value);
574 CPT(RenderEffects) _effects;
580 DrawMask _draw_control_mask, _draw_show_mask;
585 CollideMask _into_collide_mask;
588 BoundingVolume::BoundsType _bounds_type;
592 CPT(BoundingVolume) _user_bounds;
613 CollideMask _net_collide_mask;
616 DrawMask _net_draw_control_mask, _net_draw_show_mask;
621 CPT(RenderAttrib) _off_clip_planes;
624 int _nested_vertices;
628 CPT(BoundingVolume) _external_bounds;
631 UpdateSeq _last_update, _next_update;
636 UpdateSeq _last_bounds_update;
642 void write_up_list(
const Up &up_list,
643 BamWriter *manager, Datagram &dg)
const;
644 void write_down_list(
const Down &down_list,
645 BamWriter *manager, Datagram &dg)
const;
646 void update_up_list(
const Up &up_list, BamWriter *manager)
const;
647 void update_down_list(
const Down &down_list, BamWriter *manager)
const;
648 int complete_up_list(Up &up_list,
const std::string &tag,
649 TypedWritable **p_list, BamReader *manager);
650 int complete_down_list(Down &down_list,
const std::string &tag,
651 TypedWritable **p_list, BamReader *manager);
652 void fillin_up_list(Up &up_list,
const std::string &tag,
653 DatagramIterator &scan, BamReader *manager);
654 void fillin_down_list(Down &down_list,
const std::string &tag,
655 DatagramIterator &scan, BamReader *manager);
657 INLINE CPT(Down) get_down()
const;
658 INLINE PT(Down) modify_down();
659 INLINE CPT(Down) get_stashed()
const;
660 INLINE PT(Down) modify_stashed();
661 INLINE CPT(Up) get_up()
const;
662 INLINE PT(Up) modify_up();
668 COWPT(Down) _stashed;
672 static TypeHandle get_class_type() {
675 static void init_type() {
680 static TypeHandle _type_handle;
683 PipelineCycler<CData> _cycler;
684 typedef CycleDataReader<CData> CDReader;
685 typedef CycleDataWriter<CData> CDWriter;
686 typedef CycleDataLockedStageReader<CData> CDLockedStageReader;
687 typedef CycleDataStageReader<CData> CDStageReader;
688 typedef CycleDataStageWriter<CData> CDStageWriter;
690 int do_find_child(PandaNode *node,
const Down *down)
const;
691 CDStageWriter update_cached(
bool update_bounds,
int pipeline_stage,
692 CDLockedStageReader &cdata);
694 static DrawMask _overall_bit;
696 static PStatCollector _reset_prev_pcollector;
697 static PStatCollector _update_bounds_pcollector;
706 class EXPCL_PANDA_PGRAPH Children {
709 INLINE Children(
const CData *cdata);
710 INLINE Children(
const Children ©);
711 INLINE Children(Children &&from)
noexcept;
713 INLINE
void operator = (
const Children ©);
714 INLINE
void operator = (Children &&from)
noexcept;
717 INLINE PandaNode *
get_child(
size_t n)
const;
721 INLINE PandaNode *operator [](
size_t n)
const {
return get_child(n); }
729 class EXPCL_PANDA_PGRAPH Stashed {
732 INLINE Stashed(
const CData *cdata);
733 INLINE Stashed(
const Stashed ©);
734 INLINE Stashed(Stashed &&from)
noexcept;
736 INLINE
void operator = (
const Stashed ©);
737 INLINE
void operator = (Stashed &&from)
noexcept;
744 INLINE PandaNode *operator [](
size_t n)
const {
return get_stashed(n); }
752 class EXPCL_PANDA_PGRAPH Parents {
755 INLINE Parents(
const CData *cdata);
756 INLINE Parents(
const Parents ©);
757 INLINE Parents(Parents &&from)
noexcept;
759 INLINE
void operator = (
const Parents ©);
760 INLINE
void operator = (Parents &&from)
noexcept;
766 INLINE PandaNode *operator [](
size_t n)
const {
return get_parent(n); }
778 typedef bool SceneRootFunc(
const PandaNode *);
787 static SceneRootFunc *_scene_root_func;
796 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
804 static void init_type() {
805 TypedWritableReferenceCount::init_type();
806 Namable::init_type();
808 TypedWritableReferenceCount::get_class_type(),
809 Namable::get_class_type());
813 BamReaderAuxDataDown::init_type();
815 virtual TypeHandle get_type()
const {
816 return get_class_type();
818 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
821 static TypeHandle _type_handle;
824 friend class PandaNode::Children;
825 friend class PandaNode::Stashed;
827 friend class NodePath;
828 friend class NodePathComponent;
829 friend class WorkingNodePath;
830 friend class PandaNodePipelineReader;
831 friend class EggLoader;
832 friend class Extension<PandaNode>;
833 friend class CullTraverserData;
840class EXPCL_PANDA_PGRAPH PandaNodePipelineReader {
842 INLINE PandaNodePipelineReader(
const PandaNode *
object,
Thread *current_thread);
843 INLINE PandaNodePipelineReader(
const PandaNodePipelineReader ©);
844 INLINE
void operator = (
const PandaNodePipelineReader ©);
847 INLINE ~PandaNodePipelineReader();
848 ALLOC_DELETED_CHAIN(PandaNodePipelineReader);
850 INLINE
const PandaNode *get_node()
const;
851 INLINE
Thread *get_current_thread()
const;
859 DrawMask camera_mask)
const;
880 INLINE std::string
get_tag(
const std::string &key)
const;
881 INLINE
bool has_tag(
const std::string &key)
const;
899 const PandaNode::CData *_cdata;
905 static void init_type() {
916INLINE
void PointerToBase<PandaNode>::update_type(
To *ptr) {}
918INLINE std::ostream &operator << (std::ostream &out,
const PandaNode &node) {
This class is used by the SceneGraphReducer to maintain and accumulate the set of attributes we have ...
Stores auxiliary data that may be piggybacked on the BamReader during each object's read pass.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
A single page of data maintained by a PipelineCycler.
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
The abstract interface to all kinds of lights.
void output(std::ostream &out) const
Outputs the Namable.
This is one component of a NodePath.
const TransformState * get_transform() const
Returns the transform that has been set on this particular node.
int find_stashed(PandaNode *node) const
Returns the index of the indicated stashed node, if it is a stashed child, or -1 if it is not.
int get_child_sort(int n) const
Returns the sort index of the nth child node of this node (that is, the number that was passed to add...
void release()
Releases the lock on this object.
const RenderEffects * get_effects() const
Returns the complete RenderEffects that will be applied to this node.
const BoundingVolume * get_bounds() const
Returns the external bounding volume of this node: a bounding volume that contains the user bounding ...
PandaNode * get_child(int n) const
Returns the nth child node of this node.
const RenderState * get_state() const
Returns the complete RenderState that will be applied to all nodes at this level and below,...
PandaNode * get_stashed(int n) const
Returns the nth stashed child of this node.
void check_cached(bool update_bounds) const
Ensures that the draw masks etc.
PandaNode * get_parent(int n) const
Returns the nth parent node of this node.
int get_stashed_sort(int n) const
Returns the sort index of the nth stashed node of this node (that is, the number that was passed to a...
int get_num_children() const
Returns the number of child nodes this node has.
int get_num_parents() const
Returns the number of parent nodes this node has.
const TransformState * get_prev_transform() const
Returns the transform that has been set as this node's "previous" position.
void compose_draw_mask(DrawMask &running_draw_mask) const
Computes the result of applying this node's draw masks to a running draw mask, as during a traversal.
int get_num_stashed() const
Returns the number of stashed nodes this node has.
bool has_tag(const std::string &key) const
Returns true if a value has been defined on this node for the particular key (even if that value is t...
bool compare_draw_mask(DrawMask running_draw_mask, DrawMask camera_mask) const
Compares the running draw mask computed during a traversal with this node's net draw masks.
PandaNode::Parents get_parents() const
Returns an object that can be used to walk through the list of parents of the node,...
std::string get_tag(const std::string &key) const
Retrieves the user-defined value that was previously set on this node for the particular key,...
PandaNode::Children get_children() const
Returns an object that can be used to walk through the list of children of the node.
CollideMask get_net_collide_mask() const
Returns the union of all into_collide_mask() values set at CollisionNodes at this level and below.
int get_nested_vertices() const
Returns the total number of vertices that will be rendered by this node and all of its descendents.
const RenderAttrib * get_off_clip_planes() const
Returns a ClipPlaneAttrib which represents the union of all of the clip planes that have been turned ...
CollideMask get_into_collide_mask() const
Returns the "into" collide mask for this node.
int get_fancy_bits() const
Returns the union of all of the enum FancyBits values corresponding to the various "fancy" attributes...
int find_child(PandaNode *node) const
Returns the index of the indicated child node, if it is a child, or -1 if it is not.
bool is_final() const
Returns the current state of the "final" flag.
int find_parent(PandaNode *node) const
Returns the index of the indicated parent node, if it is a parent, or -1 if it is not.
int get_child_sort(size_t n) const
Returns the sort index of the nth child node of this node (that is, the number that was passed to add...
PandaNode * get_child(size_t n) const
Returns the nth child of the node.
size_t get_num_children() const
Returns the number of children of the node.
void set_child(PandaNode *child)
This is only called by PandaNode::replace_child().
PandaNode * get_parent(size_t n) const
Returns the nth parent of the node.
size_t get_num_parents() const
Returns the number of parents of the node.
PandaNode * get_stashed(size_t n) const
Returns the nth stashed child of the node.
int get_stashed_sort(size_t n) const
Returns the sort index of the nth child node of this node (that is, the number that was passed to add...
size_t get_num_stashed() const
Returns the number of stashed children of the node.
A basic node of the scene graph or data graph.
void copy_children(PandaNode *other, Thread *current_thread=Thread::get_current_thread())
Makes another instance of all the children of the other node, copying them to this node.
void write_recorder(BamWriter *manager, Datagram &dg)
This method is provided for the benefit of classes (like MouseRecorder) that inherit from PandaMode a...
DrawMask get_net_draw_control_mask() const
Returns the set of bits in get_net_draw_show_mask() that have been explicitly set via adjust_draw_mas...
virtual bool preserve_name() const
Returns true if the node's name has extrinsic meaning and must be preserved across a flatten operatio...
bool replace_child(PandaNode *orig_child, PandaNode *new_child, Thread *current_thread=Thread::get_current_thread())
Searches for the orig_child node in the node's list of children, and replaces it with the new_child i...
get_draw_control_mask
Returns the set of bits in draw_show_mask that are considered meaningful.
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
is_final
Returns the current state of the "final" flag.
virtual bool is_geom_node() const
A simple downcast check.
void get_tag_keys(vector_string &keys) const
Fills the given vector up with the list of tags on this PandaNode.
virtual PandaNode * combine_with(PandaNode *other)
Collapses this PandaNode with the other PandaNode, if possible, and returns a pointer to the combined...
virtual int get_next_visible_child(int n) const
Returns the index number of the next visible child of this node following the indicated child,...
int count_num_descendants() const
Returns the number of nodes at and below this level.
bool unstash_child(PandaNode *child_node, Thread *current_thread=Thread::get_current_thread())
Returns the indicated stashed node to normal child status.
virtual bool has_single_child_visibility() const
Should be overridden by derived classes to return true if this kind of node has the special property ...
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
virtual int get_unsafe_to_apply_attribs() const
Returns the union of all attributes from SceneGraphReducer::AttribTypes that may not safely be applie...
virtual int get_visible_child() const
Returns the index number of the currently visible child of this node.
set_tag
Associates a user-defined value with a user-defined key which is stored on the node.
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of PandaNode by calling the xf...
DrawMask get_net_draw_show_mask() const
Returns the union of all draw_show_mask values–of renderable nodes only– at this level and below.
void reset_prev_transform(Thread *current_thread=Thread::get_current_thread())
Resets the transform that represents this node's "previous" position to the same as the current trans...
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
get_nested_vertices
Returns the total number of vertices that will be rendered by this node and all of its descendents.
CollideMask get_net_collide_mask(Thread *current_thread=Thread::get_current_thread()) const
Returns the union of all into_collide_mask() values set at CollisionNodes at this level and below.
is_overall_hidden
Returns true if the node has been hidden to all cameras by clearing its overall bit.
set_overall_hidden
Sets or clears the hidden flag.
void remove_all_children(Thread *current_thread=Thread::get_current_thread())
Removes all the children from the node at once, including stashed children.
int find_stashed(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated stashed node, if it is a stashed child, or -1 if it is not.
void mark_internal_bounds_stale(Thread *current_thread=Thread::get_current_thread())
Should be called by a derived class to mark the internal bounding volume stale, so that compute_inter...
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
static void reset_all_prev_transform(Thread *current_thread=Thread::get_current_thread())
Visits all nodes in the world with the _dirty_prev_transform flag–that is, all nodes whose _prev_tran...
virtual bool safe_to_combine_children() const
Returns true if it is generally safe to combine the children of this PandaNode with each other.
virtual bool safe_to_modify_transform() const
Returns true if it is safe to automatically adjust the transform on this kind of node.
void remove_stashed(int child_index, Thread *current_thread=Thread::get_current_thread())
Removes the nth stashed child from the node.
get_num_parents
Returns the number of parent nodes this node has.
get_all_camera_mask
Returns a DrawMask that is appropriate for rendering to all cameras.
get_legal_collide_mask
Returns the subset of CollideMask bits that may be set for this particular type of PandaNode.
int find_child(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated child node, if it is a child, or -1 if it is not.
void set_bounds(const BoundingVolume *volume)
Resets the bounding volume so that it is the indicated volume.
set_effects
Sets the complete RenderEffects that will be applied this node.
void remove_child(int child_index, Thread *current_thread=Thread::get_current_thread())
Removes the nth child from the node.
get_into_collide_mask
Returns the "into" collide mask for this node.
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
get_parents
Returns an object that can be used to walk through the list of parents of the node,...
get_num_stashed
Returns the number of stashed nodes this node has.
void adjust_draw_mask(DrawMask show_mask, DrawMask hide_mask, DrawMask clear_mask)
Adjusts the hide/show bits of this particular node.
get_draw_show_mask
Returns the hide/show bits of this particular node.
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so.
bool is_under_scene_root() const
Returns true if this particular node is in a live scene graph: that is, it is a child or descendent o...
virtual int get_first_visible_child() const
Returns the index number of the first visible child of this node, or a number >= get_num_children() i...
get_child
Returns the nth child node of this node.
void copy_all_properties(PandaNode *other)
Copies the TransformState, RenderState, RenderEffects, tags, Python tags, and the show/hide state fro...
virtual bool safe_to_flatten_below() const
Returns true if a flatten operation may safely continue past this node, or false if nodes below this ...
virtual PandaNode * dupe_for_flatten() const
This is similar to make_copy(), but it makes a copy for the specific purpose of flatten.
ConstPointerTo< BoundingVolume > get_bounds(Thread *current_thread=Thread::get_current_thread()) const
Returns the external bounding volume of this node: a bounding volume that contains the user bounding ...
set_state
Sets the complete RenderState that will be applied to all nodes at this level and below.
virtual bool has_selective_visibility() const
Should be overridden by derived classes to return true if this kind of node has some restrictions on ...
set_transform
Sets the transform that will be applied to this node and below.
void prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state)
Walks through the scene graph beginning at this node, and does whatever initialization is required to...
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
virtual void apply_attribs_to_vertices(const AccumulatedAttribs &attribs, int attrib_types, GeomTransformer &transformer)
Applies whatever attributes are specified in the AccumulatedAttribs object (and by the attrib_types b...
bool is_scene_root() const
Returns true if this particular node is known to be the render root of some active DisplayRegion asso...
virtual bool is_lod_node() const
A simple downcast check.
bool stash_child(PandaNode *child_node, Thread *current_thread=Thread::get_current_thread())
Stashes the indicated child node.
void add_stashed(PandaNode *child_node, int sort=0, Thread *current_thread=Thread::get_current_thread())
Adds a new child to the node, directly as a stashed child.
void add_child(PandaNode *child_node, int sort=0, Thread *current_thread=Thread::get_current_thread())
Adds a new child to the node.
virtual bool is_collision_node() const
A simple downcast check.
get_internal_vertices
Returns the total number of vertices that will be rendered by this particular node alone,...
virtual ConstPointerTo< TransformState > calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, bool &found_any, const TransformState *transform, Thread *current_thread=Thread::get_current_thread()) const
This is used to support NodePath::calc_tight_bounds().
void list_tags(std::ostream &out, const std::string &separator="\n") const
Writes a list of all the tag keys assigned to the node to the indicated stream.
static void set_scene_root_func(SceneRootFunc *func)
This is used by the GraphicsEngine to hook in a pointer to the scene_root_func(), the function to det...
clear_tag
Removes the value defined for this key on this particular node.
void copy_tags(PandaNode *other)
Copies all of the tags stored on the other node onto this node.
void set_prev_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Sets the transform that represents this node's "previous" position, one frame ago,...
void set_bound(const BoundingVolume *volume)
virtual bool is_ambient_light() const
Returns true if this is an AmbientLight, false if it is not a light, or it is some other kind of ligh...
int find_parent(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated parent node, if it is a parent, or -1 if it is not.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
int get_child_sort(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns the sort index of the nth child node of this node (that is, the number that was passed to add...
void set_attrib(const RenderAttrib *attrib, int override=0)
Adds the indicated render attribute to the scene graph on this node.
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,...
get_stashed
Returns the nth stashed child of this node.
void clear_bounds()
Reverses the effect of a previous call to set_bounds(), and allows the node's bounding volume to be a...
set_into_collide_mask
Sets the "into" CollideMask.
get_children
Returns an object that can be used to walk through the list of children of the node.
get_bounds_type
Returns the bounding volume type set with set_bounds_type().
void replace_node(PandaNode *other)
Inserts this node into the scene graph in place of the other one, and removes the other node.
void mark_bounds_stale(Thread *current_thread=Thread::get_current_thread()) const
Indicates that the bounding volume, or something that influences the bounding volume (or any of the o...
void steal_children(PandaNode *other, Thread *current_thread=Thread::get_current_thread())
Moves all the children from the other node onto this node.
int compare_tags(const PandaNode *other) const
Returns a number less than 0, 0, or greater than 0, to indicate the similarity of tags between this n...
get_internal_bounds
Returns the node's internal bounding volume.
set_bounds_type
Specifies the desired type of bounding volume that will be created for this node.
PointerTo< PandaNode > copy_subgraph(Thread *current_thread=Thread::get_current_thread()) const
Allocates and returns a complete copy of this PandaNode and the entire scene graph rooted at this Pan...
ConstPointerTo< RenderAttrib > get_off_clip_planes(Thread *current_thread=Thread::get_current_thread()) const
Returns a ClipPlaneAttrib which represents the union of all of the clip planes that have been turned ...
int get_stashed_sort(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns the sort index of the nth stashed node of this node (that is, the number that was passed to a...
virtual Light * as_light()
Cross-casts the node to a Light pointer, if it is one of the four kinds of Light nodes,...
get_parent
Returns the nth parent node of this node.
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...
get_num_children
Returns the number of child nodes this node has.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the base class for a number of special render effects that may be set on scene graph nodes to...
This represents a unique collection of RenderEffect objects that correspond to a particular renderabl...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
A thread; that is, a lightweight process.
get_current_thread
Returns a pointer to the currently-executing Thread object.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void update_bam_nested(BamWriter *manager)
Called by the BamWriter when this object has not itself been modified recently, but it should check i...
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 int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
This is a sequence number that increments monotonically.
A specialization of ordered_vector that emulates a standard STL set: many copies of each element are ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.