From b4f302de769c38be478c58e549d55e81bf622b70 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 5 Jun 2015 16:45:51 +0300 Subject: [PATCH] Display point object as '+' symbol --- src/ConstructionPlugin/ConstructionPlugin_Point.cpp | 10 ++++++++++ src/ConstructionPlugin/ConstructionPlugin_Point.h | 7 ++++++- src/SketchPlugin/SketchPlugin_SketchEntity.h | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index b31b3b552..9bca1063c 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -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 theDefaultPrs) +{ + bool isCustomized = theDefaultPrs.get() != NULL && + theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs); + thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol + return true; +} diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.h b/src/ConstructionPlugin/ConstructionPlugin_Point.h index 84cb35cb3..8e0f0fcda 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.h +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.h @@ -10,12 +10,13 @@ #include "ConstructionPlugin.h" #include #include +#include /**\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 theDefaultPrs); }; #endif diff --git a/src/SketchPlugin/SketchPlugin_SketchEntity.h b/src/SketchPlugin/SketchPlugin_SketchEntity.h index 95c4505b6..19bc0428c 100644 --- a/src/SketchPlugin/SketchPlugin_SketchEntity.h +++ b/src/SketchPlugin/SketchPlugin_SketchEntity.h @@ -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; } -- 2.39.2