]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#2205 Ability to customize the arrows and texts of dimensions: Default value is set... Dev_2.8.0
authornds <nds@opencascade.com>
Wed, 4 Oct 2017 04:14:36 +0000 (07:14 +0300)
committernds <nds@opencascade.com>
Wed, 4 Oct 2017 04:14:36 +0000 (07:14 +0300)
src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistanceHorizontal.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistanceVertical.cpp
src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp

index e1d15b68ce2099b623fed5f9aee8329237646884..0bc856f0a02481a0ea2a50c1f20c64eb84605c50 100644 (file)
 
 #include "SketchPlugin_ConstraintAngle.h"
 #include <SketchPlugin_Line.h>
+#include <SketcherPrs_Tools.h>
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Validator.h>
 
 #include <GeomDataAPI_Point2D.h>
 
@@ -70,7 +69,7 @@ void SketchPlugin_ConstraintAngle::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintAngle::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
+  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
 }
 
 void SketchPlugin_ConstraintAngle::colorConfigInfo(std::string& theSection, std::string& theName,
index e75dcde94be98107862445248b2f20f5319ab821..1ee864766bd02e62018df47e2e3a380d9024e25c 100644 (file)
@@ -35,8 +35,6 @@
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_Data.h>
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Validator.h>
 
 #include <Config_PropManager.h>
 
@@ -61,7 +59,7 @@ void SketchPlugin_ConstraintDistance::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintDistance::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
+  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
 }
 
 void SketchPlugin_ConstraintDistance::colorConfigInfo(std::string& theSection, std::string& theName,
index 355292413533f48d127d4443380c85af2188e92f..d2e0ef7931fa6470b18ea45fe203ff4db95ef1aa 100644 (file)
@@ -33,8 +33,6 @@
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Validator.h>
 
 const double tolerance = 1e-7;
 
@@ -54,7 +52,7 @@ void SketchPlugin_ConstraintDistanceHorizontal::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintDistanceHorizontal::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
+  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
 }
 
 //*************************************************************************************
index 8823c3aa06bd25ae252a611e9de489f5d9b7658e..6cebbd4f5f3ffcbf730cb2b3eb2e3f9727055fb1 100644 (file)
@@ -33,8 +33,6 @@
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Validator.h>
 
 const double tolerance = 1e-7;
 
@@ -54,7 +52,7 @@ void SketchPlugin_ConstraintDistanceVertical::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintDistanceVertical::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
+  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
 }
 
 //*************************************************************************************
index 70f00444110a9d53cb951d2032c02414060fcc5a..35986de79d752d0235525996090ece0946c1d1e1 100644 (file)
 #include <GeomDataAPI_Point2D.h>
 
 #include <SketcherPrs_Factory.h>
+#include <SketcherPrs_Tools.h>
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Result.h>
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Validator.h>
 
 #include <GeomDataAPI_Point2D.h>
 
@@ -58,7 +57,7 @@ void SketchPlugin_ConstraintLength::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintLength::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
+  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
 }
 
 void SketchPlugin_ConstraintLength::colorConfigInfo(std::string& theSection, std::string& theName,
index 0b34c183c507df854725bb23ec85dfaaca5ef30f..b38de08ee224a336d19de69ab99c5ef4475535f1 100644 (file)
 #include <SketchPlugin_Point.h>
 
 #include <SketcherPrs_Factory.h>
+#include <SketcherPrs_Tools.h>
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_Data.h>
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Validator.h>
 
 #include <GeomAPI_Pnt2d.h>
 #include <GeomAPI_Circ.h>
@@ -58,7 +57,7 @@ void SketchPlugin_ConstraintRadius::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintRadius::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
+  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
 }
 
 void SketchPlugin_ConstraintRadius::colorConfigInfo(std::string& theSection, std::string& theName,