Fluxus::PolyPrimitive Class Reference

#include <PolyPrimitive.h>

Inheritance diagram for Fluxus::PolyPrimitive:

Inheritance graph
[legend]
Collaboration diagram for Fluxus::PolyPrimitive:

Collaboration graph
[legend]

Public Types

enum  Type {
  TRISTRIP, QUADS, TRILIST, TRIFAN,
  POLYGON
}

Public Member Functions

 PolyPrimitive (Type t=TRISTRIP)
 PolyPrimitive (const PolyPrimitive &other)
virtual ~PolyPrimitive ()
Type GetType ()
virtual void AddVertex (const dVertex &Vert)
Primitive Interface
virtual PolyPrimitiveClone () const
virtual void Render ()
virtual dBoundingBox GetBoundingBox ()
virtual void RecalculateNormals (bool smooth)
 Only makes sense for certain primitive types.
virtual void ApplyTransform (bool ScaleRotOnly=false)
virtual string GetTypeName ()
 This needs to be set appropriately for all derived types.
Topology functions
Functions to get topological information about the primitive. These are lazily computed and stored as they can take some time.

const vector< vector< int > > & GetConnectedVerts ()
const vector< vector< pair<
int, int > > > & 
GetUniqueEdges ()
const vector< dVector > & GetGeometricNormals ()
Indexed mode access
void SetIndexMode (bool s)
bool IsIndexed ()
vector< unsigned int > & GetIndex ()
void ConvertToIndexed ()

Protected Member Functions

virtual void PDataDirty ()
 Called when a named pdata mapping changes.
void GenerateTopology ()
void CalculateConnected ()
void CalculateGeometricNormals ()
void CalculateUniqueEdges ()
void UniqueEdgesFindShared (pair< int, int > edge, set< pair< int, int > > firstpass, set< pair< int, int > > &stored)
void RecalculateNormalsIndexed ()

Protected Attributes

vector< vector< int > > m_ConnectedVerts
vector< dVectorm_GeometricNormals
vector< vector< pair< int,
int > > > 
m_UniqueEdges
bool m_IndexMode
vector< unsigned int > m_IndexData
Type m_Type
vector< dVector > * m_VertData
vector< dVector > * m_NormData
vector< dColour > * m_ColData
vector< dVector > * m_TexData

Detailed Description

A Polygon primitive

Definition at line 29 of file PolyPrimitive.h.


Member Enumeration Documentation

enum Fluxus::PolyPrimitive::Type

Enumerator:
TRISTRIP 
QUADS 
TRILIST 
TRIFAN 
POLYGON 

Definition at line 32 of file PolyPrimitive.h.


Constructor & Destructor Documentation

PolyPrimitive::PolyPrimitive ( Type  t = TRISTRIP  ) 

Definition at line 26 of file PolyPrimitive.cpp.

PolyPrimitive::PolyPrimitive ( const PolyPrimitive other  ) 

Definition at line 39 of file PolyPrimitive.cpp.

PolyPrimitive::~PolyPrimitive (  )  [virtual]

Definition at line 48 of file PolyPrimitive.cpp.


Member Function Documentation

PolyPrimitive * PolyPrimitive::Clone (  )  const [virtual]

Implements Fluxus::Primitive.

Reimplemented in Fluxus::TextPrimitive.

Definition at line 52 of file PolyPrimitive.cpp.

void PolyPrimitive::Render (  )  [virtual]

Implements Fluxus::Primitive.

Reimplemented in Fluxus::TextPrimitive.

Definition at line 78 of file PolyPrimitive.cpp.

dBoundingBox PolyPrimitive::GetBoundingBox (  )  [virtual]

Implements Fluxus::Primitive.

Definition at line 513 of file PolyPrimitive.cpp.

void PolyPrimitive::RecalculateNormals ( bool  smooth  )  [virtual]

Only makes sense for certain primitive types.

Reimplemented from Fluxus::Primitive.

Definition at line 194 of file PolyPrimitive.cpp.

void PolyPrimitive::ApplyTransform ( bool  ScaleRotOnly = false  )  [virtual]

Implements Fluxus::Primitive.

Definition at line 523 of file PolyPrimitive.cpp.

virtual string Fluxus::PolyPrimitive::GetTypeName (  )  [inline, virtual]

This needs to be set appropriately for all derived types.

Reimplemented from Fluxus::Primitive.

Reimplemented in Fluxus::TextPrimitive.

Definition at line 46 of file PolyPrimitive.h.

