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

BuilderPrimTempl< VTX > Class Template Reference

The main body of BuilderPrim and BuilderPrimI. More...

#include <builderPrimTempl.h>

List of all members.

Public Types

typedef VTX Vertex
typedef TYPENAME VTX::VType VType
typedef TYPENAME VTX::NType NType
typedef TYPENAME VTX::TType TType
typedef TYPENAME VTX::CType CType
typedef TYPENAME VTX::Attrib DAttrib

Public Member Functions

 BuilderPrimTempl ()
 BuilderPrimTempl (const BuilderPrimTempl &copy)
BuilderPrimTempl & operator= (const BuilderPrimTempl &copy)
void remove_doubled_verts (int closed)
 Removes consecutive identical vertices from the prim definition.

bool is_valid () const
 Returns true if the primitive is well-defined and has the right number of vertices for its primitive type, and all of its vertices are valid.

bool has_normal () const
 Returns true if set_normal() has been called on the primitive.

bool has_color () const
 Returns true if set_color() has been called on the primitive.

bool has_pixel_size () const
 Returns true if set_pixel_size() has been called on the primitive.

bool has_overall_normal () const
 Returns true if the primitive has a single, overall normal value.

bool has_overall_color () const
 Returns true if the primitive has a single, overall color value.

bool has_overall_pixel_size () const
 Returns true if the primitive has a single, overall pixel_size value.

bool has_vertex_normal () const
 Returns true if each of the primitive's vertices has a different normal value set.

bool has_vertex_color () const
 Returns true if each of the primitive's vertices has a different color value set.

bool has_vertex_texcoord () const
 Returns true if each of the primitive's vertices has a texcoord value set.

bool has_vertex_pixel_size () const
 Returns true if each of the primitive's vertices has a different pixel_size value set.

bool has_component_normal () const
 Returns true if the prim is a composite primitive like a tristrip, and its individual components each have a different normal value set.

bool has_component_color () const
 Returns true if the prim is a composite primitive like a tristrip, and its individual components each have a different color value set.

bool has_component_pixel_size () const
 Returns true if the prim is a composite primitive like a tristrip, and its individual components each have a different pixel_size value set.

bool has_any_normal () const
 Returns true if the prim has a normal value set at any level.

bool has_any_color () const
 Returns true if the prim has a color value set at any level.

bool has_any_texcoord () const
 Returns true if the prim has a texcoord value set at any level.

bool has_any_pixel_size () const
 Returns true if the prim has a pixel_size value set at any level.

BuilderPrimTempl & clear ()
 Resets the BuilderPrim to its initial, default state.

BuilderPrimTempl & clear_vertices ()
 Removes all the vertices that have been added to the BuilderPrim, without otherwise affecting its properties.

BuilderPrimTempl & set_attrib (const DAttrib &attrib)
 Copies the polygon attributes, color and normal, from the indicated attribute structure (which might be another BuilderPrim).

BuilderPrimType get_type () const
 Indicates the type of primitive represented by the BuilderPrim.

BuilderPrimTempl & set_type (BuilderPrimType t)
 Indicates the type of primitive represented by the BuilderPrim.

NType get_normal () const
 Returns the value previously set by set_normal(), or the overall normal value common to all vertices.

BuilderPrimTempl & set_normal (const NType &n)
 Sets the flat normal associated with the primitive.

CType get_color () const
 Returns the value previously set by set_color(), or the overall color value common to all vertices.

BuilderPrimTempl & set_color (const CType &c)
 Sets the flat color associated with the primitive.

float get_pixel_size () const
 Returns the value previously set by set_pixel_size(), or the overall pixel_size value common to all vertices.

BuilderPrimTempl & set_pixel_size (float s)
 Sets the line thickness (for a polygon or line) or size (for a point) in pixels.

BuilderPrimTempl & add_vertex (const Vertex &v)
 Adds a new vertex to the BuilderPrim.

int get_num_verts () const
 Returns the number of vertices in the primitive.

Vertexget_vertex (int n)
 Returns a reference to the nth vertex of the primitive, where 0 <= n < get_num_verts().

const Vertexget_vertex (int n) const
 Returns the nth vertex of the primitive, where 0 <= n < get_num_verts().

BuilderPrimTempl & add_component (const DAttrib &attrib)
 Normally, this function is only used by the mesher code; user code generally should not need to call it.

