From: vsv Date: Thu, 16 Jun 2016 15:54:55 +0000 (+0300) Subject: Make highlight of points as a circle instead of + X-Git-Tag: V_2.4.0~95 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=72829498140a21dbf2f5634f300afc75a2ab4b00;p=modules%2Fshaper.git Make highlight of points as a circle instead of + --- diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 75c326a27..128770c2f 100755 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -29,6 +30,7 @@ #include #include #include +#include IMPLEMENT_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner); IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_BRepOwner, StdSelect_BRepOwner); @@ -57,6 +59,8 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult) // Activate individual repaintng if this is a part of compsolid ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(myResult); SetAutoHilight(aCompSolid.get() == NULL); + + ModuleBase_Tools::setPointBallHighlighting(this); } void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 169f911d3..986d22d18 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -41,6 +41,9 @@ #include #include +#include +#include + #include #include #include @@ -1150,6 +1153,17 @@ void translate(const std::string& theContext, std::string& theMessage) } } +void setPointBallHighlighting(AIS_Shape* theAIS) +{ + Handle(Prs3d_Drawer) aDrawer = theAIS->HilightAttributes(); + if (aDrawer->HasOwnPointAspect()) { + Handle(Prs3d_PointAspect) aPntAspect = aDrawer->PointAspect(); + aPntAspect->Aspect()->SetType(Aspect_TOM_BALL); + aDrawer->SetPointAspect(aPntAspect); + theAIS->SetHilightAttributes(aDrawer); + } +} + } // namespace ModuleBase_Tools diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index ad735c09b..376337dc4 100755 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -311,6 +312,10 @@ void MODULEBASE_EXPORT convertToFeatures(const QObjectPtrList& theObjects, std:: /// \param theParams a list of parameters (can be empty) void MODULEBASE_EXPORT translate(const std::string& theContext, std::string& theMessage); +/// Set Highlighting of points as a Ball shape +/// \param theAIS - the presentation +void MODULEBASE_EXPORT setPointBallHighlighting(AIS_Shape* theAIS); + } #endif diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index d23125683..ccf60f8ae 100755 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #define DEBUG_WIRE @@ -61,6 +62,8 @@ PartSet_ResultSketchPrs::PartSet_ResultSketchPrs(ResultPtr theResult) // Activate individual repaintng if this is a part of compsolid ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(myResult); SetAutoHilight(aCompSolid.get() == NULL); + + ModuleBase_Tools::setPointBallHighlighting(this); } void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 48559568c..091cd446c 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -186,6 +186,11 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) Handle(AIS_InteractiveObject) anAISPrs = myWorkshop->module()->createPresentation(aResult); if (anAISPrs.IsNull()) anAISPrs = new ModuleBase_ResultPrs(aResult); + else { + Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(anAISPrs); + if (!aShapePrs.IsNull()) + ModuleBase_Tools::setPointBallHighlighting((AIS_Shape*) aShapePrs.Access()); + } anAIS->setImpl(new Handle(AIS_InteractiveObject)(anAISPrs)); //anAIS->createShape(aShapePtr); isShading = true;