Salome HOME
Porting to DEV version of OpenCASCADE.
authorrnv <rnv@opencascade.com>
Fri, 10 Feb 2017 13:38:51 +0000 (16:38 +0300)
committerrnv <rnv@opencascade.com>
Fri, 10 Feb 2017 13:38:51 +0000 (16:38 +0300)
12 files changed:
src/BasicGUI/BasicGUI.cxx
src/CurveCreator/CurveCreator_Utils.cxx
src/CurveCreator/CurveCreator_Widget.cxx
src/EntityGUI/EntityGUI.cxx
src/EntityGUI/EntityGUI_PolylineDlg.cxx
src/GEOMGUI/GEOMGUI_AnnotationMgr.cxx
src/GEOMGUI/GEOM_Displayer.cxx
src/MeasureGUI/MeasureGUI_AnnotationInteractor.cxx
src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx
src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx
src/OBJECT/GEOM_Annotation.cxx
src/OBJECT/GEOM_Annotation.hxx

index d7686b070092df4e6a5af677fe67f8c2e7e60a69..816162deec4cf3711f21183d941e3599f9920edc 100644 (file)
@@ -144,9 +144,9 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
 
       ic->InitSelected();
       if ( pe->modifiers() == Qt::ShiftModifier )
-        ic->ShiftSelect();  // Append selection
+        ic->ShiftSelect( Standard_True );  // Append selection
       else
-        ic->Select();       // New selection
+        ic->Select( Standard_True );       // New selection
 
       ic->InitSelected();
       if ( ic->MoreSelected() ) {
index 0170fb5ffe5d186e212926248a0096346e9a82fb..5f53caea4b9b76b1c622ec05d4b18bc85669d24f 100644 (file)
@@ -687,7 +687,7 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur
   }
   else {
     if ( theContext->HasOpenedContext() )
-      theContext->CloseAllContexts();
+      theContext->CloseAllContexts( Standard_True );
   }
 }
 
index b34b1f2da40f40ecd56a0d9fa47743700bd4cf76..1906c758dbd8b613e86daf80fbbb9446f51cb7f4 100644 (file)
@@ -1090,7 +1090,7 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
     {
       Handle(AIS_InteractiveContext) aCtx = getAISContext();
       if ( !aCtx.IsNull() )
-        aCtx->ClearSelected();
+        aCtx->ClearSelected( Standard_True );
     }
     return;
   } 
@@ -1121,11 +1121,11 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
       // otherwise a rectangular selection.
       if ( myStartPoint == myEndPoint )
       {
-        aCtx->MoveTo( myEndPoint.x(), myEndPoint.y(), aView3d );
+        aCtx->MoveTo( myEndPoint.x(), myEndPoint.y(), aView3d, Standard_True );
         if ( aHasShift )
-          aCtx->ShiftSelect();
+          aCtx->ShiftSelect( Standard_True );
         else
-          aCtx->Select();
+          aCtx->Select( Standard_True );
       }
       else
       {
index d35d6b218cbf2d6d1af24f609e4670622972bdf0..019e0ad47ecfc812bffe84535a695a4a7ae17b2f 100644 (file)
@@ -234,9 +234,9 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
     
         ic->InitSelected();
         if ( pe->modifiers() == Qt::ShiftModifier )
-          ic->ShiftSelect();  // Append selection
+          ic->ShiftSelect( Standard_True );  // Append selection
         else
-          ic->Select();       // New selection
+          ic->Select( Standard_True );       // New selection
 
         ic->InitSelected();
         if ( ic->MoreSelected() ) {
@@ -263,7 +263,7 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
         Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();   
 
         ic->InitSelected();
-        ic->Select();       // New selection
+        ic->Select( Standard_True );       // New selection
 
         ic->InitSelected();
         TopoDS_Shape aShape;
@@ -365,7 +365,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha
     if ( !S1.IsNull() ) {
       /* erase any previous */
       ic->Erase( mySimulationShape1, Standard_True );
-      ic->ClearPrs( mySimulationShape1 );
+      ic->ClearPrs( mySimulationShape1, 0, Standard_True );
 
       mySimulationShape1 = new AIS_Shape( TopoDS_Shape() );
       mySimulationShape1->Set( S1 );
@@ -377,7 +377,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha
     }
     if ( !S2.IsNull() ) {
       ic->Erase( mySimulationShape2, Standard_True );
-      ic->ClearPrs( mySimulationShape2 );
+      ic->ClearPrs( mySimulationShape2, 0, Standard_True );
 
       mySimulationShape2 = new AIS_Shape( TopoDS_Shape() );
       mySimulationShape2->Set( S2 );
@@ -422,8 +422,8 @@ void EntityGUI::EraseSimulationShape()
       Handle(AIS_InteractiveContext) ic = v3d->getAISContext();
       ic->Erase( mySimulationShape1, Standard_True );
       ic->Erase( mySimulationShape2, Standard_True );
-      ic->ClearPrs( mySimulationShape1 );
-      ic->ClearPrs( mySimulationShape2 );
+      ic->ClearPrs( mySimulationShape1, 0, Standard_True );
+      ic->ClearPrs( mySimulationShape2, 0, Standard_True );
       ic->UpdateCurrentViewer();
     } 
   }
index a2c4be2c603a983292125f83824e00446deb1791..1c6c9bda5cb44a81ab9bd11563f308cc9e361f26 100644 (file)
@@ -780,7 +780,7 @@ void EntityGUI_PolylineDlg::displayPreview()
 
         // Set color for temporary AIS_InteractiveObject
         anAISObj->Attributes()->WireAspect()->SetColor( Quantity_NOC_VIOLET );
-        aCtx->Redisplay( anAISObj );
+        aCtx->Redisplay( anAISObj, Standard_True );
       }
     }
   }
