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

BuilderVertexI Class Reference

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

#include <builderVertex.h>

Inheritance diagram for BuilderVertexI:

BuilderVertexTempl< ushort, ushort, ushort, ushort > BuilderAttribTempl< ushort, ushort, ushort, ushort > List of all members.

Public Types

typedef BuilderAttribI Attrib
typedef ushort VType
typedef ushort NType
typedef ushort TType
typedef ushort CType

Public Member Functions

 BuilderVertexI ()
 BuilderVertexI (ushort 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 indexed 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 124 of file builderVertex.h.


Member Typedef Documentation

typedef BuilderAttribI BuilderVertexI::Attrib
 

Definition at line 127 of file builderVertex.h.

typedef ushort BuilderVertexTempl< ushort, ushort, ushort, ushort >::CType [inherited]
 

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

Definition at line 53 of file builderVertexTempl.h.

typedef ushort BuilderVertexTempl< ushort, ushort, ushort, ushort >::NType [inherited]
 

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

Definition at line 51 of file builderVertexTempl.h.

typedef ushort BuilderVertexTempl< ushort, ushort, ushort, ushort >::TType [inherited]
 

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

Definition at line 52 of file builderVertexTempl.h.

typedef ushort BuilderVertexTempl< ushort, ushort, ushort, ushort >::VType [inherited]
 

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

Definition at line 50 of file builderVertexTempl.h.


Constructor & Destructor Documentation

BuilderVertexI::BuilderVertexI  )  [inline]
 

Definition at line 129 of file builderVertex.h.

BuilderVertexI::BuilderVertexI ushort  c  )  [inline]
 

Definition at line 130 of file builderVertex.h.


Member Function Documentation

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::clear void   )  [inline, inherited]
 

Resets the vertex to its initial, empty state.

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::clear_color  )  [inline, inherited]
 

Removes the vertex's color.

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::clear_normal  )  [inline, inherited]
 

Removes the vertex's normal.

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::clear_pixel_size  )  [inline, inherited]
 

Removes the vertex's pixel_size.

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::clear_texcoord  )  [inline, inherited]
 

Removes the vertex's texcoord.

int BuilderAttribTempl< ushort, ushort, ushort, ushort >::compare_to const BuilderAttribTempl< ushort, ushort, ushort, ushort > &  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< ushort, ushort, ushort, ushort >::compare_to const BuilderVertexTempl< ushort, ushort, ushort, ushort > &  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< ushort, ushort, ushort, ushort >::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.

Reimplemented in BuilderPrimTempl< BuilderVertexI >, and BuilderPrimTempl< BuilderVertex >.

BuilderC BuilderVertexI::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 412 of file builderVertex.I.

VType BuilderVertexTempl< ushort, ushort, ushort, ushort >::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.

BuilderV BuilderVertexI::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 358 of file builderVertex.I.

NType BuilderAttribTempl< ushort, ushort, ushort, ushort >::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.

Reimplemented in BuilderPrimTempl< BuilderVertexI >, and BuilderPrimTempl< BuilderVertex >.

Referenced by set_coord_value().

BuilderN BuilderVertexI::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 376 of file builderVertex.I.

float BuilderAttribTempl< ushort, ushort, ushort, ushort >::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.

Reimplemented in BuilderPrimTempl< BuilderVertexI >, and BuilderPrimTempl< BuilderVertex >.

TType BuilderVertexTempl< ushort, ushort, ushort, ushort >::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 BuilderVertexI::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 394 of file builderVertex.I.

bool BuilderAttribTempl< ushort, ushort, ushort, ushort >::has_color  )  const [inline, inherited]
 

Returns true if the attribute has a color.

Reimplemented in BuilderPrimTempl< BuilderVertexI >, and BuilderPrimTempl< BuilderVertex >.

bool BuilderVertexTempl< ushort, ushort, ushort, ushort >::has_coord  )  const [inline, inherited]
 

