Avogadro::Rendering::Drawable#

class Drawable#

The base class for all drawable geometry and types.

This class provides the common API for drawable objects on the scene. It is not a Node object, and can only be attached to GeometryNode objects in the Scene.

Author

Marcus D. Hanwell

Subclassed by AmbientOcclusionSphereGeometry, ArrowGeometry, CurveGeometry, CylinderGeometry, DashedLineGeometry, LineStripGeometry, MeshGeometry, SphereGeometry, TextLabelBase, VolumeGeometry

Unnamed Group

inline void setRenderPass(RenderPass pass)#

The render pass in which this drawable should be rendered.

See also

Rendering::RenderPass

inline RenderPass renderPass() const#

The render pass in which this drawable should be rendered.

See also

Rendering::RenderPass

Public Functions

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

Accept a visit from our friendly visitor.

inline const GeometryNode *parent() const#

Get a pointer to the drawable object’s parent.

Returns:

Pointer to the parent node, nullptr if no parent.

inline GeometryNode *parent()#
inline void setVisible(bool visibility)#

Set the visibility of the drawable object.

Parameters:

visibility – True if the drawable is visible, false if invisible.

inline bool isVisible() const#

Get the current visibility of the drawable.

Returns:

True if visible.

virtual void render(const Camera &camera)#

Render the contents of the drawable.

Parameters:

camera – The current Camera.

inline Identifier &identifier()#

Get the identifier for the object, this stores the parent Molecule and the type represented by the geometry.

inline const Identifier &identifier() const#
virtual std::multimap<float, Identifier> hits(const Vector3f &rayOrigin, const Vector3f &rayEnd, const Vector3f &rayDirection) const#

Return the primitives that are hit by the ray.

Parameters:
  • rayOrigin – Origin of the ray.

  • rayEnd – End point of the ray.

  • rayDirection – Normalized direction of the ray.

Returns:

Sorted collection of primitives that were hit.

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

Return the primitives within the supplied area.

Parameters:

f – The frustrum defining the area highlighted.

Returns:

Collection of primitives in the area.

virtual void clear()#

Clear the contents of the node.

Protected Functions

void setParent(GeometryNode *parent)#

Set the parent node for the node.

Parameters:

parent – The parent, a value of nullptr denotes no parent node.

Protected Attributes

GeometryNode *m_parent#
bool m_visible#
RenderPass m_renderPass#
Identifier m_identifier#

Friends

friend class GeometryNode
friend void swap(Drawable &lhs, Drawable &rhs)#