]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1657 In the Sketcher, disable all coordinate and lenght inputs : rename "Sketc...
authornds <nds@opencascade.com>
Thu, 28 Jul 2016 06:09:06 +0000 (09:09 +0300)
committernds <nds@opencascade.com>
Thu, 28 Jul 2016 06:09:06 +0000 (09:09 +0300)
src/Config/Config_Prop.h
src/Config/Config_PropManager.cpp
src/ConstructionPlugin/ConstructionPlugin_Plane.cpp
src/ModuleBase/ModuleBase_ModelWidget.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_PreviewPlanes.cpp
src/PartSet/PartSet_WidgetSketchLabel.cpp

index b24e422789cd86d197b76000dad3ccec783fae76..aba70bf7b83d35c824a834a78960d9f40e04ede3 100644 (file)
@@ -12,6 +12,8 @@
 #include <string>
 #include <list>
 
+const static char* SKETCH_TAB_NAME = "Sketch";
+
 /*!
  * \class Config_Prop
  * \brief Class which describes a one property
index ad5ceca9b779bb2a0b0c3865c6625219646e1b86..c6e71b88e36435a44c0cdd3c3edc7fc44e54926c 100644 (file)
@@ -151,7 +151,7 @@ std::vector<int> stringToRGB(const std::string& theColor)
     aBuf[1] = theColor[6];
     aRes[2] = strtol(aBuf, &aP, 16);
   } else {
-    int aPos = theColor.find(",");
+    int aPos = (int)theColor.find(",");
     char aBuf[10];
     // Get Red
     std::size_t length = theColor.copy(aBuf, aPos, 0);
@@ -159,7 +159,7 @@ std::vector<int> stringToRGB(const std::string& theColor)
     aRes[0] = atoi(aBuf);
 
     // Get Green
-    int aNPos = theColor.find(",", aPos + 1);
+    int aNPos = (int)theColor.find(",", aPos + 1);
     length = theColor.copy(aBuf, aNPos - aPos - 1, aPos + 1);
     aBuf[length] = '\0';
     aRes[1] = atoi(aBuf);
index 68f3e5b0a732aa1a05f3026b072696f912c4be85..31687872392de013d64f7a0b51399081cb8f04c5 100644 (file)
@@ -158,7 +158,7 @@ std::shared_ptr<GeomAPI_Shape> ConstructionPlugin_Plane::createByGeneralEquation
     std::shared_ptr<GeomAPI_Pln> aPlane = 
       std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(aA, aB, aC, aD));
     std::string kDefaultPlaneSize = "200";
-    double aSize = Config_PropManager::integer("Sketch planes", "planes_size", kDefaultPlaneSize);
+    double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size", kDefaultPlaneSize);
     aSize *= 4.;
     aPlaneFace = GeomAlgoAPI_FaceBuilder::squareFace(aPlane, aSize);
   }
index 77d58959b1bd322e45e6c5b51ae41e5309c3e09a..713adea890d132a12a0b4b231bf6a3190eb14d7e 100644 (file)
@@ -90,7 +90,7 @@ bool ModuleBase_ModelWidget::isValueEnabled() const
 {
   bool anEnabled = true;
   if (myIsValueEnabled == DefinedInPreferences) {
-    bool aCanDisable = Config_PropManager::boolean("Sketch planes", "disable_input_fields", "true");
+    bool aCanDisable = Config_PropManager::boolean(SKETCH_TAB_NAME, "disable_input_fields", "true");
     if (aCanDisable)
       anEnabled = false;
   }
index 120d4d6acad297a075a6786fee038144ce0b8ce3..8c818d861c0666a7b4edaeee80268643560e114b 100755 (executable)
@@ -166,7 +166,7 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
                           PartSet_CustomPrs::OPERATION_HIGHLIGHT_COLOR());
 
 
-  Config_PropManager::registerProp("Sketch planes", "disable_input_fields", "Disable input fields",
+  Config_PropManager::registerProp(SKETCH_TAB_NAME, "disable_input_fields", "Disable input fields",
                           Config_Prop::Boolean, "true");
 }
 
@@ -244,11 +244,11 @@ void PartSet_Module::registerFilters()
 
 void PartSet_Module::registerProperties()
 {
-  Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
+  Config_PropManager::registerProp(SKETCH_TAB_NAME, "planes_size", "Size", Config_Prop::Double,
                                    PLANE_SIZE);
-  Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
+  Config_PropManager::registerProp(SKETCH_TAB_NAME, "planes_thickness", "Thickness",
                                    Config_Prop::Integer, SKETCH_WIDTH);
-  Config_PropManager::registerProp("Sketch planes", "rotate_to_plane", "Rotate to plane when selected",
+  Config_PropManager::registerProp(SKETCH_TAB_NAME, "rotate_to_plane", "Rotate to plane when selected",
     Config_Prop::Boolean, "false");
 }
 
index 53e4cebfd00eab49ccbea0205dfc0521e530b06c..4e362145d770269559708af823b72eb8b6e64886 100755 (executable)
@@ -123,11 +123,11 @@ AISObjectPtr PartSet_PreviewPlanes::createPreviewPlane(std::shared_ptr<GeomAPI_P
                                                        std::shared_ptr<GeomAPI_Dir> theNorm, 
                                                        const int theRGB[3])
 {
-  double aSize = Config_PropManager::integer("Sketch planes", "planes_size", PLANE_SIZE);
+  double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size", PLANE_SIZE);
   std::shared_ptr<GeomAPI_Shape> aFace = GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize);
   AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject());
   aAIS->createShape(aFace);
-  aAIS->setWidth(Config_PropManager::integer("Sketch planes", "planes_thickness", SKETCH_WIDTH));
+  aAIS->setWidth(Config_PropManager::integer(SKETCH_TAB_NAME, "planes_thickness", SKETCH_WIDTH));
   aAIS->setColor(theRGB[0], theRGB[1], theRGB[2]);
   return aAIS;
 }
index c09625924e83a1b377cf08caee693ce665b489b8..9a94798aad80491d4143caf310f337e0d16beb75 100644 (file)
@@ -270,7 +270,7 @@ void PartSet_WidgetSketchLabel::updateByPlaneSelected(const ModuleBase_ViewerPrs
 
     // Rotate view if the sketcher plane is selected only from preview planes
     // Preview planes are created only if there is no any shape
-    bool aRotate = Config_PropManager::boolean("Sketch planes", "rotate_to_plane", "false");
+    bool aRotate = Config_PropManager::boolean(SKETCH_TAB_NAME, "rotate_to_plane", "false");
     if (aRotate) {
       myWorkshop->viewer()->setViewProjection(aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aTwist);
       PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());