Stellarium  HEAD
Public Member Functions | Static Public Member Functions | Data Fields
SphericalPoint Class Reference

Special SphericalRegion for a point on the sphere. More...

#include <StelSphereGeometry.hpp>

Public Member Functions

 SphericalPoint (const Vec3d &an)
 
 SphericalPoint (const SphericalPoint &other)
 
SphericalPointoperator= (const SphericalPoint &other)
 
SphericalRegionType getType () const override
 
OctahedronPolygon getOctahedronPolygon () const override
 Return the octahedron contour representation of the polygon. More...
 
double getArea () const override
 Return the area of the region in steradians.
 
bool isEmpty () const override
 Return true if the region is empty.
 
Vec3d getPointInside () const override
 Return a point located inside the region.
 
SphericalCap getBoundingCap () const override
 Return a bounding SphericalCap. More...
 
QVariantList toQVariant () const override
 Serialize the region into a QVariant map matching the JSON format. More...
 
void serialize (QDataStream &out) const override
 Serialize the region. This method must allow as fast as possible serialization and work with deserialize().
 
bool contains (const Vec3d &p) const override
 
bool contains (const SphericalPolygon &) const override
 
bool contains (const SphericalConvexPolygon &) const override
 
bool contains (const SphericalCap &) const override
 
bool contains (const SphericalPoint &r) const override
 
bool contains (const AllSkySphericalRegion &) const override
 
bool intersects (const SphericalPolygon &) const override
 
bool intersects (const SphericalConvexPolygon &) const override
 
bool intersects (const SphericalCap &r) const override
 
bool intersects (const SphericalPoint &r) const override
 
bool intersects (const AllSkySphericalRegion &) const override
 
- Public Member Functions inherited from SphericalRegion
virtual QVector< SphericalCapgetBoundingSphericalCaps () const
 Return the list of SphericalCap bounding the ConvexPolygon.
 
virtual SphericalRegionP getEnlarged (double margin) const
 Return an enlarged version of this SphericalRegion so that any point distant of more than the given margin now lays within the region. More...
 
virtual StelVertexArray getFillVertexArray () const
 Return an OpenGL compatible array to be displayed using vertex arrays.
 
virtual StelVertexArray getFillVertexArray (const Vec3d &observerVelocityForAberration)
 Return an OpenGL compatible array to be displayed using vertex arrays. More...
 
virtual StelVertexArray getOutlineVertexArray () const
 Get the outline of the contours defining the SphericalPolygon. More...
 
virtual StelVertexArray getOutlineVertexArray (Vec3d observerVelocityForAberration)
 Get the outline of the contours defining the SphericalPolygon. More...
 
virtual QVector< QVector< Vec3d > > getSimplifiedContours () const
 Get the contours defining the SphericalPolygon when combined using a positive winding rule. More...
 
QByteArray toJSON () const
 Output a JSON string representing the polygon. More...
 
bool contains (const SphericalRegion *r) const
 Returns whether a SphericalRegion is contained into this region. More...
 
bool contains (const SphericalRegionP r) const
 
bool contains (const EmptySphericalRegion &) const
 
bool intersects (const SphericalRegion *r) const
 Returns whether a SphericalRegion intersects with this region. More...
 
bool intersects (const SphericalRegionP r) const
 
bool intersects (const Vec3d &p) const
 
bool intersects (const EmptySphericalRegion &) const
 
SphericalRegionP getSubtraction (const SphericalRegion *r) const
 Return a new SphericalRegion consisting of the subtraction of the given region from this. More...
 
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
 

Static Public Member Functions

static SphericalRegionP deserialize (QDataStream &in)
 Deserialize the region. This method must allow as fast as possible deserialization.
 

Data Fields

Vec3d n
 The unit vector of the point direction.
 

Additional Inherited Members

- Public Types inherited from SphericalRegion
enum  SphericalRegionType {
  Point = 0 , Cap = 1 , AllSky = 2 , Polygon = 3 ,
  ConvexPolygon = 4 , Empty = 5 , Invalid = 6
}
 define types for all supported regions.
 

Detailed Description

Special SphericalRegion for a point on the sphere.

Member Function Documentation

◆ getBoundingCap()

SphericalCap SphericalPoint::getBoundingCap ( ) const
inlineoverridevirtual

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 from SphericalRegion.

◆ getOctahedronPolygon()

OctahedronPolygon SphericalPoint::getOctahedronPolygon ( ) const
overridevirtual

Return the octahedron contour representation of the polygon.

It can be used for safe computation of intersection/union in the general case.

Implements SphericalRegion.

◆ toQVariant()

QVariantList SphericalPoint::toQVariant ( ) const
overridevirtual

Serialize the region into a QVariant map matching the JSON format.

The format is ["POINT", [ra, dec]], with ra dec in degree in ICRS frame.

Implements SphericalRegion.