int get_num_components () const
 Returns the number of times add_component() has been called.

DAttribget_component (int n)
 Returns a refernece to the attribute structure associated with the nth component, where 0 <= n < get_num_components().

const DAttribget_component (int n) const
 Returns the attributes associated with the nth component, where 0 <= n < get_num_components().

bool operator< (const BuilderPrimTempl &other) const
 Returns true if this primitive should come before the other one, in the bin ordering.

ostream & output (ostream &out) const
 Formats the prim for output in some sensible way.


Protected Types

typedef pvector< VertexVerts
typedef pvector< DAttribComponents

Protected Member Functions

int sort_value () const
 Returns a number for grouping primitives, such that only primitives that share the same number can be tristripped together.

void update_overall_attrib ()
 Examines the primitive and all of its vertices and components to determine the amount of commonality of each attribute, and updates the bits in _overall to indicate this.


Protected Attributes

Verts _verts
Components _components
BuilderPrimType _type
int _overall


Detailed Description

template<class VTX>
class BuilderPrimTempl< VTX >

The main body of BuilderPrim and BuilderPrimI.

This is a template class on vertex type, which must be either BuilderVertex or BuilderVertexI; these classes are themselves template classes on vertex type, texcoord type, color type, etc.

Definition at line 50 of file builderPrimTempl.h.


Member Typedef Documentation

template<class VTX>
typedef pvector<DAttrib> BuilderPrimTempl< VTX >::Components [protected]
 

Definition at line 149 of file builderPrimTempl.h.

template<class VTX>
typedef TYPENAME VTX::CType BuilderPrimTempl< VTX >::CType
 

Definition at line 56 of file builderPrimTempl.h.

template<class VTX>
typedef TYPENAME VTX::Attrib BuilderPrimTempl< VTX >::DAttrib
 

Definition at line 57 of file builderPrimTempl.h.

Referenced by BuilderPrimTempl< VTX >::get_color(), BuilderPrimTempl< VTX >::operator<(), and BuilderPrimTempl< VTX >::sort_value().

template<class VTX>
typedef TYPENAME VTX::NType BuilderPrimTempl< VTX >::NType
 

Definition at line 54 of file builderPrimTempl.h.

template<class VTX>
typedef TYPENAME VTX::TType BuilderPrimTempl< VTX >::TType
 

Definition at line 55 of file builderPrimTempl.h.

template<class VTX>
typedef VTX BuilderPrimTempl< VTX >::Vertex
 

Definition at line 52 of file builderPrimTempl.h.

Referenced by BuilderPrimTempl< VTX >::get_component().

template<class VTX>
typedef pvector<Vertex> BuilderPrimTempl< VTX >::Verts [protected]
 

Definition at line 148 of file builderPrimTempl.h.

template<class VTX>
typedef TYPENAME VTX::VType BuilderPrimTempl< VTX >::VType
 

Definition at line 53 of file builderPrimTempl.h.


Constructor & Destructor Documentation

template<class VTX>
BuilderPrimTempl< VTX >::BuilderPrimTempl  )  [inline]
 

Definition at line 35 of file builderPrimTempl.I.

References INLINE.

template<class VTX>
BuilderPrimTempl< VTX >::BuilderPrimTempl const BuilderPrimTempl< VTX > &  copy  )  [inline]
 

Definition at line 49 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_components, BuilderPrimTempl< VTX >::_overall, BuilderPrimTempl< VTX >::_type, BuilderPrimTempl< VTX >::_verts, and INLINE.


Member Function Documentation

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::add_component const DAttrib attrib  )  [inline]
 

Normally, this function is only used by the mesher code; user code generally should not need to call it.

In addition to storing a simple polygon, a BuilderPrim can store a composite primitive, like a triangle strip. In this case, it is useful to store the attributes (like color and normal) associated with each component.

When get_type() is one of the composite types, it is the responsibility of the caller to call add_component() once for each component, where the number of components is defined by the type and the number of vertices (e.g. for a triangle strip, the number of components is the number of vertices - 2).

Definition at line 838 of file builderPrimTempl.I.

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::add_vertex const Vertex v  )  [inline]
 

Adds a new vertex to the BuilderPrim.

The vertex data is copied into the prim's internal structure. Vertices should be added in counterclockwise order, when viewed from the front.

Definition at line 738 of file builderPrimTempl.I.

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::clear  )  [inline]
 

