src/modeleditcontext.cpp

changeset 151
e628fc2e0c72
parent 136
e8444e0d7f1a
child 152
03f8e6d42e13
equal deleted inserted replaced
150:b6cbba6e29a1 151:e628fc2e0c72
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 }

mercurial