34class EXPCL_PANDA_PGRAPH GeomNode :
public PandaNode {
36 explicit GeomNode(
const std::string &name);
39 GeomNode(
const GeomNode ©);
45 GeomTransformer &transformer);
46 virtual void xform(
const LMatrix4 &mat);
52 Thread *current_thread)
const;
62 GeomTransformer &transformer,
70 INLINE CPT(
Geom) get_geom(
int n)
const;
72 INLINE PT(
Geom) modify_geom(
int n);
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;
95 virtual void output(std::ostream &out)
const;
101 GeomTransformer &transformer);
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;
125 typedef pmap<const InternalName *, int> NameCount;
127 INLINE
void count_name(NameCount &name_count,
const InternalName *name);
128 INLINE
int get_name_count(
const NameCount &name_count,
const InternalName *name);
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;
151 PipelineCycler<CData> _cycler;
152 typedef CycleDataReader<CData> CDReader;
153 typedef CycleDataWriter<CData> CDWriter;
154 typedef CycleDataStageReader<CData> CDStageReader;
155 typedef CycleDataLockedStageReader<CData> CDLockedStageReader;
156 typedef CycleDataStageWriter<CData> CDStageWriter;
162 class EXPCL_PANDA_PGRAPH Geoms {
165 INLINE Geoms(
const CData *cdata);
166 INLINE Geoms(
const Geoms ©);
167 INLINE Geoms(Geoms &&from)
noexcept;
169 INLINE
void operator = (
const Geoms ©);
170 INLINE
void operator = (Geoms &&from)
noexcept;
173 INLINE CPT(
Geom) get_geom(
int n)
const;
174 INLINE
const RenderState *get_geom_state(
int n)
const;
177 CPT(GeomList) _geoms;
197 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
204 static void init_type() {
205 GeomList::init_type();
206 PandaNode::init_type();
208 PandaNode::get_class_type());
210 virtual TypeHandle get_type()
const {
211 return get_class_type();
213 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
216 static TypeHandle _type_handle;
218 friend class GeomTransformer;
This class is used by the SceneGraphReducer to maintain and accumulate the set of attributes we have ...
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 is similar to RefCountObj, but it implements a CopyOnWriteObject inheritance instead of a Refere...
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...
int get_num_geoms() const
Returns the number of geoms of the node.
void add_geoms_from(const GeomNode *other)
Copies the Geoms (and their associated RenderStates) from the indicated GeomNode into this one.
void do_premunge(GraphicsStateGuardianBase *gsg, const RenderState *node_state, GeomTransformer &transformer)
Uses the indicated GSG to premunge the Geoms in this node to optimize them for eventual rendering.
void write_geoms(std::ostream &out, int indent_level) const
Writes a short description of all the Geoms in the node.
void add_geom(Geom *geom, const RenderState *state=RenderState::make_empty())
Adds a new Geom to the node.
get_num_geoms
Returns the number of geoms in the node.
Geoms get_geoms(Thread *current_thread=Thread::get_current_thread()) const
Returns an object that can be used to walk through the list of geoms of the node.
void unify(int max_indices, bool preserve_order)
Attempts to unify all of the Geoms contained within this node into a single Geom, or at least as few ...
void remove_all_geoms()
Removes all the geoms from the node at once.
void remove_geom(int n)
Removes the nth geom from the node.
get_geom_state
Returns the RenderState associated with the nth geom of the node.
void set_geom(int n, Geom *geom)
Replaces the nth Geom of the node with a new pointer.
get_default_collide_mask
Returns the default into_collide_mask assigned to new GeomNodes.
void write_verbose(std::ostream &out, int indent_level) const
Writes a detailed description of all the Geoms in the node.
void set_geom_state(int n, const RenderState *state)
Changes the RenderState associated with the nth geom of the node.
void set_preserved(bool value)
Sets the "preserved" flag.
bool check_valid() const
Verifies that the each Geom within the GeomNode reference vertices that actually exist within its Geo...
void decompose()
Calls decompose() on each Geom with the GeomNode.
bool get_preserved() const
Returns the "preserved" flag.
A container for geometry primitives.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
Encodes a string name in a hash table, mapping it to a pointer.
virtual bool is_geom_node() const
A simple downcast check.
virtual PandaNode * combine_with(PandaNode *other)
Collapses this PandaNode with the other PandaNode, if possible, and returns a pointer to the combined...
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 bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
get_legal_collide_mask
Returns the subset of CollideMask bits that may be set for this particular type of PandaNode.
virtual void r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, GeomTransformer &transformer, Thread *current_thread)
The recursive implementation of prepare_scene().
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
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 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...
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().
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
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 void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...
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 finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...
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 our own Panda specialization on the default STL list.
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(),...