index f46d527d3234957b78df5834b6b0e662f926138f..14edb15098d5c42d9d00cbc39730aa1b1e19f650 100755 (executable)
@@ -251,7 +251,7 @@ void GEOMGUI_AnnotationMgr::Redisplay( const QString& theEntry, const int theInd
       Handle(GEOM_Annotation) aPresentation = Handle(GEOM_Annotation)::DownCast( aPrs );
 
       GEOMGUI_AnnotationAttrs::SetupPresentation( aPresentation, theProperty, aShapeLCS );
-      aView->getAISContext()->Redisplay( aPresentation );
+      aView->getAISContext()->Redisplay( aPresentation, Standard_True );
     }
   }
 }
@@ -440,7 +440,7 @@ void GEOMGUI_AnnotationMgr::UpdateVisibleAnnotations( const QString& theEntry, S
 
       setDisplayProperties( aPresentation, aView, theEntry );
 
-      aView->getAISContext()->Redisplay( aPresentation );
+      aView->getAISContext()->Redisplay( aPresentation, Standard_True );
     }
   }
   getDisplayer()->UpdateViewer();
index c03b93777bb4763da0c4d2de6a0136a17b9baaab..43521f3f5b4f5c00aad1e10c5f167896260cc1c4 100755 (executable)
@@ -2068,7 +2068,7 @@ void GEOM_Displayer::BeforeDisplay( SALOME_View* v, const SALOME_OCCPrs* )
     if ( !ic.IsNull() )
     {
       if ( ic->HasOpenedContext() )
-      ic->CloseAllContexts();
+      ic->CloseAllContexts(Standard_True);
     }
   }
 }
@@ -3128,11 +3128,11 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons
       aView->ColorScaleErase();
 #else
     if( !aViewModel->getAISContext()->IsDisplayed( myColorScale ) )
-      aViewModel->getAISContext()->Display( myColorScale );
+      aViewModel->getAISContext()->Display( myColorScale, Standard_True);
   }
   else
     if( aViewModel->getAISContext()->IsDisplayed( myColorScale ) )
-      aViewModel->getAISContext()->Erase( myColorScale );
+      aViewModel->getAISContext()->Erase( myColorScale, Standard_True );
 #endif
 
   if( theIsRedisplayFieldSteps )
