Change Scale to PropertyFloatConstaint to prevent OCC loop when Scale == 0

This commit is contained in:
WandererFan
2017-01-31 18:47:08 -05:00
committed by Yorik van Havre
parent d5bb03b75f
commit 79a5a6adde
8 changed files with 178 additions and 5 deletions

View File

@@ -52,6 +52,10 @@
#include <TopTools.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp.hxx>
#include <Precision.hxx>
#include <cmath>
#endif
#include <App/Application.h>
@@ -59,6 +63,7 @@
#include <Base/Exception.h>
#include <Base/FileInfo.h>
#include <Base/Parameter.h>
#include <Base/UnitsApi.h>
#include "HatchLine.h"
#include "DrawUtil.h"
@@ -73,6 +78,10 @@ using namespace TechDraw;
using namespace TechDrawGeometry;
using namespace std;
App::PropertyFloatConstraint::Constraints DrawGeomHatch::scaleRange = {Precision::Confusion(),
std::numeric_limits<double>::max(),
pow(10,- Base::UnitsApi::getDecimals())};
PROPERTY_SOURCE(TechDraw::DrawGeomHatch, App::DocumentObject)
@@ -84,6 +93,7 @@ DrawGeomHatch::DrawGeomHatch(void)
ADD_PROPERTY_TYPE(FilePattern ,(""),vgroup,App::Prop_None,"The crosshatch pattern file for this area");
ADD_PROPERTY_TYPE(NamePattern,(""),vgroup,App::Prop_None,"The name of the pattern");
ADD_PROPERTY_TYPE(ScalePattern,(1.0),vgroup,App::Prop_None,"GeomHatch pattern size adjustment");
ScalePattern.setConstraints(&scaleRange);
getParameters();