]> Shamusworld >> Repos - architektonas/blob - src/base/rs_information.h
Changed RS_Graphic to Drawing; this is less confusing as a drawing is
[architektonas] / src / base / rs_information.h
1 #ifndef RS_INFORMATION_H
2 #define RS_INFORMATION_H
3
4 #include "rs_entitycontainer.h"
5 #include "rs_line.h"
6 #include "rs_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 RS_Information
18 {
19         public:
20                 RS_Information(RS_EntityContainer & entityContainer);
21
22                 static bool isDimension(RS2::EntityType type);
23                 static bool isTrimmable(RS_Entity * e);
24                 static bool isTrimmable(RS_Entity * e1, RS_Entity * e2);
25
26                 Vector getNearestEndpoint(const Vector & point, double * dist = NULL) const;
27                 Vector getNearestPointOnEntity(const Vector & point, bool onEntity = true,
28                         double * dist = NULL, RS_Entity ** entity = NULL) const;
29                 RS_Entity * getNearestEntity(const Vector & point, double * dist = NULL,
30                         RS2::ResolveLevel level = RS2::ResolveAll) const;
31
32                 static VectorSolutions getIntersection(RS_Entity * e1, RS_Entity * e2, bool onEntities = false);
33                 static VectorSolutions getIntersectionLineLine(RS_Line * e1, RS_Line * e2);
34                 static VectorSolutions getIntersectionLineArc(RS_Line * line, RS_Arc * arc);
35                 static VectorSolutions getIntersectionArcArc(RS_Arc * e1, RS_Arc * e2);
36                 static VectorSolutions getIntersectionLineEllipse(RS_Line * line, RS_Ellipse * ellipse);
37
38                 static bool isPointInsideContour(const Vector & point, RS_EntityContainer * contour,
39                         bool * onContour = NULL);
40
41         protected:
42                 RS_EntityContainer * container;
43 };
44
45 #endif