16 #include "eggPrimitive.h"
17 #include "eggVertexPool.h"
48 template<
class FunctionObject>
50 split_vertex(
EggVertex *vert,
const FunctionObject &sequence) {
52 vert->test_pref_integrity();
53 vert->test_gref_integrity();
72 Prims::const_iterator pri;
73 for (pri = prims.begin(); pri != prims.end(); ++pri) {
77 int seq = sequence(prim);
83 Sequences::const_iterator si = _sequences.find(seq);
85 if (si != _sequences.end()) {
88 new_vert = (*si).second;
95 _sequences[seq] = new_vert;
99 EggVertex::GroupRef::const_iterator gri;
107 EggPrimitive::iterator pi;
108 for (pi = prim->begin(); pi != prim->end(); ++pi) {
118 vert->test_pref_integrity();
119 vert->test_gref_integrity();
121 Sequences::const_iterator si;
122 for (si = _sequences.begin();
123 si != _sequences.end();
126 new_vert->test_gref_integrity();
127 new_vert->test_pref_integrity();
A base class for any of a number of kinds of geometry primitives: polygons, point lights...
bool test_ref_count_integrity() const
Does some easy checks to make sure that the reference count isn't completely bogus.
PrimitiveRef::const_iterator pref_end() const
Returns an iterator that can, in conjunction with pref_begin(), be used to traverse the entire set of...
This is our own Panda specialization on the default STL map.
EggVertex * add_vertex(EggVertex *vertex, int index=-1)
Adds the indicated vertex to the pool.
PrimitiveRef::const_iterator pref_begin() const
Returns an iterator that can, in conjunction with pref_end(), be used to traverse the entire set of p...
GroupRef::const_iterator gref_end() const
Returns an iterator that can, in conjunction with gref_begin(), be used to traverse the entire set of...
GroupRef::const_iterator gref_begin() const
Returns an iterator that can, in conjunction with gref_end(), be used to traverse the entire set of g...
This is our own Panda specialization on the default STL vector.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
PrimitiveRef::size_type pref_size() const
Returns the number of elements between pref_begin() and pref_end().
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal...
double get_vertex_membership(const EggVertex *vert) const
Returns the amount of membership of the indicated vertex in this group.
void ref_vertex(EggVertex *vert, double membership=1.0)
Adds the vertex to the set of those referenced by the group, at the indicated membership level...
void replace(iterator position, EggVertex *vertex)
Replaces the vertex at the indicated position with the indicated vertex.
EggVertexPool * get_pool() const
Returns the vertex pool this vertex belongs in.
A collection of vertices.