cee::geo::DataTriangleStrip Class Reference

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

Public Member Functions

 DataTriangleStrip ()
 Constructs an empty triangle strip data object. More...
 
 DataTriangleStrip (const std::vector< Vec3d > &vertices)
 Constructs a triangles object from the specified vertices. More...
 
virtual Type type () const
 Returns Data::TRIANGLE_STRIP. 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::DataTriangleStrip:
cee::geo::Data cee::RefCountedObject

Detailed Description

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

For many surfaces and shapes, you will need to draw several connected triangles. You can save a lot of time by drawing a strip of connected triangles. After specifying the first three vertices for the initial triangle, you only need to specify a single point for each additional triangle. Each additional triangle will be one the added point (Vn) in combination with the two previous points (Vn-1 and Vn-2).

    Indices:    0 1 2 3 4 5 ...
    Triangles: {0 1 2}
                 {1 2 3}
                   {2 3 4}
                     {3 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::DataTriangleFan

Constructor & Destructor Documentation

cee::geo::DataTriangleStrip::DataTriangleStrip ( )

Constructs an empty triangle strip data object.

cee::geo::DataTriangleStrip::DataTriangleStrip ( 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(2, 1, 0));

Member Function Documentation

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

Returns the bounding box of the part data.

Implements cee::geo::Data.

void cee::geo::DataTriangleStrip::removeAll ( )

Clears all data.

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

Sets vertices of all the triangles.

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

Returns number of triangles available.

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

Returns Data::TRIANGLE_STRIP.

Implements cee::geo::Data.

std::vector< Vec3d > cee::geo::DataTriangleStrip::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