36 explicit GeomNode(
const std::string &name);
46 virtual void xform(
const LMatrix4 &mat);
49 calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point,
52 Thread *current_thread)
const;
66 INLINE
void set_preserved(
bool value);
67 INLINE
bool get_preserved()
const;
69 INLINE
int get_num_geoms()
const;
70 INLINE CPT(
Geom) get_geom(
int n)
const;
71 MAKE_SEQ(get_geoms, get_num_geoms, get_geom);
72 INLINE PT(
Geom) modify_geom(
int n);
73 MAKE_SEQ(modify_geoms, get_num_geoms, modify_geom);
74 INLINE
const RenderState *get_geom_state(
int n)
const;
75 MAKE_SEQ(get_geom_states, get_num_geoms, get_geom_state);
76 INLINE
void set_geom_state(
int n,
const RenderState *state);
78 void add_geom(
Geom *geom,
const RenderState *state = RenderState::make_empty());
79 void add_geoms_from(
const GeomNode *other);
80 void set_geom(
int n,
Geom *geom);
81 INLINE
void remove_geom(
int n);
82 INLINE
void remove_all_geoms();
83 bool check_valid()
const;
86 void unify(
int max_indices,
bool preserve_order);
88 void write_geoms(std::ostream &out,
int indent_level)
const;
89 void write_verbose(std::ostream &out,
int indent_level)
const;
91 INLINE
static CollideMask get_default_collide_mask();
92 MAKE_PROPERTY(default_collide_mask, get_default_collide_mask);
95 virtual void output(std::ostream &out)
const;
104 virtual void r_mark_geom_bounds_stale(
Thread *current_thread);
105 virtual void compute_internal_bounds(CPT(
BoundingVolume) &internal_bounds,
106 int &internal_vertices,
108 Thread *current_thread)
const;
131 class EXPCL_PANDA_PGRAPH CData :
public CycleData {
134 CData(
const CData ©);
140 return GeomNode::get_class_type();
143 INLINE CPT(GeomList) get_geoms()
const;
144 INLINE PT(GeomList) modify_geoms();
145 INLINE
void set_geoms(GeomList *geoms);
148 COWPT(GeomList) _geoms;
165 INLINE
Geoms(
const CData *cdata);
169 INLINE
void operator = (
const Geoms ©);
170 INLINE
void operator = (
Geoms &&from) noexcept;
172 INLINE
int get_num_geoms()
const;
173 INLINE CPT(
Geom) get_geom(
int n)
const;
174 INLINE
const RenderState *get_geom_state(
int n)
const;
180 INLINE
Geoms get_geoms(
Thread *current_thread = Thread::get_current_thread())
const;
191 static void register_with_read_factory();
194 virtual void finalize(
BamReader *manager);
204 static void init_type() {
205 GeomList::init_type();
206 PandaNode::init_type();
208 PandaNode::get_class_type());
211 return get_class_type();
213 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL map.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
virtual PandaNode * combine_with(PandaNode *other)
Collapses this PandaNode with the other PandaNode, if possible, and returns a pointer to the combined...
This class is similar to CycleDataWriter, except it allows writing to a particular stage of the pipel...
A single page of data maintained by a PipelineCycler.
Base class for objects that can be written to and read from Bam files.
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.
virtual TypeHandle get_parent_type() const
Returns the type of the container that owns the CycleData.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is our own Panda specialization on the default STL list.
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 void r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, GeomTransformer &transformer, Thread *current_thread)
The recursive implementation of prepare_scene().
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so.
virtual void write_datagram(BamWriter *, Datagram &) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
This class is used by the SceneGraphReducer to maintain and accumulate the set of attributes we have ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A container for geometry primitives.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
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,...
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 template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
This class is similar to CycleDataLockedReader, except it allows reading from a particular stage of t...
Encodes a string name in a hash table, mapping it to a pointer.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
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...
This class is similar to CycleDataReader, except it allows reading from a particular stage of the pip...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A thread; that is, a lightweight process.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is similar to RefCountObj, but it implements a CopyOnWriteObject inheritance instead of a Refere...
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool is_geom_node() const
A simple downcast check.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
A node that holds Geom objects, renderable pieces of geometry.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...