Avogadro::Rendering::DashedLineGeometry#

class DashedLineGeometry : public Drawable#

The DashedLineGeometry class is used to store sets of dashed lines.

<avogadro/rendering/dashedlinegeometry.h>

Unnamed Group

size_t addDashedLine(const Vector3f &start, const Vector3f &end, const Vector4ub &color, int dashCount)#

Add a complete line strip to the object.

Note

All arrays must be the same length, or this function call will fail, returning InvalidIndex.

Parameters:
  • vertices – The 3D vertices which will be connected to form the line strip.

  • color – Vertex color. If not specified, use the current color() and opacity(). If the 3 component color is set, the current opacity() is used.

  • lineWidth – The width of the line strip.

Returns:

The index of the first vertex added by this call.

size_t addDashedLine(const Vector3f &start, const Vector3f &end, const Vector3ub &color, int dashCount)#

Add a complete line strip to the object.

Note

All arrays must be the same length, or this function call will fail, returning InvalidIndex.

Parameters:
  • vertices – The 3D vertices which will be connected to form the line strip.

  • color – Vertex color. If not specified, use the current color() and opacity(). If the 3 component color is set, the current opacity() is used.

  • lineWidth – The width of the line strip.

Returns:

The index of the first vertex added by this call.

size_t addDashedLine(const Vector3f &start, const Vector3f &end, int dashCount)#

Add a complete line strip to the object.

Note

All arrays must be the same length, or this function call will fail, returning InvalidIndex.

Parameters:
  • vertices – The 3D vertices which will be connected to form the line strip.

  • color – Vertex color. If not specified, use the current color() and opacity(). If the 3 component color is set, the current opacity() is used.

  • lineWidth – The width of the line strip.

Returns:

The index of the first vertex added by this call.

Unnamed Group

inline void setColor(const Vector3ub &c)#

The default color of the lines. This is used to set the color of new vertices when no explicit vertex color is specified.

inline Vector3ub color() const#

The default color of the lines. This is used to set the color of new vertices when no explicit vertex color is specified.

Unnamed Group

inline void setOpacity(unsigned char opacity_)#

The default opacity of the lines. This is used when either no explicit vertex color is specified, or a three component color is used.

inline unsigned char opacity() const#

The default opacity of the lines. This is used when either no explicit vertex color is specified, or a three component color is used.

Unnamed Group

inline void setLineWidth(unsigned char lineWidth_)#

The line width used for all of the lines.

inline unsigned char lineWidth() const#

The line width used for all of the lines.

Public Functions

DashedLineGeometry()#
DashedLineGeometry(const DashedLineGeometry &other)#
~DashedLineGeometry() override#
inline DashedLineGeometry &operator=(DashedLineGeometry)#
virtual void accept(Visitor&) override#

Accept a visit from our friendly visitor.

virtual void render(const Camera &camera) override#

Render the line strips.

Parameters:

camera – The current camera to be used for rendering.

virtual void clear() override#

Clear the contents of the node.

Friends

friend void swap(DashedLineGeometry &lhs, DashedLineGeometry &rhs)#
struct PackedVertex#

Public Functions

inline PackedVertex(const Vector3f &v, const Vector4ub &c)#

Public Members

Vector3f vertex#
Vector4ub color#

Public Static Functions

static inline int vertexOffset()#
static inline int colorOffset()#