]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Porting to OCCT 7.4 dev V9_3_0a1
authormnt <mnt@opencascade.com>
Tue, 19 Feb 2019 11:47:33 +0000 (14:47 +0300)
committervsr <vsr@opencascade.com>
Fri, 22 Feb 2019 12:55:49 +0000 (15:55 +0300)
13 files changed:
src/BlockFix/BlockFix_UnionEdges.cxx
src/CurveCreator/CurveCreator_Utils.cxx
src/CurveCreator/CurveCreator_Widget.cxx
src/GEOMGUI/GEOMGUI_OCCSelector.cxx
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GeometryGUI.cxx
src/GEOMImpl/GEOMImpl_ChamferDriver.cxx
src/GEOMImpl/GEOMImpl_PartitionDriver.cxx
src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx
src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx
src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx
src/OBJECT/GEOM_AISShape.cxx
src/OBJECT/GEOM_Annotation.hxx

index 45fa5adbb4f85ff8a008aeb752805b51c65c6ab5..65d825b39f33c2741c3a753be873999fcead02b3 100644 (file)
@@ -375,11 +375,12 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain,
   }
   Handle(TColGeom_HArray1OfBSplineCurve)  concatcurve;     //array of the concatenated curves
   Handle(TColStd_HArray1OfInteger)        ArrayOfIndices;  //array of the remining Vertex
+  Standard_Boolean ClosedFlag = Standard_False;
   GeomConvert::ConcatC1(tab_c3d,
                         tabtolvertex,
                         ArrayOfIndices,
                         concatcurve,
-                        Standard_False,
+                        ClosedFlag,
                         Precision::Confusion());   //C1 concatenation
   
   if (concatcurve->Length() > 1)
@@ -425,11 +426,12 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain,
     }
     Handle(TColGeom2d_HArray1OfBSplineCurve)  concatc2d;     //array of the concatenated curves
     Handle(TColStd_HArray1OfInteger)        ArrayOfInd2d;  //array of the remining Vertex
+    Standard_Boolean ClosedFlag = Standard_False;
     Geom2dConvert::ConcatC1(tab_c2d,
                             tabtolvertex,
                             ArrayOfInd2d,
                             concatc2d,
-                            Standard_False,
+                            ClosedFlag,
                             Precision::Confusion());   //C1 concatenation
     
     if (concatc2d->Length() > 1)
index 4bca859d04f54e7f0afc9c68f313c6c2d1b8583f..4aac8b87f2af3240af0206be40454866206fd51b 100644 (file)
@@ -17,6 +17,8 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+#include <Basics_OCCTVersion.hxx>
+
 #include "CurveCreator_Utils.hxx"
 #include "CurveCreator.hxx"
 #include "CurveCreator_Curve.hxx"
 #include <AIS_Shape.hxx>
 #include <AIS_Line.hxx>
 #include <AIS_Trihedron.hxx>
+
+#if OCC_VERSION_LARGE <= 0x07030000
 #include <AIS_LocalContext.hxx>
+#endif
 
 #include <Geom_Point.hxx>
 #include <Geom_BSplineCurve.hxx>
@@ -646,7 +651,9 @@ void CurveCreator_Utils::setSelectedPoints( Handle(AIS_InteractiveContext) theCo
   //ASL: we switch on again automatic highlight (otherwise selection will not be shown)
   //     and call HilightPicked to draw selected owners
   theContext->SetAutomaticHilight( Standard_True );
+#if OCC_VERSION_LARGE <= 0x07030000
   theContext->LocalContext()->HilightPicked( Standard_True );
+#endif
 }
 
 //=======================================================================
@@ -661,11 +668,15 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur
     return;
 
   if ( theOpen ) {
+#if OCC_VERSION_LARGE <= 0x07030000
     // Open local context if there is no one
     if ( !theContext->HasOpenedContext() ) {
+#endif
       theContext->ClearCurrents( false );
+#if OCC_VERSION_LARGE <= 0x07030000
       theContext->OpenLocalContext( false/*use displayed objects*/, true/*allow shape decomposition*/ );
     }
+#endif
     // load the curve AIS object to the local context with the point selection
     Handle(AIS_InteractiveObject) anAIS = theCurve->getAISObject();
     if ( !anAIS.IsNull() )
@@ -678,8 +689,13 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur
     }
   }
   else {
+#if OCC_VERSION_LARGE <= 0x07030000
     if ( theContext->HasOpenedContext() )
       theContext->CloseAllContexts( Standard_True );
+#else
+    theContext->Deactivate();
+    theContext->Activate(0);
+#endif
   }
 }
 
