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

SphericalConvexPolygon Class Reference

A special case of SphericalPolygon for which the polygon is convex. More...

#include <StelSphereGeometry.hpp>

Inherits SphericalRegion.

List of all members.

Public Member Functions

 SphericalConvexPolygon ()
 SphericalConvexPolygon (const QVector< QVector< Vec3d > > &contours)
 SphericalConvexPolygon (const QVector< Vec3d > &contour)
 SphericalConvexPolygon (const Vec3d &e0, const Vec3d &e1, const Vec3d &e2)
 SphericalConvexPolygon (const Vec3d &e0, const Vec3d &e1, const Vec3d &e2, const Vec3d &e3)
virtual SphericalRegionType getType () const
virtual OctahedronPolygon getOctahedronPolygon () const
virtual StelVertexArray getFillVertexArray () const
virtual StelVertexArray getOutlineVertexArray () const
virtual double getArea () const
virtual bool isEmpty () const
virtual Vec3d getPointInside () const
virtual SphericalCap getBoundingCap () const
QVector< SphericalCapgetBoundingSphericalCaps () const
virtual QVariantMap toQVariant () const
virtual void serialize (QDataStream &out) 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
virtual bool intersects (const SphericalCap &r) const
virtual bool intersects (const SphericalPolygon &r) const
virtual bool intersects (const SphericalConvexPolygon &r) const
virtual bool intersects (const SphericalPoint &r) const
virtual bool intersects (const AllSkySphericalRegion &r) const
void setContour (const QVector< Vec3d > &acontour)
const QVector< Vec3d > & getConvexContour () const
bool checkValid () const

Static Public Member Functions

static bool checkValidContour (const QVector< Vec3d > &contour)
static SphericalRegionP deserialize (QDataStream &in)

Protected Member Functions

void updateBoundingCap ()
bool areAllPointsOutsideOneSide (const QVector< Vec3d > &points) const
bool containsConvexContour (const Vec3d *vertice, int nbVertex) const

Static Protected Member Functions

static bool areAllPointsOutsideOneSide (const Vec3d *thisContour, int nbThisContour, const Vec3d *points, int nbPoints)

Protected Attributes

QVector< Vec3dcontour
SphericalCap cachedBoundingCap

Detailed Description

A special case of SphericalPolygon for which the polygon is convex.

Constructor & Destructor Documentation

SphericalConvexPolygon::SphericalConvexPolygon (  )  [inline]

Default constructor.

SphericalConvexPolygon::SphericalConvexPolygon ( const QVector< QVector< Vec3d > > &  contours  )  [inline]

Constructor from a list of contours.

SphericalConvexPolygon::SphericalConvexPolygon ( const QVector< Vec3d > &  contour  )  [inline]

Constructor from one contour.

SphericalConvexPolygon::SphericalConvexPolygon ( const Vec3d e0,
const Vec3d e1,
const Vec3d e2 
) [inline]

Special constructor for triangle.

SphericalConvexPolygon::SphericalConvexPolygon ( const Vec3d e0,
const Vec3d e1,
const Vec3d e2,
const Vec3d e3 
) [inline]

Special constructor for quads.

Member Function Documentation

virtual OctahedronPolygon SphericalConvexPolygon::getOctahedronPolygon (  )  const [inline, virtual]

Return the octahedron contour representation of the polygon.

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

Implements SphericalRegion.

virtual StelVertexArray SphericalConvexPolygon::getFillVertexArray (  )  const [inline, virtual]

Return an openGL compatible array to be displayed using vertex arrays.

Reimplemented from SphericalRegion.

virtual StelVertexArray SphericalConvexPolygon::getOutlineVertexArray (  )  const [inline, virtual]

Get the outline of the contours defining the SphericalPolygon.

a list of vertex which taken 2 by 2 define the contours of the polygon.

Reimplemented from SphericalRegion.

virtual double SphericalConvexPolygon::getArea (  )  const [virtual]

Return the area of the region in steradians.

Reimplemented from SphericalRegion.

virtual bool SphericalConvexPolygon::isEmpty (  )  const [inline, virtual]

Return true if the region is empty.

Reimplemented from SphericalRegion.

virtual Vec3d SphericalConvexPolygon::getPointInside (  )  const [virtual]

Return a point located inside the region.

Reimplemented from SphericalRegion.

virtual SphericalCap SphericalConvexPolygon::getBoundingCap (  )  const [inline, 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 from SphericalRegion.

QVector<SphericalCap> SphericalConvexPolygon::getBoundingSphericalCaps (  )  const [virtual]

Return the list of SphericalCap bounding the ConvexPolygon.

Reimplemented from SphericalRegion.

virtual QVariantMap SphericalConvexPolygon::toQVariant (  )  const [virtual]

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

The format is

 {"type": "CVXPOLYGON", "worldCoords": [[[ra,dec], [ra,dec], [ra,dec], [ra,dec]], [[ra,dec], [ra,dec], [ra,dec]],[...]]} 
worldCoords is a list of closed contours, with each points defined by ra dec in degree in the ICRS frame.

Implements SphericalRegion.

virtual void SphericalConvexPolygon::serialize ( QDataStream &  out  )  const [inline, virtual]

Serialize the region. This method must allow as fast as possible serialization and work with deserialize().

Implements SphericalRegion.

void SphericalConvexPolygon::setContour ( const QVector< Vec3d > &  acontour  )  [inline]

Set a single contour defining the SphericalPolygon.

acontour a contour defining the polygon area.

const QVector<Vec3d>& SphericalConvexPolygon::getConvexContour (  )  const [inline]

Get the single contour defining the SphericalConvexPolygon.

bool SphericalConvexPolygon::checkValid (  )  const

Check if the polygon is valid, i.e. it has no side >180.

static bool SphericalConvexPolygon::checkValidContour ( const QVector< Vec3d > &  contour  )  [static]

Check if the passed contour is convex and valid, i.e. it has no side >180.

static SphericalRegionP SphericalConvexPolygon::deserialize ( QDataStream &  in  )  [static]

Deserialize the region. This method must allow as fast as possible deserialization.

void SphericalConvexPolygon::updateBoundingCap (  )  [protected]

Update the bounding cap from the vertex list.

static bool SphericalConvexPolygon::areAllPointsOutsideOneSide ( const Vec3d thisContour,
int  nbThisContour,
const Vec3d points,
int  nbPoints 
) [static, protected]

Computes whether the passed points are all outside of at least one SphericalCap defining the polygon boundary.

thisContour the vertices defining the contour.
nbThisContour nb of vertice of the contour.
points the points to test.
points the number of points to test.

bool SphericalConvexPolygon::areAllPointsOutsideOneSide ( const QVector< Vec3d > &  points  )  const [inline, protected]

Computes whether the passed points are all outside of at least one SphericalCap defining the polygon boundary.

Member Data Documentation

QVector<Vec3d> SphericalConvexPolygon::contour [protected]

A list of vertices of the convex contour.

Cache the bounding cap.

Generated on Mon Mar 22 09:55:38 2010 for Stellarium by  doxygen 1.5.5