cee::geo::DataTriangleFan Class Reference

Data structure representing triangle strip data for a geometry part used in the GeometryModel More...

Public Member Functions

 DataTriangleFan ()
 Constructs an empty triangle data object. More...
 
 DataTriangleFan (const std::vector< Vec3d > &vertices)
 Constructs a triangles object from the specified vertices. More...
 
virtual Type type () const
 Returns Data::TRIANGLE_FAN. More...
 
virtual BoundingBox boundingBox () const
 Returns the bounding box of the part data. More...
 
std::vector< Vec3dvertices () const
 Returns array of vertices used to build up the triangles. More...
 
void setVertices (const std::vector< Vec3d > &vertices)
 Sets vertices of all the triangles. More...
 
size_t triangleCount () const
 Returns number of triangles available. More...
 
void removeAll ()
 Clears all data. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 

Additional Inherited Members

- Public Types inherited from cee::geo::Data
enum  Type {
  INDEXED_TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, INDEXED_POLYLINES,
  POINTS
}
 Enumerator for each of the available primitives. More...
 
- Protected Member Functions inherited from cee::geo::Data
 Data ()
 Constructs an empty part data. More...
 
Inheritance diagram for cee::geo::DataTriangleFan:
cee::geo::Data cee::RefCountedObject

Detailed Description

Data structure representing triangle strip data for a geometry part used in the GeometryModel

A triangle fan is used to produce a group of connected triangles that fan around a central point. The first vertex forms the origin of the fan. After the first three vertices are used to draw the initial triangle, all subsequent vertices are used with the origin (V0) and the vertex immediately preceding it (Vn-1) to form the next triangle.

Indices:    0 1 2 3 4 5 ...
Triangles: {0 1 2}
           {0} {2 3}
           {0}   {3 4}
           {0}     {4 5}

A vertices array of length n, will generate n - 2 triangles

See also
cee::geo::GeometryModel
cee::geo::Part
cee::geo::Data
cee::geo::DataIndexedTriangles
cee::geo::DataTriangleStrip

Constructor & Destructor Documentation

cee::geo::DataTriangleFan::DataTriangleFan ( )

Constructs an empty triangle data object.

cee::geo::DataTriangleFan::DataTriangleFan ( const std::vector< Vec3d > &  vertices)

Constructs a triangles object from the specified vertices.

std::vector<cee::Vec3d> vertices;
vertices.push_back(cee::Vec3d(0, 0, 0));
vertices.push_back(cee::Vec3d(1, 0, 0));
vertices.push_back(cee::Vec3d(1, 1, 0));
vertices.push_back(cee::Vec3d(0, 1, 0));

Member Function Documentation

cee::BoundingBox cee::geo::DataTriangleFan::boundingBox ( ) const
virtual

Returns the bounding box of the part data.

Implements cee::geo::Data.

void cee::geo::DataTriangleFan::removeAll ( )

Clears all data.

void cee::geo::DataTriangleFan::setVertices ( const std::vector< Vec3d > &  vertices)

Sets vertices of all the triangles.

See also
vertices
size_t cee::geo::DataTriangleFan::triangleCount ( ) const

Returns number of triangles available.

Data::Type cee::geo::DataTriangleFan::type ( ) const
virtual

Returns Data::TRIANGLE_FAN.

Implements cee::geo::Data.

std::vector< Vec3d > cee::geo::DataTriangleFan::vertices ( ) const

Returns array of vertices used to build up the triangles.

A vertices array of length n, will generate n - 2 triangles

See also
setVertices