57 { |
55 { |
58 const linetypes::Object* object = this->body[index].get(); |
56 const linetypes::Object* object = this->body[index].get(); |
59 return object->getProperty(property); |
57 return object->getProperty(property); |
60 } |
58 } |
61 |
59 |
|
60 std::vector<gl::Polygon> Model::getPolygons(DocumentManager* documents) const |
|
61 { |
|
62 if (this->needRecache) |
|
63 { |
|
64 this->cachedPolygons.clear(); |
|
65 linetypes::GetPolygonsContext context{documents}; |
|
66 for (int i = 0; i < this->size(); i += 1) |
|
67 { |
|
68 this->getObjectPolygons(i, this->cachedPolygons, &context); |
|
69 } |
|
70 this->needRecache = false; |
|
71 } |
|
72 return this->cachedPolygons; |
|
73 } |
|
74 |
|
75 void Model::getObjectPolygons( |
|
76 const int index, |
|
77 std::vector<gl::Polygon>& polygons_out, |
|
78 linetypes::GetPolygonsContext* context) const |
|
79 { |
|
80 const linetypes::Object* object = this->body[index].get(); |
|
81 object->getPolygons(polygons_out, context); |
|
82 } |
|
83 |
62 void Model::append(ModelObjectPointer&& object) |
84 void Model::append(ModelObjectPointer&& object) |
63 { |
85 { |
64 this->body.push_back(std::move(object)); |
86 this->body.push_back(std::move(object)); |
65 } |
87 } |