+ clean up the synchronization of Contraints and Geometry lists

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5069 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
logari81 2011-10-26 11:02:04 +00:00
parent 1869f0701a
commit 8285c1d4e5
2 changed files with 5 additions and 16 deletions

View File

@ -179,10 +179,8 @@ void PropertyConstraintList::Restore(Base::XMLReader &reader)
Property *PropertyConstraintList::Copy(void) const
{
PropertyConstraintList *p = new PropertyConstraintList();
p->setValidGeometryKeys(validGeometryKeys);
if (invalidGeometry)
p->invalidateGeometry();
p->setValues(_lValueList);
p->applyValidGeometryKeys(validGeometryKeys);
p->applyValues(_lValueList);
return p;
}
@ -191,9 +189,7 @@ void PropertyConstraintList::Paste(const Property &from)
const PropertyConstraintList& FromList = dynamic_cast<const PropertyConstraintList&>(from);
aboutToSetValue();
applyValues(FromList._lValueList);
setValidGeometryKeys(FromList.validGeometryKeys);
if (FromList.invalidGeometry)
invalidateGeometry();
applyValidGeometryKeys(FromList.validGeometryKeys);
hasSetValue();
}
@ -217,15 +213,9 @@ void PropertyConstraintList::acceptGeometry(const std::vector<Part::Geometry *>
hasSetValue();
}
void PropertyConstraintList::setValidGeometryKeys(const std::vector<unsigned int> &keys)
void PropertyConstraintList::applyValidGeometryKeys(const std::vector<unsigned int> &keys)
{
validGeometryKeys = keys;
invalidGeometry = false;
}
void PropertyConstraintList::invalidateGeometry()
{
invalidGeometry = true;
}
void PropertyConstraintList::checkGeometry(const std::vector<Part::Geometry *> &GeoList)

View File

@ -87,7 +87,6 @@ public:
virtual unsigned int getMemSize(void) const;
void acceptGeometry(const std::vector<Part::Geometry *> &GeoList);
void invalidateGeometry();
void checkGeometry(const std::vector<Part::Geometry *> &GeoList);
private:
@ -97,7 +96,7 @@ private:
bool invalidGeometry;
void applyValues(const std::vector<Constraint*>&);
void setValidGeometryKeys(const std::vector<unsigned int> &keys);
void applyValidGeometryKeys(const std::vector<unsigned int> &keys);
static std::vector<Constraint *> _emptyValueList;
};