Resets the BuilderPrim to its initial, default state.

Definition at line 487 of file builderPrimTempl.I.

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::clear_vertices  )  [inline]
 

Removes all the vertices that have been added to the BuilderPrim, without otherwise affecting its properties.

Definition at line 508 of file builderPrimTempl.I.

References INLINE.

Referenced by BuilderPrimTempl< VTX >::has_component_color().

template<class VTX>
TYPENAME BuilderPrimTempl< VTX >::CType BuilderPrimTempl< VTX >::get_color  )  const [inline]
 

Returns the value previously set by set_color(), or the overall color value common to all vertices.

It is an error to call this without first testing that one of has_color() or has_overall_color() is true.

Definition at line 656 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_components, BuilderPrimTempl< VTX >::DAttrib, INLINE, nassertr, and TYPENAME.

template<class VTX>
const TYPENAME BuilderPrimTempl< VTX >::DAttrib & BuilderPrimTempl< VTX >::get_component int  n  )  const [inline]
 

Returns the attributes associated with the nth component, where 0 <= n < get_num_components().

See add_component() and get_num_components().

Definition at line 908 of file builderPrimTempl.I.

template<class VTX>
TYPENAME BuilderPrimTempl< VTX >::DAttrib & BuilderPrimTempl< VTX >::get_component int  n  )  [inline]
 

Returns a refernece to the attribute structure associated with the nth component, where 0 <= n < get_num_components().

This reference may be modified directly, e.g. to change the color of a polygon after it has been added to the tristrip. See add_component() and get_num_components().

Definition at line 888 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::Vertex.

template<class VTX>
TYPENAME BuilderPrimTempl< VTX >::NType BuilderPrimTempl< VTX >::get_normal  )  const [inline]
 

Returns the value previously set by set_normal(), or the overall normal value common to all vertices.

It is an error to call this without first testing that one of has_normal() or has_overall_normal() is true.

Definition at line 616 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_components.

template<class VTX>
int BuilderPrimTempl< VTX >::get_num_components  )  const [inline]
 

Returns the number of times add_component() has been called.

This should be, but is not necessarily, the same as the number of components in the composite primitive (e.g. a triangle strip). See add_component().

Definition at line 863 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::get_vertex(), BuilderPrimTempl< VTX >::has_component_color(), BuilderPrimTempl< VTX >::has_component_normal(), BuilderPrimTempl< VTX >::has_component_pixel_size(), BuilderPrimTempl< VTX >::has_vertex_color(), BuilderPrimTempl< VTX >::has_vertex_normal(), BuilderPrimTempl< VTX >::has_vertex_pixel_size(), and BuilderPrimTempl< VTX >::has_vertex_texcoord().

template<class VTX>
int BuilderPrimTempl< VTX >::get_num_verts  )  const [inline]
 

Returns the number of vertices in the primitive.

Definition at line 755 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_verts, and TYPENAME.

Referenced by BuilderPrimTempl< VTX >::get_vertex().

template<class VTX>
float BuilderPrimTempl< VTX >::get_pixel_size  )  const [inline]
 

Returns the value previously set by set_pixel_size(), or the overall pixel_size value common to all vertices.

It is an error to call this without first testing that one of has_pixel_size() or has_overall_pixel_size() is true.

Definition at line 698 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::has_vertex_normal(), and INLINE.

Referenced by BuilderPrimTempl< VTX >::set_color().

template<class VTX>
BuilderPrimType BuilderPrimTempl< VTX >::get_type  )  const [inline]
 

Indicates the type of primitive represented by the BuilderPrim.

See set_type().

Definition at line 550 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_verts, and INLINE.

Referenced by BuilderPrimTempl< VTX >::get_vertex().

template<class VTX>
const TYPENAME BuilderPrimTempl< VTX >::Vertex & BuilderPrimTempl< VTX >::get_vertex int  n  )  const [inline]
 

Returns the nth vertex of the primitive, where 0 <= n < get_num_verts().

Definition at line 794 of file builderPrimTempl.I.

References BPT_line, BPT_quad, BPT_tri, BPT_trifan, and BPT_tristrip.

template<class VTX>
TYPENAME BuilderPrimTempl< VTX >::Vertex & BuilderPrimTempl< VTX >::get_vertex int  n  )  [inline]
 

Returns a reference to the nth vertex of the primitive, where 0 <= n < get_num_verts().