Type Fluxus::PolyPrimitive::GetType (  )  [inline]

Definition at line 49 of file PolyPrimitive.h.

void PolyPrimitive::AddVertex ( const dVertex Vert  )  [virtual]

Definition at line 70 of file PolyPrimitive.cpp.

const vector<vector<int> >& Fluxus::PolyPrimitive::GetConnectedVerts (  )  [inline]

Connected verts is a list of lists of vertices which are coincident. If this polyprimitive is indexed the coincident verts are calculated by looking at the index values and the position of the index is stored, otherwise it's done by looking at the actual vertex positions, with a small allowed error, and the index is stored.

Definition at line 66 of file PolyPrimitive.h.

const vector<vector<pair<int,int> > >& Fluxus::PolyPrimitive::GetUniqueEdges (  )  [inline]

Unique edges is a list of coincident edges in the topology, formed by pairs of vert indexes, or index positions if the poly is indexed.

Definition at line 71 of file PolyPrimitive.h.

const vector<dVector>& Fluxus::PolyPrimitive::GetGeometricNormals (  )  [inline]

In indexed mode there is a geometric normal for every index

Definition at line 75 of file PolyPrimitive.h.

void Fluxus::PolyPrimitive::SetIndexMode ( bool  s  )  [inline]

Definition at line 81 of file PolyPrimitive.h.

bool Fluxus::PolyPrimitive::IsIndexed (  )  [inline]

Definition at line 82 of file PolyPrimitive.h.

vector<unsigned int>& Fluxus::PolyPrimitive::GetIndex (  )  [inline]

Definition at line 83 of file PolyPrimitive.h.

void PolyPrimitive::ConvertToIndexed (  ) 

Look at coincident verts and compress the poly primitive into an indexed form

Definition at line 254 of file PolyPrimitive.cpp.

void PolyPrimitive::PDataDirty (  )  [protected, virtual]

Called when a named pdata mapping changes.

Implements Fluxus::PDataContainer.

Definition at line 57 of file PolyPrimitive.cpp.

void PolyPrimitive::GenerateTopology (  )  [protected]

Definition at line 308 of file PolyPrimitive.cpp.

void PolyPrimitive::CalculateConnected (  )  [protected]

Definition at line 321 of file PolyPrimitive.cpp.

void PolyPrimitive::CalculateGeometricNormals (  )  [protected]

Definition at line 359 of file PolyPrimitive.cpp.

void PolyPrimitive::CalculateUniqueEdges (  )  [protected]

Definition at line 424 of file PolyPrimitive.cpp.

void PolyPrimitive::UniqueEdgesFindShared ( pair< int, int >  edge,
set< pair< int, int > >  firstpass,
set< pair< int, int > > &  stored 
) [protected]

Definition at line 466 of file PolyPrimitive.cpp.

void Fluxus::PolyPrimitive::RecalculateNormalsIndexed (  )  [protected]


Field Documentation

vector<vector<int> > Fluxus::PolyPrimitive::m_ConnectedVerts [protected]

Definition at line 102 of file PolyPrimitive.h.

vector<dVector> Fluxus::PolyPrimitive::m_GeometricNormals [protected]

Definition at line 103 of file PolyPrimitive.h.

vector<vector<pair<int,int> > > Fluxus::PolyPrimitive::m_UniqueEdges [protected]

Definition at line 104 of file PolyPrimitive.h.

bool Fluxus::PolyPrimitive::m_IndexMode [protected]

Definition at line 106 of file PolyPrimitive.h.

vector<unsigned int> Fluxus::PolyPrimitive::m_IndexData [protected]

Definition at line 107 of file PolyPrimitive.h.

Type Fluxus::PolyPrimitive::m_Type [protected]

Definition at line 109 of file PolyPrimitive.h.

vector<dVector>* Fluxus::PolyPrimitive::m_VertData [protected]

Definition at line 110 of file PolyPrimitive.h.

vector<dVector>* Fluxus::PolyPrimitive::m_NormData [protected]

Definition at line 111 of file PolyPrimitive.h.

vector<dColour>* Fluxus::PolyPrimitive::m_ColData [protected]

Definition at line 112 of file PolyPrimitive.h.

vector<dVector>* Fluxus::PolyPrimitive::m_TexData [protected]

Definition at line 113 of file PolyPrimitive.h.


The documentation for this class was generated from the following files:
Generated on Tue Sep 4 23:22:43 2007 for The Fluxus Renderer (libfluxus) by  doxygen 1.5.1