Stellarium  1.2
Data Structures | Public Member Functions
SphericalTexturedPolygon Class Reference

#include <StelSphereGeometry.hpp>

Data Structures

struct  TextureVertex
 

Public Member Functions

 SphericalTexturedPolygon (const QVector< QVector< TextureVertex > > &contours)
 Constructor from a list of contours.
 
 SphericalTexturedPolygon (const QVector< TextureVertex > &contour)
 Constructor from one contour.
 
virtual StelVertexArray getFillVertexArray () const Q_DECL_OVERRIDE
 Return an OpenGL compatible array of texture coords to be used using vertex arrays. More...
 
virtual StelVertexArray getFillVertexArray (const Vec3d &observerVelocityForAberration) Q_DECL_OVERRIDE
 Return an OpenGL compatible array to be displayed using vertex arrays. More...
 
virtual QVariantList toQVariant () const Q_DECL_OVERRIDE
 Serialize the region into a QVariant map matching the JSON format. More...
 
virtual void serialize (QDataStream &out) const Q_DECL_OVERRIDE
 Serialize the region. This method must allow as fast as possible serialization and work with deserialize().
 
void setContours (const QVector< QVector< TextureVertex > > &contours)
 Set the contours defining the SphericalPolygon. More...
 
void setContour (const QVector< TextureVertex > &contour)
 Set a single contour defining the SphericalPolygon. More...
 
- Public Member Functions inherited from SphericalPolygon
 SphericalPolygon (const QVector< QVector< Vec3d > > &contours)
 Constructor from a list of contours.
 
 SphericalPolygon (const QVector< Vec3d > &contour)
 Constructor from one contour.
 
 SphericalPolygon (const OctahedronPolygon &octContour)
 
 SphericalPolygon (const QList< OctahedronPolygon > &octContours)
 
virtual SphericalRegionType getType () const Q_DECL_OVERRIDE
 
virtual OctahedronPolygon getOctahedronPolygon () const Q_DECL_OVERRIDE
 Return the octahedron contour representation of the polygon. More...
 
virtual SphericalCap getBoundingCap () const Q_DECL_OVERRIDE
 Return a bounding SphericalCap. More...
 
virtual bool contains (const Vec3d &p) const Q_DECL_OVERRIDE
 
virtual bool contains (const SphericalPolygon &r) const Q_DECL_OVERRIDE
 
virtual bool contains (const SphericalConvexPolygon &r) const Q_DECL_OVERRIDE
 
virtual bool contains (const SphericalCap &r) const Q_DECL_OVERRIDE
 
virtual bool contains (const SphericalPoint &r) const Q_DECL_OVERRIDE
 
virtual bool contains (const AllSkySphericalRegion &r) const Q_DECL_OVERRIDE
 
virtual SphericalRegionP getSubtraction (const SphericalPoint &) const Q_DECL_OVERRIDE
 
virtual SphericalRegionP getSubtraction (const EmptySphericalRegion &) const Q_DECL_OVERRIDE
 
void setContours (const QVector< QVector< Vec3d > > &contours)
 Set the contours defining the SphericalPolygon. More...
 
void setContour (const QVector< Vec3d > &contour)
 Set a single contour defining the SphericalPolygon. More...
 
QVector< QVector< Vec3d > > getClosedOutlineContours () const
 Return the list of closed contours defining the polygon boundaries.
 
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
 
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 &) const
 
bool contains (const SphericalRegion *r) const
 Returns whether a SphericalRegion is contained into this region. More...
 
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 &) 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
 
- Public Member Functions inherited from SphericalRegion
virtual double getArea () const
 Return the area of the region in steradians.
 
virtual bool isEmpty () const
 Return true if the region is empty.
 
virtual Vec3d getPointInside () const
 Return a point located inside the region.
 
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 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
 
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 &) 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
 
SphericalRegionP getSubtraction (const AllSkySphericalRegion &r) const
 

Additional Inherited Members

- Public Types inherited from SphericalRegion
enum  SphericalRegionType {
  Point = 0, Cap = 1, AllSky = 2, Polygon = 3,
  ConvexPolygon = 4, Empty = 5, Invalid = 6
}
 
- Static Public Member Functions inherited from SphericalPolygon
static SphericalRegionP deserialize (QDataStream &in)
 Deserialize the region. This method must allow as fast as possible deserialization.
 

Detailed Description

An extension of SphericalPolygon with addition of texture coordinates.


Data Structure Documentation

◆ SphericalTexturedPolygon::TextureVertex

struct SphericalTexturedPolygon::TextureVertex

A container for 3D vertex + associated texture coordinates

Data Fields
Vec2f texCoord
Vec3d vertex

Member Function Documentation

◆ getFillVertexArray() [1/2]

virtual StelVertexArray SphericalTexturedPolygon::getFillVertexArray ( ) const
inlinevirtual

This implementation never should appear in practice.

Reimplemented from SphericalRegion.

◆ getFillVertexArray() [2/2]

virtual StelVertexArray SphericalTexturedPolygon::getFillVertexArray ( const Vec3d observerVelocityForAberration)
inlinevirtual
Note
Presumably these general polygons of the base class don't describe geometry that may undergo aberration, so the observerVelocity must be zero. Implementation in derived classes should show aberration correction.

Reimplemented from SphericalRegion.

◆ setContour()

void SphericalTexturedPolygon::setContour ( const QVector< TextureVertex > &  contour)
inline
Parameters
contoura contour defining the polygon area.

◆ setContours()

void SphericalTexturedPolygon::setContours ( const QVector< QVector< TextureVertex > > &  contours)
inline
Parameters
contoursthe list of contours defining the polygon area using the WindingPositive winding rule.

◆ toQVariant()

virtual QVariantList SphericalTexturedPolygon::toQVariant ( ) const
virtual

The format is:

["TEXTURED_POLYGON", [[[ra,dec], [ra,dec], [ra,dec], [ra,dec]], [[ra,dec], [ra,dec], [ra,dec]],[...]],
[[[u,v],[u,v],[u,v],[u,v]], [[u,v],[u,v],[u,v]], [...]]]

where the two lists are a list of closed contours, with each points defined by ra dec in degree in the ICRS frame followed by a list of texture coordinates in the u,v texture space (between 0 and 1). There must be one texture coordinate for each vertex.

Reimplemented from SphericalPolygon.