Skip to content

Commit

Permalink
Surface: handle old project files using Extend feature
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jul 3, 2020
1 parent 01edf38 commit 6e5bd7b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/Mod/Surface/App/FeatureExtend.cpp
Expand Up @@ -189,3 +189,25 @@ App::DocumentObjectExecReturn *Extend::execute(void)

return StdReturn;
}

void Extend::handleChangedPropertyName(Base::XMLReader &reader,
const char * TypeName,
const char *PropName)
{
Base::Type type = Base::Type::fromName(TypeName);
if (App::PropertyFloatConstraint::getClassTypeId() == type && strcmp(PropName, "ExtendU") == 0) {
App::PropertyFloatConstraint v;
v.Restore(reader);
ExtendUNeg.setValue(v.getValue());
ExtendUPos.setValue(v.getValue());
}
else if (App::PropertyFloatConstraint::getClassTypeId() == type && strcmp(PropName, "ExtendV") == 0) {
App::PropertyFloatConstraint v;
v.Restore(reader);
ExtendVNeg.setValue(v.getValue());
ExtendVPos.setValue(v.getValue());
}
else {
Part::Spline::handleChangedPropertyName(reader, TypeName, PropName);
}
}
5 changes: 4 additions & 1 deletion src/Mod/Surface/App/FeatureExtend.h
Expand Up @@ -57,8 +57,11 @@ class SurfaceExport Extend : public Part::Spline
App::DocumentObjectExecReturn *execute(void) override;
short mustExecute() const override;

private:
protected:
virtual void onChanged(const App::Property* prop) override;
virtual void handleChangedPropertyName(Base::XMLReader &reader,
const char * TypeName,
const char *PropName) override;
};

}//Namespace Surface
Expand Down

0 comments on commit 6e5bd7b

Please sign in to comment.