Stellarium 0.11.4
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

core/StelSphereGeometry.hpp File Reference

Define all SphericalGeometry primitives as well as the SphericalRegionP type. More...

#include <QVector>
#include <QVariant>
#include <QDebug>
#include <QSharedPointer>
#include <QVarLengthArray>
#include "VecMath.hpp"
#include "OctahedronPolygon.hpp"
#include "StelVertexArray.hpp"

Go to the source code of this file.

Classes

class  SphericalRegionP
 A shared pointer on a SphericalRegion. More...
class  SphericalRegion
 Abstract class defining a region of the sphere. More...
class  SphericalCap
 A SphericalCap is defined by a direction and an aperture. More...
class  SphericalPoint
 Special SphericalRegion for a point on the sphere. More...
class  AllSkySphericalRegion
 Special SphericalRegion for the whole sphere. More...
class  EmptySphericalRegion
class  SphericalPolygon
class  SphericalConvexPolygon
 A special case of SphericalPolygon for which the polygon is convex. More...
class  SphericalTexturedPolygon
 An extension of SphericalPolygon with addition of texture coordinates. More...
struct  SphericalTexturedPolygon::TextureVertex
 A container for 3D vertex + associated texture coordinates. More...
class  SphericalTexturedConvexPolygon
 Extension of SphericalConvexPolygon for textured polygon. More...

Functions

 Q_DECLARE_METATYPE (SphericalRegionP)
QDataStream & operator<< (QDataStream &out, const SphericalRegionP &region)
 Serialize the passed SphericalRegionP into a binary blob.
QDataStream & operator>> (QDataStream &in, SphericalRegionP &region)
 Load the SphericalRegionP from a binary blob.
bool sideHalfSpaceContains (const Vec3d &v1, const Vec3d &v2, const Vec3d &p)
 Return whether the halfspace defined by the vectors v1^v2 and with aperture 90 deg contains the point p.
bool sideHalfSpaceContains (const Vec3d &v1, const Vec3d &v2, const SphericalCap &h)
 Return whether the halfspace defined by the vectors v1 and v2 contains the SphericalCap h.
bool sideHalfSpaceIntersects (const Vec3d &v1, const Vec3d &v2, const SphericalCap &h)
 Return whether the halfspace defined by the vectors v1 and v2 intersects the SphericalCap h.
 Q_DECLARE_TYPEINFO (SphericalTexturedPolygon::TextureVertex, Q_PRIMITIVE_TYPE)
Vec3d greatCircleIntersection (const Vec3d &p1, const Vec3d &p2, const Vec3d &p3, const Vec3d &p4, bool &ok)
 Compute the intersection of 2 great circles segments.
Vec3d greatCircleIntersection (const Vec3d &p1, const Vec3d &p2, const Vec3d &nHalfSpace, bool &ok)
 Compute the intersection of a great circles segment with another great circle.

Detailed Description

Define all SphericalGeometry primitives as well as the SphericalRegionP type.


Function Documentation

Vec3d greatCircleIntersection ( const Vec3d p1,
const Vec3d p2,
const Vec3d nHalfSpace,
bool &  ok 
)

Compute the intersection of a great circles segment with another great circle.

Parameters:
ok is set to false if no intersection was found.
Returns:
the intersection point on the sphere (normalized) if ok is true, or undefined of ok is false.
Vec3d greatCircleIntersection ( const Vec3d p1,
const Vec3d p2,
const Vec3d p3,
const Vec3d p4,
bool &  ok 
)

Compute the intersection of 2 great circles segments.

Parameters:
ok is set to false if no intersection was found.
Returns:
the intersection point on the sphere (normalized) if ok is true, or undefined of ok is false.
QDataStream& operator<< ( QDataStream &  out,
const SphericalRegionP region 
)

Serialize the passed SphericalRegionP into a binary blob.

QDataStream& operator>> ( QDataStream &  in,
SphericalRegionP region 
)

Load the SphericalRegionP from a binary blob.

bool sideHalfSpaceContains ( const Vec3d v1,
const Vec3d v2,
const SphericalCap h 
) [inline]

Return whether the halfspace defined by the vectors v1 and v2 contains the SphericalCap h.

bool sideHalfSpaceContains ( const Vec3d v1,
const Vec3d v2,
const Vec3d p 
) [inline]

Return whether the halfspace defined by the vectors v1^v2 and with aperture 90 deg contains the point p.

The comparison is made with a double number slightly smaller than zero to avoid floating point precision errors problems (one test fails if it is set to zero).

bool sideHalfSpaceIntersects ( const Vec3d v1,
const Vec3d v2,
const SphericalCap h 
) [inline]

Return whether the halfspace defined by the vectors v1 and v2 intersects the SphericalCap h.

Generated on Sat Aug 25 22:13:31 2012 for Stellarium by  doxygen 1.6.3