Avogadro::Rendering::CylinderGeometry#

class CylinderGeometry : public Drawable#

The CylinderGeometry contains one or more cylinders.

<avogadro/rendering/cylindergeometry.h>

Author

Marcus D. Hanwell

Public Functions

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

Accept a visit from our friendly visitor.

void update()#

Update the VBOs, IBOs etc ready for rendering.

virtual void render(const Camera &camera) override#

Render the cylinder geometry.

Parameters:

camera – The current camera to be used for rendering.

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

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.

void addCylinder(const Vector3f &pos1, const Vector3f &pos2, float radius, const Vector3ub &color)#

Add a cylinder to the geometry object.

Parameters:
  • pos1 – Base of the cylinder axis.

  • pos2 – Top of the cylinder axis.

  • radius – Radius of the cylinder.

  • color – Color the cylinder will be rendered.

void addCylinder(const Vector3f &pos1, const Vector3f &pos2, float radius, const Vector3ub &color1, const Vector3ub &color2)#

Add a cylinder to the geometry object.

Parameters:
  • pos1 – Base of the cylinder axis.

  • pos2 – Top of the cylinder axis.

  • radius – Radius of the cylinder.

  • color1 – Color the start of the base of the cylinder.

  • color2 – Color of the end of the cylinder.

void addCylinder(const Vector3f &pos1, const Vector3f &pos2, float radius, const Vector3ub &color, size_t index)#

Add a cylinder to the geometry object.

Parameters:
  • pos1 – Base of the cylinder axis.

  • pos2 – Top of the cylinder axis.

  • radius – Radius of the cylinder.

  • color – Color the cylinder will be rendered.

  • index – The index of the cylinder being added.

void addCylinder(const Vector3f &pos1, const Vector3f &pos2, float radius, const Vector3ub &color, const Vector3ub &color2, size_t index)#

Add a cylinder to the geometry object.

Parameters:
  • pos1 – Base of the cylinder axis.

  • pos2 – Top of the cylinder axis.

  • radius – Radius of the cylinder.

  • color – Color the start of the base of the cylinder.

  • color2 – Color of the end of the cylinder.

  • index – The index of the cylinder being added.

inline std::vector<CylinderColor> &cylinders()#

Get a reference to the cylinders.

inline const std::vector<CylinderColor> &cylinders() const#
virtual void clear() override#

Clear the contents of the node.

inline size_t size() const#

Get the number of cylinders in the node object.

inline void setOpacity(float o)#

Set the opacity of the cylinders in this group.

Friends

friend void swap(CylinderGeometry &lhs, CylinderGeometry &rhs)#