Part::Thickness: This fixes issue #2876 by changing property type for value to include a unit.

This commit is contained in:
Eivind Kvedalen
2017-07-21 19:42:23 +02:00
committed by wmayer
parent bf3a1660a5
commit 60b90ec8a3
4 changed files with 40 additions and 2 deletions

View File

@@ -491,6 +491,9 @@ Thickness::Thickness()
Join.setEnums(JoinEnums);
ADD_PROPERTY_TYPE(Intersection,(false),"Thickness",App::Prop_None,"Intersection");
ADD_PROPERTY_TYPE(SelfIntersection,(false),"Thickness",App::Prop_None,"Self Intersection");
// Value should have length as unit
Value.setUnit(Base::Unit::Length);
}
short Thickness::mustExecute() const
@@ -510,6 +513,17 @@ short Thickness::mustExecute() const
return 0;
}
void Thickness::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop)
{
if (prop == &Value && strcmp(TypeName, "App::PropertyFloat") == 0) {
App::PropertyFloat v;
v.Restore(reader);
Value.setValue(v.getValue());
}
}
App::DocumentObjectExecReturn *Thickness::execute(void)
{
App::DocumentObject* source = Faces.getValue();