|
Core 1.0
|
Intersection between a cone and a circle in the plane. More...
#include <sector.h>
Public Member Functions | |
| Sector2 () | |
| Empty. | |
| Sector2 (const double &, const double &=Math::HalfPi) | |
| Creates a sector. | |
| Sector2 (const Vector2 &, const Vector2 &, const double &, const double &=Math::HalfPi) | |
| Creates a sector. | |
| ~Sector2 () | |
| Empty. | |
| double | Signed (const Vector2 &) const |
| Compute the signed Euclidean distance between a point and a sector. | |
| void | Rotate (const Matrix2 &) |
| Rotates a sector. | |
| void | Translate (const Vector2 &) |
| Translates a circle. | |
| void | Scale (const double &) |
| Uniformly scales a circle. | |
| Box2 | GetBox () const |
| Compute the axis aligned bounding box. | |
| OrientedBox2 | GetOrientedBox () const |
| Compute the oriented bounding box. | |
| void | Draw (QGraphicsScene &, const QPen &, const QBrush &) const |
| Draw the sector. | |
Protected Attributes | |
| Vector2 | c = Vector2::Null |
| Center. | |
| Vector2 | sc = Vector2(Math::Sqrt2, Math::Sqrt2) |
| Sine and cosine of the sector angle. | |
| double | a = Math::Pi / 4.0 |
| Angle. | |
| Vector2 | axis = Vector::X |
| Axis. | |
| double | r = 1.0 |
| Radius. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Sector2 §or) |
| Overloaded. | |
Intersection between a cone and a circle in the plane.
|
explicit |
Creates a sector.
| r | Radius. |
| a | Angle. |
|
explicit |
Creates a sector.
| c | Center. |
| axis | Axis, which should be normalized. |
| r | Radius. |
| a | Angle. |
| void Sector2::Draw | ( | QGraphicsScene & | scene, |
| const QPen & | pen, | ||
| const QBrush & | brush ) const |
Draw the sector.
The arc is approximated by line segments, with an π/64 angle accuracy.
| scene | Graphics scene. |
| pen | The pen. |
| brush | The brush. |
| void Sector2::Rotate | ( | const Matrix2 & | r | ) |
Rotates a sector.
| r | Rotation matrix. |
| void Sector2::Scale | ( | const double & | s | ) |
Uniformly scales a circle.
| s | Scaling factor. |
| double Sector2::Signed | ( | const Vector2 & | p | ) | const |
Compute the signed Euclidean distance between a point and a sector.
| p | Point. |
| void Sector2::Translate | ( | const Vector2 & | t | ) |
Translates a circle.
| t | Translation vector. |
|
friend |
Overloaded.
| s | Stream. |
| sector | The sector. |