PD: [skip ci] set angle constraints for groove
This commit is contained in:
@@ -55,6 +55,8 @@ namespace PartDesign {
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Groove, PartDesign::ProfileBased)
|
||||
|
||||
const App::PropertyAngle::Constraints Groove::floatAngle = { Base::toDegrees<double>(Precision::Angular()), 360.0, 1.0 };
|
||||
|
||||
Groove::Groove()
|
||||
{
|
||||
addSubType = FeatureAddSub::Subtractive;
|
||||
@@ -62,6 +64,7 @@ Groove::Groove()
|
||||
ADD_PROPERTY_TYPE(Base,(Base::Vector3d(0.0f,0.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Base");
|
||||
ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0.0f,1.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Axis");
|
||||
ADD_PROPERTY_TYPE(Angle,(360.0),"Groove", App::Prop_None, "Angle");
|
||||
Angle.setConstraints(&floatAngle);
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis,(0),"Groove",(App::PropertyType)(App::Prop_None),"Reference axis of Groove");
|
||||
}
|
||||
|
||||
@@ -86,6 +89,7 @@ App::DocumentObjectExecReturn *Groove::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Angle of groove too large");
|
||||
|
||||
angle = Base::toRadians<double>(angle);
|
||||
|
||||
// Reverse angle if selected
|
||||
if (Reversed.getValue() && !Midplane.getValue())
|
||||
angle *= (-1.0);
|
||||
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
protected:
|
||||
/// updates Axis from ReferenceAxis
|
||||
void updateAxis(void);
|
||||
|
||||
static const App::PropertyAngle::Constraints floatAngle;
|
||||
};
|
||||
|
||||
} //namespace PartDesign
|
||||
|
||||
Reference in New Issue
Block a user