index 2d0cd204aa1f38a5abe8a42c2cc1fde1fa7c94be..952c54bd20af633fe45a73b30de67fcff80f3bcd 100755 (executable)
@@ -211,7 +211,7 @@ bool MeasureGUI_AnnotationInteractor::eventFilter( QObject* theObject, QEvent* t
 
       const Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
 
-      anAISContext->MoveTo( aMouseEv->x(), aMouseEv->y(), aView3d );
+      anAISContext->MoveTo( aMouseEv->x(), aMouseEv->y(), aView3d, Standard_True );
 
       if ( !anAISContext->HasDetected() )
       {
@@ -316,7 +316,7 @@ bool MeasureGUI_AnnotationInteractor::eventFilter( QObject* theObject, QEvent* t
 
         anAISContext->Update( myActiveIO, Standard_False );
         anAISContext->UpdateCurrentViewer();
-        anAISContext->MoveTo( aMouseEv->pos().x(), aMouseEv->pos().y(), aView3d );
+        anAISContext->MoveTo( aMouseEv->pos().x(), aMouseEv->pos().y(), aView3d, Standard_True );
 
         emit SignalInteractionFinished( myActiveIO );
 
index 6713729f7ebace8303419cf6e7ee419dac85364c..6032636e07803d00f22dac64b02f7d19ff4584c5 100644 (file)
@@ -440,7 +440,7 @@ void MeasureGUI_CreateDimensionDlg::StartLocalEditing()
   anAISContext->SetZLayer( myDimension, myEditingLayer );
   anAISContext->Activate( myDimension, AIS_DSM_Line );
   anAISContext->Activate( myDimension, AIS_DSM_Text );
-  anAISContext->Redisplay( myDimension );
+  anAISContext->Redisplay( myDimension , Standard_True );
 }
 
 //=================================================================================
@@ -460,7 +460,7 @@ void MeasureGUI_CreateDimensionDlg::StopLocalEditing()
   Handle(V3d_Viewer)             aViewer3d    = myEditingViewer->getViewer3d();
 
   aViewer3d->RemoveZLayer( myEditingLayer );
-  anAISContext->CloseLocalContext();
+  anAISContext->CloseLocalContext( Standard_True );
 
   myEditingViewer = NULL;
 }
index 4d738e0db71b1b7db714598b91ab70716c7b16d9..8a7eaf259a776122ffd3559d7240dc2ae3b6d863 100644 (file)
@@ -373,7 +373,7 @@ void MeasureGUI_DimensionInteractor::MoveFlyoutFree( const Handle(V3d_View)& the
   if ( aNewFlyout <= Precision::Confusion() )
   {
     myInteractedIO->SetFlyout( 0.0 );
-    myViewer->getAISContext()->Redisplay( myInteractedIO );
+    myViewer->getAISContext()->Redisplay( myInteractedIO, Standard_True );
     return;
   }
 
@@ -382,7 +382,7 @@ void MeasureGUI_DimensionInteractor::MoveFlyoutFree( const Handle(V3d_View)& the
   myInteractedIO->SetFlyout( aNewFlyout );
   myInteractedIO->SetCustomPlane( aNewPlane );
 
-  myViewer->getAISContext()->Redisplay( myInteractedIO );
+  myViewer->getAISContext()->Redisplay( myInteractedIO, Standard_True );
 }
 
 //=================================================================================
@@ -496,7 +496,7 @@ void MeasureGUI_DimensionInteractor::MoveFlyoutInPlane( const Handle(V3d_View)&
 
   myInteractedIO->SetFlyout( aFlyout );
 
-  myViewer->getAISContext()->Redisplay( myInteractedIO );
+  myViewer->getAISContext()->Redisplay( myInteractedIO, Standard_True );
 }
 
 //=================================================================================
@@ -668,7 +668,7 @@ void MeasureGUI_DimensionInteractor::MoveText( const Handle(V3d_View)& theView,
   myInteractedIO->DimensionAspect()->SetArrowOrientation( aArrPos );
   myInteractedIO->SetToUpdate();
 
-  myViewer->getAISContext()->Redisplay( myInteractedIO );
+  myViewer->getAISContext()->Redisplay( myInteractedIO, Standard_True );
 }
 
 //=================================================================================
@@ -691,7 +691,7 @@ bool MeasureGUI_DimensionInteractor::eventFilter( QObject* theObject, QEvent* th
       QMouseEvent* aMouseEv = dynamic_cast<QMouseEvent*>( theEvent );
 
       // init detection
-      anAISContext->MoveTo( aMouseEv->x(), aMouseEv->y(), aView3d );
+      anAISContext->MoveTo( aMouseEv->x(), aMouseEv->y(), aView3d, Standard_True );
       if ( !anAISContext->HasDetected() )
       {
         return false;
@@ -738,7 +738,7 @@ bool MeasureGUI_DimensionInteractor::eventFilter( QObject* theObject, QEvent* th
       }
 
       anAISContext->ClearSelected( Standard_False );
-      anAISContext->AddOrRemoveSelected( aDetectedOwner );
+      anAISContext->AddOrRemoveSelected( aDetectedOwner, Standard_True );
 
       emit InteractionStarted( myInteractedIO );
 
index 1d966bb3d695cfe2e6dc26c6a89b0af073143165..1c66c77c15e94d9b8d838c0a552c8b1c642f826c 100755 (executable)
@@ -66,7 +66,9 @@ GEOM_Annotation::GEOM_Annotation() : AIS_InteractiveObject()
   SetDisplayMode( 0 );
   SetZLayer( Graphic3d_ZLayerId_Default );
   SetAutoHide( Standard_True );
+#if OCC_VERSION_LARGE <= 0x07010000
   SetHilightMode( HighlightAll );
+#endif
   SetMutable( Standard_True );
   SetDepthCulling( Standard_True );
 
@@ -616,9 +618,9 @@ GEOM_Annotation::OpenGl_Annotation::OpenGl_Annotation( GEOM_Annotation* theAnnot
                                                        const Standard_Integer theTextHeight,
                                                        const OpenGl_GraphicDriver* theDriver )
 : OpenGl_Element(),
-  myDepthMode( 0 ),
   myAISObject( theAnnotation ),
   myText( theAnnotation->myText.ToExtString() ),
+  myDepthMode( 0 ),
   myTextLineY( 0.f ),
   myTextDPI( 0 )
 {
@@ -747,7 +749,15 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
       return;
     }
   }
-
+#if OCC_VERSION_LARGE > 0x07010000
+  const Handle(Graphic3d_PresentationAttributes) aHighlightStyle = theWorkspace->HighlightStyle();
+  if (!aHighlightStyle.IsNull() && myAISObject->myHilightMode == HighlightLabel)
+  {
+    Handle(Graphic3d_PresentationAttributes) empty;
+    theWorkspace->SetHighlightStyle(empty);
+    theWorkspace->ApplyAspectLine();
+  }
+#else    
   const bool toHighlight = theWorkspace->ToHighlight();
 
   if (toHighlight && myAISObject->myHilightMode == HighlightLabel)
@@ -755,7 +765,8 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
     theWorkspace->SetHighlight( false );
     theWorkspace->ApplyAspectLine();
   }
-
+#endif
+  
   GLint myOldDepthMode = 0;
 
   if ( myDepthMode )
@@ -867,11 +878,15 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
   }
 
   aContext->ApplyModelViewMatrix();
-
+  
+#if OCC_VERSION_LARGE > 0x07010000
+  theWorkspace->SetHighlightStyle(aHighlightStyle);
+#else
   if ( toHighlight != theWorkspace->ToHighlight() )
   {
     theWorkspace->SetHighlight( toHighlight );
   }
+#endif
 }
 
 // =======================================================================
