AvogadroLibs 2.1.0-20261111
Loading...
Searching...
No Matches
CurveGeometry Class Referenceabstract
Inheritance diagram for CurveGeometry:
Drawable BSplineGeometry BezierGeometry Cartoon

Public Member Functions

 CurveGeometry (bool flat)
void accept (Visitor &visitor) override
void render (const Camera &camera) override
 Render the cylinder geometry.
void addPoint (const Vector3f &pos, const Vector3ub &color, float radius, size_t group, size_t id)
const std::vector< Line * > & lines () const
void tessellate (size_t lineIndex, std::vector< ColorNormalVertex > &vertices, std::vector< unsigned int > &indices) const
bool isFlatLine (size_t lineIndex) const
Public Member Functions inherited from Drawable
 Drawable (const Drawable &other)
Drawable & operator= (Drawable)
const GeometryNode * parent () const
 Get a pointer to the drawable object's parent.
GeometryNode * parent ()
void setVisible (bool visibility)
 Set the visibility of the drawable object.
bool isVisible () const
 Get the current visibility of the drawable.
Identifier & identifier ()
const Identifier & identifier () const
virtual std::multimap< float, Identifier > hits (const Vector3f &rayOrigin, const Vector3f &rayEnd, const Vector3f &rayDirection) const
virtual void clear ()
void setRenderPass (RenderPass pass)
RenderPass renderPass () const

Static Public Attributes

static const size_t SKIPPED

Protected Member 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)
Core::Array< Identifier > areaHits (const Frustrum &f) const override
Protected Member Functions inherited from Drawable
void setParent (GeometryNode *parent)
 Set the parent node for the node.

Protected Attributes

std::vector< Line * > m_lines
std::map< size_t, size_t > m_indexMap
ShaderInfo m_shaderInfo
bool m_dirty
bool m_canBeFlat
Protected Attributes inherited from Drawable
GeometryNode * m_parent
bool m_visible
RenderPass m_renderPass
Identifier m_identifier

Member Function Documentation

◆ accept()

void accept ( Visitor & visitor)
overridevirtual

Accept a visit from our friendly visitor.

Reimplemented from Drawable.

◆ render()

void render ( const Camera & camera)
overridevirtual
Parameters
cameraThe current camera to be used for rendering.

Reimplemented from Drawable.

◆ tessellate()

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
lineIndexIndex into lines().
verticesOutput vertices (cleared first). Empty if the line is too short to produce any geometry (or lineIndex is out of range).
indicesOutput triangle list into vertices (cleared first). Empty for flat lines, see isFlatLine().

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

◆ areaHits()

Core::Array< Identifier > areaHits ( const Frustrum & f) const
overrideprotectedvirtual

Return the primitives within the supplied area.

Parameters
fThe frustrum defining the area highlighted.
Returns
Collection of primitives in the area.

Reimplemented from Drawable.


The documentation for this class was generated from the following file: