]> Shamusworld >> Repos - architektonas/blob - src/base/rs_creation.h
64b4a899fe3ccaec303277a77fa516ac13623be6
[architektonas] / src / base / rs_creation.h
1 #ifndef RS_CREATION_H
2 #define RS_CREATION_H
3
4 #include <QtCore>
5 #include "vector.h"
6
7 class RS_EntityContainer;
8 class RS_GraphicView;
9 class RS_Entity;
10 class RS_Line;
11 class RS_Circle;
12 class RS_Arc;
13 class RS_Image;
14 class RS_Block;
15 class RS_Insert;
16 class Drawing;
17 class RS_Document;
18 class RS_ImageData;
19 class RS_InsertData;
20 class RS_BlockData;
21
22 /**
23  * Data needed to insert library items.
24  */
25 struct RS_LibraryInsertData
26 {
27         QString file;
28         Vector insertionPoint;
29         double factor;
30         double angle;
31 };
32
33 /**
34  * Class for the creation of new entities.
35  * This class is bound to an entity container in which the
36  * entities are stored.
37  *
38  * @author Andrew Mustun
39  */
40 class RS_Creation
41 {
42         public:
43                 RS_Creation(RS_EntityContainer * container, RS_GraphicView * graphicView = NULL,
44                         bool handleUndo = true);
45
46                 RS_Entity * createParallelThrough(const Vector & coord, int number,
47                         RS_Entity * e);
48
49                 RS_Entity * createParallel(const Vector & coord, double distance,
50                         int number, RS_Entity * e);
51
52                 RS_Line * createParallelLine(const Vector & coord, double distance, int number,
53                         RS_Line * e);
54
55                 RS_Arc * createParallelArc(const Vector & coord, double distance, int number,
56                         RS_Arc * e);
57
58                 RS_Circle * createParallelCircle(const Vector & coord, double distance, int number,
59                         RS_Circle * e);
60
61                 RS_Line * createBisector(const Vector & coord1, const Vector & coord2, double length,
62                         int num, RS_Line * l1, RS_Line * l2);
63
64                 RS_Line * createTangent1(const Vector & coord, const Vector & point, RS_Entity * circle);
65
66                 RS_Line * createTangent2(const Vector & coord, RS_Entity * circle1, RS_Entity * circle2);
67
68                 RS_Line * createLineRelAngle(const Vector & coord, RS_Entity * entity,
69                         double angle, double length);
70
71                 RS_Line * createPolygon(const Vector & center, const Vector & corner, int number);
72
73                 RS_Line * createPolygon2(const Vector & corner1, const Vector & corner2, int number);
74
75                 RS_Insert * createInsert(RS_InsertData & data);
76
77                 RS_Image * createImage(RS_ImageData & data);
78
79                 RS_Block * createBlock(const RS_BlockData & data, const Vector & referencePoint,
80                         const bool remove);
81
82                 RS_Insert * createLibraryInsert(RS_LibraryInsertData & data);
83
84                 //void createPoint(const Vector& p);
85                 //void createLine2P(const Vector& p1, const Vector& p2);
86                 //void createRectangle(const Vector& e1, const Vector& e2);
87                 //RS_Polyline* createPolyline(const Vector& p);
88
89         protected:
90                 RS_EntityContainer * container;
91                 Drawing * graphic;
92                 RS_Document * document;
93                 RS_GraphicView * graphicView;
94                 bool handleUndo;
95 };
96
97 #endif