From: vsv Date: Thu, 5 Feb 2015 16:03:09 +0000 (+0300) Subject: Debug preferences of sketch planes X-Git-Tag: V_1.0.0~1^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4a70c52812757d45d045af9f0e5a5915d1b0f9a4;p=modules%2Fshaper.git Debug preferences of sketch planes --- diff --git a/src/ModuleBase/ModuleBase_IModule.cpp b/src/ModuleBase/ModuleBase_IModule.cpp index fd2686df3..f7637f9d7 100644 --- a/src/ModuleBase/ModuleBase_IModule.cpp +++ b/src/ModuleBase/ModuleBase_IModule.cpp @@ -97,6 +97,7 @@ void ModuleBase_IModule::createFeatures() { registerValidators(); registerFilters(); + registerProperties(); Config_ModuleReader aXMLReader = Config_ModuleReader(); aXMLReader.readAll(); diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index 9420d1e74..e576cabac 100644 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -115,6 +115,9 @@ protected slots: /// Register selection filters for this module virtual void registerFilters() {} + + /// Register properties of this module + virtual void registerProperties() {} /// Returns new instance of operation object (used in createOperation for customization) virtual ModuleBase_Operation* getNewOperation(const std::string& theFeatureId); diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index a7c92844e..2b92c351a 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -52,6 +52,7 @@ //#include #include +#include #include #include @@ -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()) diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index 326866c9f..793f0a5da 100644 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -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(); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index afe12cd2d..1e9d79070 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -38,9 +38,6 @@ #include #include -#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 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 aFace = GeomAlgoAPI_FaceBuilder::square(theOrigin, theNorm, aSize); AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject()); aAIS->createShape(aFace); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index 9c9ffad2c..d7b412f16 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -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 diff --git a/src/SketchPlugin/SketchPlugin_Plugin.cpp b/src/SketchPlugin/SketchPlugin_Plugin.cpp index 452e07401..030f786f1 100644 --- a/src/SketchPlugin/SketchPlugin_Plugin.cpp +++ b/src/SketchPlugin/SketchPlugin_Plugin.cpp @@ -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); diff --git a/src/SketchPlugin/SketchPlugin_Sketch.h b/src/SketchPlugin/SketchPlugin_Sketch.h index 51ac70496..83d729144 100644 --- a/src/SketchPlugin/SketchPlugin_Sketch.h +++ b/src/SketchPlugin/SketchPlugin_Sketch.h @@ -14,15 +14,6 @@ #include #include -/// 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.