From: vsv Date: Fri, 26 Jun 2015 08:07:07 +0000 (+0300) Subject: Issue #637: Create visualization properties at Workshop constructor X-Git-Tag: V_1.3.0~180 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=443d4d24432c8bb907c28b23bf8db67dad263886;p=modules%2Fshaper.git Issue #637: Create visualization properties at Workshop constructor --- diff --git a/src/Model/Model_ResultBody.h b/src/Model/Model_ResultBody.h index 75f9863f1..1bb3f6870 100644 --- a/src/Model/Model_ResultBody.h +++ b/src/Model/Model_ResultBody.h @@ -29,13 +29,6 @@ class Model_ResultBody : public ModelAPI_ResultBody /// label; index in vector corresponds to the label tag std::vector myBuilders; public: - /// default color for a result body - inline static const std::string& DEFAULT_COLOR() - { - static const std::string RESULT_BODY_COLOR("150,150,180"); - return RESULT_BODY_COLOR; - } - /// Request for initialization of data model of the result: adding all attributes virtual void initAttributes(); diff --git a/src/Model/Model_ResultConstruction.h b/src/Model/Model_ResultConstruction.h index ac07a4a62..42fff591b 100644 --- a/src/Model/Model_ResultConstruction.h +++ b/src/Model/Model_ResultConstruction.h @@ -27,13 +27,6 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction bool myIsInHistory; bool myIsInfinite; public: - /// default color for a result construction - inline static const std::string& DEFAULT_COLOR() - { - static const std::string RESULT_CONSTRUCTION_COLOR("120,120,120"); - return RESULT_CONSTRUCTION_COLOR; - } - /// Request for initialization of data model of the result: adding all attributes virtual void initAttributes(); diff --git a/src/Model/Model_ResultGroup.h b/src/Model/Model_ResultGroup.h index be220052f..3de093e74 100644 --- a/src/Model/Model_ResultGroup.h +++ b/src/Model/Model_ResultGroup.h @@ -20,12 +20,6 @@ class Model_ResultGroup : public ModelAPI_ResultGroup { std::shared_ptr myOwnerData; ///< data of owner of this result public: - /// default color for a result body - inline static const std::string& DEFAULT_COLOR() - { - static const std::string RESULT_GROUP_COLOR("150,150,180"); - return RESULT_GROUP_COLOR; - } /// Request for initialization of data model of the result: adding all attributes virtual void initAttributes(); diff --git a/src/ModelAPI/ModelAPI_ResultBody.h b/src/ModelAPI/ModelAPI_ResultBody.h index fb5751938..05aeab91c 100644 --- a/src/ModelAPI/ModelAPI_ResultBody.h +++ b/src/ModelAPI/ModelAPI_ResultBody.h @@ -36,6 +36,13 @@ public: return MY_GROUP; } + /// default color for a result body + inline static const std::string& DEFAULT_COLOR() + { + static const std::string RESULT_BODY_COLOR("150,150,180"); + return RESULT_BODY_COLOR; + } + /// Stores the shape (called by the execution method). virtual void store(const std::shared_ptr& theShape) = 0; diff --git a/src/ModelAPI/ModelAPI_ResultConstruction.h b/src/ModelAPI/ModelAPI_ResultConstruction.h index f24fb0d90..41d74975c 100644 --- a/src/ModelAPI/ModelAPI_ResultConstruction.h +++ b/src/ModelAPI/ModelAPI_ResultConstruction.h @@ -33,6 +33,13 @@ class ModelAPI_ResultConstruction : public ModelAPI_Result return MY_GROUP; } + /// default color for a result construction + inline static const std::string& DEFAULT_COLOR() + { + static const std::string RESULT_CONSTRUCTION_COLOR("120,120,120"); + return RESULT_CONSTRUCTION_COLOR; + } + /// Sets the result virtual void setShape(std::shared_ptr theShape) = 0; diff --git a/src/ModelAPI/ModelAPI_ResultGroup.h b/src/ModelAPI/ModelAPI_ResultGroup.h index 365445f4d..8e2ac8ada 100644 --- a/src/ModelAPI/ModelAPI_ResultGroup.h +++ b/src/ModelAPI/ModelAPI_ResultGroup.h @@ -32,6 +32,13 @@ public: return MY_GROUP; } + /// default color for a result body + inline static const std::string& DEFAULT_COLOR() + { + static const std::string RESULT_GROUP_COLOR("150,150,180"); + return RESULT_GROUP_COLOR; + } + }; //! Pointer on feature object diff --git a/src/ModuleBase/CMakeLists.txt b/src/ModuleBase/CMakeLists.txt index bab934f79..8e0f82a4a 100644 --- a/src/ModuleBase/CMakeLists.txt +++ b/src/ModuleBase/CMakeLists.txt @@ -121,7 +121,6 @@ INCLUDE_DIRECTORIES( ${CAS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/src/Config ${CMAKE_SOURCE_DIR}/src/Events - ${CMAKE_SOURCE_DIR}/src/Model ${CMAKE_SOURCE_DIR}/src/ModelAPI ${CMAKE_SOURCE_DIR}/src/GeomDataAPI ${CMAKE_SOURCE_DIR}/src/GeomAPI diff --git a/src/ModuleBase/ModuleBase_Preferences.cpp b/src/ModuleBase/ModuleBase_Preferences.cpp index c4a8fa2ef..616e659e0 100644 --- a/src/ModuleBase/ModuleBase_Preferences.cpp +++ b/src/ModuleBase/ModuleBase_Preferences.cpp @@ -7,10 +7,6 @@ #include "ModuleBase_Preferences.h" //#include "ModuleBase_Constants.h" -#include -#include -#include - #include #include @@ -260,16 +256,6 @@ void ModuleBase_PreferencesDlg::createViewerPage(int thePageId) myPreferences->setItemProperty("texture_stretch_enabled", true, bgId); myPreferences->setItemProperty("custom_enabled", false, bgId); myPreferences->setItemProperty("image_formats", aImgFiles, bgId); - - //Config_PropManager::registerProp("Visualization", "object_default_color", "Object color", - // Config_Prop::Color, "225,225,225"); - - Config_PropManager::registerProp("Visualization", "result_body_color", "Body color", - Config_Prop::Color, Model_ResultBody::DEFAULT_COLOR()); - Config_PropManager::registerProp("Visualization", "result_group_color", "Group color", - Config_Prop::Color, Model_ResultGroup::DEFAULT_COLOR()); - Config_PropManager::registerProp("Visualization", "result_construction_color", "Construction color", - Config_Prop::Color, Model_ResultConstruction::DEFAULT_COLOR()); } void ModuleBase_PreferencesDlg::createMenuPage(int thePageId) diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index bbcef0e89..49abca202 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -153,6 +153,16 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) if (myMainWindow) connect(myMainWindow, SIGNAL(exitKeySequence()), SLOT(onExit())); connect(this, SIGNAL(errorOccurred(const QString&)), myErrorDlg, SLOT(addError(const QString&))); + + //Config_PropManager::registerProp("Visualization", "object_default_color", "Object color", + // Config_Prop::Color, "225,225,225"); + + Config_PropManager::registerProp("Visualization", "result_body_color", "Body color", + Config_Prop::Color, ModelAPI_ResultBody::DEFAULT_COLOR()); + Config_PropManager::registerProp("Visualization", "result_group_color", "Group color", + Config_Prop::Color, ModelAPI_ResultGroup::DEFAULT_COLOR()); + Config_PropManager::registerProp("Visualization", "result_construction_color", "Construction color", + Config_Prop::Color, ModelAPI_ResultConstruction::DEFAULT_COLOR()); } //******************************************************