48 return cdata->get_geoms()->size();
60 INLINE CPT(
Geom) GeomNode::
61 get_geom(
int n)
const {
63 CPT(
GeomList) geoms = cdata->get_geoms();
64 nassertr(n >= 0 && n < (
int)geoms->size(), NULL);
65 return (*geoms)[n]._geom.get_read_pointer();
86 INLINE PT(
Geom) GeomNode::
89 PT(
GeomList) geoms = cdata->modify_geoms();
90 nassertr(n >= 0 && n < (
int)geoms->size(), NULL);
91 mark_internal_bounds_stale();
92 return (*geoms)[n]._geom.get_write_pointer();
108 CPT(
GeomList) geoms = cdata->get_geoms();
109 nassertr(n >= 0 && n < (
int)geoms->size(), NULL);
110 return (*geoms)[n]._state;
133 PT(
GeomList) geoms = cdata->modify_geoms();
134 nassertv(n >= 0 && n < (
int)geoms->size());
135 (*geoms)[n]._state = state;
146 PT(
GeomList) geoms = cdata->modify_geoms();
147 nassertv(n >= 0 && n < (
int)geoms->size());
149 geoms->erase(geoms->begin() + n);
150 mark_internal_bounds_stale();
162 mark_internal_bounds_stale();
173 return default_geom_node_collide_mask;
181 INLINE
void GeomNode::
183 pair<NameCount::iterator, bool> result =
184 name_count.insert(NameCount::value_type(name, 1));
185 if (!result.second) {
186 (*result.first).second++;
195 INLINE
int GeomNode::
197 NameCount::const_iterator ni;
198 ni = name_count.find(name);
199 if (ni != name_count.end()) {
224 CDReader cdata(_cycler, current_thread);
233 INLINE GeomNode::GeomEntry::
245 INLINE GeomNode::CData::
258 return _geoms.get_read_pointer();
269 return _geoms.get_write_pointer();
277 INLINE
void GeomNode::CData::
287 INLINE GeomNode::Geoms::
296 INLINE GeomNode::Geoms::
297 Geoms(
const GeomNode::CData *cdata) :
298 _geoms(cdata->get_geoms())
307 INLINE GeomNode::Geoms::
318 INLINE
void GeomNode::Geoms::
320 _geoms = copy._geoms;
323 #ifdef USE_MOVE_SEMANTICS 329 INLINE GeomNode::Geoms::
331 _geoms(move(from._geoms))
340 INLINE
void GeomNode::Geoms::
342 _geoms = move(from._geoms);
344 #endif // USE_MOVE_SEMANTICS 353 nassertr(!_geoms.is_null(), 0);
354 return _geoms->size();
364 INLINE CPT(
Geom) GeomNode::Geoms::
365 get_geom(
int n)
const {
366 nassertr(!_geoms.is_null(), NULL);
367 nassertr(n >= 0 && n < (
int)_geoms->size(), NULL);
368 return (*_geoms)[n]._geom.get_read_pointer();
382 get_geom_state(
int n)
const {
383 nassertr(!_geoms.is_null(), NULL);
384 nassertr(n >= 0 && n < (
int)_geoms->size(), NULL);
385 return (*_geoms)[n]._state;
const RenderState * get_geom_state(int n) const
Returns the RenderState associated with the nth geom of the node.
This is our own Panda specialization on the default STL map.
static CollideMask get_default_collide_mask()
Returns the default into_collide_mask assigned to new GeomNodes.
int get_num_geoms() const
Returns the number of geoms in the node.
int get_num_geoms() const
Returns the number of geoms of the node.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
bool get_preserved() const
Returns the "preserved" flag.
void remove_geom(int n)
Removes the nth geom from the node.
A container for geometry primitives.
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
A thread; that is, a lightweight process.
This is similar to RefCountObj, but it implements a CopyOnWriteObject inheritance instead of a Refere...
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 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.
void remove_all_geoms()
Removes all the geoms from the node at once.