|
Core 1.0
|
Symmetry axis of revolution with a quadric curve. More...
#include <revolution.h>
Public Member Functions | |
| SymmetricQuadricCurve2 (const Vector2 &, const Vector2 &, const QuadricCurve2 &) | |
| Creates a surface of revolution based on a quadric parametric profile curve. | |
| virtual | ~SymmetricQuadricCurve2 () |
| Destructor. | |
| void | Translate (const Vector2 &) |
| Translation. | |
| void | Rotate (const Matrix2 &) |
| Rotation. | |
| void | Scale (const double &) |
| Scaling. | |
| Vector2 | Normal (const Vector2 &) const |
| Compute the distance vector between a point and the surface. | |
| double | R (const Vector2 &) const |
| Compute the squared distance between a point and the surface of revolution. | |
| double | Signed (const Vector2 &) const |
| Compute the (unsigned) Euclidean distance between a point and the profile curve. | |
| Box2 | GetBox () const |
| Compute the bounding box. | |
| OrientedBox2 | GetOrientedBox () const |
| Compute the bounding cylinder. | |
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draws the volume of revolution. | |
Protected Attributes | |
| Quadric | y |
| Quadric profile curves. | |
| Quadric | xy |
| Constant coefficients used to speed-up queries. | |
| double | yb |
| Range of values for the y quadric profile curve. | |
| Protected Attributes inherited from Axis2 | |
| Vector2 | b = Vector2(1.0, 0.0) |
| End vertexes of the axis. | |
| Vector2 | axis = Vector2::X |
| Normalized axis vector. | |
| double | length = 1.0 |
| Length of the axis. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Axis2 | |
| double | Radial (const Vector2 &, Vector2 &, Vector2 &) const |
| Compute the radial coordinates of a point. | |
| Vector2 | Radial (const Vector2 &) const |
| Compute the radial coordinates of a point. | |
| Axis2 () | |
| Empty. | |
| Axis2 (const Vector2 &, const Vector2 &) | |
| Creates an axis given end vertices. | |
| ~Axis2 () | |
| Empty. | |
| Vector2 | Vertex (int) const |
| Return one of the end vertexes of the axis. | |
| Vector2 | Point (const double &) const |
| Compute a point on the axis. | |
| Vector2 | GetAxis () const |
| Returns the normalized axis vector. | |
| constexpr double | Length () const |
| Return the axis length. | |
| void | Translate (const Vector2 &) |
| Translation. | |
| void | Rotate (const Matrix2 &) |
| Rotation. | |
| void | Scale (const double &) |
| Scaling. | |
| Vector2 | Symmetric (const Vector2 &) const |
| Symmetric point. | |
| Circle2 | Symmetric (const Circle2 &) const |
| Symmetric circle. | |
| Box2 | Symmetric (const Box2 &) const |
| Symmetric box. | |
Symmetry axis of revolution with a quadric curve.
|
explicit |
Creates a surface of revolution based on a quadric parametric profile curve.
| a,b | Axis vertices. |
| c | Quadric curve. |
| void SymmetricQuadricCurve2::Draw | ( | QGraphicsScene & | scene, |
| const QPen & | pen = QPen(), | ||
| const QBrush & | brush = QBrush() ) const |
Draws the volume of revolution.
The shape is not filled: it is drawn as the two symmetric profile curves, mirror images of each other with respect to the axis.
| scene | Graphics scene. |
| pen | The pen. |
| brush | Not used, the shape is not filled. |
| OrientedBox2 SymmetricQuadricCurve2::GetOrientedBox | ( | ) | const |
Compute the bounding cylinder.
The box is expressed in the frame of the axis: its first half size is the half height along the axis, the second one the radial half size.
Compute the distance vector between a point and the surface.
| p | Point. |
| double SymmetricQuadricCurve2::R | ( | const Vector2 & | p | ) | const |
Compute the squared distance between a point and the surface of revolution.
| p | Point. |
| void SymmetricQuadricCurve2::Rotate | ( | const Matrix2 & | r | ) |
Rotation.
| r | Rotation matrix. |
| void SymmetricQuadricCurve2::Scale | ( | const double & | s | ) |
Scaling.
| s | Scaling factor. |
| double SymmetricQuadricCurve2::Signed | ( | const Vector2 & | p | ) | const |
Compute the (unsigned) Euclidean distance between a point and the profile curve.
Despite its name, the function returns a non negative distance: the inside of the volume is not tested. The point is first expressed in the radial frame, then the distance is the minimum of the distances to the end points and to the points of the quadric curve where the derivative of the squared distance vanishes, for parameters in ]0,1[.
| p | Point. |
| void SymmetricQuadricCurve2::Translate | ( | const Vector2 & | t | ) |
Translation.
| t | Translation vector. |