cee::geo::DataTriangleFan
-
class
DataTriangleFan
: public Data 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
GeometryModel, Part, Data, DataIndexedTriangles, and DataTriangleStrip
Public Functions
-
DataTriangleFan
() Constructs an empty triangle data object.
-
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)); cee::PtrRef<cee::geo::DataTriangleFan> triangleData = new cee::geo::DataTriangleFan(vertices);
-
virtual Type
type
() const Returns Data::TRIANGLE_FAN.
-
virtual BoundingBox
boundingBox
() const Returns the bounding box of the part data.
-
std::vector<Vec3d>
vertices
() const Returns array of vertices used to build up the triangles.
A vertices array of length n, will generate n - 2 triangles
-
size_t
triangleCount
() const Returns number of triangles available.
-
void
removeAll
() Clears all data.
-