]> Shamusworld >> Repos - architektonas/blob - src/base/information.h
Removed unnecessary RS_ prefix from classes and whatnot.
[architektonas] / src / base / information.h
1 #ifndef __INFORMATION_H__
2 #define __INFORMATION_H__
3
4 #include "entitycontainer.h"
5 #include "line.h"
6 #include "arc.h"
7
8 /**
9  * Class for getting information about entities. This includes
10  * also things like the end point of an element which is
11  * nearest to a given coordinate.
12  * There's no interaction handled in this class.
13  * This class is bound to an entity container.
14  *
15  * @author Andrew Mustun
16  */
17 class Information
18 {
19         public:
20                 Information(EntityContainer & entityContainer);
21
22                 static bool isDimension(RS2::EntityType type);
23                 static bool isTrimmable(Entity * e);
24                 static bool isTrimmable(Entity * e1, Entity * e2);
25                 Vector getNearestEndpoint(const Vector & point, double * dist = NULL) const;
26                 Vector getNearestPointOnEntity(const Vector & point, bool onEntity = true,
27                         double * dist = NULL, Entity ** entity = NULL) const;
28                 Entity * getNearestEntity(const Vector & point, double * dist = NULL,
29                         RS2::ResolveLevel level = RS2::ResolveAll) const;
30                 static VectorSolutions getIntersection(Entity * e1, Entity * e2, bool onEntities = false);
31                 static VectorSolutions getIntersectionLineLine(Line * e1, Line * e2);
32                 static VectorSolutions getIntersectionLineArc(Line * line, Arc * arc);
33                 static VectorSolutions getIntersectionArcArc(Arc * e1, Arc * e2);
34                 static VectorSolutions getIntersectionLineEllipse(Line * line, Ellipse * ellipse);
35                 static bool isPointInsideContour(const Vector & point, EntityContainer * contour,
36                         bool * onContour = NULL);
37
38         protected:
39                 EntityContainer * container;
40 };
41
42 #endif