index 34fa0a02112f6eb43a90f77f1438da244a10744a..f18329ef5781e321d502b9957f5504be9abe2718 100644 (file)
@@ -17,6 +17,8 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+#include <Basics_OCCTVersion.hxx>
+
 #include "CurveCreator_Widget.h"
 #include "CurveCreator_TreeView.h"
 #include "CurveCreator_NewSectionDlg.h"
@@ -1520,7 +1522,11 @@ void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionT
   if ( myDragStarted )
     return;
   Handle(AIS_InteractiveContext) aContext = getAISContext();
-  if ( aContext.IsNull() || !aContext->HasOpenedContext() )
+  if ( aContext.IsNull() 
+#if OCC_VERSION_LARGE <= 0x07030000
+       || !aContext->HasOpenedContext() 
+#endif       
+     )
     return;
 
   CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );
index e2030efcfd1d4f11bab17b0a3a001a74fe0b689a..1be9d93118eadd7ca774054f0adc148914a30572 100644 (file)
@@ -50,6 +50,7 @@
 #include <TColStd_IndexedMapOfInteger.hxx>
 #include <NCollection_DataMap.hxx>
 
+#include <Basics_OCCTVersion.hxx>
 
 //================================================================
 // Function : GEOMGUI_OCCSelector
@@ -79,24 +80,24 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
     return;
 
   Handle(AIS_InteractiveContext) ic = vw->getAISContext();
-
+#if OCC_VERSION_LARGE <= 0x07030000
   if (ic->HasOpenedContext())
   {
+#endif
     TopoDS_Shape curBigShape;
     TopTools_IndexedMapOfShape subShapes;
 
     for (ic->InitSelected(); ic->MoreSelected(); ic->NextSelected())
     {
-      Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(ic->SelectedOwner());
-      if (anOwner.IsNull())
-        continue;
 
-      Handle(AIS_InteractiveObject) io = Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable());
+      Handle(AIS_InteractiveObject) io = Handle(AIS_InteractiveObject)::DownCast( ic->SelectedInteractive() );
 
       QString entryStr = entry(io);
       int index = -1;
 
-      if (anOwner->ComesFromDecomposition()) // == Local Selection
+      Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast( ic->SelectedOwner() );
+
+      if (!anOwner.IsNull() && anOwner->ComesFromDecomposition()) // == Local Selection
       {
         TopoDS_Shape subShape = anOwner->Shape();
         Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast(io);
@@ -126,6 +127,7 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
         aList.append(SUIT_DataOwnerPtr(owner));
       }
     }
+#if OCC_VERSION_LARGE <= 0x07030000
   }
   else
   {
@@ -145,6 +147,7 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
       }
     }
   }
+#endif
 
   // add externally selected objects
   SUIT_DataOwnerPtrList::const_iterator anExtIter;
@@ -347,8 +350,8 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
     if ( owner->State() )
       continue;
 
-    if ( ic->HasOpenedContext() )
-      ic->AddOrRemoveSelected( owner, false );
+    if ( owner->ComesFromDecomposition() )
+      ic->AddOrRemoveSelected( owner, false ); 
     else
       ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
   }
index f823834d48a8d8a33c462ed3a3ea5b2efa60e80a..5a4dc49142583c62330eefa369fffe2a449d7579 100644 (file)
 #include <vtkActorCollection.h>
 #include <vtkProperty.h>
 
+#include <Basics_OCCTVersion.hxx>
 // CORBA Headers
 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
 
@@ -2050,8 +2051,13 @@ void GEOM_Displayer::BeforeDisplay( SALOME_View* v, const SALOME_OCCPrs* )
     Handle(AIS_InteractiveContext) ic = vf->getAISContext();
     if ( !ic.IsNull() )
     {
+#if OCC_VERSION_LARGE <= 0x07030000
       if ( ic->HasOpenedContext() )
       ic->CloseAllContexts(Standard_True);
+#else
+      ic->Deactivate();
+      ic->Activate( 0 );
+#endif
     }
   }
 }
index 09d9b1dc45b834af7d60b2b1446598257ca2dfe9..f1790cd21fab4e72a9793a348aab42ff1aa6a7ba 100644 (file)
@@ -47,6 +47,8 @@
 #include <Material_ResourceMgr.h>
 #include <Material_Model.h>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
@@ -2428,10 +2430,16 @@ void GeometryGUI::createPreferences()
   aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf";
   // add enginier font into combobox
   /*int fontID =*/ QFontDatabase::addApplicationFont( aFontFile );
