]> Shamusworld >> Repos - architektonas/blob - src/base/creation.h
Fixed problem with MDI activation.
[architektonas] / src / base / creation.h
1 #ifndef __CREATION_H__
2 #define __CREATION_H__
3
4 #include <QtCore>
5 #include "vector.h"
6
7 class Arc;
8 class Block;
9 class BlockData;
10 class Circle;
11 class Document;
12 class Drawing;
13 class Entity;
14 class EntityContainer;
15 class GraphicView;
16 class Image;
17 class ImageData;
18 class Insert;
19 class InsertData;
20 class Line;
21
22 /**
23  * Data needed to insert library items.
24  */
25 struct 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 Creation
41 {
42         public:
43                 Creation(EntityContainer * container, GraphicView * graphicView = NULL,
44                         bool handleUndo = true);
45
46                 Entity * createParallelThrough(const Vector & coord, int number,
47                         Entity * e);
48
49                 Entity * createParallel(const Vector & coord, double distance,
50                         int number, Entity * e);
51
52                 Line * createParallelLine(const Vector & coord, double distance, int number,
53                         Line * e);
54
55                 Arc * createParallelArc(const Vector & coord, double distance, int number,
56                         Arc * e);
57
58                 Circle * createParallelCircle(const Vector & coord, double distance, int number,
59                         Circle * e);
60
61                 Line * createBisector(const Vector & coord1, const Vector & coord2, double length,
62                         int num, Line * l1, Line * l2);
63
64                 Line * createTangent1(const Vector & coord, const Vector & point, Entity * circle);
65
66                 Line * createTangent2(const Vector & coord, Entity * circle1, Entity * circle2);
67
68                 Line * createLineRelAngle(const Vector & coord, Entity * entity,
69                         double angle, double length);
70
71                 Line * createPolygon(const Vector & center, const Vector & corner, int number);
72
73                 Line * createPolygon2(const Vector & corner1, const Vector & corner2, int number);
74
75                 Insert * createInsert(InsertData & data);
76
77                 Image * createImage(ImageData & data);
78
79                 Block * createBlock(const BlockData & data, const Vector & referencePoint,
80                         const bool remove);
81
82                 Insert * createLibraryInsert(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                 //Polyline* createPolyline(const Vector& p);
88
89         protected:
90                 EntityContainer * container;
91                 Drawing * graphic;
92                 Document * document;
93                 GraphicView * graphicView;
94                 bool handleUndo;
95 };
96
97 #endif