From: vsv Date: Tue, 20 Dec 2016 15:41:11 +0000 (+0300) Subject: Porting of object highlighting X-Git-Tag: V_2.7.0~351^2~55^2~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=030890620a7b94b64de552d142ded65420ff7a66;p=modules%2Fshaper.git Porting of object highlighting --- diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 1dba0503d..d08ccb44d 100755 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -41,8 +41,6 @@ IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ResultPrs, ViewerData_AISShape); - - ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult) : ViewerData_AISShape(TopoDS_Shape()), myResult(theResult), myAdditionalSelectionPriority(0) { @@ -181,8 +179,7 @@ void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManag anOwner = theOwners.Value(i); aCompOwner = Handle(ModuleBase_BRepOwner)::DownCast(anOwner); if (aCompOwner.IsNull()) { - // PORTING_TO_SALOME_8 - //anOwner->Hilight(thePM); + thePM->Color(anOwner->Selectable(), GetContext()->SelectionStyle()); } else { TopoDS_Shape aShape = aCompOwner->Shape(); @@ -192,36 +189,32 @@ void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManag StdPrs_WFShape::Add(aSelectionPrs, aShape, myDrawer); aSelectionPrs->SetDisplayPriority(9); - // PORTING_TO_SALOME_8 - //aSelectionPrs->Highlight(Aspect_TOHM_COLOR, aSelectionPrs->HighlightColor()); + aSelectionPrs->Highlight(GetContext()->SelectionStyle()); aSelectionPrs->Display(); - // PORTING_TO_SALOME_8 - //thePM->Highlight(this); + thePM->Color(this, GetContext()->SelectionStyle()); } } } void ModuleBase_ResultPrs::HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM, - const Quantity_NameOfColor theColor, + const Handle(Graphic3d_HighlightStyle)& theStyle, const Handle(SelectMgr_EntityOwner)& theOwner) { - // PORTING_TO_SALOME_8 - /* Handle(StdSelect_BRepOwner) aOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner); if (aOwner.IsNull()) return; TopoDS_Shape aShape = aOwner->Shape(); if (!aShape.IsNull()) { - thePM->Color(this, theColor); + thePM->Color(this, theStyle); Handle( Prs3d_Presentation ) aHilightPrs = GetHilightPresentation( thePM ); aHilightPrs->Clear(); StdPrs_WFShape::Add(aHilightPrs, aShape, myDrawer); - aHilightPrs->Highlight(Aspect_TOHM_COLOR, theColor); + aHilightPrs->Highlight(theStyle); if (thePM->IsImmediateModeOn()) thePM->AddToImmediateList(aHilightPrs); - }*/ + } } diff --git a/src/ModuleBase/ModuleBase_ResultPrs.h b/src/ModuleBase/ModuleBase_ResultPrs.h index 040056639..fe988d3b6 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.h +++ b/src/ModuleBase/ModuleBase_ResultPrs.h @@ -80,8 +80,9 @@ public: //! Method which hilight an owner belonging to //! this selectable object ( for fast presentation draw ) Standard_EXPORT virtual void HilightOwnerWithColor( - const Handle(PrsMgr_PresentationManager3d)& thePM, - const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner); + const Handle(PrsMgr_PresentationManager3d)& thePM, + const Handle(Graphic3d_HighlightStyle)& theStyle, + const Handle(SelectMgr_EntityOwner)& theOwner); /// Returns result object Standard_EXPORT ResultPtr getResult() const { return myResult; }