18 #include "pandabase.h" 19 #include "config_pgraph.h" 20 #include "pandaNode.h" 21 #include "pointerToArray.h" 23 #include "pipelineCycler.h" 24 #include "cycleData.h" 26 #include "copyOnWritePointer.h" 51 virtual CPT(TransformState)
54 const TransformState *transform,
55 Thread *current_thread)
const;
69 INLINE
void set_preserved(
bool value);
70 INLINE
bool get_preserved()
const;
72 INLINE
int get_num_geoms()
const;
73 INLINE CPT(
Geom) get_geom(
int n)
const;
74 MAKE_SEQ(get_geoms, get_num_geoms, get_geom);
75 INLINE PT(
Geom) modify_geom(
int n);
76 MAKE_SEQ(modify_geoms, get_num_geoms, modify_geom);
77 INLINE
const RenderState *get_geom_state(
int n)
const;
78 MAKE_SEQ(get_geom_states, get_num_geoms, get_geom_state);
79 INLINE
void set_geom_state(
int n,
const RenderState *state);
81 void add_geom(
Geom *geom,
const RenderState *state = RenderState::make_empty());
82 void add_geoms_from(
const GeomNode *other);
83 void set_geom(
int n,
Geom *geom);
84 INLINE
void remove_geom(
int n);
85 INLINE
void remove_all_geoms();
86 bool check_valid()
const;
89 void unify(
int max_indices,
bool preserve_order);
91 void write_geoms(ostream &out,
int indent_level)
const;
92 void write_verbose(ostream &out,
int indent_level)
const;
94 INLINE
static CollideMask get_default_collide_mask();
97 virtual void output(ostream &out)
const;
106 virtual void r_mark_geom_bounds_stale(
Thread *current_thread);
107 virtual void compute_internal_bounds(CPT(
BoundingVolume) &internal_bounds,
108 int &internal_vertices,
110 Thread *current_thread)
const;
129 INLINE
void count_name(NameCount &name_count,
const InternalName *name);
130 INLINE
int get_name_count(
const NameCount &name_count,
const InternalName *name);
133 class EXPCL_PANDA_PGRAPH CData :
public CycleData {
136 CData(
const CData ©);
142 return GeomNode::get_class_type();
145 INLINE CPT(GeomList) get_geoms()
const;
146 INLINE PT(GeomList) modify_geoms();
147 INLINE
void set_geoms(GeomList *geoms);
150 COWPT(GeomList) _geoms;
168 INLINE Geoms(
const CData *cdata);
169 INLINE Geoms(
const Geoms ©);
170 INLINE
void operator = (
const Geoms ©);
172 #ifdef USE_MOVE_SEMANTICS 173 INLINE Geoms(Geoms &&from) NOEXCEPT;
174 INLINE
void operator = (Geoms &&from) NOEXCEPT;
177 INLINE
int get_num_geoms()
const;
178 INLINE CPT(
Geom) get_geom(
int n)
const;
179 INLINE
const RenderState *get_geom_state(
int n)
const;
182 CPT(GeomList) _geoms;
196 static void register_with_read_factory();
199 virtual void finalize(
BamReader *manager);
209 static void init_type() {
210 GeomList::init_type();
211 PandaNode::init_type();
212 register_type(_type_handle,
"GeomNode",
213 PandaNode::get_class_type());
216 return get_class_type();
218 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
226 #include "geomNode.I" A basic node of the scene graph or data graph.
virtual CollideMask get_legal_collide_mask() const
Returns the subset of CollideMask bits that may be set for this particular type of PandaNode...
This is our own Panda specialization on the default STL map.
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.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
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...
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
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...
This class is used by the SceneGraphReducer to maintain and accumulate the set of attributes we have ...
This is a 4-by-4 transform matrix.
A container for geometry primitives.
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, so that it will be drawn at render time.
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...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
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.
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.
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...