cee::geo::DataIndexedPolylines Class Reference

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

Public Member Functions

 DataIndexedPolylines ()
 Constructs an empty data object. More...
 
 DataIndexedPolylines (const std::vector< Vec3d > &vertices, const std::vector< std::vector< unsigned int > > &indices)
 Constructs polyline data defined by an array of vertices and an array of indices. More...
 
virtual Type type () const
 Returns Data::INDEXED_POLYLINES. More...
 
virtual BoundingBox boundingBox () const
 Returns the bounding box of the part data. More...
 
size_t vertexCount () const
 Returns number of vertices for all polylines. More...
 
std::vector< Vec3dvertices () const
 Returns an array of vertices for all the polylines. More...
 
void setVertices (const std::vector< Vec3d > &vertices)
 Sets vertices used by all the polylines. More...
 
size_t polylineCount () const
 Returns number of polylines. More...
 
std::vector< std::vector< unsigned int > > polylinesIndices () const
 Returns the two dimensional array of indices for all polylines in data. More...
 
void setPolylinesIndices (const std::vector< std::vector< unsigned int > > &indices)
 Sets the indices into the vertex array for all polylines. 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::DataIndexedPolylines:
cee::geo::Data cee::RefCountedObject

Detailed Description

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

Polylines data consist of an array of vertices, and a two dimensional array of indices where each entry describes a polyline. You can have as many polylines as you want, and each polyline can have any number of segments.

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

Constructor & Destructor Documentation

cee::geo::DataIndexedPolylines::DataIndexedPolylines ( )

Constructs an empty data object.

cee::geo::DataIndexedPolylines::DataIndexedPolylines ( const std::vector< Vec3d > &  vertices,
const std::vector< std::vector< unsigned int > > &  indices 
)

Constructs polyline data defined by an array of vertices and an array of indices.

indices is a two dimensional array where each entry describes a polyline. You can have as many polylines as you want, and each polyline can have any number of segments.

Example, part containing two polylines:

// Polyline vertices
std::vector<cee::Vec3d> polylinesVertices;
polylinesVertices.push_back(cee::Vec3d(0.0, 0.0, 0.0));
polylinesVertices.push_back(cee::Vec3d(1.0, 0.0, 0.0));
polylinesVertices.push_back(cee::Vec3d(1.5, 0.0, 1.0));
polylinesVertices.push_back(cee::Vec3d(0.0, 0.0, -1.0));
polylinesVertices.push_back(cee::Vec3d(1.0, 0.0, -1.0));
polylinesVertices.push_back(cee::Vec3d(1.5, 0.0, 0.0));
// Polyline indices
std::vector<unsigned int> firstLineIndices = { 0, 1, 2 };
std::vector<unsigned int> secondLineIndices = { 3, 4, 5 };
std::vector<std::vector<unsigned int> > polylinesIndices;
polylinesIndices.push_back(firstLineIndices); // First polyline
polylinesIndices.push_back(secondLineIndices); // Second polyline
// Create polyline data part using the vertices and connectivities
cee::PtrRef<cee::geo::DataIndexedPolylines> linePartData = new cee::geo::DataIndexedPolylines(polylinesVertices, polylinesIndices);

Member Function Documentation

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

Returns the bounding box of the part data.

This also includes vertices which may not be used by the indices data.

Implements cee::geo::Data.

size_t cee::geo::DataIndexedPolylines::polylineCount ( ) const

Returns number of polylines.

std::vector< std::vector< unsigned int > > cee::geo::DataIndexedPolylines::polylinesIndices ( ) const

Returns the two dimensional array of indices for all polylines in data.

See also
setPolylinesIndices
vertices
void cee::geo::DataIndexedPolylines::removeAll ( )

Clears all data.

void cee::geo::DataIndexedPolylines::setPolylinesIndices ( const std::vector< std::vector< unsigned int > > &  indices)

Sets the indices into the vertex array for all polylines.

The indices must be a two dimensional array, even if there is only one polyline.

Example:

std::vector<unsigned int> firstLineIndices = { 0, 1, 2 };
std::vector<unsigned int> secondLineIndices = { 3, 4, 5 };
std::vector<std::vector<unsigned int> > polylinesIndices;
polylinesIndices.push_back(firstLineIndices);
polylinesIndices.push_back(secondLineIndices);
// Create polyline data part using the vertices and connectivities
linePartData->setVertices(polylinesVertices);
linePartData->setPolylinesIndices(polylinesIndices);
Note
This does not affect the bounding box.
See also
polylinesIndices
setVertices
void cee::geo::DataIndexedPolylines::setVertices ( const std::vector< Vec3d > &  vertices)

Sets vertices used by all the polylines.

These vertices are used to build up each polyline defined by their associated connectivity indices.

See also
vertices
setPolylinesIndices
Data::Type cee::geo::DataIndexedPolylines::type ( ) const
virtual
size_t cee::geo::DataIndexedPolylines::vertexCount ( ) const

Returns number of vertices for all polylines.

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

Returns an array of vertices for all the polylines.

These vertices are used to build up each polyline defined by their associated connectivity indices.

See also
polylinesIndices
setVertices