67 explicit PandaNode(
const std::string &name);
78 virtual PandaNode *dupe_for_flatten()
const;
80 virtual bool safe_to_flatten()
const;
81 virtual bool safe_to_transform()
const;
82 virtual bool safe_to_modify_transform()
const;
83 virtual bool safe_to_combine()
const;
84 virtual bool safe_to_combine_children()
const;
85 virtual bool safe_to_flatten_below()
const;
86 virtual bool preserve_name()
const;
87 virtual int get_unsafe_to_apply_attribs()
const;
91 virtual void xform(
const LMatrix4 &mat);
94 calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point,
100 virtual bool has_selective_visibility()
const;
101 virtual int get_first_visible_child()
const;
102 virtual int get_next_visible_child(
int n)
const;
103 virtual bool has_single_child_visibility()
const;
104 virtual int get_visible_child()
const;
105 virtual bool is_renderable()
const;
112 EXTENSION(PT(
PandaNode) __copy__()
const);
113 EXTENSION(PyObject *__deepcopy__(PyObject *
self, PyObject *memo)
const);
118 MAKE_SEQ(get_parents, get_num_parents, get_parent);
124 MAKE_SEQ(get_children, get_num_children, get_child);
126 int count_num_descendants()
const;
128 void add_child(
PandaNode *child_node,
int sort = 0,
135 INLINE
bool stash_child(
PandaNode *child_node,
137 void stash_child(
int child_index,
139 INLINE
bool unstash_child(
PandaNode *child_node,
141 void unstash_child(
int stashed_index,
148 MAKE_SEQ(get_stashed, get_num_stashed, get_stashed);
157 void set_attrib(
const RenderAttrib *attrib,
int override = 0);
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;
173 MAKE_PROPERTY(state, get_state, set_state);
178 MAKE_PROPERTY(effects, get_effects, set_effects);
183 MAKE_PROPERTY(transform, get_transform, set_transform);
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,
198 void clear_tag(
const std::string &key,
202 void get_tag_keys(vector_string &keys)
const;
203 INLINE
size_t get_num_tags()
const;
204 INLINE std::string get_tag_key(
size_t i)
const;
207 MAKE_MAP_PROPERTY(tags, has_tag, get_tag, set_tag, clear_tag);
208 MAKE_MAP_KEYS_SEQ(tags, get_num_tags, get_tag_key);
210 EXTENSION(PyObject *get_tag_keys()
const);
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;
226 int compare_tags(
const PandaNode *other)
const;
228 void copy_all_properties(
PandaNode *other);
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);
247 MAKE_PROPERTY(all_camera_mask, get_all_camera_mask);
248 MAKE_PROPERTY(overall_hidden, is_overall_hidden, set_overall_hidden);
250 void adjust_draw_mask(
DrawMask show_mask,
253 INLINE
DrawMask get_draw_control_mask()
const;
254 INLINE
DrawMask get_draw_show_mask()
const;
255 MAKE_PROPERTY(draw_control_mask, get_draw_control_mask);
256 MAKE_PROPERTY(draw_show_mask, get_draw_show_mask);
258 DrawMask get_net_draw_control_mask()
const;
259 DrawMask get_net_draw_show_mask()
const;
263 virtual CollideMask get_legal_collide_mask()
const;
264 MAKE_PROPERTY(into_collide_mask, get_into_collide_mask, set_into_collide_mask);
265 MAKE_PROPERTY(legal_collide_mask, get_legal_collide_mask);
272 bool is_scene_root()
const;
273 bool is_under_scene_root()
const;
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;
291 void set_bounds_type(BoundingVolume::BoundsType bounds_type);
292 BoundingVolume::BoundsType get_bounds_type()
const;
293 MAKE_PROPERTY(bounds_type, get_bounds_type);
297 INLINE
void clear_bounds();
303 MAKE_PROPERTY(nested_vertices, get_nested_vertices);
304 MAKE_PROPERTY(internal_bounds, get_internal_bounds);
305 MAKE_PROPERTY(internal_vertices, get_internal_vertices);
309 INLINE
bool is_bounds_stale()
const;
310 MAKE_PROPERTY(bounds_stale, is_bounds_stale);
312 INLINE
void set_final(
bool flag);
314 MAKE_PROPERTY(
final, is_final, set_final);
316 virtual bool is_geom_node()
const;
317 virtual bool is_lod_node()
const;
318 virtual bool is_collision_node()
const;
319 virtual Light *as_light();
320 virtual bool is_ambient_light()
const;
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();
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,
402 int pipeline_stage,
Thread *current_thread);
404 void quick_add_new_child(
PandaNode *child_node,
int sort,
407 INLINE
bool verify_child_no_cycles(
PandaNode *child_node);
415 int pipeline_stage,
Thread *current_thread);
420 int pipeline_stage,
Thread *current_thread);
423 bool as_stashed,
int pipeline_stage,
Thread *current_thread);
426 int pipeline_stage,
Thread *current_thread);
428 int pipeline_stage,
Thread *current_thread);
430 int pipeline_stage,
Thread *current_thread);
432 bool &ambiguity_detected,
433 int pipeline_stage,
Thread *current_thread);
436 int pipeline_stage,
Thread *current_thread);
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();
454 INLINE
int get_sort()
const;
470 INLINE BamReaderAuxDataDown();
474 return get_class_type();
476 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
482 static void init_type() {
483 BamReaderAuxData::init_type();
485 BamReaderAuxData::get_class_type());
492 class EXPCL_PANDA_PGRAPH UpConnection {
495 INLINE
bool operator < (
const UpConnection &other)
const;
510 typedef phash_set<NodePathComponent *, pointer_hash> Paths;
518 bool _dirty_prev_transform;
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);
552 return PandaNode::get_class_type();
567 INLINE
void set_fancy_bit(
int bits,
bool value);
580 DrawMask _draw_control_mask, _draw_show_mask;
588 BoundingVolume::BoundsType _bounds_type;
616 DrawMask _net_draw_control_mask, _net_draw_show_mask;
624 int _nested_vertices;
642 void write_up_list(
const Up &up_list,
644 void write_down_list(
const Down &down_list,
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,
650 int complete_down_list(Down &down_list,
const std::string &tag,
652 void fillin_up_list(Up &up_list,
const std::string &tag,
654 void fillin_down_list(Down &down_list,
const std::string &tag,
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;
675 static void init_type() {
690 int do_find_child(
PandaNode *node,
const Down *down)
const;
691 CDStageWriter update_cached(
bool update_bounds,
int pipeline_stage,
692 CDLockedStageReader &cdata);
709 INLINE
Children(
const CData *cdata);
713 INLINE
void operator = (
const Children ©);
714 INLINE
void operator = (
Children &&from) noexcept;
716 INLINE
size_t get_num_children()
const;
717 INLINE
PandaNode *get_child(
size_t n)
const;
718 INLINE
int get_child_sort(
size_t n)
const;
721 INLINE
PandaNode *operator [](
size_t n)
const {
return get_child(n); }
722 INLINE
size_t size()
const {
return get_num_children(); }
732 INLINE
Stashed(
const CData *cdata);
736 INLINE
void operator = (
const Stashed ©);
737 INLINE
void operator = (
Stashed &&from) noexcept;
739 INLINE
size_t get_num_stashed()
const;
740 INLINE
PandaNode *get_stashed(
size_t n)
const;
741 INLINE
int get_stashed_sort(
size_t n)
const;
744 INLINE
PandaNode *operator [](
size_t n)
const {
return get_stashed(n); }
745 INLINE
size_t size()
const {
return get_num_stashed(); }
755 INLINE
Parents(
const CData *cdata);
759 INLINE
void operator = (
const Parents ©);
760 INLINE
void operator = (
Parents &&from) noexcept;
762 INLINE
size_t get_num_parents()
const;
763 INLINE
PandaNode *get_parent(
size_t n)
const;
766 INLINE
PandaNode *operator [](
size_t n)
const {
return get_parent(n); }
767 INLINE
size_t size()
const {
return get_num_parents(); }
778 typedef bool SceneRootFunc(
const PandaNode *);
779 static void set_scene_root_func(SceneRootFunc *func);
782 MAKE_PROPERTY(children, get_children);
783 MAKE_PROPERTY(stashed, get_stashed);
784 MAKE_PROPERTY(parents, get_parents);
787 static SceneRootFunc *_scene_root_func;
790 static void register_with_read_factory();
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();
816 return get_class_type();
818 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
823 #ifndef DO_PIPELINING
850 INLINE
const PandaNode *get_node()
const;
851 INLINE
Thread *get_current_thread()
const;
853 INLINE
void release();
855 void check_cached(
bool update_bounds)
const;
857 INLINE
void compose_draw_mask(
DrawMask &running_draw_mask)
const;
858 INLINE
bool compare_draw_mask(
DrawMask running_draw_mask,
861 INLINE
int get_num_parents()
const;
862 INLINE
PandaNode *get_parent(
int n)
const;
863 INLINE
int find_parent(
PandaNode *node)
const;
865 INLINE
int get_num_children()
const;
866 INLINE
PandaNode *get_child(
int n)
const;
867 INLINE
int get_child_sort(
int n)
const;
868 INLINE
int find_child(
PandaNode *node)
const;
870 INLINE
int get_num_stashed()
const;
871 INLINE
PandaNode *get_stashed(
int n)
const;
872 INLINE
int get_stashed_sort(
int n)
const;
873 INLINE
int find_stashed(
PandaNode *node)
const;
880 INLINE std::string get_tag(
const std::string &key)
const;
881 INLINE
bool has_tag(
const std::string &key)
const;
886 INLINE
int get_nested_vertices()
const;
887 INLINE
bool is_final()
const;
888 INLINE
int get_fancy_bits()
const;
898 const PandaNode::CData *_cdata;
904 static void init_type() {
917 INLINE 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 the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
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,...
This class is similar to CycleDataLockedReader, except it allows reading from a particular stage of t...
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
This class is similar to CycleDataReader, except it allows reading from a particular stage of the pip...
This class is similar to CycleDataWriter, except it allows writing to a particular stage of the pipel...
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
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 ...
Converts an egg data structure, possibly read from an egg file but not necessarily,...
The default class template does not define any methods.
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...
A lightweight reentrant mutex.
The abstract interface to all kinds of lights.
This just stores the pointers to implement a doubly-linked list of some kind of object.
A base class for all things which can have a name.
void output(std::ostream &out) const
Outputs the Namable.
This is one component of a NodePath.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
A lightweight class that represents a single element that may be timed and/or counted via stats.
This class maintains a linked list of PandaNodes.
Encapsulates the data from a PandaNode, pre-fetched for one stage of the pipeline.
A basic node of the scene graph or data graph.
This is the base class for PointerTo and ConstPointerTo.
A base class for all things that want to be reference-counted.
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.
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
Base class for objects that can be written to and read from Bam files.
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.
This is a class designed to support low-overhead traversals of the complete scene graph,...
A specialization of ordered_vector that emulates a standard STL set: many copies of each element are ...
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
This is our own Panda specialization on the default STL list.
This is our own Panda specialization on the default STL map.
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.