]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Display point object as '+' symbol
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 5 Jun 2015 13:45:51 +0000 (16:45 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 5 Jun 2015 13:45:51 +0000 (16:45 +0300)
src/ConstructionPlugin/ConstructionPlugin_Point.cpp
src/ConstructionPlugin/ConstructionPlugin_Point.h
src/SketchPlugin/SketchPlugin_SketchEntity.h

index b31b3b55217d0b0bd94b538207392dc58d90ba14..9bca1063cb4d08a760949383d07fc890bba34749 100644 (file)
@@ -45,3 +45,13 @@ void ConstructionPlugin_Point::execute()
   aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt));
   setResult(aConstr);
 }
+
+bool ConstructionPlugin_Point::customisePresentation(ResultPtr theResult, 
+                                                     AISObjectPtr thePrs,
+                               std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
+{
+  bool isCustomized = theDefaultPrs.get() != NULL &&
+                      theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs);
+  thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol
+  return true;
+}
index 84cb35cb35085d1b7461b84cf3da54ca5ea7f07f..8e0f0fcda6f74a4b959fdbbe664db39ab332ed0a 100644 (file)
 #include "ConstructionPlugin.h"
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Result.h>
+#include <GeomAPI_ICustomPrs.h>
 
 /**\class ConstructionPlugin_Point
  * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
  */
-class ConstructionPlugin_Point : public ModelAPI_Feature
+class ConstructionPlugin_Point : public ModelAPI_Feature, public GeomAPI_ICustomPrs
 {
  public:
   /// Returns the kind of a feature
@@ -57,6 +58,10 @@ class ConstructionPlugin_Point : public ModelAPI_Feature
 
   /// Use plugin manager for features creation
   ConstructionPlugin_Point();
+
+  /// Customize presentation of the feature
+  virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
+                                     std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
 };
 
 #endif
index 95c4505b6a8034a1489dba34014ba2186e5aa19f..19bc0428cf82f6dfd2284bb1f6b2ee996786e2e9 100644 (file)
@@ -99,7 +99,7 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
       }
     }
     else if (aShapeType == 7) { // otherwise this is a vertex
-      //  thePrs->setPointMarker(6, 2.);
+      thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol
     }
     return isCustomized;
   }