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

BuilderVertex Class Reference

The basic class for passing nonindexed vertices to the builder. More...

#include <builderVertex.h>

Inheritance diagram for BuilderVertex:

BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC > BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC > List of all members.

Public Types

typedef BuilderAttrib Attrib
typedef BuilderV VType
typedef BuilderN NType
typedef BuilderTC TType
typedef BuilderC CType

Public Member Functions

 BuilderVertex ()
 BuilderVertex (const BuilderV &c)
void set_coord_value (const BuilderV *array, ushort index)
 Reassigns the vertex coordinate, without knowing whether the vertex is indexed or nonindexed.

void set_normal_value (const BuilderN *array, ushort index)
 Reassigns the vertex normal, without knowing whether the vertex is indexed or nonindexed.

void set_texcoord_value (const BuilderTC *array, ushort index)
 Reassigns the vertex texture coordinate, without knowing whether the vertex is indexed or nonindexed.

void set_color_value (const BuilderC *array, ushort index)
 Reassigns the vertex color, without knowing whether the vertex is indexed or nonindexed.

BuilderV get_coord_value (const BuilderBucket &bucket) const
 Returns the actual coordinate value of the vertex, whether it is indexed or nonindexed.

BuilderN get_normal_value (const BuilderBucket &bucket) const
 Returns the actual normal value of the vertex, whether it is indexed or nonindexed.

BuilderTC get_texcoord_value (const BuilderBucket &bucket) const
 Returns the actual texture coordinate value of the vertex, whether it is indexed or nonindexed.

BuilderC get_color_value (const BuilderBucket &bucket) const
 Returns the actual color value of the vertex, whether it is indexed or nonindexed.

bool is_valid () const
BuilderVertexTemplclear ()
bool has_coord () const
VType get_coord () const
BuilderVertexTemplset_coord (const VType &c)
BuilderVertexTemplset_normal (const NType &c)
BuilderVertexTemplclear_normal ()
bool has_texcoord () const
TType get_texcoord () const
BuilderVertexTemplset_texcoord (const TType &t)
BuilderVertexTemplclear_texcoord ()
BuilderVertexTemplset_color (const CType &c)
BuilderVertexTemplclear_color ()
BuilderVertexTemplset_pixel_size (float s)
BuilderVertexTemplclear_pixel_size ()
bool operator== (const BuilderVertexTempl &other) const
bool operator== (const BuilderAttribTempl &other) const
bool operator!= (const BuilderVertexTempl &other) const
bool operator!= (const BuilderAttribTempl &other) const
bool operator< (const BuilderVertexTempl &other) const
bool operator< (const BuilderAttribTempl &other) const
int compare_to (const BuilderVertexTempl &other) const
int compare_to (const BuilderAttribTempl &other) const
ostream & output (ostream &out) const
bool has_normal () const
NType get_normal () const
bool has_color () const
CType get_color () const
bool has_pixel_size () const
float get_pixel_size () const

Protected Attributes

VType _coord
TType _texcoord
NType _normal
CType _color
float _pixel_size
int _flags

Detailed Description

The basic class for passing nonindexed vertices to the builder.

See the comments at the the head of this file, and in builder.h.

Look in builderVertexTempl.h and builderAttribTempl.h for most of the interface to BuilderVertex.

Definition at line 85 of file builderVertex.h.


Member Typedef Documentation

typedef BuilderAttrib BuilderVertex::Attrib
 

Definition at line 88 of file builderVertex.h.

typedef BuilderC BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::CType [inherited]
 

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

Definition at line 53 of file builderVertexTempl.h.

typedef BuilderN BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::NType [inherited]
 

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

Definition at line 51 of file builderVertexTempl.h.

typedef BuilderTC BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::TType [inherited]
 

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

Definition at line 52 of file builderVertexTempl.h.

typedef BuilderV BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::VType [inherited]
 

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

Definition at line 50 of file builderVertexTempl.h.


Constructor & Destructor Documentation

BuilderVertex::BuilderVertex  )  [inline]
 

Definition at line 90 of file builderVertex.h.

BuilderVertex::BuilderVertex const BuilderV c  )  [inline]
 

Definition at line 91 of file builderVertex.h.


Member Function Documentation

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::clear void   )  [inline, inherited]
 

Resets the vertex to its initial, empty state.

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::clear_color  )  [inline, inherited]
 

Removes the vertex's color.

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::clear_normal  )  [inline, inherited]
 

Removes the vertex's normal.

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::clear_pixel_size  )  [inline, inherited]
 

