cee::vis::MarkupPartLines Class Reference

A MarkupModel part for drawing lines. More...

Public Member Functions

 MarkupPartLines ()
 Constructs an empty part. More...
 
 MarkupPartLines (const Color3f &color, float lineWidth, bool alwaysVisible, float eyeLiftFactor)
 Constructs a part with the given settings. More...
 
virtual PartType type () const
 Returns the type of the part. Always MarkupPart::LINES. 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 Mat4dtransformation () 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 Color3fcolor () const
 Returns the current line color. More...
 
void setColor (const Color3f &color)
 Sets the line color. More...
 
float lineWidth () const
 Returns the current line width in pixels. More...
 
void setLineWidth (float lineWidth)
 Sets the line width in pixels. More...
 
bool alwaysVisible () const
 Returns true if the lines are always visible and does not use the z buffer. More...
 
void setAlwaysVisible (bool showAlways)
 Sets if the lines should be always visible and not use the z buffer. More...
 
float eyeLiftFactor () const
 Returns the eye lift factor of the lines. More...
 
void setEyeLiftFactor (float factor)
 Sets the eye lift factor for the lines. More...
 
void add (const Vec3d &vertex1, const Vec3d &vertex2)
 Adds the given line to the part. More...
 
void add (const std::vector< Vec3d > &vertices)
 Adds the given lines to the part. More...
 
size_t count () const
 Returns the number of line segments in the part. More...
 
void removeAll ()
 Removes all lines from the part. More...
 
const std::vector< Vec3d > & vertices () const
 Returns the vertices describing the line segments of the part. More...
 
- Public Member Functions inherited from cee::vis::MarkupPart
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...
 
- 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...
 

Static Public Member Functions

static PtrRef< MarkupPartLinescreate (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. More...
 
static PtrRef< MarkupPartLinescreate (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> More...
 

Additional Inherited Members

- Public Types inherited from cee::vis::MarkupPart
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...
 
Inheritance diagram for cee::vis::MarkupPartLines:
cee::vis::MarkupPart cee::RefCountedObject

Detailed Description

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

Constructor & Destructor Documentation

cee::vis::MarkupPartLines::MarkupPartLines ( )

Constructs an empty part.

cee::vis::MarkupPartLines::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.

Member Function Documentation

void cee::vis::MarkupPartLines::add ( const Vec3d vertex1,
const Vec3d vertex2 
)

Adds the given line to the part.

void cee::vis::MarkupPartLines::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.

bool cee::vis::MarkupPartLines::alwaysVisible ( ) const

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

cee::BoundingBox cee::vis::MarkupPartLines::boundingBox ( ) const
virtual

Returns the current bounding box of the part.

Implements cee::vis::MarkupPart.

const Color3f & cee::vis::MarkupPartLines::color ( ) const

Returns the current line color.

size_t cee::vis::MarkupPartLines::count ( ) const

Returns the number of line segments in the part.

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

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.
PtrRef< MarkupPartLines > cee::vis::MarkupPartLines::create ( const Vec3d vertex1,
const Vec3d vertex2,
const Color3f color,
float  lineWidth = 1.0f,
bool  alwaysVisible = false,
float  eyeLiftFactor = 0.0f 
)
static

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.
float cee::vis::MarkupPartLines::eyeLiftFactor ( ) const

Returns the eye lift factor of the lines.

See also
setEyeLiftFactor
float cee::vis::MarkupPartLines::lineWidth ( ) const

Returns the current line width in pixels.

int cee::vis::MarkupPartLines::priority ( ) const
virtual

Returns the render priority of the part.

Implements cee::vis::MarkupPart.

void cee::vis::MarkupPartLines::removeAll ( )

Removes all lines from the part.

void cee::vis::MarkupPartLines::setAlwaysVisible ( bool  showAlways)

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

void cee::vis::MarkupPartLines::setColor ( const Color3f color)

Sets the line color.

void cee::vis::MarkupPartLines::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 cee::vis::MarkupPartLines::setLineWidth ( float  lineWidth)

Sets the line width in pixels.

void cee::vis::MarkupPartLines::setPriority ( int  priority)
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 11.

Implements cee::vis::MarkupPart.

void cee::vis::MarkupPartLines::setTransformation ( const Mat4d matrix)
virtual

Sets the transformation matrix to use for the part.

Implements cee::vis::MarkupPart.

const Mat4d & cee::vis::MarkupPartLines::transformation ( ) const
virtual

Returns the current transformation matrix for the part.

Implements cee::vis::MarkupPart.

MarkupPart::PartType cee::vis::MarkupPartLines::type ( ) const
virtual

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

Implements cee::vis::MarkupPart.

const std::vector< Vec3d > & cee::vis::MarkupPartLines::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>