0000581: crash when editing duplicated sketch

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5427 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer 2012-01-27 10:53:51 +00:00
parent 9b0e3818b0
commit 0b044ffd91
4 changed files with 11 additions and 0 deletions

View File

@ -1529,6 +1529,7 @@ DocumentObject* Document::_copyObject(DocumentObject* obj, std::map<DocumentObje
}
// unmark to be not re-computed later
copy->onFinishDuplicating();
copy->purgeTouched();
return copy;
}

View File

@ -181,6 +181,8 @@ protected:
virtual void onChanged(const Property* prop);
/// get called after a document has been fully restored
virtual void onDocumentRestored() {}
/// get called after duplicating an object
virtual void onFinishDuplicating() {}
/// python object of this class and all descendend
protected: // attributes

View File

@ -1441,6 +1441,13 @@ void SketchObject::onDocumentRestored()
}
}
void SketchObject::onFinishDuplicating()
{
Constraints.acceptGeometry(getCompleteGeometry());
rebuildVertexIndex();
onDocumentRestored();
}
void SketchObject::getGeoVertexIndex(int VertexId, int &GeoId, PointPos &PosId)
{
if (VertexId < 0 || VertexId >= int(VertexId2GeoId.size())) {

View File

@ -152,6 +152,7 @@ protected:
/// get called by the container when a property has changed
virtual void onChanged(const App::Property* /*prop*/);
virtual void onDocumentRestored();
virtual void onFinishDuplicating();
private:
std::vector<Part::Geometry *> ExternalGeo;