-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (31 loc) · 1.24 KB
/
main.cpp
File metadata and controls
40 lines (31 loc) · 1.24 KB
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
40
#include <iostream>
#include "controller.h"
#include "model.h"
#include "view.h"
#include "gliph.h"
//1. Adding new gliphs is just creating new classes inheritable from Gliph
//2. Database interconnection is a new functions in MenuModel
//3. Modification of gliphs needs adding an access to their properties. Gliphstore in DrawModel allows to find elements and call appropriates methods for changing their properties
//4. Gliphstore in DrawModel allows to iterate through gliphs and work with them (replace, modification, etc)
int main()
{
MenuModel menuModel{};
DrawModel drawModel{};
MenuController menuController(menuModel);
DrawController drawController(drawModel);
View menuView {};
View drawView {};
menuModel.connect([&](Model* m) {
menuView.printStateOfDocument(m);
});
drawModel.connect([&](Model* m) {
drawView.printStateOfDocument(m);
});
menuController.createNewDocument("picture.jpg");
menuController.exportDocument("awesome_drawing.pdf");
menuController.importDocument("other_picture.jpg");
auto glyph = menuController.createGlyph(GlyphType::SIMPLE_GLYPH, "simple glyph");
drawController.drawGlyph(glyph, 0, 0);
drawController.deleteGlyph(glyph);
return 0;
}