+#if OCC_VERSION_LARGE <= 0x07030000
   Handle(Font_SystemFont) sf = new Font_SystemFont( 
     new TCollection_HAsciiString("Y14.5M-2009"), 
     Font_FA_Regular, 
     new TCollection_HAsciiString(aFontFile.toLatin1().data()) );
+# else
+  Handle(Font_SystemFont) sf = new Font_SystemFont( TCollection_AsciiString("Y14.5M-2009") );
+  sf->SetFontPath( Font_FA_Regular, 
+    TCollection_AsciiString( aFontFile.toLatin1().data() ) );
+#endif
   // register font in OCC font manager
   fmgr->RegisterFont( sf, Standard_False );
 
index b78a7a5d0eb4cf1175ab162d29a8a20d2accb334..99462cceee20dad0eb94a7f27ec456a62bcf7b4e 100644 (file)
@@ -45,6 +45,8 @@
 
 #include <StdFail_NotDone.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -128,7 +130,11 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(Handle(TFunction_Logbook)& log)
       if (!BRepTools::IsReallyClosed(E, F) &&
           !BRep_Tool::Degenerated(E) &&
           M.FindFromIndex(i).Extent() == 2)
+#if OCC_VERSION_LARGE <= 0x07030000
         fill.Add(aD, E, F);