This reference may be modified directly, e.g. to set a vertex normal on a vertex after it has been added to the primitive.

Definition at line 777 of file builderPrimTempl.I.

References BPT_point, BPT_poly, BuilderPrimTempl< VTX >::get_num_verts(), and BuilderPrimTempl< VTX >::get_type().

Referenced by BuilderPrimTempl< VTX >::get_num_components().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_any_color  )  const [inline]
 

Returns true if the prim has a color value set at any level.

That is, it returns true if any of has_overall_color(), has_vertex_color(), or has_component_color() is true.

Definition at line 430 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_type, INLINE, and t.

template<class VTX>
bool BuilderPrimTempl< VTX >::has_any_normal  )  const [inline]
 

Returns true if the prim has a normal value set at any level.

That is, it returns true if any of has_overall_normal(), has_vertex_normal(), or has_component_normal() is true.

Definition at line 409 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_type, BuilderPrimType, and INLINE.

template<class VTX>
bool BuilderPrimTempl< VTX >::has_any_pixel_size  )  const [inline]
 

Returns true if the prim has a pixel_size value set at any level.

That is, it returns true if any of has_overall_pixel_size(), has_vertex_pixel_size(), or has_component_pixel_size() is true.

Definition at line 471 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall.

template<class VTX>
bool BuilderPrimTempl< VTX >::has_any_texcoord  )  const [inline]
 

Returns true if the prim has a texcoord value set at any level.

Since texture coordinates can only be set on vertices, this is the same thing as has_vertex_texcoord().

Definition at line 451 of file builderPrimTempl.I.

References INLINE, and TYPENAME.

template<class VTX>
bool BuilderPrimTempl< VTX >::has_color  )  const [inline]
 

Returns true if set_color() has been called on the primitive.

This is unrelated to the color values that may or may not override from the vertices. Also see has_overall_color().

Definition at line 111 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall, BAF_overall_normal, BAF_overall_updated, and INLINE.

template<class VTX>
bool BuilderPrimTempl< VTX >::has_component_color  )  const [inline]
 

Returns true if the prim is a composite primitive like a tristrip, and its individual components each have a different color value set.

Definition at line 363 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_type, BPT_poly, BuilderPrimTempl< VTX >::clear_vertices(), and INLINE.

Referenced by BuilderPrimTempl< VTX >::get_num_components(), and BuilderPrimTempl< VTX >::has_vertex_pixel_size().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_component_normal  )  const [inline]
 

Returns true if the prim is a composite primitive like a tristrip, and its individual components each have a different normal value set.

Definition at line 341 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::has_component_pixel_size(), BuilderPrimTempl< VTX >::has_overall_pixel_size(), BuilderPrimTempl< VTX >::has_vertex_pixel_size(), and INLINE.

Referenced by BuilderPrimTempl< VTX >::get_num_components(), and BuilderPrimTempl< VTX >::has_vertex_texcoord().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_component_pixel_size  )  const [inline]
 

Returns true if the prim is a composite primitive like a tristrip, and its individual components each have a different pixel_size value set.

Definition at line 385 of file builderPrimTempl.I.

Referenced by BuilderPrimTempl< VTX >::get_num_components(), and BuilderPrimTempl< VTX >::has_component_normal().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_normal  )  const [inline]
 

Returns true if set_normal() has been called on the primitive.

This is unrelated to the normal values that may or may not override from the vertices. Also see has_overall_normal().

Definition at line 90 of file builderPrimTempl.I.

template<class VTX>
bool BuilderPrimTempl< VTX >::has_overall_color  )  const [inline]
 

Returns true if the primitive has a single, overall color value.

This can happen because of one of: (a) the primitive had a color value assigned to it directly, and its individual vertices and components did not; (b) each vertex was assigned the same color value; (c) each component was assigned the same color value.

If has_overall_color() returns true, then get_color() will return the overall color value.

Definition at line 201 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall, BAF_overall_updated, BAF_vertex_color, and INLINE.

Referenced by BuilderPrimTempl< VTX >::has_vertex_pixel_size().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_overall_normal  )  const [inline]
 

Returns true if the primitive has a single, overall normal value.

This can happen because of one of: (a) the primitive had a normal value assigned to it directly, and its individual vertices and components did not; (b) each vertex was assigned the same normal value; (c) each component was assigned the same normal value.

