Salome HOME
17.12.2013. Added Partition algorithm (draft version).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.cxx
index 3e73e5757ce3b0ee04bd90ad6a7273818327a4d6..597c9db775e82e70464816dee99f4e502f7c7f1c 100644 (file)
@@ -116,6 +116,7 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
   if ( myContext.IsNull() )
     return;
 
+  bool isDeactivateSelection = false;
   // Try to retrieve information from object
   if ( !myObject.IsNull() )
   {
@@ -295,6 +296,7 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
 
       setTextureFileName( aTextureFileName, false, false );
       setFace( aWire, false, false );
+      isDeactivateSelection = true;
     }
     else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_Profile) ) )
     {
@@ -354,6 +356,8 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
     return;
 
   myContext->Display( myShape, theIsUpdateViewer );
+  if (isDeactivateSelection)
+    myContext->Deactivate(myShape);
 }
 
 void HYDROGUI_Shape::setVisible( const bool theState,
@@ -373,7 +377,7 @@ void HYDROGUI_Shape::setVisible( const bool theState,
     myContext->Erase( myShape, theIsUpdateViewer );
 }
 
-void HYDROGUI_Shape::highlight( bool theIsHighlight )
+void HYDROGUI_Shape::highlight( bool theIsHighlight, bool isUpdateViewer )
 {
   if ( myIsHighlight == theIsHighlight )
     return;
@@ -384,7 +388,7 @@ void HYDROGUI_Shape::highlight( bool theIsHighlight )
     return;
 
   colorShapeBorder( getActiveColor() );
-  myContext->Display( myShape );
+  myContext->Display( myShape, isUpdateViewer );
 }
 
 bool HYDROGUI_Shape::isHighlighted() const
@@ -667,7 +671,10 @@ void HYDROGUI_Shape::colorShapeBorder( const QColor& theColor )
 
       Handle(Prs3d_LineAspect) aBoundaryAspect = anAttributes->FaceBoundaryAspect();
       if ( !aBoundaryAspect.IsNull() )
+      {
         aBoundaryAspect->SetColor( aBorderColor );
+        anAttributes->SetFaceBoundaryAspect( aBoundaryAspect );
+      }
     }
   }
   else if ( myDisplayMode == AIS_WireFrame )