Salome HOME
Avoid extra methods.
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 24 Aug 2015 09:17:45 +0000 (12:17 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 24 Aug 2015 09:17:45 +0000 (12:17 +0300)
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistance.h
src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
src/SketchPlugin/SketchPlugin_ConstraintLength.h

index a119433d36f7f09a5b0cd801cd8811ce1f56505b..6b1dd6bece6a3310ce855309214503d4fb86bdb9 100644 (file)
@@ -134,6 +134,9 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi
   if (!anAIS) {
     anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane());
   }
+  std::vector<int> aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color",
+                                                    SKETCH_DIMENSION_COLOR);
+  anAIS->setColor(aRGB[0], aRGB[1], aRGB[2]);
   return anAIS;
 }
 
@@ -284,15 +287,3 @@ void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID)
   }
 }
 
-bool SketchPlugin_ConstraintDistance::customisePresentation(ResultPtr theResult,
-                                    AISObjectPtr thePrs,
-                                    std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
-{
-  bool isCustomized = false;
-  std::vector<int> aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color",
-                                                    SKETCH_DIMENSION_COLOR);
-  isCustomized = thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]);
-
-  return isCustomized;
-}
-
index a1e315d2bc0246a0a75b8b7fec4d8aff02847b8f..e1d8a71abfe99f5c283bdce2939a64fa05a30e1c 100644 (file)
@@ -27,7 +27,7 @@ class GeomDataAPI_Point2D;
  *  This constraint has three attributes:
  *  SketchPlugin_Constraint::VALUE(), SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
  */
-class SketchPlugin_ConstraintDistance : public SketchPlugin_ConstraintBase, public GeomAPI_ICustomPrs
+class SketchPlugin_ConstraintDistance : public SketchPlugin_ConstraintBase
 {
  public:
   /// Distance constraint kind
@@ -70,10 +70,6 @@ class SketchPlugin_ConstraintDistance : public SketchPlugin_ConstraintBase, publ
   /// Returns the current distance between the feature attributes
   double calculateCurrentDistance();
 
-    /// Customize presentation of the feature
-  virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
-                                     std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
-
   /// \brief Use plugin manager for features creation
   SketchPlugin_ConstraintDistance();
 
index dfdca6488f6131804db15880136a774af34cc3e8..575c0f10a9f9a620ee01a97802eea42e44dcccff 100644 (file)
@@ -128,6 +128,9 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou
   if (!anAIS) {
     anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane());
   }
+  std::vector<int> aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color",
+                                                    SKETCH_DIMENSION_COLOR);
+  anAIS->setColor(aRGB[0], aRGB[1], aRGB[2]);
   return anAIS;
 }
 
@@ -205,15 +208,3 @@ void SketchPlugin_ConstraintLength::attributeChanged(const std::string& theID) {
     myFlyoutUpdate = false;
   }
 }
-
-bool SketchPlugin_ConstraintLength::customisePresentation(ResultPtr theResult,
-                                    AISObjectPtr thePrs,
-                                    std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
-{
-  bool isCustomized = false;
-  std::vector<int> aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color",
-                                                    SKETCH_DIMENSION_COLOR);
-  isCustomized = thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]);
-
-  return isCustomized;
-}
index d6098af221cf8c12e60b629ff246c56b80c63a45..dd16d1a3a781478c97287e320beab29a37b2a88a 100644 (file)
@@ -25,7 +25,7 @@ class GeomDataAPI_Point2D;
  *  SketchPlugin_Constraint::VALUE() (length) and SketchPlugin_Constraint::ENTITY_A() (segment),
  *  SketchPlugin_Constraint::FLYOUT_VALUE_PNT() (distance of a constraints handle)
  */
-class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase, public GeomAPI_ICustomPrs
+class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase
 {
  public:
   /// Length constraint kind
@@ -64,10 +64,6 @@ class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase, public
   /// \param theID identifier of changed attribute
   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
 
-  /// Customize presentation of the feature
-  virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
-                                     std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
-
   /// \brief Use plugin manager for features creation
   SketchPlugin_ConstraintLength();