Removes the vertex's pixel_size.

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::clear_texcoord  )  [inline, inherited]
 

Removes the vertex's texcoord.

int BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::compare_to const BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC > &  other  )  const [inherited]
 

Returns a number less than zero if this object sorts before the indicated object, greater than zero if it sorts after, and zero if the objects are equivalent.

int BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::compare_to const BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC > &  other  )  const [inherited]
 

Returns a number less than zero if this vertex sorts before the indicated vertex, greater than zero if it sorts after, and zero if the vertices are equivalent.

CType BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::get_color void   )  const [inline, inherited]
 

Returns the attribute's color.

It is an error to call this without first verifying that has_color() is true.

BuilderC BuilderVertex::get_color_value const BuilderBucket bucket  )  const [inline]
 

Returns the actual color value of the vertex, whether it is indexed or nonindexed.

See get_coord_value().

Definition at line 216 of file builderVertex.I.

References BuilderV, BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::get_coord(), BuilderBucket::get_coords(), INLINE, nassertr, NULL, and Vertexf.

VType BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::get_coord  )  const [inline, inherited]
 

Returns the vertex's coordinate.

It is an error to call this without first verifying that has_coord() is true.

Referenced by get_color_value(), and set_texcoord_value().

BuilderV BuilderVertex::get_coord_value const BuilderBucket bucket  )  const [inline]
 

Returns the actual coordinate value of the vertex, whether it is indexed or nonindexed.

Normally, the value returned by get_coord(), which will be either a BuilderV or a ushort, is sufficient, but there are occasional times when it is necessary to get the actual location in space of the vertex position (for instance, to subdivide a concave polygon).

This function returns the actual coordinate value. For a nonindexed vertex, its return value is the same as get_coord(); for an indexed vertex, it looks up the vertex's index in the bucket's coord array, and returns that value.

Note that this makes some perhaps unwarranted assumptions about indexed geometry; specifically, that its value is valid at creation time, and that it won't change too drastically during runtime.

Definition at line 162 of file builderVertex.I.

References BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_coord().

NType BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::get_normal  )  const [inline, inherited]
 

Returns the attribute's normal.

It is an error to call this without first verifying that has_normal() is true.

Referenced by set_color_value().

BuilderN BuilderVertex::get_normal_value const BuilderBucket bucket  )  const [inline]
 

Returns the actual normal value of the vertex, whether it is indexed or nonindexed.

See get_coord_value().

Definition at line 180 of file builderVertex.I.

float BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::get_pixel_size  )  const [inline, inherited]
 

Returns the attribute's pixel_size.

It is an error to call this without first verifying that has_pixel_size() is true.

TType BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::get_texcoord  )  const [inline, inherited]
 

Returns the vertex's texture coordinate.

It is an error to call this without first verifying that has_texcoord() is true.

BuilderTC BuilderVertex::get_texcoord_value const BuilderBucket bucket  )  const [inline]
 

Returns the actual texture coordinate value of the vertex, whether it is indexed or nonindexed.

See get_coord_value().

Definition at line 198 of file builderVertex.I.

References INLINE, and BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_color().

bool BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::has_color  )  const [inline, inherited]
 

Returns true if the attribute has a color.

bool BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::has_coord  )  const [inline, inherited]
 

Returns true if the vertex has a vertex coordinate.

bool BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::has_normal  )  const [inline, inherited]
 

Returns true if the attribute has a normal.

bool BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::has_pixel_size  )  const [inline, inherited]
 

Returns true if the attribute has a pixel_size.

bool BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::has_texcoord  )  const [inline, inherited]
 

Returns true if the vertex has a texture coordinate.

bool BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::is_valid  )  const [inline, inherited]
 

Returns true if the vertex is valid, i.e.

if it has a vertex coordinate.

bool BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::operator!= const BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC > &  other  )  const [inline, inherited]
 

Assigns an ordering to the vertices.

This is used by the Mesher to group identical vertices. This assumes that all vertices in the locus of consideration will share the same state: with or without normals, texcoords, etc.

bool BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::operator!= const BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC > &  other  )  const [inline, inherited]
 

Assigns an ordering to the vertices.

This is used by the Mesher to group identical vertices. This assumes that all vertices in the locus of consideration will share the same state: with or without normals, texcoords, etc.

bool BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::operator< const BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC > &  other  )  const [inline, inherited]
 

Assigns an ordering to the vertices.

This is used by the Mesher to group identical vertices. This assumes that all vertices in the locus of consideration will share the same state: with or without normals, texcoords, etc.