Returns true if the vertex has a vertex coordinate.

bool BuilderAttribTempl< ushort, ushort, ushort, ushort >::has_normal  )  const [inline, inherited]
 

Returns true if the attribute has a normal.

Reimplemented in BuilderPrimTempl< BuilderVertexI >, and BuilderPrimTempl< BuilderVertex >.

bool BuilderAttribTempl< ushort, ushort, ushort, ushort >::has_pixel_size  )  const [inline, inherited]
 

Returns true if the attribute has a pixel_size.

Reimplemented in BuilderPrimTempl< BuilderVertexI >, and BuilderPrimTempl< BuilderVertex >.

bool BuilderVertexTempl< ushort, ushort, ushort, ushort >::has_texcoord  )  const [inline, inherited]
 

Returns true if the vertex has a texture coordinate.

bool BuilderVertexTempl< ushort, ushort, ushort, ushort >::is_valid  )  const [inline, inherited]
 

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

if it has a vertex coordinate.

bool BuilderAttribTempl< ushort, ushort, ushort, ushort >::operator!= const BuilderAttribTempl< ushort, ushort, ushort, ushort > &  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< ushort, ushort, ushort, ushort >::operator!= const BuilderVertexTempl< ushort, ushort, ushort, ushort > &  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< ushort, ushort, ushort, ushort >::operator< const BuilderAttribTempl< ushort, ushort, ushort, ushort > &  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< ushort, ushort, ushort, ushort >::operator< const BuilderVertexTempl< ushort, ushort, ushort, ushort > &  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< ushort, ushort, ushort, ushort >::operator== const BuilderAttribTempl< ushort, ushort, ushort, ushort > &  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< ushort, ushort, ushort, ushort >::operator== const BuilderVertexTempl< ushort, ushort, ushort, ushort > &  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< ushort, ushort, ushort, ushort >::output ostream &  out  )  const [inherited]
 

Formats the vertex for output in some sensible way.

Reimplemented from BuilderAttribTempl< ushort, ushort, ushort, ushort >.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::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< ushort, ushort, ushort, ushort >.

void BuilderVertexI::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 311 of file builderVertex.I.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::set_coord const VType c  )  [inline, inherited]
 

Resets the vertex's coordinate.

void BuilderVertexI::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 240 of file builderVertex.I.

References BuilderN, BuilderAttribTempl< ushort, ushort, ushort, ushort >::get_normal(), BuilderBucket::get_normals(), INLINE, nassertr, Normalf, and NULL.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::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< ushort, ushort, ushort, ushort >.

void BuilderVertexI::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 264 of file builderVertex.I.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::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< ushort, ushort, ushort, ushort >.

BuilderVertexTempl& BuilderVertexTempl< ushort, ushort, ushort, ushort >::set_texcoord const TType t  )  [inline, inherited]
 

Resets the vertex's texture coordinate.

void BuilderVertexI::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 288 of file builderVertex.I.


Member Data Documentation

CType BuilderAttribTempl< ushort, ushort, ushort, ushort >::_color [protected, inherited]
 

Definition at line 84 of file builderAttribTempl.h.

VType BuilderVertexTempl< ushort, ushort, ushort, ushort >::_coord [protected, inherited]
 

Definition at line 89 of file builderVertexTempl.h.

int BuilderAttribTempl< ushort, ushort, ushort, ushort >::_flags [protected, inherited]
 

Definition at line 86 of file builderAttribTempl.h.

NType BuilderAttribTempl< ushort, ushort, ushort, ushort >::_normal [protected, inherited]
 

Definition at line 83 of file builderAttribTempl.h.

float BuilderAttribTempl< ushort, ushort, ushort, ushort >::_pixel_size [protected, inherited]
 

Definition at line 85 of file builderAttribTempl.h.

TType BuilderVertexTempl< ushort, ushort, ushort, ushort >::_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:59 2003 for Panda by doxygen1.3