If has_overall_normal() returns true, then get_normal() will return the overall normal value.

Definition at line 165 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall, BAF_overall_pixel_size, BAF_overall_updated, and INLINE.

Referenced by BuilderPrimTempl< VTX >::has_vertex_texcoord().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_overall_pixel_size  )  const [inline]
 

Returns true if the primitive has a single, overall pixel_size value.

This can happen because of one of: (a) the primitive had a pixel_size value assigned to it directly, and its individual vertices and components did not; (b) each vertex was assigned the same pixel_size value; (c) each component was assigned the same pixel_size value.

If has_overall_pixel_size() returns true, then get_pixel_size() will return the overall pixel_size value.

Definition at line 239 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall, BAF_overall_updated, and BAF_vertex_pixel_size.

Referenced by BuilderPrimTempl< VTX >::has_component_normal().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_pixel_size  )  const [inline]
 

Returns true if set_pixel_size() has been called on the primitive.

This is unrelated to the pixel_size values that may or may not override from the vertices. Also see has_overall_pixel_size().

Definition at line 132 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall, BAF_overall_color, BAF_overall_updated, and INLINE.

Referenced by BuilderPrimTempl< VTX >::set_color().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_vertex_color  )  const [inline]
 

Returns true if each of the primitive's vertices has a different color value set.

Definition at line 279 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall, BAF_component_pixel_size, BAF_overall_updated, and INLINE.

Referenced by BuilderPrimTempl< VTX >::get_num_components(), and BuilderPrimTempl< VTX >::has_vertex_pixel_size().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_vertex_normal  )  const [inline]
 

Returns true if each of the primitive's vertices has a different normal value set.

Definition at line 259 of file builderPrimTempl.I.

Referenced by BuilderPrimTempl< VTX >::get_num_components(), BuilderPrimTempl< VTX >::get_pixel_size(), and BuilderPrimTempl< VTX >::has_vertex_texcoord().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_vertex_pixel_size  )  const [inline]
 

Returns true if each of the primitive's vertices has a different pixel_size value set.

Definition at line 319 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::has_component_color(), BuilderPrimTempl< VTX >::has_overall_color(), BuilderPrimTempl< VTX >::has_vertex_color(), and INLINE.

Referenced by BuilderPrimTempl< VTX >::get_num_components(), and BuilderPrimTempl< VTX >::has_component_normal().

template<class VTX>
bool BuilderPrimTempl< VTX >::has_vertex_texcoord  )  const [inline]
 

Returns true if each of the primitive's vertices has a texcoord value set.

Definition at line 299 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::has_component_normal(), BuilderPrimTempl< VTX >::has_overall_normal(), BuilderPrimTempl< VTX >::has_vertex_normal(), and INLINE.

Referenced by BuilderPrimTempl< VTX >::get_num_components().

template<class VTX>
bool BuilderPrimTempl< VTX >::is_valid  )  const
 

Returns true if the primitive is well-defined and has the right number of vertices for its primitive type, and all of its vertices are valid.

Definition at line 1057 of file builderPrimTempl.I.

template<class VTX>
bool BuilderPrimTempl< VTX >::operator< const BuilderPrimTempl< VTX > &  other  )  const [inline]
 

Returns true if this primitive should come before the other one, in the bin ordering.

This is used to sort polygons into groups which can be tristripped together, similar to the same operation on the BuilderBucket, except that this works at a finer level of detail (i.e. on prims within the same bucket).

Definition at line 936 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::DAttrib.

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::operator= const BuilderPrimTempl< VTX > &  copy  )  [inline]
 

Definition at line 63 of file builderPrimTempl.I.

References INLINE.

Referenced by BuilderPrim::BuilderPrim().

template<class VTX>
ostream & BuilderPrimTempl< VTX >::output ostream &  out  )  const
 

Formats the prim for output in some sensible way.

Definition at line 1101 of file builderPrimTempl.I.

template<class VTX>
void BuilderPrimTempl< VTX >::remove_doubled_verts int  closed  ) 
 

Removes consecutive identical vertices from the prim definition.

These are meaningless and only confuse polygon subdividing and meshing.

If closed is true, this also removes vertices doubled at the beginning and end (as if the list of vertices were implicitly closed, as it is for a polygon).

Definition at line 1024 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall, and BAF_overall_pixel_size.

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::set_attrib const DAttrib attrib  )  [inline]
 

