63 |
64 |
64 // TODO: check that the object isn't in the vector once there's a cheap way to do so! |
65 // TODO: check that the object isn't in the vector once there's a cheap way to do so! |
65 _objects.insert(position, object); |
66 _objects.insert(position, object); |
66 _needsTriangleRecount = true; |
67 _needsTriangleRecount = true; |
67 object->setDocument(this); |
68 object->setDocument(this); |
|
69 emit objectAdded(object); |
68 } |
70 } |
69 |
71 |
70 /* |
72 /* |
71 * Swaps one object with another, assuming they both are in this model. |
73 * Swaps one object with another, assuming they both are in this model. |
72 */ |
74 */ |
246 * Drops an object from the model at the provided position. The caller must immediately put the result value object into a new model. |
248 * Drops an object from the model at the provided position. The caller must immediately put the result value object into a new model. |
247 */ |
249 */ |
248 LDObject* Model::withdrawAt(int position) |
250 LDObject* Model::withdrawAt(int position) |
249 { |
251 { |
250 LDObject* object = _objects[position]; |
252 LDObject* object = _objects[position]; |
|
253 emit aboutToRemoveObject(object); |
251 _objects.removeAt(position); |
254 _objects.removeAt(position); |
252 _needsTriangleRecount = true; |
255 _needsTriangleRecount = true; |
253 return object; |
256 return object; |
254 } |
257 } |
255 |
258 |