kalzium
Avogadro::Painter Class Reference
#include <painter.h>

Detailed Description
Pure virtual Painter base class to be implemented by painters.This class is a pure virtual base class of the Painter. It should be implemented by painters in order to satisfy all primitives objects to be drawn by the engines.
- See also:
- GLPainter, POVPainter
Definition at line 47 of file src/painter.h.
Public Member Functions | |
| virtual void | drawArc (const Eigen::Vector3d &origin, const Eigen::Vector3d &direction1, const Eigen::Vector3d &direction2, double radius, double lineWidth, bool alternateAngle=false)=0 |
| virtual void | drawCone (const Eigen::Vector3d &base, const Eigen::Vector3d &tip, double radius)=0 |
| virtual void | drawCylinder (const Eigen::Vector3d &end1, const Eigen::Vector3d &end2, double radius)=0 |
| virtual void | drawLine (const Eigen::Vector3d &start, const Eigen::Vector3d &end, double lineWidth)=0 |
| virtual void | drawMultiCylinder (const Eigen::Vector3d &end1, const Eigen::Vector3d &end2, double radius, int order, double shift)=0 |
| virtual void | drawMultiLine (const Eigen::Vector3d &start, const Eigen::Vector3d &end, double lineWidth, int order, short stipple)=0 |
| virtual void | drawQuadrilateral (const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, const Eigen::Vector3d &point3, const Eigen::Vector3d &point4, double lineWidth)=0 |
| virtual void | drawShadedQuadrilateral (const Eigen::Vector3d &point1, const Eigen::Vector3d &point2, const Eigen::Vector3d &point3, const Eigen::Vector3d &point4)=0 |
| virtual void | drawShadedSector (const Eigen::Vector3d &origin, const Eigen::Vector3d &direction1, const Eigen::Vector3d &direction2, double radius, bool alternateAngle=false)=0 |
| virtual void | drawSphere (const Eigen::Vector3d ¢er, double radius)=0 |
| virtual void | drawSpline (const QVector< Eigen::Vector3d > &pts, double radius)=0 |
| virtual int | drawText (const Eigen::Vector3d &pos, const QString &string) const =0 |
| virtual int | drawText (const QPoint &pos, const QString &string) const =0 |
| virtual int | drawText (int x, int y, const QString &string) const =0 |
| virtual void | drawTriangle (const Eigen::Vector3d &p1, const Eigen::Vector3d &p2, const Eigen::Vector3d &p3, const Eigen::Vector3d &n)=0 |
| virtual void | drawTriangle (const Eigen::Vector3d &p1, const Eigen::Vector3d &p2, const Eigen::Vector3d &p3)=0 |
| Painter () | |
| virtual int | quality () const =0 |
| virtual void | setColor (float red, float green, float blue, float alpha=1.0)=0 |
| virtual void | setColor (const Color *color)=0 |
| virtual void | setName (Primitive::Type type, int id)=0 |
| virtual void | setName (const Primitive *primitive)=0 |
| ~Painter () | |
Constructor & Destructor Documentation
| Avogadro::Painter::Painter | ( | ) |
| Avogadro::Painter::~Painter | ( | ) |
Member Function Documentation
| virtual void Avogadro::Painter::drawArc | ( | const Eigen::Vector3d & | origin, | |
| const Eigen::Vector3d & | direction1, | |||
| const Eigen::Vector3d & | direction2, | |||
| double | radius, | |||
| double | lineWidth, | |||
| bool | alternateAngle = false | |||
| ) | [pure virtual] |
Draws an arc.
The arc is defined by three vectors, the center of the circle, and two vectors that define the lines going out from the center of the circle to the circumference of the circle. The actual points on the circumference are found using these two vectors and the radius of the circle.
- Parameters:
-
origin the center of the circle whose circumference this arc is a portion of. direction1 a vector defining the line the start of the arc will lie on. direction2 a vector defining the line the end of the arc will lie on. radius the radius of the circle whose circumference this arc is a portion of. lineWidth the thickness of the line the arc will be drawn with. alternateAngle whether to draw the obtuse angle made by the two vectors instead of the acute angle between them.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawCone | ( | const Eigen::Vector3d & | base, | |
| const Eigen::Vector3d & | tip, | |||
| double | radius | |||
| ) | [pure virtual] |
Draws a cone between the tip and the base with the base radius given.
- Parameters:
-
base the position of the base of the cone. tip the position of the tip of the cone. radius the radius of the base of the cone.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawCylinder | ( | const Eigen::Vector3d & | end1, | |
| const Eigen::Vector3d & | end2, | |||
| double | radius | |||
| ) | [pure virtual] |
Draws a cylinder, leaving the Painter choose the appropriate detail level based on the apparent radius (ratio of radius over distance) and the global quality setting.
- Parameters:
-
end1 the position of the first end of the cylinder. end2 the position of the second end of the cylinder. radius the radius, i.e. half-width of the cylinder.
Implemented in Avogadro::GLPainter.
| virtual void Avogadro::Painter::drawLine | ( | const Eigen::Vector3d & | start, | |
| const Eigen::Vector3d & | end, | |||
| double | lineWidth | |||
| ) | [pure virtual] |
Draws a line between the given points of the given width.
- Parameters:
-
start the position of the start of the line. end the position of the end of the line. lineWidth the width of the line.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawMultiCylinder | ( | const Eigen::Vector3d & | end1, | |
| const Eigen::Vector3d & | end2, | |||
| double | radius, | |||
| int | order, | |||
| double | shift | |||
| ) | [pure virtual] |
Draws a multiple cylinder (see below), leaving the Painter choose the appropriate detail level based on the apparent radius (ratio of radius over distance) and the global quality setting.
What is a "multiple cylinder"? Think bond of order two or more between two atoms. This function is here to allow drawing multiple bonds in a single call.
This function takes care of rendering multiple bonds in such a way that the individual bonds avoid hiding each other, at least in the defaut viewpoint of a molecule. To achieves that, it asks the GLWidget for the normal vector of the molecule's best-fitting plane.
- Parameters:
-
end1 the position of the first end of the bond. end2 the position of the second end of the bond. radius the radius, i.e. half-width of each cylinder. order the multiplicity order of the bond, e.g. 2 for a double bond. When this parameter equals 1, this function is equivalent to drawCylinder(). shift how far away from the central axis the cylinders are shifted. In other words this influences the total width of multiple bonds.
Implemented in Avogadro::GLPainter.
| virtual void Avogadro::Painter::drawMultiLine | ( | const Eigen::Vector3d & | start, | |
| const Eigen::Vector3d & | end, | |||
| double | lineWidth, | |||
| int | order, | |||
| short | stipple | |||
| ) | [pure virtual] |
Draws a multiple line between the given points.
This function is the line equivalent to the drawMultiCylinder function and performs the same basic operations using simpler and quicker lines.
- Parameters:
-
start the position of the start of the line. end the position of the end of the line. lineWidth the width of the line. order the order of the bond, e.g. 2 for a double bond. stipple The stipple parameter for the bond, can be used to draw aromatic bonds etc. sa drawMultiCylinder
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawQuadrilateral | ( | const Eigen::Vector3d & | point1, | |
| const Eigen::Vector3d & | point2, | |||
| const Eigen::Vector3d & | point3, | |||
| const Eigen::Vector3d & | point4, | |||
| double | lineWidth | |||
| ) | [pure virtual] |
Draws the outline of a two dimensional quadrilateral in three dimensional space.
- Parameters:
-
point1 the first of the four corners of the quadrilateral. point2 the second of the four corners of the quadrilateral. point3 the third of the four corners of the quadrilateral. point4 the last of the four corners of the quadrilateral. lineWidth the thickness of the line the quadrilateral will be drawn with.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawShadedQuadrilateral | ( | const Eigen::Vector3d & | point1, | |
| const Eigen::Vector3d & | point2, | |||
| const Eigen::Vector3d & | point3, | |||
| const Eigen::Vector3d & | point4 | |||
| ) | [pure virtual] |
Draws a solid two dimensional quadrilateral in three dimensional space.
- Parameters:
-
point1 the first of the four corners of the quadrilateral. point2 the second of the four corners of the quadrilateral. point3 the third of the four corners of the quadrilateral. point4 the last of the four corners of the quadrilateral.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawShadedSector | ( | const Eigen::Vector3d & | origin, | |
| const Eigen::Vector3d & | direction1, | |||
| const Eigen::Vector3d & | direction2, | |||
| double | radius, | |||
| bool | alternateAngle = false | |||
| ) | [pure virtual] |
Draws a shaded sector of a circle.
The sector is defined by three vectors, the center of the circle, and two vectors that define the lines going out from the centre of the circle to the circumference of the circle. The actual points on the circumference are found using these two vectors and the radius of the circle.
- Parameters:
-
origin the center of the circle this sector is a portion of. direction1 a vector defining the line the first point will lie on. direction2 a vector defining the line the second point will lie on. radius the radius of the circle this sector is a portion of. alternateAngle whether to draw the obtuse angle made by the two vectors instead of the acute angle between them.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawSphere | ( | const Eigen::Vector3d & | center, | |
| double | radius | |||
| ) | [pure virtual] |
Draws a sphere, leaving the Painter choose the appropriate detail level based on the apparent radius (ratio of radius over distance) and the global quality setting.
- Parameters:
-
center the position of the center of the sphere. radius the radius of the sphere.
Implemented in Avogadro::GLPainter.
| virtual void Avogadro::Painter::drawSpline | ( | const QVector< Eigen::Vector3d > & | pts, | |
| double | radius | |||
| ) | [pure virtual] |
Draw a cubic B-spline between the given points.
- Parameters:
-
pts QVector containing the points to draw the cubic B-spline along. radius the radius of the cubic B-spline.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual int Avogadro::Painter::drawText | ( | const Eigen::Vector3d & | pos, | |
| const QString & | string | |||
| ) | const [pure virtual] |
Draws text at a given scene position, inside the scene.
- Note:
- Calls to drawText methods must be enclosed between begin() and endText().
Text is rendered as a transparent object, and should therefore be rendered after the opaque objects.
- Parameters:
-
pos the scene coordinates of the top-left corner of the text to render. string The string to render. All character encodings are allowed but superposed characters are not supported yet. For accented letters, use a character giving the whole accented letter, not a separate character for the accent.
- See also:
- begin(), drawText(const QPoint&, const QString &) const, drawText(int, int, const QString &) const
Implemented in Avogadro::GLPainter.
| virtual int Avogadro::Painter::drawText | ( | const QPoint & | pos, | |
| const QString & | string | |||
| ) | const [pure virtual] |
Draws text at a given window position, on top of the scene.
- Note:
- Calls to drawText methods must be enclosed between begin() and endText().
Text is rendered as a transparent object, and should therefore be rendered after the opaque objects.
- Parameters:
-
pos the window coordinates of the top-left corner of the text to render, (0, 0) is the top-left corner of the window. string the string to render. All character encodings are allowed but superposed characters are not supported yet. For accented letters, use a character giving the whole accented letter, not a separate character for the accent.
- See also:
- begin(), drawText(const Eigen::Vector3d &, const QString &) const, drawText(int, int, const QString &) const
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual int Avogadro::Painter::drawText | ( | int | x, | |
| int | y, | |||
| const QString & | string | |||
| ) | const [pure virtual] |
Draws text at a given window position, on top of the scene.
- Note:
- Calls to drawText methods must be enclosed between begin() and end().
Text is rendered as a transparent object, and should therefore be rendered after the opaque objects.
- Parameters:
-
x,y the window coordinates of the top-left corner of the text to render, (0, 0) is the top-left corner of the window. string the string to render. All character encodings are allowed but superposed characters are not supported yet. For accented letters, use a character giving the whole accented letter, not a separate character for the accent.
- See also:
- begin(), drawText(const Eigen::Vector3d &, const QString &) const, drawText(const QPoint &, const QString &) const
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawTriangle | ( | const Eigen::Vector3d & | p1, | |
| const Eigen::Vector3d & | p2, | |||
| const Eigen::Vector3d & | p3, | |||
| const Eigen::Vector3d & | n | |||
| ) | [pure virtual] |
Draws a triangle with vertives on the three given points using the given normal.
This function corrects the triangle's winding order.
- Parameters:
-
p1 first triangle vertex. p2 second triangle vertex. p3 third triangle vertex. n the normal of the triangle.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::drawTriangle | ( | const Eigen::Vector3d & | p1, | |
| const Eigen::Vector3d & | p2, | |||
| const Eigen::Vector3d & | p3 | |||
| ) | [pure virtual] |
Draws a triangle with vertives on the three given points.
This function calculates the normal of the triangle and corrects the winding order to ensure the front face is facing the camera.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual int Avogadro::Painter::quality | ( | ) | const [pure virtual] |
- Returns:
- the current global quality setting.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::setColor | ( | float | red, | |
| float | green, | |||
| float | blue, | |||
| float | alpha = 1.0 | |||
| ) | [pure virtual] |
Set the color to paint elements with where 0.0 is the minimum and 1.0 is the maximum.
- Parameters:
-
red component of the color. green component of the color. blue component of the color. alpha component of the color.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::setColor | ( | const Color * | color | ) | [pure virtual] |
Set the color to paint the primitive elements with.
- Parameters:
-
color the color to be used for painting.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::setName | ( | Primitive::Type | type, | |
| int | id | |||
| ) | [pure virtual] |
Sets the primitive type and id.
- Parameters:
-
type the primitive type about to be drawn. id the primitive id.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
| virtual void Avogadro::Painter::setName | ( | const Primitive * | primitive | ) | [pure virtual] |
Uses the primitive to set the type and name if the Paint Device supports it.
- Parameters:
-
primitive the primitive about to be drawn.
Implemented in Avogadro::GLPainter, and Avogadro::POVPainter.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference