src/vertexmap.cpp

changeset 333
07e65a4c6611
parent 309
d862721d19a3
child 338
719b909a7d2b
equal deleted inserted replaced
332:ae7f7fbb9cda 333:07e65a4c6611
11 } 11 }
12 12
13 VertexMap::VertexMap(const Model *model) : 13 VertexMap::VertexMap(const Model *model) :
14 model{model} 14 model{model}
15 { 15 {
16 connect(
17 model,
18 &Model::dataChanged,
19 this,
20 &VertexMap::build
21 );
22 connect(
23 model,
24 &Model::rowsInserted,
25 this,
26 &VertexMap::build
27 );
28 connect(
29 model,
30 &Model::rowsRemoved,
31 this,
32 &VertexMap::build
33 );
34 this->build(); 16 this->build();
35 } 17 }
36 18
37 struct Edge 19 struct Edge
38 { 20 {
114 void VertexMap::build() 96 void VertexMap::build()
115 { 97 {
116 this->map.clear(); 98 this->map.clear();
117 this->vertices.clear(); 99 this->vertices.clear();
118 this->vertexHashes.clear(); 100 this->vertexHashes.clear();
101 #if 0
119 for (std::size_t i = 0; i < this->model->size(); ++i) 102 for (std::size_t i = 0; i < this->model->size(); ++i)
120 { 103 {
121 const ModelElement& element = this->model->at(i); 104 const ModelElement& element = this->model->at(i);
122 std::optional<glm::mat4> matrix = ifplanar<glm::mat4>( 105 std::optional<glm::mat4> matrix = ifplanar<glm::mat4>(
123 element, 106 element,
171 }); 154 });
172 } 155 }
173 } 156 }
174 info.transform = glm::scale(info.transform, glm::vec3{scale, scale, scale}); 157 info.transform = glm::scale(info.transform, glm::vec3{scale, scale, scale});
175 } 158 }
159 #endif
176 Q_EMIT this->verticesChanged(); 160 Q_EMIT this->verticesChanged();
177 } 161 }
178 162
179 /** 163 /**
180 * @brief Apply \c fn for all vertices in the map. 164 * @brief Apply \c fn for all vertices in the map.

mercurial