![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
#include <StelSphereGeometry.hpp>
Inherited by AllSkySphericalRegion, EmptySphericalRegion, SphericalCap, SphericalConvexPolygon, SphericalPoint, SphericalPolygon, and SphericalPolygon.
Public Types | |
enum | SphericalRegionType { Point = 0, Cap = 1, AllSky = 2, Polygon = 3, ConvexPolygon = 4, Empty = 5 } |
Public Member Functions | |
virtual SphericalRegionType | getType () const =0 |
virtual OctahedronPolygon | getOctahedronPolygon () const =0 |
virtual double | getArea () const |
virtual bool | isEmpty () const |
virtual Vec3d | getPointInside () const |
virtual QVector< SphericalCap > | getBoundingSphericalCaps () const |
virtual SphericalCap | getBoundingCap () const |
virtual SphericalRegionP | getEnlarged (double margin) const |
virtual StelVertexArray | getFillVertexArray () const |
virtual StelVertexArray | getOutlineVertexArray () const |
virtual QVariantMap | toQVariant () const =0 |
virtual void | serialize (QDataStream &out) const =0 |
QByteArray | toJSON () const |
bool | contains (const SphericalRegion *r) const |
bool | contains (const SphericalRegionP r) const |
virtual bool | contains (const Vec3d &p) const |
virtual bool | contains (const SphericalPolygon &r) const |
virtual bool | contains (const SphericalConvexPolygon &r) const |
virtual bool | contains (const SphericalCap &r) const |
virtual bool | contains (const SphericalPoint &r) const |
virtual bool | contains (const AllSkySphericalRegion &r) const |
bool | contains (const EmptySphericalRegion &r) const |
bool | intersects (const SphericalRegion *r) const |
bool | intersects (const SphericalRegionP r) const |
bool | intersects (const Vec3d &p) const |
virtual bool | intersects (const SphericalPolygon &r) const |
virtual bool | intersects (const SphericalConvexPolygon &r) const |
virtual bool | intersects (const SphericalCap &r) const |
virtual bool | intersects (const SphericalPoint &r) const |
virtual bool | intersects (const AllSkySphericalRegion &r) const |
bool | intersects (const EmptySphericalRegion &r) const |
SphericalRegionP | getIntersection (const SphericalRegion *r) const |
SphericalRegionP | getIntersection (const SphericalRegionP r) const |
virtual SphericalRegionP | getIntersection (const SphericalPolygon &r) const |
virtual SphericalRegionP | getIntersection (const SphericalConvexPolygon &r) const |
virtual SphericalRegionP | getIntersection (const SphericalCap &r) const |
virtual SphericalRegionP | getIntersection (const SphericalPoint &r) const |
virtual SphericalRegionP | getIntersection (const AllSkySphericalRegion &r) const |
SphericalRegionP | getIntersection (const EmptySphericalRegion &r) const |
SphericalRegionP | getUnion (const SphericalRegion *r) const |
SphericalRegionP | getUnion (const SphericalRegionP r) const |
virtual SphericalRegionP | getUnion (const SphericalPolygon &r) const |
virtual SphericalRegionP | getUnion (const SphericalConvexPolygon &r) const |
virtual SphericalRegionP | getUnion (const SphericalCap &r) const |
virtual SphericalRegionP | getUnion (const SphericalPoint &r) const |
SphericalRegionP | getUnion (const AllSkySphericalRegion &r) const |
virtual SphericalRegionP | getUnion (const EmptySphericalRegion &r) const |
SphericalRegionP | getSubtraction (const SphericalRegion *r) const |
SphericalRegionP | getSubtraction (const SphericalRegionP r) const |
virtual SphericalRegionP | getSubtraction (const SphericalPolygon &r) const |
virtual SphericalRegionP | getSubtraction (const SphericalConvexPolygon &r) const |
virtual SphericalRegionP | getSubtraction (const SphericalCap &r) const |
virtual SphericalRegionP | getSubtraction (const SphericalPoint &r) const |
SphericalRegionP | getSubtraction (const AllSkySphericalRegion &r) const |
virtual SphericalRegionP | getSubtraction (const EmptySphericalRegion &r) const |
It provides default implementation for the general non-convex polygon which can extend on more than 180 deg based on the OctahedronPolygon class. Subclasses provides special faster implementations of many methods.
define types for all supported regions.
virtual OctahedronPolygon SphericalRegion::getOctahedronPolygon | ( | ) | const [pure virtual] |
Return the octahedron contour representation of the polygon.
It can be used for safe computation of intersection/union in the general case.
Implemented in SphericalCap, SphericalPoint, AllSkySphericalRegion, and SphericalConvexPolygon.
virtual double SphericalRegion::getArea | ( | ) | const [inline, virtual] |
Return the area of the region in steradians.
Reimplemented in SphericalCap, SphericalPoint, AllSkySphericalRegion, and SphericalConvexPolygon.
virtual bool SphericalRegion::isEmpty | ( | ) | const [inline, virtual] |
Return true if the region is empty.
Reimplemented in SphericalCap, SphericalPoint, AllSkySphericalRegion, and SphericalConvexPolygon.
virtual Vec3d SphericalRegion::getPointInside | ( | ) | const [inline, virtual] |
Return a point located inside the region.
Reimplemented in SphericalCap, SphericalPoint, AllSkySphericalRegion, and SphericalConvexPolygon.
virtual QVector<SphericalCap> SphericalRegion::getBoundingSphericalCaps | ( | ) | const [virtual] |
Return the list of SphericalCap bounding the ConvexPolygon.
Reimplemented in SphericalConvexPolygon.
virtual SphericalCap SphericalRegion::getBoundingCap | ( | ) | const [virtual] |
Return a bounding SphericalCap.
This method is heavily used and therefore needs to be very fast. The returned SphericalCap doesn't have to be the smallest one, but smaller is better.
Reimplemented in SphericalCap, SphericalPoint, AllSkySphericalRegion, and SphericalConvexPolygon.
virtual SphericalRegionP SphericalRegion::getEnlarged | ( | double | margin | ) | const [virtual] |
Return an enlarged version of this SphericalRegion so that any point distant of more than the given margin now lays within the region.
The returned region can be larger than the smallest enlarging region, therefore returning false positive on subsequent intersection tests. The default implementation always return an enlarged bounding SphericalCap.
margin | the minimum enlargement margin in radian. |
virtual StelVertexArray SphericalRegion::getFillVertexArray | ( | ) | const [inline, virtual] |
Return an openGL compatible array to be displayed using vertex arrays.
Reimplemented in SphericalConvexPolygon.
virtual StelVertexArray SphericalRegion::getOutlineVertexArray | ( | ) | const [inline, virtual] |
Get the outline of the contours defining the SphericalPolygon.
Reimplemented in SphericalConvexPolygon.
virtual QVariantMap SphericalRegion::toQVariant | ( | ) | const [pure virtual] |
Serialize the region into a QVariant map matching the JSON format.
Implemented in SphericalCap, SphericalPoint, AllSkySphericalRegion, and SphericalConvexPolygon.
virtual void SphericalRegion::serialize | ( | QDataStream & | out | ) | const [pure virtual] |
Serialize the region. This method must allow as fast as possible serialization and work with deserialize().
Implemented in SphericalCap, SphericalPoint, AllSkySphericalRegion, and SphericalConvexPolygon.
QByteArray SphericalRegion::toJSON | ( | ) | const |
Output a JSON string representing the polygon.
This method is convenient for debugging.
bool SphericalRegion::contains | ( | const SphericalRegion * | r | ) | const |
Returns whether a SphericalRegion is contained into this region.
A default potentially very slow implementation is provided for each cases.
bool SphericalRegion::intersects | ( | const SphericalRegion * | r | ) | const |
Returns whether a SphericalRegion intersects with this region.
A default potentially very slow implementation is provided for each cases.
SphericalRegionP SphericalRegion::getIntersection | ( | const SphericalRegion * | r | ) | const |
Return a new SphericalRegion consisting of the intersection of this and the given region.
A default potentially very slow implementation is provided for each cases.
SphericalRegionP SphericalRegion::getUnion | ( | const SphericalRegion * | r | ) | const |
Return a new SphericalRegion consisting of the union of this and the given region.
A default potentially very slow implementation is provided for each cases.
SphericalRegionP SphericalRegion::getSubtraction | ( | const SphericalRegion * | r | ) | const |
Return a new SphericalRegion consisting of the subtraction of the given region from this.
A default potentially very slow implementation is provided for each cases.