Copies the polygon attributes, color and normal, from the indicated attribute structure (which might be another BuilderPrim).

Definition at line 531 of file builderPrimTempl.I.

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::set_color const CType c  )  [inline]
 

Sets the flat color associated with the primitive.

If each of the primitive's vertices also has a color set, the vertex colors will override.

Definition at line 674 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::get_pixel_size(), BuilderPrimTempl< VTX >::has_pixel_size(), INLINE, and BuilderPrimTempl< VTX >::sort_value().

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::set_normal const NType n  )  [inline]
 

Sets the flat normal associated with the primitive.

If each of the primitive's vertices also has a normal set, the vertex normals will override.

Definition at line 634 of file builderPrimTempl.I.

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::set_pixel_size float  s  )  [inline]
 

Sets the line thickness (for a polygon or line) or size (for a point) in pixels.

Definition at line 715 of file builderPrimTempl.I.

template<class VTX>
BuilderPrimTempl< VTX > & BuilderPrimTempl< VTX >::set_type BuilderPrimType  t  )  [inline]
 

Indicates the type of primitive represented by the BuilderPrim.

Normally, the user should set this to one of BPT_poly, BPT_point, or BPT_line. However, other types are possible, and are created by the mesher, including triangle strips, quad strips, and triangle fans.

Setting this value changes the interpretation of the vertices, for instance, a triangle strip is defined by vertices that zigzag back and forth between the triangles. Note that when defining a composite primitive such as a triangle strip, it is also necessary to call add_component() the correct number of times to match the calls to add_vertex(), according to the primitive type. See add_component().

Definition at line 595 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::_overall, and INLINE.

template<class VTX>
int BuilderPrimTempl< VTX >::sort_value  )  const [inline, protected]
 

Returns a number for grouping primitives, such that only primitives that share the same number can be tristripped together.

Definition at line 966 of file builderPrimTempl.I.

References BuilderPrimTempl< VTX >::DAttrib.

Referenced by BuilderPrimTempl< VTX >::set_color().

template<class VTX>
void BuilderPrimTempl< VTX >::update_overall_attrib  )  [protected]
 

Examines the primitive and all of its vertices and components to determine the amount of commonality of each attribute, and updates the bits in _overall to indicate this.

If an overall attribute is found, the primitive attribute value is set to that common value.

Definition at line 1143 of file builderPrimTempl.I.


Member Data Documentation

template<class VTX>
Components BuilderPrimTempl< VTX >::_components [protected]
 

Definition at line 152 of file builderPrimTempl.h.

Referenced by BuilderPrimTempl< VTX >::BuilderPrimTempl(), BuilderPrimTempl< VTX >::get_color(), and BuilderPrimTempl< VTX >::get_normal().

template<class VTX>
int BuilderPrimTempl< VTX >::_overall [protected]
 

Definition at line 154 of file builderPrimTempl.h.

Referenced by BuilderPrimTempl< VTX >::BuilderPrimTempl(), BuilderPrimTempl< VTX >::has_any_pixel_size(), BuilderPrimTempl< VTX >::has_color(), BuilderPrimTempl< VTX >::has_overall_color(), BuilderPrimTempl< VTX >::has_overall_normal(), BuilderPrimTempl< VTX >::has_overall_pixel_size(), BuilderPrimTempl< VTX >::has_pixel_size(), BuilderPrimTempl< VTX >::has_vertex_color(), SameCoord< VTX >::operator()(), BuilderPrimTempl< VTX >::remove_doubled_verts(), and BuilderPrimTempl< VTX >::set_type().

template<class VTX>
BuilderPrimType BuilderPrimTempl< VTX >::_type [protected]
 

Definition at line 153 of file builderPrimTempl.h.

Referenced by BuilderPrimTempl< VTX >::BuilderPrimTempl(), BuilderPrimTempl< VTX >::has_any_color(), BuilderPrimTempl< VTX >::has_any_normal(), and BuilderPrimTempl< VTX >::has_component_color().

template<class VTX>
Verts BuilderPrimTempl< VTX >::_verts [protected]
 

Definition at line 151 of file builderPrimTempl.h.

Referenced by BuilderPrimTempl< VTX >::BuilderPrimTempl(), BuilderPrimTempl< VTX >::get_num_verts(), and BuilderPrimTempl< VTX >::get_type().


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