00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _SPHERICALPOLYGON_HPP_
00021 #define _SPHERICALPOLYGON_HPP_
00022
00023 #include <QVector>
00024 #include <QVariant>
00025 #include <QDebug>
00026 #include <QSharedPointer>
00027 #include <QVarLengthArray>
00028 #include "StelSphereGeometry.hpp"
00029
00033 class SphericalPolygon : public SphericalRegion
00034 {
00035 public:
00038 enum PolyWindingRule
00039 {
00040 WindingPositive,
00041 WindingAbsGeqTwo
00042 };
00043
00045 SphericalPolygon() {;}
00047 SphericalPolygon(const QVector<QVector<Vec3d> >& contours) {setContours(contours);}
00049 SphericalPolygon(const QVector<Vec3d>& contour) {setContour(contour);}
00050 SphericalPolygon(const OctahedronPolygon& octContour) : octahedronPolygon(octContour) {;}
00051
00052 virtual SphericalRegionType getType() const {return SphericalRegion::Polygon;}
00053
00058 virtual QVariantMap toQVariant() const;
00059
00060 virtual OctahedronPolygon getOctahedronPolygon() const {return octahedronPolygon;}
00061
00063
00065
00070 virtual void setContours(const QVector<QVector<Vec3d> >& contours, SphericalPolygon::PolyWindingRule windingRule=SphericalPolygon::WindingPositive);
00071
00074 virtual void setContour(const QVector<Vec3d>& contour);
00075
00077 bool intersects(const AllSkySphericalRegion& poly) const {return true;}
00078 bool contains(const AllSkySphericalRegion& poly) const {return false;}
00079
00080 private:
00081 OctahedronPolygon octahedronPolygon;
00082 };
00083
00084
00085 #endif // _SPHERICALPOLYGON_HPP_
00086