]> Shamusworld >> Repos - architektonas/blob - src/base/infoarea.h
Bugfixes related to removing Snapper class.
[architektonas] / src / base / infoarea.h
1 #ifndef __INFOAREA_H__
2 #define __INFOAREA_H__
3
4 #include <QtCore>
5 #include "vector.h"
6
7 /**
8  * Class for getting information about an area.
9  *
10  * @author Andrew Mustun
11  */
12 class InfoArea
13 {
14         public:
15                 InfoArea();
16                 ~InfoArea();
17
18                 void reset();
19                 void addPoint(const Vector & p);
20                 void calculate();
21                 void close();
22                 bool isValid();
23                 bool isClosed();
24                 double getArea();
25                 double getCircumference();
26                 int count();
27
28         private:
29                 double calcSubArea(const Vector & p1, const Vector & p2);
30                 QVector<Vector> thePoints;
31                 double baseY;
32                 double area;
33                 double circumference;
34 };
35
36 #endif