[PartDesign] Draft angle property change from App::PropertyFloatConstraint to App::PropertyAngle

This commit is contained in:
mwganson
2019-08-12 21:53:49 -05:00
committed by wmayer
parent 79a722830d
commit ecd4038d3a
2 changed files with 6 additions and 4 deletions

View File

@@ -65,12 +65,10 @@ using namespace PartDesign;
PROPERTY_SOURCE(PartDesign::Draft, PartDesign::DressUp)
const App::PropertyFloatConstraint::Constraints floatAngle = {0.0,89.99,0.1};
Draft::Draft()
{
ADD_PROPERTY(Angle,(1.5));
Angle.setConstraints(&floatAngle);
ADD_PROPERTY_TYPE(NeutralPlane,(0),"Draft",(App::PropertyType)(App::Prop_None),"NeutralPlane");
ADD_PROPERTY_TYPE(PullDirection,(0),"Draft",(App::PropertyType)(App::Prop_None),"PullDirection");
ADD_PROPERTY(Reversed,(0));
@@ -105,7 +103,10 @@ App::DocumentObjectExecReturn *Draft::execute(void)
return new App::DocumentObjectExecReturn("No faces specified");
// Draft angle
double angle = Angle.getValue() / 180.0 * M_PI;
double angle = Angle.getValue();
angle = angle >= 90.0 ? 89.99 : angle < 0.0 ? 0.0 : angle;
Angle.setValue(angle);
angle = angle / 180.0 * M_PI;
// Pull direction
gp_Dir pullDirection;

View File

@@ -25,6 +25,7 @@
#define PARTDESIGN_FEATUREDRAFT_H
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include "FeatureDressUp.h"
@@ -38,7 +39,7 @@ class PartDesignExport Draft : public DressUp
public:
Draft();
App::PropertyFloatConstraint Angle;
App::PropertyAngle Angle;
App::PropertyLinkSub NeutralPlane;
App::PropertyLinkSub PullDirection;
App::PropertyBool Reversed;