]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
The default colors in preferences for sketch elements and features.
authornds <natalia.donis@opencascade.com>
Fri, 22 May 2015 04:53:11 +0000 (07:53 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 22 May 2015 04:53:44 +0000 (07:53 +0300)
src/ConstructionPlugin/ConstructionPlugin_Plane.h
src/ExchangePlugin/ExchangePlugin_Plugin.cpp
src/Model/Model_ResultBody.h
src/Model/Model_ResultConstruction.h
src/Model/Model_ResultGroup.h
src/ModuleBase/ModuleBase_Preferences.cpp
src/SketchPlugin/SketchPlugin_ConstraintBase.h
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchPlugin/SketchPlugin_SketchEntity.h

index 317d6f348232239c1b4c3c5037c5f3085d23d183..546577b44ea5d35a31fe8df7881b2ab083b5ea47 100644 (file)
@@ -31,7 +31,7 @@ class ConstructionPlugin_Plane : public ModelAPI_Feature, public GeomAPI_ICustom
   /// default color for a plane
   inline static const std::string& DEFAULT_COLOR()
   {
-    static const std::string CONSTRUCTION_PLANE_COLOR("#32FF32");
+    static const std::string CONSTRUCTION_PLANE_COLOR("150,150,180");
     return CONSTRUCTION_PLANE_COLOR;
   }
 
index c843f6cc15cc133ff0b811851c816cf8029cedd0..2b8cb8b484f3e46221f6f6588f602d6b3d0e1b31 100644 (file)
@@ -31,10 +31,6 @@ ExchangePlugin_Plugin::ExchangePlugin_Plugin()
                               new ExchangePlugin_ImportFormatValidator);
   aFactory->registerValidator("ExchangePlugin_ExportFormat",
                               new ExchangePlugin_ExportFormatValidator);
-
-  // register construction properties
-  //Config_PropManager::registerProp("Visualization", "import_feature_color", "Imported feature color",
-  //                                 Config_Prop::Color, ExchangePlugin_ImportFeature::DEFAULT_COLOR());
 }
 
 FeaturePtr ExchangePlugin_Plugin::createFeature(string theFeatureID)
index befed5622160d40ce29394c6344afd43c4f0fdd5..cafa565177122830702734ba0065bc4ec5d9a87f 100644 (file)
@@ -32,7 +32,7 @@ public:
   /// default color for a result body
   inline static const std::string& DEFAULT_COLOR()
   {
-    static const std::string RESULT_BODY_COLOR("#E0A01B");
+    static const std::string RESULT_BODY_COLOR("150,150,180");
     return RESULT_BODY_COLOR;
   }
 
index 9c7ccd57d557dd565f3feb89d5aceee0c3822f65..e5081240976388fbd85640eaff8013c29f05530a 100644 (file)
@@ -29,7 +29,7 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction
   /// default color for a result construction
   inline static const std::string& DEFAULT_COLOR()
   {
-    static const std::string RESULT_CONSTRUCTION_COLOR("#000000");
+    static const std::string RESULT_CONSTRUCTION_COLOR("120,120,120");
     return RESULT_CONSTRUCTION_COLOR;
   }
 
index 63e8368f4334e0a29b2a2a62e7297c45f45a3c21..be220052fb987e89b2da637c0ed06c1289a91417 100644 (file)
@@ -23,7 +23,7 @@ public:
   /// default color for a result body
   inline static const std::string& DEFAULT_COLOR()
   {
-    static const std::string RESULT_GROUP_COLOR("#E0A01B");
+    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
index f97a9ed7f4cbabe15350fc9165530511dd40a6f8..c4a8fa2ef6367f87c75f330e2c9710d67dd52fdd 100644 (file)
@@ -262,7 +262,7 @@ void ModuleBase_PreferencesDlg::createViewerPage(int thePageId)
   myPreferences->setItemProperty("image_formats", aImgFiles, bgId);
 
   //Config_PropManager::registerProp("Visualization", "object_default_color", "Object color",
-  //                                 Config_Prop::Color, "#ffffff");
+  //                                 Config_Prop::Color, "225,225,225");
 
   Config_PropManager::registerProp("Visualization", "result_body_color", "Body color",
                                    Config_Prop::Color, Model_ResultBody::DEFAULT_COLOR());
index ddf0cbf7fff2f6a9dff2f5a0f5e32da590c82c6a..cd7155409b14f2de533dcbefd9c2549878287858 100644 (file)
@@ -30,8 +30,8 @@
  *    Also the list of possible attributes is provided to simplify assignment.
  */
 
-#define SKETCH_CONSTRAINT_COLOR "#ffff00"
-#define SKETCH_DIMENSION_COLOR "#ff00ff"
+#define SKETCH_CONSTRAINT_COLOR "225,225,0"
+#define SKETCH_DIMENSION_COLOR "64,128,225"
 
 /** \class SketchPlugin_ConstraintBase
  *  \ingroup Plugins
index 920ec399bb4e5a961c481511ef34fa540adafc07..9f5f4a4580113b7c147890da43f3499099f075c2 100644 (file)
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_Pln.h>
 #include <GeomAPI_IPresentable.h>
+#include <GeomAPI_ICustomPrs.h>
+
 #include <GeomAPI_Ax3.h>
 #include <GeomAPI_XYZ.h>
 #include <GeomDataAPI_Point.h>
 #include <GeomDataAPI_Dir.h>
 #include <list>
 
-#define YZ_PLANE_COLOR "#ff0000"
-#define XZ_PLANE_COLOR "#00ff00"
-#define XY_PLANE_COLOR "#0000ff"
+#define YZ_PLANE_COLOR "225,0,0"
+#define XZ_PLANE_COLOR "0,225,0"
+#define XY_PLANE_COLOR "0,0,225"
 
 /**\class SketchPlugin_Sketch
  * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
  */
-class SketchPlugin_Sketch : public ModelAPI_CompositeFeature//, public GeomAPI_IPresentable
+class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_ICustomPrs//, public GeomAPI_IPresentable
 {
  public:
   /// Sketch feature kind
@@ -201,6 +203,20 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature//, public GeomAPI_I
   static void createPoint2DResult(ModelAPI_Feature* theFeature,
                                   SketchPlugin_Sketch* theSketch,
                                   const std::string& theAttributeID, const int theIndex);
+  /// Customize presentation of the feature
+  virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
+                                     std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
+  {
+    bool isCustomized = false;
+    // apply the color of the result to the presentation
+    if (theDefaultPrs.get())
+      isCustomized = theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs);
+    // set the sketch presentation bold    
+    isCustomized = thePrs->setWidth(2) || isCustomized;
+  
+    return isCustomized;
+  }
+
 };
 
 #endif
index 8f716c79f1de1427c742db9c61afbc18f7b67255..95c4505b6a8034a1489dba34014ba2186e5aa19f 100644 (file)
@@ -20,9 +20,9 @@
 
 #include <Config_PropManager.h>
 
-#define SKETCH_ENTITY_COLOR "#ff0000"
-#define SKETCH_EXTERNAL_COLOR "#00ff00"
-#define SKETCH_AUXILIARY_COLOR "#000000"
+#define SKETCH_ENTITY_COLOR "225,0,0"
+#define SKETCH_EXTERNAL_COLOR "170,0,225"
+#define SKETCH_AUXILIARY_COLOR "0,85,0"
 
 /**\class SketchPlugin_SketchEntity
  * \ingroup Plugins