From: vsv Date: Fri, 26 Jun 2015 09:25:24 +0000 (+0300) Subject: Define color for part result X-Git-Tag: V_1.3.0~178 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2e4a932b26ac2a7539c1b787d77956828ffd8f82;p=modules%2Fshaper.git Define color for part result --- diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index bdae260d6..10e884ff3 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -114,3 +114,12 @@ std::shared_ptr Model_ResultPart::shape() } return std::shared_ptr(); } + + +void Model_ResultPart::colorConfigInfo(std::string& theSection, std::string& theName, + std::string& theDefault) +{ + theSection = "Visualization"; + theName = "result_part_color"; + theDefault = DEFAULT_COLOR(); +} diff --git a/src/Model/Model_ResultPart.h b/src/Model/Model_ResultPart.h index 2afb017ee..57e130239 100644 --- a/src/Model/Model_ResultPart.h +++ b/src/Model/Model_ResultPart.h @@ -35,6 +35,10 @@ class Model_ResultPart : public ModelAPI_ResultPart /// Result shape of part document is compound of bodies inside of this part MODEL_EXPORT virtual std::shared_ptr shape(); + /// Returns the parameters of color definition in the resources config manager + MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName, + std::string& theDefault); + protected: /// makes a result on a temporary feature (an action) Model_ResultPart(); diff --git a/src/ModelAPI/ModelAPI_ResultPart.h b/src/ModelAPI/ModelAPI_ResultPart.h index 11cae2bae..131af613f 100644 --- a/src/ModelAPI/ModelAPI_ResultPart.h +++ b/src/ModelAPI/ModelAPI_ResultPart.h @@ -38,6 +38,13 @@ class ModelAPI_ResultPart : public ModelAPI_Result return MY_DOC_REF; } + /// default color for a result body + inline static const std::string& DEFAULT_COLOR() + { + static const std::string RESULT_BODY_COLOR("96,157,255"); + return RESULT_BODY_COLOR; + } + /// Returns the part-document of this result virtual std::shared_ptr partDoc() = 0; diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index cfc79f6b7..0f6cd8c77 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -164,6 +164,8 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) Config_Prop::Color, ModelAPI_ResultGroup::DEFAULT_COLOR()); Config_PropManager::registerProp("Visualization", "result_construction_color", "Construction color", Config_Prop::Color, ModelAPI_ResultConstruction::DEFAULT_COLOR()); + Config_PropManager::registerProp("Visualization", "result_part_color", "Part color", + Config_Prop::Color, ModelAPI_ResultPart::DEFAULT_COLOR()); } //******************************************************