src/model.cpp

changeset 73
97df974b5ed5
parent 51
1a9eac27698d
child 76
7c4a63a02632
equal deleted inserted replaced
72:7c27cda03747 73:97df974b5ed5
86 this->needRecache = false; 86 this->needRecache = false;
87 } 87 }
88 return this->cachedPolygons; 88 return this->cachedPolygons;
89 } 89 }
90 90
91 QModelIndex Model::lookup(ldraw::Id id) const 91 QModelIndex Model::lookup(ldraw::id_t id) const
92 { 92 {
93 // FIXME: This linear search will probably cause performance issues 93 // FIXME: This linear search will probably cause performance issues
94 for (std::size_t i = 0; i < this->body.size(); i += 1) 94 for (std::size_t i = 0; i < this->body.size(); i += 1)
95 { 95 {
96 if (this->body[i]->id == id) 96 if (this->body[i]->id == id)
99 } 99 }
100 } 100 }
101 return {}; 101 return {};
102 } 102 }
103 103
104 ldraw::Id Model::resolve(const QModelIndex& index) const 104 ldraw::id_t Model::resolve(const QModelIndex& index) const
105 { 105 {
106 return this->objectAt(index)->id; 106 return this->objectAt(index)->id;
107 } 107 }
108 108
109 void Model::getObjectPolygons( 109 void Model::getObjectPolygons(

mercurial