51 const ldraw::id_t id, |
51 const ldraw::id_t id, |
52 const ldraw::Property property, |
52 const ldraw::Property property, |
53 const QVariant& value) |
53 const QVariant& value) |
54 -> ldraw::Object::SetPropertyResult |
54 -> ldraw::Object::SetPropertyResult |
55 { |
55 { |
56 ldraw::Object* const object = this->model().objectAt(id); |
56 ldraw::Object* const object = this->model().findObjectById(id); |
57 if (object != nullptr) |
57 if (object != nullptr) |
58 { |
58 { |
59 const ldraw::Object::SetPropertyResult result = object->setProperty(ldraw::PropertyKeyValue{property, value}); |
59 const ldraw::Object::SetPropertyResult result = object->setProperty(ldraw::PropertyKeyValue{property, value}); |
60 modifiedObjects.insert(id); |
60 modifiedObjects.insert(id); |
61 return result; |
61 return result; |
66 } |
66 } |
67 } |
67 } |
68 |
68 |
69 void Model::EditContext::setObjectPoint(ldraw::id_t id, int pointId, const glm::vec3& value) |
69 void Model::EditContext::setObjectPoint(ldraw::id_t id, int pointId, const glm::vec3& value) |
70 { |
70 { |
71 ldraw::Object* object = this->model().objectAt(id); |
71 ldraw::Object* object = this->model().findObjectById(id); |
72 if (object != nullptr) |
72 if (object != nullptr) |
73 { |
73 { |
74 object->setProperty(ldraw::PropertyKeyValue{ldraw::pointProperty(pointId), QVariant::fromValue(value)}); |
74 object->setProperty(ldraw::PropertyKeyValue{ldraw::pointProperty(pointId), QVariant::fromValue(value)}); |
75 modifiedObjects.insert(id); |
75 modifiedObjects.insert(id); |
76 } |
76 } |