Stellarium  0.90.0
SPolygon.hpp
1 /*
2  * Stellarium Scenery3d Plug-in
3  *
4  * Copyright (C) 2011 Simon Parzer, Peter Neubauer, Georg Zotti, Andrei Borza
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19  */
20 
21 #ifndef _SPOLYGON_HPP_
22 #define _SPOLYGON_HPP_
23 
24 #include "VecMath.hpp"
25 
26 #include <QVector>
27 
28 class Plane;
29 
30 class SPolygon
31 {
32 public:
33 
34  SPolygon();
36  SPolygon(const Vec3f &c0, const Vec3f &c1, const Vec3f &c2, const Vec3f &c3);
37  ~SPolygon();
38 
39  enum Order
40  {
41  CCW = 0, CW
42  };
43 
45  QVector<Vec3f> vertices;
46 
48  void intersect(const Plane &p, QVector<Vec3f> &intersectionPoints);
49 
51  void reverseOrder();
53  void addUniqueVert(const Vec3f &v);
54 
55  void render();
56 
57 private:
58 
59 };
60 
61 #endif
void addUniqueVert(const Vec3f &v)
Add the vertex v to vertices if it is not already present.
Definition: Plane.hpp:27
void intersect(const Plane &p, QVector< Vec3f > &intersectionPoints)
Intersect by specified plane and store the intersection points.
void reverseOrder()
Reverse the vertices order.
QVector< Vec3f > vertices
Holds all vertices of this polygon.
Definition: SPolygon.hpp:45