Avogadro::Rendering::CurveGeometry#

class CurveGeometry : public Drawable#

Subclassed by BSplineGeometry, BezierGeometry

Public Functions

CurveGeometry()#
CurveGeometry(bool flat)#
~CurveGeometry() override#
virtual void accept(Visitor &visitor) override#

Accept a visit from our friendly visitor.

virtual void render(const Camera &camera) override#

Render the cylinder geometry.

Parameters:

camera – The current camera to be used for rendering.

void addPoint(const Vector3f &pos, const Vector3ub &color, float radius, size_t group, size_t id)#
inline const std::vector<Line*> &lines() const#
void tessellate(size_t lineIndex, std::vector<ColorNormalVertex> &vertices, std::vector<unsigned int> &indices) const#

Compute the triangle mesh (or, for flat lines, the centre-line polyline) for one line, without touching OpenGL. This is exactly the data uploaded to the GPU by render(), and honours the circleResolution(), appendCirclePoints() and computeScale() hooks of subclasses.

Parameters:
  • lineIndex – Index into lines().

  • vertices – Output vertices (cleared first). Empty if the line is too short to produce any geometry (or lineIndex is out of range).

  • indices – Output triangle list into vertices (cleared first). Empty for flat lines, see isFlatLine().

bool isFlatLine(size_t lineIndex) const#
Returns:

true if the line is drawn on screen as a GL_LINE_STRIP of width -lines()[lineIndex]->radius pixels. For such lines tessellate() returns the polyline vertices along the curve (colour and a normal each) and no indices.

Public Static Attributes

static const size_t SKIPPED#

Protected Functions

virtual void update(int index)#
virtual Vector3f computeCurvePoint(float t, const std::vector<Point> &points) const = 0#
virtual size_t circleResolution(bool flat) const#
virtual void appendCirclePoints(std::vector<ColorNormalVertex> &result, const Eigen::Affine3f &a, const Eigen::Affine3f &b, bool flat) const#
virtual float computeScale(size_t index, float t, float scale) const#
void processShaderError(bool error)#
virtual Core::Array<Identifier> areaHits(const Frustrum &f) const override#

Return the primitives within the supplied area.

Parameters:

f – The frustrum defining the area highlighted.

Returns:

Collection of primitives in the area.

Protected Attributes

std::vector<Line*> m_lines#
std::map<size_t, size_t> m_indexMap#
ShaderInfo m_shaderInfo#
bool m_dirty#
bool m_canBeFlat#