+#else
+        fill.Add(aD, aD, E, F);
+#endif
     }
   }
   else if (aType == CHAMFER_SHAPE_EDGE || aType == CHAMFER_SHAPE_EDGE_AD) {
index 326c420be2dea968342d6a2317fe2ae0ad7756c1..3012715d9bdebf9e936d1c5123e26bd72f82e3e3 100644 (file)
@@ -48,6 +48,7 @@
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <BOPDS_DS.hxx>
+#include <BRepTools_History.hxx>
 
 // Depth of self-intersection check (see BOPAlgo_CheckerSI::SetLevelOfCheck() for more details)
 // Default value for BOPAlgo_CheckerSI gives very long computation when checking face-to-face intersections;
@@ -440,10 +441,6 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(Handle(TFunction_Logbook)& lo
   TopTools_IndexedMapOfShape aResIndices;
   TopExp::MapShapes(aShape, aResIndices);
 
-  // Map: source_shape/images of source_shape in Result
-  const TopTools_IndexedDataMapOfShapeListOfShape& aMR = PS.ImagesResult();
-  //const TopTools_IndexedDataMapOfShapeListOfShape& aMR = PS.ImagesResult();
-
   // history for all argument shapes
   // be sure to use aCopyMap
   TDF_LabelSequence aLabelSeq;
@@ -467,37 +464,39 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(Handle(TFunction_Logbook)& lo
 
     for (Standard_Integer ie = 1; ie <= nbArgumentEntities; ie++) {
       TopoDS_Shape anEntity = anArgumentIndices.FindKey(ie);
+      if (!BRepTools_History::IsSupportedType(anEntity))
+        continue;
+
       // be sure to use aCopyMap here
       if (aCopyMap.IsBound(anEntity))
         anEntity = aCopyMap.Find(anEntity);
       //
-      if (!aMR.Contains(anEntity)) continue;
-
-      const TopTools_ListOfShape& aModified = aMR.FindFromKey(anEntity);
-      //const TopTools_ListOfShape& aModified = aMR.FindFromKey(anEntity);
-      Standard_Integer nbModified = aModified.Extent();
-
-      if (nbModified > 0) { // Mantis issue 0021182
-        int ih = 1;
-        TopTools_ListIteratorOfListOfShape itM (aModified);
-        for (; itM.More() && nbModified > 0; itM.Next(), ++ih) {
-          if (!aResIndices.Contains(itM.Value())) {
-            nbModified = 0;
-          }
-        }
+      if (PS.IsDeleted(anEntity))
+        // The shape has been deleted
+        continue;
+
+      // Check if the shape has been modified during the operation.
+      // If it was - use its splits, otherwise use the shape itself
+      const TopTools_ListOfShape *pModified;
+      TopTools_ListOfShape aLItself;
+      const TopTools_ListOfShape& aPSModified = PS.Modified(anEntity);
+      if (!aPSModified.IsEmpty())
+        pModified = &aPSModified;
+      else
+      {
+        aLItself.Append(anEntity);
+        pModified = &aLItself;
       }
-      if (nbModified > 0) {
-        TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(ie, Standard_True);
-        Handle(TDataStd_IntegerArray) anAttr =
-          TDataStd_IntegerArray::Set(aWhatHistoryLabel, 1, nbModified);
-
-        int ih = 1;
-        TopTools_ListIteratorOfListOfShape itM (aModified);
-        //TopTools_ListIteratorOfListOfShape itM (aModified);
-        for (; itM.More(); itM.Next(), ++ih) {
-          int id = aResIndices.FindIndex(itM.Value());
-          anAttr->SetValue(ih, id);
-        }
+        
+      TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(ie, Standard_True);
+      Handle(TDataStd_IntegerArray) anAttr =
+        TDataStd_IntegerArray::Set(aWhatHistoryLabel, 1, pModified->Extent());
+
+      int ih = 1;
+      TopTools_ListIteratorOfListOfShape itM (*pModified);
+      for (; itM.More(); itM.Next(), ++ih) {
+        int id = aResIndices.FindIndex(itM.Value());
+        anAttr->SetValue(ih, id);
       }
     }
   }
index c194cd9fa2c8ee6ec3fd39ffe7a724271a218047..dd54dc688c91041cbcf8c737fd811da5e1ecd52f 100644 (file)
@@ -98,6 +98,8 @@
 #include <SALOMEDS_wrap.hxx>
 #include <GEOMImpl_Types.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #ifdef max
 #undef max
 #endif
@@ -905,9 +907,11 @@ bool MeasureGUI_AnnotationDlg::getPickedPoint( gp_Pnt& thePnt, const TopoDS_Shap
 
   Handle(AIS_InteractiveContext) anAISContext = aViewer->getAISContext();
   Handle(SelectMgr_ViewerSelector) aSelector;
+#if OCC_VERSION_LARGE <= 0x07030000
   if ( anAISContext->HasOpenedContext() )
     aSelector = anAISContext->LocalSelector();
   else
+#endif
     aSelector = anAISContext->MainSelector();
 
   if ( aSelector->NbPicked() < 1 )
index 46201b2a240eec0321d4da9e3f32e4de7b3729dc..34f34789c8641c68f47dc3d3afb7380ef11a9610 100644 (file)
@@ -52,6 +52,8 @@
 
 #include <Aspect_PolygonOffsetMode.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 //=================================================================================
 // function : Constructor
 // purpose  :
@@ -434,8 +436,9 @@ void MeasureGUI_CreateDimensionDlg::StartLocalEditing()
   Handle(V3d_Viewer)             aViewer3d    = myEditingViewer->getViewer3d();
 
   aViewer3d->AddZLayer( myEditingLayer );
-
+#if OCC_VERSION_LARGE <= 0x07030000
   anAISContext->OpenLocalContext( Standard_False, Standard_False );
+#endif
   anAISContext->Load( myDimension, AIS_DSM_All );
   anAISContext->SetZLayer( myDimension, myEditingLayer );
   anAISContext->Activate( myDimension, AIS_DSM_Line );
@@ -460,7 +463,12 @@ void MeasureGUI_CreateDimensionDlg::StopLocalEditing()
   Handle(V3d_Viewer)             aViewer3d    = myEditingViewer->getViewer3d();
 
   aViewer3d->RemoveZLayer( myEditingLayer );
+#if OCC_VERSION_LARGE <= 0x07030000
   anAISContext->CloseLocalContext( Standard_True );
+#else
+  anAISContext->Deactivate();
+  anAISContext->Activate(0);
+#endif
 
   myEditingViewer = NULL;
 }
index 84265fdfa709104702a6d026cf1f5e33580f8012..de58cbcff8f5573fff821e3a49b52813126e57f2 100644 (file)
@@ -61,6 +61,8 @@
 #include <QHBoxLayout>
 #include <QPixmap>
 
+#include <Basics_OCCTVersion.hxx>
+
 //=================================================================================
 // function : Constructor
 // purpose  :
@@ -196,8 +198,9 @@ void MeasureGUI_ManageDimensionsDlg::StartSelection( const Selection theSelectio
 
     anAISContext->ClearCurrents( Standard_False );
     anAISContext->ClearSelected( Standard_False );
+#if OCC_VERSION_LARGE <= 0x07030000
     anAISContext->OpenLocalContext( Standard_True, Standard_False );
-
+#endif
     Handle(MeasureGUI_DimensionFilter) aFilter = new MeasureGUI_DimensionFilter( myEditObject->GetStudyEntry() );
 
     anAISContext->AddFilter( aFilter );
@@ -261,8 +264,12 @@ void MeasureGUI_ManageDimensionsDlg::StopSelection()
      * ------------------------------------------------ */
 
     Handle(AIS_InteractiveContext) anAISContext = myOperatedViewer->getAISContext();
-
+#if OCC_VERSION_LARGE <= 0x07030000
     anAISContext->CloseLocalContext();
+#else
+    anAISContext->Deactivate();
+    anAISContext->Activate(0);
+#endif
 
     LightApp_SelectionMgr* aSelectionMgr = myGeomGUI->getApp()->selectionMgr();
 
@@ -355,7 +362,7 @@ void MeasureGUI_ManageDimensionsDlg::SelectionIntoArgument( const Selection theS
     anAISContext->InitSelected();
 
     Handle(AIS_InteractiveObject) anAIS;
-
+#if OCC_VERSION_LARGE <= 0x07030000
     if ( anAISContext->HasOpenedContext() )
     {
       Handle(SelectMgr_EntityOwner) anAISOwner = anAISContext->SelectedOwner();
@@ -363,8 +370,11 @@ void MeasureGUI_ManageDimensionsDlg::SelectionIntoArgument( const Selection theS
     }
     else
     {
+#endif
       anAIS = anAISContext->Current();
+#if OCC_VERSION_LARGE <= 0x07030000
     }
+#endif
 
     int aDimensionId = IdFromPrs( anAIS );
 
@@ -1239,7 +1249,7 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con
   {
     return;
   }
-
+#if OCC_VERSION_LARGE <= 0x07030000
   Standard_Boolean isLocal = anAISContext->HasOpenedContext();
   if ( isLocal )
   {
@@ -1247,9 +1257,11 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con
   }
   else
   {
+#endif
     anAISContext->ClearCurrents( Standard_False );
+#if OCC_VERSION_LARGE <= 0x07030000
   }
-
+#endif
   SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( theViewer->CreatePrs( myEditObject->GetStudyEntry() ) );
 
   AIS_ListOfInteractive aListOfIO;
@@ -1261,24 +1273,32 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con
     const Handle(AIS_InteractiveObject)& anIO = anIt.Value();
     if ( IdFromPrs( anIO ) != theId )
     {
+#if OCC_VERSION_LARGE <= 0x07030000
       if ( isLocal )
       {
+#endif
         anAISContext->Deactivate( anIO, AIS_DSM_Line );
         anAISContext->Deactivate( anIO, AIS_DSM_Text );
       }
       continue;
+#if OCC_VERSION_LARGE <= 0x07030000
     }
 
     if ( isLocal )
     {
+#endif
       anAISContext->AddOrRemoveSelected( anIO, Standard_False );
       anAISContext->Activate( anIO, AIS_DSM_Line );
       anAISContext->Activate( anIO, AIS_DSM_Text );
+#if OCC_VERSION_LARGE <= 0x07030000
     }
     else
     {
+#endif
       anAISContext->AddOrRemoveCurrentObject( anIO, Standard_False );
+#if OCC_VERSION_LARGE <= 0x07030000
     }
+#endif
 
     anAISContext->UpdateCurrentViewer();
   }
index 6a57c85aeee3ccf2dc41c63a3dd5d89fa3a70340..11ef68e1c7505d7bb2c569a33e09adafc92f0c0b 100644 (file)
@@ -70,6 +70,8 @@
 #include <Prs3d_VertexDrawMode.hxx>
 #include <StdPrs_WFShape.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <SalomeApp_Tools.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -358,7 +360,11 @@ void GEOM_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndex
 {
   Handle(AIS_InteractiveObject) anObj = this;
   Handle(AIS_InteractiveContext) anIC = GetContext();
-  if ( anIC.IsNull() || !anIC->HasOpenedContext() ) 
+  if ( anIC.IsNull() 
+#if OCC_VERSION_LARGE <= 0x07030000
+       || !anIC->HasOpenedContext() 
+#endif
+     ) 
     return;
 
   Standard_Boolean isAutoHilight = anIC->AutomaticHilight();
index 39def573dfdbd7fda247fb3e966646df811586ac..5ecb3817488a7c1f981864a2b7deb5004cdc803f 100644 (file)
@@ -44,6 +44,8 @@
 #include <StdSelect_Shape.hxx>
 #include <TCollection_ExtendedString.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 class OpenGl_GraphicDriver;
 class OpenGl_PrimitiveArray;
 class OpenGl_Text;
@@ -401,7 +403,11 @@ public:
       const Standard_Boolean isMatches = Select3D_SensitiveBox::Matches( theMgr, thePickResult );
       if ( !myIsDepthCulling )
       {
+#if OCC_VERSION_LARGE <= 0x07030000
         thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter() );
+#else
+        thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter(), thePickResult.PickedPoint() );
+#endif
       }
       return isMatches;
     }