Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/egg/eggUtilities.I File Reference

#include "eggGroup.h"
#include "eggPrimitive.h"
#include <algorithm>

Go to the source code of this file.

Functions

template<class FunctionObject> void split_vertex (EggVertex *vert, const FunctionObject &sequence)
 Splits a vertex into two or more vertices, each an exact copy of the original and in the same vertex pool.


Detailed Description

Definition in file eggUtilities.I.


Function Documentation

template<class FunctionObject>
void split_vertex EggVertex vert,
const FunctionObject &  sequence
 

Splits a vertex into two or more vertices, each an exact copy of the original and in the same vertex pool.

The splitting is based on some arbitrary property of the primitives that own the vertex. In the extreme, each primitive may get a different copy of the vertex, although it is also possible for some primitives to still share vertices.

This decision is made based on the function object 'sequence'. This object must define the following function:

int operator () (const EggPrimitive *prim) const;

This function returns a sequence number, which determines which primitives will share which vertices. The sequence number 0 refers to the original vertex pointer; other sequence numbers indicate new vertices. Other than that, the sequence number is totally arbitrary. Primitives for which the sequence number is the same will end up sharing the same copy of the vertex.

Definition at line 82 of file eggUtilities.I.

References EggVertexPool::add_vertex(), EggPrimitive::begin(), EggPrimitive::end(), EggGroup::get_vertex_membership(), EggVertex::gref_begin(), EggVertex::gref_end(), EggPrimitive::iterator, NULL, EggGroup::ref_vertex(), and EggPrimitive::replace().


Generated on Fri May 2 00:45:27 2003 for Panda by doxygen1.3