@@ -880,14 +895,21 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
 // purpose  : Perform highlighting of the presentation.
 // =======================================================================
 void GEOM_Annotation::GEOM_AnnotationOwner::HilightWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
-                                                              const Handle(Graphic3d_HighlightStyle)& theStyle,
+#if OCC_VERSION_LARGE > 0x07010000                     
+                                                             const Handle(Prs3d_Drawer)& theStyle,
+#else                  
+                                                             const Handle(Graphic3d_HighlightStyle)& theStyle,
+#endif                 
                                                               const Standard_Integer theMode )
 {
   if ( myPrsSh.IsNull() )
   {
     Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer;
+#if OCC_VERSION_LARGE > 0x07010000
+    aDrawer->Link( theStyle );
+#else
     aDrawer->Link( Selectable()->HilightAttributes() );
-
+#endif
     Handle(Prs3d_IsoAspect) aUIsoAspect = new Prs3d_IsoAspect(
       aDrawer->UIsoAspect()->Aspect()->Color(),
       aDrawer->UIsoAspect()->Aspect()->Type(),
@@ -905,7 +927,7 @@ void GEOM_Annotation::GEOM_AnnotationOwner::HilightWithColor( const Handle(PrsMg
   }
 
   myPrsSh->SetZLayer ( Selectable()->ZLayer() );
-
+  
   thePM->Color( Selectable(), theStyle, theMode, NULL, Graphic3d_ZLayerId_Topmost );
 
   thePM->Color( myPrsSh, theStyle, theMode, Selectable(), Graphic3d_ZLayerId_Topmost );
@@ -920,8 +942,12 @@ void GEOM_Annotation::GEOM_AnnotationOwner::Unhilight ( const Handle(PrsMgr_Pres
                                                         const Standard_Integer theMode )
 {
   SelectMgr_EntityOwner::Unhilight( thePM, theMode );
-
+  
+#if OCC_VERSION_LARGE > 0x07010000
+  thePM->Unhighlight( myPrsSh );
+#else
   thePM->Unhighlight( myPrsSh, theMode );
+#endif
 }
 
 // =======================================================================
index ac8bf3a2fd727a4a10b80b2faa65c77113f45dee..e672dd446eedabf147d776b2743aeb0f8c3f6d3f 100755 (executable)
@@ -27,6 +27,8 @@
 #ifndef GEOM_Annotation_HeaderFile
 #define GEOM_Annotation_HeaderFile
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <AIS_InteractiveObject.hxx>
 #include <Bnd_Box.hxx>
 #include <Font_FontAspect.hxx>
@@ -361,7 +363,11 @@ public:
     //! \param theMode [in] the display mode.
     virtual void
       HilightWithColor( const Handle(PrsMgr_PresentationManager3d)& thePM,
-                        const Handle(Graphic3d_HighlightStyle)& theStyle,
+#if OCC_VERSION_LARGE > 0x07010000                     
+                       const Handle(Prs3d_Drawer)& theStyle,
+#else                  
+                       const Handle(Graphic3d_HighlightStyle)& theStyle,
+#endif                 
                         const Standard_Integer theMode = 0 ) Standard_OVERRIDE;
 
     //! Removes highlighting from the type of shape.