|
Core 1.0
|
Lenses in the plane with uniform radius. More...
#include <lens.h>
Public Member Functions | |
| Lens2 (const Vector2 &, const Vector2 &, const double &) | |
| Create a lens. | |
| Lens2 (const Vector2 &, const double &, const double &) | |
| Create a lens. | |
| bool | Inside (const Vector2 &) const |
| Test if a point is inside the lens. | |
| double | R (const Vector2 &) const |
| Compute the squared Euclidean distance to the lens. | |
| double | Signed (const Vector2 &) const |
| Compute the Euclidean distance to the lens. | |
| double | Height () const |
| Compute the height of the lens. | |
| double | Thickness () const |
| Compute the thickness of the lens. | |
| Vector2 | Center () const |
| Compute the center of the lens. | |
| double | Alpha () const |
| Compute the internal half opening angle of the lens. | |
| double | Area () const |
| Compute the area of the lens. | |
| Box2 | GetBox () const |
| Compute the (tight) bounding box. | |
| Frame2 | GetFrame () const |
| Compute the local frame of the lens. | |
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draw the lens. | |
Protected Attributes | |
| Vector2 | b = -Vector::X |
| Centers. | |
| double | r = 3.0 |
| Radius. | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const Lens2 &l) |
| Overloaded. | |
Lenses in the plane with uniform radius.
A lens is defined as the intersection of two circles. Lenses are used in beta-skeletons geometric graphs.
Create a lens.
| a,b | Centers of the circles. |
| r | Radius. |
| Lens2::Lens2 | ( | const Vector2 & | c, |
| const double & | t, | ||
| const double & | h ) |
Create a lens.
| c | Centers of the lens. |
| t | Thickness. |
| h | Height. |
|
inline |
Compute the internal half opening angle of the lens.
This is an inlined and optimized version of:
| double Lens2::Area | ( | ) | const |
Compute the area of the lens.
This is a simplified version of the equation of the area of two intersecting circles with different radii.
| void Lens2::Draw | ( | QGraphicsScene & | scene, |
| const QPen & | pen = QPen(), | ||
| const QBrush & | brush = QBrush() ) const |
Draw the lens.
| scene | Graphics scene. |
| pen | The pen. |
| brush | The brush, should the circle be filled. |
| bool Lens2::Inside | ( | const Vector2 & | p | ) | const |
Test if a point is inside the lens.
| p | Point. |
| double Lens2::R | ( | const Vector2 & | p | ) | const |
Compute the squared Euclidean distance to the lens.
| p | Point. |
| double Lens2::Signed | ( | const Vector2 & | p | ) | const |
Compute the Euclidean distance to the lens.
| p | Point. |
|
friend |
Overloaded.
| s | Stream. |
| l | Lens. |