Panda3D
Typedefs | Functions
eggUtilities.h File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#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 pmap< Filename, EggTexturesEggTextureFilenames
 
typedef pset< PT_EggTexture > EggTextures
 

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

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
1999-01-28

Definition in file eggUtilities.h.

Function Documentation

◆ get_textures_by_filename()

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 28 of file eggUtilities.cxx.

References TypedObject::is_of_type().

◆ split_vertex()

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.

See the more detailed comments in eggUtilities.I.

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 43 of file eggUtilities.I.

References EggVertexPool::add_vertex(), EggVertex::get_pool(), EggGroup::get_vertex_membership(), EggVertex::gref_begin(), EggVertex::gref_end(), EggVertex::pref_begin(), EggVertex::pref_end(), EggVertex::pref_size(), EggGroup::ref_vertex(), and ReferenceCount::test_ref_count_integrity().