bool BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::operator< const BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC > &  other  )  const [inline, inherited]
 

Assigns an ordering to the vertices.

This is used by the Mesher to group identical vertices. This assumes that all vertices to be meshed together must share the same state: with or without normals, texcoords, etc.

bool BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::operator== const BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC > &  other  )  const [inline, inherited]
 

Assigns an ordering to the vertices.

This is used by the Mesher to group identical vertices. This assumes that all vertices in the locus of consideration will share the same state: with or without normals, texcoords, etc.

bool BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::operator== const BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC > &  other  )  const [inline, inherited]
 

Assigns an ordering to the vertices.

This is used by the Mesher to group identical vertices. This assumes that all vertices in the locus of consideration will share the same state: with or without normals, texcoords, etc.

ostream& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::output ostream &  out  )  const [inherited]
 

Formats the vertex for output in some sensible way.

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_color const CType c  )  [inline, inherited]
 

Resets the vertex's color.

This is overridden from BuilderAttrib just so we can typecast the return value to BuilderVertex. The other functions, has_color() and get_color(), are inherited untouched from BuilderAttrib.

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

Referenced by get_texcoord_value(), and set_normal_value().

void BuilderVertex::set_color_value const BuilderC array,
ushort  index
[inline]
 

Reassigns the vertex color, without knowing whether the vertex is indexed or nonindexed.

A nonindexed vertex will look up the index in the array and store the resulting value, while an indexed vertex will just store the index number (which assumes the array is the same one it's indexing on).

Definition at line 114 of file builderVertex.I.

References BuilderN, BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::get_normal(), and INLINE.

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_coord const VType c  )  [inline, inherited]
 

Resets the vertex's coordinate.

Referenced by get_coord_value().

void BuilderVertex::set_coord_value const BuilderV array,
ushort  index
[inline]
 

Reassigns the vertex coordinate, without knowing whether the vertex is indexed or nonindexed.

A nonindexed vertex will look up the index in the array and store the resulting value, while an indexed vertex will just store the index number (which assumes the array is the same one it's indexing on).

Definition at line 43 of file builderVertex.I.

References INLINE, and BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_normal().

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_normal const NType c  )  [inline, inherited]
 

Resets the vertex's normal.

This is overridden from BuilderAttrib just so we can typecast the return value to BuilderVertex. The other functions, has_normal() and get_normal(), are inherited untouched from BuilderAttrib.

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

Referenced by set_coord_value().

void BuilderVertex::set_normal_value const BuilderN array,
ushort  index
[inline]
 

Reassigns the vertex normal, without knowing whether the vertex is indexed or nonindexed.

A nonindexed vertex will look up the index in the array and store the resulting value, while an indexed vertex will just store the index number (which assumes the array is the same one it's indexing on).

Definition at line 67 of file builderVertex.I.

References INLINE, and BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_color().

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_pixel_size float  s  )  [inline, inherited]
 

Resets the vertex's pixel_size.

This is overridden from BuilderAttrib just so we can typecast the return value to BuilderVertex. The other functions, has_pixel_size() and get_pixel_size(), are inherited untouched from BuilderAttrib.

Reimplemented from BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >.

BuilderVertexTempl& BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::set_texcoord const TType t  )  [inline, inherited]
 

Resets the vertex's texture coordinate.

void BuilderVertex::set_texcoord_value const BuilderTC array,
ushort  index
[inline]
 

Reassigns the vertex texture coordinate, without knowing whether the vertex is indexed or nonindexed.

A nonindexed vertex will look up the index in the array and store the resulting value, while an indexed vertex will just store the index number (which assumes the array is the same one it's indexing on).

Definition at line 90 of file builderVertex.I.

References BuilderV, BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::get_coord(), and INLINE.


Member Data Documentation

CType BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::_color [protected, inherited]
 

Definition at line 84 of file builderAttribTempl.h.

VType BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::_coord [protected, inherited]
 

Definition at line 89 of file builderVertexTempl.h.

int BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::_flags [protected, inherited]
 

Definition at line 86 of file builderAttribTempl.h.

NType BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::_normal [protected, inherited]
 

Definition at line 83 of file builderAttribTempl.h.

float BuilderAttribTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::_pixel_size [protected, inherited]
 

Definition at line 85 of file builderAttribTempl.h.

TType BuilderVertexTempl< BuilderV, BuilderN, BuilderTC, BuilderC >::_texcoord [protected, inherited]
 

Definition at line 90 of file builderVertexTempl.h.


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:47:58 2003 for Panda by doxygen1.3