AvogadroLibs  1.96.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Drawable Class Reference

The base class for all drawable geometry and types. More...

#include <avogadro/rendering/drawable.h>

Inheritance diagram for Drawable:
AmbientOcclusionSphereGeometry ArrowGeometry CurveGeometry CylinderGeometry DashedLineGeometry LineStripGeometry MeshGeometry SphereGeometry TextLabelBase VolumeGeometry

Public Member Functions

 Drawable (const Drawable &other)
 
Drawableoperator= (Drawable)
 
virtual void accept (Visitor &)
 
const GeometryNodeparent () const
 Get a pointer to the drawable object's parent. More...
 
GeometryNodeparent ()
 
void setVisible (bool visibility)
 Set the visibility of the drawable object. More...
 
bool isVisible () const
 Get the current visibility of the drawable. More...
 
virtual void render (const Camera &camera)
 Render the contents of the drawable. More...
 
Identifieridentifier ()
 
const Identifieridentifier () const
 
virtual std::multimap< float, Identifierhits (const Vector3f &rayOrigin, const Vector3f &rayEnd, const Vector3f &rayDirection) const
 
virtual Core::Array< IdentifierareaHits (const Frustrum &f) const
 
virtual void clear ()
 
void setRenderPass (RenderPass pass)
 
RenderPass renderPass () const
 

Protected Member Functions

void setParent (GeometryNode *parent)
 Set the parent node for the node. More...
 

Protected Attributes

GeometryNodem_parent
 
bool m_visible
 
RenderPass m_renderPass
 
Identifier m_identifier
 

Detailed Description

Author
Marcus D. Hanwell

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.

Member Function Documentation

◆ accept()

virtual void accept ( Visitor )
virtual

◆ parent()

const GeometryNode* parent ( ) const
Returns
Pointer to the parent node, nullptr if no parent.

◆ setVisible()

void setVisible ( bool  visibility)
Parameters
visibilityTrue if the drawable is visible, false if invisible.

◆ isVisible()

bool isVisible ( ) const
Returns
True if visible.

◆ setRenderPass()

void setRenderPass ( RenderPass  pass)

The render pass in which this drawable should be rendered.

See also
Rendering::RenderPass

◆ renderPass()

RenderPass renderPass ( ) const

The render pass in which this drawable should be rendered.

See also
Rendering::RenderPass

◆ render()

virtual void render ( const Camera camera)
virtual

◆ identifier()

Identifier& identifier ( )

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

◆ hits()

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

Return the primitives that are hit by the ray.

Parameters
rayOriginOrigin of the ray.
rayEndEnd point of the ray.
rayDirectionNormalized direction of the ray.
Returns
Sorted collection of primitives that were hit.

Reimplemented in SphereGeometry, CylinderGeometry, and AmbientOcclusionSphereGeometry.

◆ areaHits()

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

Return the primitives within the supplied area.

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

Reimplemented in SphereGeometry, and CurveGeometry.

◆ clear()

virtual void clear ( )
virtual

◆ setParent()

void setParent ( GeometryNode parent)
protected
Parameters
parentThe parent, a value of nullptr denotes no parent node.

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