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, set_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();}