]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Porting of object highlighting
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 20 Dec 2016 15:41:11 +0000 (18:41 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 20 Dec 2016 15:41:11 +0000 (18:41 +0300)
src/ModuleBase/ModuleBase_ResultPrs.cpp
src/ModuleBase/ModuleBase_ResultPrs.h

index 1dba0503d3c7793ef6fb85e37ccc3faf60727db1..d08ccb44dfa7f6d09443c529ce2bb28014ef1569 100755 (executable)
@@ -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);
-  }*/
+  }
 }
index 040056639fc26df6eab0ae4f5bd5b67c25f81e7a..fe988d3b69573572667707310b9033cf66c5ff5b 100644 (file)
@@ -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; }