cee::vis::MarkupPartLines

class MarkupPartLines : public MarkupPart

A MarkupModel part for drawing lines.

The part can contain any number of lines, but all lines will share the same settings for

  • color

  • line width (in pixels)

  • always visible. True if the lines should always be visible and not use the z buffer.

  • eye lift factor. A factor to move the lines towards the camera. This is used to control item drawn in the same plane.

See also

MarkupModel

Public Functions

MarkupPartLines()

Constructs an empty part.

MarkupPartLines(const Color3f &color, float lineWidth, bool alwaysVisible, float eyeLiftFactor)

Constructs a part with the given settings.

  • color: The line color for all lines in the part

  • lineWidth: The line width in pixels for all lines in the part

  • alwaysVisible: If true, the lines will always be visible and not use the z buffer.

  • eyeLiftFactor: A factor to move the lines towards the camera. This is used to control item drawn in the same plane.

virtual PartType type() const

Returns the type of the part. Always MarkupPart::LINES.

virtual BoundingBox boundingBox() const

Returns the current bounding box of the part.

virtual void setPriority(int priority)

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 11.

virtual int priority() const

Returns the render priority of the part.

virtual const Mat4d &transformation() const

Returns the current transformation matrix for the part.

virtual void setTransformation(const Mat4d &matrix)

Sets the transformation matrix to use for the part.

const Color3f &color() const

Returns the current line color.

void setColor(const Color3f &color)

Sets the line color.

float lineWidth() const

Returns the current line width in pixels.

void setLineWidth(float lineWidth)

Sets the line width in pixels.

bool alwaysVisible() const

Returns true if the lines are always visible and does not use the z buffer.

void setAlwaysVisible(bool showAlways)

Sets if the lines should be always visible and not use the z buffer.

float eyeLiftFactor() const

Returns the eye lift factor of the lines.

See also

setEyeLiftFactor

void setEyeLiftFactor(float factor)

Sets the eye lift factor for the lines.

The eye lift factor specifies if the lines 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 add(const Vec3d &vertex1, const Vec3d &vertex2)

Adds the given line to the part.

void add(const std::vector<Vec3d> &vertices)

Adds the given lines to the part.

The array must contain pairs of vertices specifying the line segments to add.

size_t count() const

Returns the number of line segments in the part.

void removeAll()

Removes all lines from the part.

const std::vector<Vec3d> &vertices() const

Returns the vertices describing the line segments of the part.

The array contains pairs of start, end vertices for the lines. E.g.: <v1,v2,v3,v4> = line <v1 -> v2> , line <v3 -> v4>

Public Static Functions

static PtrRef<MarkupPartLines> create(const std::vector<Vec3d> &vertices, const Color3f &color, float lineWidth = 1.0f, bool alwaysVisible = false, float eyeLiftFactor = 0.0f)

Returns a newly created part with the given line segments and settings.

The returned part will have vertices.size()/2 lines, as the array contains pairs of <start,end> vertices.

  • color: The line color for all lines in the part

  • lineWidth: The line width in pixels for all lines in the part

  • alwaysVisible: If true, the lines will always be visible and not use the z buffer.

  • eyeLiftFactor: A factor to move the lines towards the camera. This is used to control item drawn in the same plane.

static PtrRef<MarkupPartLines> create(const Vec3d &vertex1, const Vec3d &vertex2, const Color3f &color, float lineWidth = 1.0f, bool alwaysVisible = false, float eyeLiftFactor = 0.0f)

Returns a newly created part with one line segment <vertex1 -> vertex2>

The returned part will have vertices.size()/2 lines, as the array contains pairs of <start,end> vertices.

  • color: The line color for all lines in the part

  • lineWidth: The line width in pixels for all lines in the part

  • alwaysVisible: If true, the lines will always be visible and not use the z buffer.

  • eyeLiftFactor: A factor to move the lines towards the camera. This is used to control item drawn in the same plane.