-
Notifications
You must be signed in to change notification settings - Fork 0
/
Geometrie.h
39 lines (30 loc) · 889 Bytes
/
Geometrie.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//---------------------------------------------------------------------------
#ifndef GeometrieH
#define GeometrieH
#include <utility>
#include <boost/geometry.hpp>
#include "Observable.h"
#include "IModel.h"
namespace AreaPrj {
class Geometrie : public IModel, public Observable {
public:
protected:
virtual PolygonCont const & DoGetPolygons() const override {
return polygons_;
}
virtual void DoSetPolygons( PolygonCont const & Items ) override {
AssignPolygons( Items );
}
virtual bool DoHitTest( CoordType X, CoordType Y ) const override {
return boost::geometry::within( PointType{ X, Y }, polygons_ );
}
private:
PolygonCont polygons_;
template<typename PC>
void AssignPolygons( PC&& Items ) {
polygons_ = std::forward<PC>( Items );
NotifyObservers();
}
};
} // End of namespace AreaPrj
#endif