src/document.cpp

changeset 127
f64bfb7f5d26
parent 126
a7c720aff97c
child 128
7c834fe36b25
equal deleted inserted replaced
126:a7c720aff97c 127:f64bfb7f5d26
23 #include "model.h" 23 #include "model.h"
24 #include "modeleditcontext.h" 24 #include "modeleditcontext.h"
25 #include "tools/basetool.h" 25 #include "tools/basetool.h"
26 #include "tools/drawtool.h" 26 #include "tools/drawtool.h"
27 #include "tools/selecttool.h" 27 #include "tools/selecttool.h"
28 #include "tools/transformtool.h"
28 29
29 static const QMetaObject* const toolMetaObjects[] = { 30 static const QMetaObject* const toolMetaObjects[] = {
30 &SelectTool::staticMetaObject, 31 &SelectTool::staticMetaObject,
31 &DrawTool::staticMetaObject, 32 &DrawTool::staticMetaObject,
33 &TransformTool::staticMetaObject,
32 }; 34 };
33 35
34 Document::Document( 36 Document::Document(
35 Model* model, 37 Model* model,
36 DocumentManager* documents, 38 DocumentManager* documents,
146 this->vertexMap.apply(fn); 148 this->vertexMap.apply(fn);
147 } 149 }
148 150
149 void Document::selectionChanged(const QSet<ldraw::id_t>& newSelection) 151 void Document::selectionChanged(const QSet<ldraw::id_t>& newSelection)
150 { 152 {
151 if (this->selectedTool != nullptr) 153 for (BaseTool* tool : this->tools)
152 { 154 {
153 this->selectedTool->selectionChanged(newSelection); 155 tool->selectionChanged(newSelection);
154 } 156 }
155 } 157 }
156 158
157 void Document::initializeTools() 159 void Document::initializeTools()
158 { 160 {

mercurial