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:
parent
9b0e3818b0
commit
0b044ffd91
|
@ -1529,6 +1529,7 @@ DocumentObject* Document::_copyObject(DocumentObject* obj, std::map<DocumentObje
|
||||||
}
|
}
|
||||||
|
|
||||||
// unmark to be not re-computed later
|
// unmark to be not re-computed later
|
||||||
|
copy->onFinishDuplicating();
|
||||||
copy->purgeTouched();
|
copy->purgeTouched();
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,8 @@ protected:
|
||||||
virtual void onChanged(const Property* prop);
|
virtual void onChanged(const Property* prop);
|
||||||
/// get called after a document has been fully restored
|
/// get called after a document has been fully restored
|
||||||
virtual void onDocumentRestored() {}
|
virtual void onDocumentRestored() {}
|
||||||
|
/// get called after duplicating an object
|
||||||
|
virtual void onFinishDuplicating() {}
|
||||||
|
|
||||||
/// python object of this class and all descendend
|
/// python object of this class and all descendend
|
||||||
protected: // attributes
|
protected: // attributes
|
||||||
|
|
|
@ -1441,6 +1441,13 @@ void SketchObject::onDocumentRestored()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SketchObject::onFinishDuplicating()
|
||||||
|
{
|
||||||
|
Constraints.acceptGeometry(getCompleteGeometry());
|
||||||
|
rebuildVertexIndex();
|
||||||
|
onDocumentRestored();
|
||||||
|
}
|
||||||
|
|
||||||
void SketchObject::getGeoVertexIndex(int VertexId, int &GeoId, PointPos &PosId)
|
void SketchObject::getGeoVertexIndex(int VertexId, int &GeoId, PointPos &PosId)
|
||||||
{
|
{
|
||||||
if (VertexId < 0 || VertexId >= int(VertexId2GeoId.size())) {
|
if (VertexId < 0 || VertexId >= int(VertexId2GeoId.size())) {
|
||||||
|
|
|
@ -152,6 +152,7 @@ protected:
|
||||||
/// get called by the container when a property has changed
|
/// get called by the container when a property has changed
|
||||||
virtual void onChanged(const App::Property* /*prop*/);
|
virtual void onChanged(const App::Property* /*prop*/);
|
||||||
virtual void onDocumentRestored();
|
virtual void onDocumentRestored();
|
||||||
|
virtual void onFinishDuplicating();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<Part::Geometry *> ExternalGeo;
|
std::vector<Part::Geometry *> ExternalGeo;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user