]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#2205 Ability to customize the arrows and texts of dimensions: location type is not...
authornds <nds@opencascade.com>
Wed, 4 Oct 2017 08:09:43 +0000 (11:09 +0300)
committernds <nds@opencascade.com>
Wed, 4 Oct 2017 08:09:43 +0000 (11:09 +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 0bc856f0a02481a0ea2a50c1f20c64eb84605c50..89c61105ce430d444ba5582aea0191ea31cd8c2e 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
 
 #include <GeomDataAPI_Point2D.h>
 
@@ -69,7 +71,7 @@ void SketchPlugin_ConstraintAngle::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintAngle::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
 }
 
 void SketchPlugin_ConstraintAngle::colorConfigInfo(std::string& theSection, std::string& theName,
index 1ee864766bd02e62018df47e2e3a380d9024e25c..e75dcde94be98107862445248b2f20f5319ab821 100644 (file)
@@ -35,6 +35,8 @@
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_Data.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
 
 #include <Config_PropManager.h>
 
@@ -59,7 +61,7 @@ void SketchPlugin_ConstraintDistance::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintDistance::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
 }
 
 void SketchPlugin_ConstraintDistance::colorConfigInfo(std::string& theSection, std::string& theName,
index d2e0ef7931fa6470b18ea45fe203ff4db95ef1aa..355292413533f48d127d4443380c85af2188e92f 100644 (file)
@@ -33,6 +33,8 @@
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
 
 const double tolerance = 1e-7;
 
@@ -52,7 +54,7 @@ void SketchPlugin_ConstraintDistanceHorizontal::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintDistanceHorizontal::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
 }
 
 //*************************************************************************************
index 6cebbd4f5f3ffcbf730cb2b3eb2e3f9727055fb1..8823c3aa06bd25ae252a611e9de489f5d9b7658e 100644 (file)
@@ -33,6 +33,8 @@
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
 
 const double tolerance = 1e-7;
 
@@ -52,7 +54,7 @@ void SketchPlugin_ConstraintDistanceVertical::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintDistanceVertical::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
 }
 
 //*************************************************************************************
index 35986de79d752d0235525996090ece0946c1d1e1..b1cc7010d9ad4eaafaafba89459f0dbe7205cc5e 100644 (file)
@@ -30,6 +30,8 @@
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Result.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
 
 #include <GeomDataAPI_Point2D.h>
 
@@ -57,7 +59,7 @@ void SketchPlugin_ConstraintLength::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintLength::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
 }
 
 void SketchPlugin_ConstraintLength::colorConfigInfo(std::string& theSection, std::string& theName,
index b38de08ee224a336d19de69ab99c5ef4475535f1..08b8b9be730c6e558b14537f6c8aba292ebeeca3 100644 (file)
@@ -30,6 +30,8 @@
 #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>
@@ -57,7 +59,7 @@ void SketchPlugin_ConstraintRadius::initAttributes()
 
   data()->addAttribute(SketchPlugin_ConstraintRadius::LOCATION_TYPE_ID(),
                        ModelAPI_AttributeInteger::typeId());
-  data()->integer(LOCATION_TYPE_ID())->setValue(SketcherPrs_Tools::LOCATION_AUTOMATIC);
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
 }
 
 void SketchPlugin_ConstraintRadius::colorConfigInfo(std::string& theSection, std::string& theName,