37 CDReader cdata(_cycler);
38 return cdata->get_geoms()->size();
48get_geom(
int n)
const {
49 CDReader cdata(_cycler);
50 CPT(GeomList) geoms = cdata->get_geoms();
51 nassertr(n >= 0 && n < (
int)geoms->size(),
nullptr);
52 return (*geoms)[n]._geom.get_read_pointer();
67INLINE PT(
Geom) GeomNode::
69 CDWriter cdata(_cycler,
true);
70 PT(GeomList) geoms = cdata->modify_geoms();
71 nassertr(n >= 0 && n < (
int)geoms->size(),
nullptr);
73 return (*geoms)[n]._geom.get_write_pointer();
84 CDReader cdata(_cycler);
85 CPT(GeomList) geoms = cdata->get_geoms();
86 nassertr(n >= 0 && n < (
int)geoms->size(),
nullptr);
87 return (*geoms)[n]._state;
103 CDWriter cdata(_cycler,
true);
104 PT(GeomList) geoms = cdata->modify_geoms();
105 nassertv(n >= 0 && n < (
int)geoms->size());
106 (*geoms)[n]._state = state;
114 CDWriter cdata(_cycler);
115 PT(GeomList) geoms = cdata->modify_geoms();
116 nassertv(n >= 0 && n < (
int)geoms->size());
118 geoms->erase(geoms->begin() + n);
127 CDWriter cdata(_cycler);
128 cdata->set_geoms(
new GeomList);
137 return default_geom_node_collide_mask;
143INLINE
void GeomNode::
144count_name(GeomNode::NameCount &name_count,
const InternalName *name) {
145 std::pair<NameCount::iterator, bool> result =
146 name_count.insert(NameCount::value_type(name, 1));
147 if (!result.second) {
148 (*result.first).second++;
156get_name_count(
const GeomNode::NameCount &name_count,
const InternalName *name) {
157 NameCount::const_iterator ni;
158 ni = name_count.find(name);
159 if (ni != name_count.end()) {
178 CDReader cdata(_cycler, current_thread);
185INLINE GeomNode::GeomEntry::
195INLINE GeomNode::CData::
204INLINE CPT(GeomNode::GeomList) GeomNode::CData::
206 return _geoms.get_read_pointer();
212INLINE PT(GeomNode::GeomList) GeomNode::CData::
214 return _geoms.get_write_pointer();
220INLINE
void GeomNode::CData::
221set_geoms(GeomNode::GeomList *geoms) {
228INLINE GeomNode::Geoms::
235INLINE GeomNode::Geoms::
236Geoms(
const GeomNode::CData *cdata) :
244INLINE GeomNode::Geoms::
253INLINE
void GeomNode::Geoms::
255 _geoms = copy._geoms;
261INLINE GeomNode::Geoms::
262Geoms(GeomNode::Geoms &&from) noexcept :
263 _geoms(std::move(from._geoms))
270INLINE
void GeomNode::Geoms::
271operator = (GeomNode::Geoms &&from)
noexcept {
272 _geoms = std::move(from._geoms);
280 nassertr(!_geoms.is_null(), 0);
281 return _geoms->size();
288INLINE CPT(
Geom) GeomNode::Geoms::
289get_geom(
int n)
const {
290 nassertr(!_geoms.is_null(),
nullptr);
291 nassertr(n >= 0 && n < (
int)_geoms->size(),
nullptr);
292 return (*_geoms)[n]._geom.get_read_pointer();
302get_geom_state(
int n)
const {
303 nassertr(!_geoms.is_null(),
nullptr);
304 nassertr(n >= 0 && n < (
int)_geoms->size(),
nullptr);
305 return (*_geoms)[n]._state;
int get_num_geoms() const
Returns the number of geoms of the node.
A node that holds Geom objects, renderable pieces of geometry.
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 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.
get_default_collide_mask
Returns the default into_collide_mask assigned to new GeomNodes.
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 get_preserved() const
Returns the "preserved" flag.
A container for geometry primitives.
Encodes a string name in a hash table, mapping it to a pointer.
void mark_internal_bounds_stale(Thread *current_thread=Thread::get_current_thread())
Should be called by a derived class to mark the internal bounding volume stale, so that compute_inter...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
A thread; that is, a lightweight process.