A MarkupModel part for drawing triangles. More...
Public Member Functions | |
MarkupPartTriangles () | |
Constructs an empty part. More... | |
MarkupPartTriangles (const Color3f &color, float opacity, float polygonOffsetFactor, float eyeLiftFactor) | |
Constructs a part with the given settings. More... | |
virtual PartType | type () const |
Returns the type of the part. Always MarkupPart::TRIANGLES. More... | |
virtual BoundingBox | boundingBox () const |
Returns the current bounding box of the part. More... | |
virtual void | setPriority (int priority) |
Sets render priority of the part. More... | |
virtual int | priority () const |
Returns the render priority of the part. More... | |
virtual const Mat4d & | transformation () const |
Returns the current transformation matrix for the part. More... | |
virtual void | setTransformation (const Mat4d &matrix) |
Sets the transformation matrix to use for the part. More... | |
const Color3f & | color () const |
Returns the color of the triangles. More... | |
void | setColor (const Color3f &color) |
Sets the color of the triangles. More... | |
float | opacity () const |
Returns the opacity of the triangles. More... | |
void | setOpacity (float opacity) |
Sets the opacity of the triangles. More... | |
bool | lighting () const |
Returns true if lighting is enabled for this part. More... | |
void | setLighting (bool enable) |
Sets if the triangles should be lit (true) or unlit (false) More... | |
float | polygonOffsetFactor () const |
Returns the polygon offset factor for the triangles. More... | |
void | setPolygonOffsetFactor (float factor) |
Sets the polygon offset factor for the triangles. More... | |
float | eyeLiftFactor () const |
Returns the eye lift factor of the triangles. More... | |
void | setEyeLiftFactor (float factor) |
Sets the eye lift factor for the triangles. More... | |
void | add (const Vec3d &vertex1, const Vec3d &vertex2, const Vec3d &vertex3) |
Adds a triangle to the part. More... | |
void | add (const std::vector< Vec3d > &vertices) |
Adds a set of triangles to the part. More... | |
size_t | count () const |
Returns the number of triangles. More... | |
void | removeAll () |
Removes all triangles from the part. More... | |
const std::vector< Vec3d > & | vertices () const |
Returns the vertices of all triangles in the part. More... | |
![]() | |
bool | visible () const |
Returns true if the part is visible. More... | |
void | setVisible (bool visible) |
Sets if the part should be visible or not. More... | |
![]() | |
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... | |
Static Public Member Functions | |
static PtrRef< MarkupPartTriangles > | create (const std::vector< Vec3d > &vertices, const Color3f &color, float opacity=1.0f, float polygonOffsetFactor=0.0f, float eyeLiftFactor=0.0f) |
Returns a newly created part with the given triangles and settings. More... | |
Additional Inherited Members | |
![]() | |
enum | PartType { LABELS, TEXTS_3D, TRIANGLES, INSTANCED_GEOMETRY, LINES, POINTS, ARROWS, FIXED_SIZE_ARROW, FIXED_SIZE_SPHERE, FIXED_SIZE_IMAGE_GLYPH } |
Enum specifying the type of MarkupPart. More... | |
A MarkupModel part for drawing triangles.
The part can contain any number of triangles, but all triangles will share the same settings for
cee::vis::MarkupPartTriangles::MarkupPartTriangles | ( | ) |
Constructs an empty part.
cee::vis::MarkupPartTriangles::MarkupPartTriangles | ( | const Color3f & | color, |
float | opacity, | ||
float | polygonOffsetFactor, | ||
float | eyeLiftFactor | ||
) |
Constructs a part with the given settings.
void cee::vis::MarkupPartTriangles::add | ( | const Vec3d & | vertex1, |
const Vec3d & | vertex2, | ||
const Vec3d & | vertex3 | ||
) |
Adds a triangle to the part.
The vertices should be given in counter-clockwise order.
void cee::vis::MarkupPartTriangles::add | ( | const std::vector< Vec3d > & | vertices | ) |
Adds a set of triangles to the part.
Each triangle is described by three vertices and should be given in counter-clockwise order.
|
virtual |
Returns the current bounding box of the part.
Implements cee::vis::MarkupPart.
const Color3f & cee::vis::MarkupPartTriangles::color | ( | ) | const |
Returns the color of the triangles.
size_t cee::vis::MarkupPartTriangles::count | ( | ) | const |
Returns the number of triangles.
|
static |
Returns a newly created part with the given triangles and settings.
The returned part will have vertices.size()/3
triangles, defined in counter clock-wise order.
float cee::vis::MarkupPartTriangles::eyeLiftFactor | ( | ) | const |
Returns the eye lift factor of the triangles.
bool cee::vis::MarkupPartTriangles::lighting | ( | ) | const |
Returns true if lighting is enabled for this part.
float cee::vis::MarkupPartTriangles::opacity | ( | ) | const |
Returns the opacity of the triangles.
1.0 is opaque and 0.0 is fully transparent (invisible).
float cee::vis::MarkupPartTriangles::polygonOffsetFactor | ( | ) | const |
Returns the polygon offset factor for the triangles.
|
virtual |
Returns the render priority of the part.
The default priority is cee::UNDEFINED_INT. In this case the priority will be set to 99 if the opacity is less than 0.999. Else set to 10.
Implements cee::vis::MarkupPart.
void cee::vis::MarkupPartTriangles::removeAll | ( | ) |
Removes all triangles from the part.
void cee::vis::MarkupPartTriangles::setColor | ( | const Color3f & | color | ) |
Sets the color of the triangles.
void cee::vis::MarkupPartTriangles::setEyeLiftFactor | ( | float | factor | ) |
Sets the eye lift factor for the triangles.
The eye lift factor specifies if the triangles should be moved towards the camera (or away from the camera if the factor is negative).
This is useful for controlling the ordering of items that are defined in the same plane.
void cee::vis::MarkupPartTriangles::setLighting | ( | bool | enable | ) |
Sets if the triangles should be lit (true) or unlit (false)
void cee::vis::MarkupPartTriangles::setOpacity | ( | float | opacity | ) |
Sets the opacity of the triangles.
1.0 is opaque and 0.0 is fully transparent (invisible).
void cee::vis::MarkupPartTriangles::setPolygonOffsetFactor | ( | float | factor | ) |
Sets the polygon offset factor for the triangles.
The factor controls the moving of the polygons slightly in the z buffer. Both positive and negative factors can be used to move forward and backward in the z buffer.
Used in cooperation with eye lift to control draw order with items in the same plane.
|
virtual |
Sets render priority of the part.
The render priority determines the order in which parts get rendered. Parts with lower priorities get rendered first. The default priority is cee::UNDEFINED_INT. In this case the priority will be set to 99 if the opacity is less than 0.999. Else set to 10. Setting the priority to another value will override this.
Implements cee::vis::MarkupPart.
|
virtual |
Sets the transformation matrix to use for the part.
Implements cee::vis::MarkupPart.
|
virtual |
Returns the current transformation matrix for the part.
Implements cee::vis::MarkupPart.
|
virtual |
Returns the type of the part. Always MarkupPart::TRIANGLES.
Implements cee::vis::MarkupPart.
const std::vector< Vec3d > & cee::vis::MarkupPartTriangles::vertices | ( | ) | const |
Returns the vertices of all triangles in the part.