]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Debug preferences of sketch planes
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 5 Feb 2015 16:03:09 +0000 (19:03 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 5 Feb 2015 16:03:09 +0000 (19:03 +0300)
src/ModuleBase/ModuleBase_IModule.cpp
src/ModuleBase/ModuleBase_IModule.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/PartSet/PartSet_WidgetSketchLabel.h
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Sketch.h

index fd2686df308b3bc672761701127e048f974182b7..f7637f9d77128f8c720878d0d6a274720e97ea64 100644 (file)
@@ -97,6 +97,7 @@ void ModuleBase_IModule::createFeatures()
 {
   registerValidators();
   registerFilters();
+  registerProperties();
 
   Config_ModuleReader aXMLReader = Config_ModuleReader();
   aXMLReader.readAll();
index 9420d1e74d8818724ca2547c8e02fb9a9a5213a4..e576cabac151e1b95bf0c7ffc80413c13c611f7f 100644 (file)
@@ -115,6 +115,9 @@ protected slots:
 \r
   /// Register selection filters for this module\r
   virtual void registerFilters() {}\r
+
+  /// Register properties of this module
+  virtual void registerProperties() {}
 \r
   /// Returns new instance of operation object (used in createOperation for customization)\r
   virtual ModuleBase_Operation* getNewOperation(const std::string& theFeatureId);\r
index a7c92844e87a28c2e80f3ddc0da61dfec4ca279c..2b92c351a5ec2fdf8a88d31fd0c77168050d70cb 100644 (file)
@@ -52,6 +52,7 @@
 //#include <SketchPlugin_ConstraintRigid.h>
 
 #include <Events_Loop.h>
+#include <Config_PropManager.h>
 
 #include <StdSelect_TypeOfFace.hxx>
 #include <TopoDS_Vertex.hxx>
@@ -134,6 +135,14 @@ void PartSet_Module::registerFilters()
             new ModuleBase_FilterCustom(aSelectFilter));
 }
 
+void PartSet_Module::registerProperties()
+{
+  Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
+                                   PLANE_SIZE);
+  Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
+                                   Config_Prop::Integer, SKETCH_WIDTH);
+}
+
 void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation) 
 {
   if (theOperation->isEditOperation())
index 326866c9fd16917a5163ffec8ba13394046375d6..793f0a5da306ccbbcf3187b8cab54ccd365ff4db 100644 (file)
@@ -113,6 +113,9 @@ protected slots:
   /// Register selection filters for this module
   virtual void registerFilters();
 
+  /// Register properties of this module
+  virtual void registerProperties();
+
  private slots:
    /// Processing of vertex selected
    void onVertexSelected();
index afe12cd2d39ce60e64dc1994fcb02387218cf796..1e9d79070eb5a41837512e6b5ede0469edba7144 100644 (file)
@@ -38,9 +38,6 @@
 #include <QTimer>
 #include <QApplication>
 
-#define PLANE_SIZE          "200"     
-#define SKETCH_WIDTH        "4"
-
 
 PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
                                                      const Config_WidgetAPI* theData,
@@ -214,7 +211,7 @@ AISObjectPtr PartSet_WidgetSketchLabel::createPreviewPlane(std::shared_ptr<GeomA
                                                            std::shared_ptr<GeomAPI_Dir> theNorm, 
                                                            const int theRGB[3])
 {
-  double aSize = Config_PropManager::integer("Sketch planes", "Size of planes", PLANE_SIZE);
+  double aSize = Config_PropManager::integer("Sketch planes", "planes_size", PLANE_SIZE);
   std::shared_ptr<GeomAPI_Shape> aFace = GeomAlgoAPI_FaceBuilder::square(theOrigin, theNorm, aSize);
   AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject());
   aAIS->createShape(aFace);
index 9c9ffad2cc8a4007c626792c5d06b205821b9e44..d7b412f16b0024dffdfa9951693193d55c2595ca 100644 (file)
@@ -24,6 +24,12 @@ class QTimer;
 class XGUI_OperationMgr;
 class XGUI_Workshop;
 
+/// the plane edge width
+#define SKETCH_WIDTH        "4"
+
+/// face of the square-face displayed for selection of general plane
+#define PLANE_SIZE          "200"
+
 /**
 * \ingroup Modules
 * A model widget implementation for a label which provides specific behaviour 
index 452e07401f313c26d1d867ccaf2f0182f2b86f06..030f786f18b1d78d2e5d0f218b0dd3e0d98ebb85 100644 (file)
@@ -53,12 +53,6 @@ SketchPlugin_Plugin::SketchPlugin_Plugin()
   ModelAPI_Session::get()->registerPlugin(this);
 
   // register sketcher properties
-  Config_PropManager::registerProp("Sketch planes", "planes_color", "Color", Config_Prop::Color,
-                                   SKETCH_PLANE_COLOR);
-  Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
-                                   PLANE_SIZE);
-  Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
-                                   Config_Prop::Integer, SKETCH_WIDTH);
 
   Config_PropManager::registerProp("Visualization", "parallel_color", "Parallel constraint color",
                                    Config_Prop::Color, PARALLEL_COLOR);
index 51ac70496b266da567e9d7b086728f5ed0f03da7..83d7291442b7cce53bc774e34a89931265c8df1c 100644 (file)
 #include <GeomAPI_IPresentable.h>
 #include <list>
 
-/// the plane edge color
-#define SKETCH_PLANE_COLOR "#700000" 
-
-/// the plane edge width
-#define SKETCH_WIDTH        "4"
-
-/// face of the square-face displayed for selection of general plane
-#define PLANE_SIZE          "200"     
-
 /**\class SketchPlugin_Sketch
  * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.