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

panda/src/egg/eggUtilities.h File Reference

#include <pandabase.h>
#include "eggTexture.h"
#include "pt_EggTexture.h"
#include <filename.h>
#include <pointerTo.h>
#include "pset.h"
#include "pmap.h"
#include "eggUtilities.I"

Go to the source code of this file.

Typedefs

typedef pset< PT_EggTextureEggTextures
typedef pmap< Filename, EggTexturesEggTextureFilenames

Functions

void get_textures_by_filename (const EggNode *node, EggTextureFilenames &result)
 Extracts from the egg subgraph beginning at the indicated node a set of all the texture objects referenced, grouped together by filename.

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.h.


Typedef Documentation

typedef pmap<Filename, EggTextures> EggTextureFilenames
 

Definition at line 51 of file eggUtilities.h.

typedef pset< PT_EggTexture > EggTextures
 

Definition at line 50 of file eggUtilities.h.


Function Documentation

void get_textures_by_filename const EggNode node,
EggTextureFilenames result
 

Extracts from the egg subgraph beginning at the indicated node a set of all the texture objects referenced, grouped together by filename.

Texture objects that share a common filename (but possibly differ in other properties) are returned together in the same element of the map.

Definition at line 45 of file eggUtilities.cxx.

References EggGroupNode::const_iterator.

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