Porting to OCCT 7.4 dev

This commit is contained in:
mnt 2019-02-19 14:47:33 +03:00 committed by vsr
parent 3d5efd4572
commit bfd48ef62a
13 changed files with 136 additions and 46 deletions

View File

@ -375,11 +375,12 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain,
} }
Handle(TColGeom_HArray1OfBSplineCurve) concatcurve; //array of the concatenated curves Handle(TColGeom_HArray1OfBSplineCurve) concatcurve; //array of the concatenated curves
Handle(TColStd_HArray1OfInteger) ArrayOfIndices; //array of the remining Vertex Handle(TColStd_HArray1OfInteger) ArrayOfIndices; //array of the remining Vertex
Standard_Boolean ClosedFlag = Standard_False;
GeomConvert::ConcatC1(tab_c3d, GeomConvert::ConcatC1(tab_c3d,
tabtolvertex, tabtolvertex,
ArrayOfIndices, ArrayOfIndices,
concatcurve, concatcurve,
Standard_False, ClosedFlag,
Precision::Confusion()); //C1 concatenation Precision::Confusion()); //C1 concatenation
if (concatcurve->Length() > 1) 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(TColGeom2d_HArray1OfBSplineCurve) concatc2d; //array of the concatenated curves
Handle(TColStd_HArray1OfInteger) ArrayOfInd2d; //array of the remining Vertex Handle(TColStd_HArray1OfInteger) ArrayOfInd2d; //array of the remining Vertex
Standard_Boolean ClosedFlag = Standard_False;
Geom2dConvert::ConcatC1(tab_c2d, Geom2dConvert::ConcatC1(tab_c2d,
tabtolvertex, tabtolvertex,
ArrayOfInd2d, ArrayOfInd2d,
concatc2d, concatc2d,
Standard_False, ClosedFlag,
Precision::Confusion()); //C1 concatenation Precision::Confusion()); //C1 concatenation
if (concatc2d->Length() > 1) if (concatc2d->Length() > 1)

View File

@ -17,6 +17,8 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
#include <Basics_OCCTVersion.hxx>
#include "CurveCreator_Utils.hxx" #include "CurveCreator_Utils.hxx"
#include "CurveCreator.hxx" #include "CurveCreator.hxx"
#include "CurveCreator_Curve.hxx" #include "CurveCreator_Curve.hxx"
@ -38,7 +40,10 @@
#include <AIS_Shape.hxx> #include <AIS_Shape.hxx>
#include <AIS_Line.hxx> #include <AIS_Line.hxx>
#include <AIS_Trihedron.hxx> #include <AIS_Trihedron.hxx>
#if OCC_VERSION_LARGE <= 0x07030000
#include <AIS_LocalContext.hxx> #include <AIS_LocalContext.hxx>
#endif
#include <Geom_Point.hxx> #include <Geom_Point.hxx>
#include <Geom_BSplineCurve.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) //ASL: we switch on again automatic highlight (otherwise selection will not be shown)
// and call HilightPicked to draw selected owners // and call HilightPicked to draw selected owners
theContext->SetAutomaticHilight( Standard_True ); theContext->SetAutomaticHilight( Standard_True );
#if OCC_VERSION_LARGE <= 0x07030000
theContext->LocalContext()->HilightPicked( Standard_True ); theContext->LocalContext()->HilightPicked( Standard_True );
#endif
} }
//======================================================================= //=======================================================================
@ -661,11 +668,15 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur
return; return;
if ( theOpen ) { if ( theOpen ) {
#if OCC_VERSION_LARGE <= 0x07030000
// Open local context if there is no one // Open local context if there is no one
if ( !theContext->HasOpenedContext() ) { if ( !theContext->HasOpenedContext() ) {
#endif
theContext->ClearCurrents( false ); theContext->ClearCurrents( false );
#if OCC_VERSION_LARGE <= 0x07030000
theContext->OpenLocalContext( false/*use displayed objects*/, true/*allow shape decomposition*/ ); theContext->OpenLocalContext( false/*use displayed objects*/, true/*allow shape decomposition*/ );
} }
#endif
// load the curve AIS object to the local context with the point selection // load the curve AIS object to the local context with the point selection
Handle(AIS_InteractiveObject) anAIS = theCurve->getAISObject(); Handle(AIS_InteractiveObject) anAIS = theCurve->getAISObject();
if ( !anAIS.IsNull() ) if ( !anAIS.IsNull() )
@ -678,8 +689,13 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur
} }
} }
else { else {
#if OCC_VERSION_LARGE <= 0x07030000
if ( theContext->HasOpenedContext() ) if ( theContext->HasOpenedContext() )
theContext->CloseAllContexts( Standard_True ); theContext->CloseAllContexts( Standard_True );
#else
theContext->Deactivate();
theContext->Activate(0);
#endif
} }
} }

View File

@ -17,6 +17,8 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
#include <Basics_OCCTVersion.hxx>
#include "CurveCreator_Widget.h" #include "CurveCreator_Widget.h"
#include "CurveCreator_TreeView.h" #include "CurveCreator_TreeView.h"
#include "CurveCreator_NewSectionDlg.h" #include "CurveCreator_NewSectionDlg.h"
@ -1520,7 +1522,11 @@ void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionT
if ( myDragStarted ) if ( myDragStarted )
return; return;
Handle(AIS_InteractiveContext) aContext = getAISContext(); Handle(AIS_InteractiveContext) aContext = getAISContext();
if ( aContext.IsNull() || !aContext->HasOpenedContext() ) if ( aContext.IsNull()
#if OCC_VERSION_LARGE <= 0x07030000
|| !aContext->HasOpenedContext()
#endif
)
return; return;
CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints ); CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );

View File

@ -50,6 +50,7 @@
#include <TColStd_IndexedMapOfInteger.hxx> #include <TColStd_IndexedMapOfInteger.hxx>
#include <NCollection_DataMap.hxx> #include <NCollection_DataMap.hxx>
#include <Basics_OCCTVersion.hxx>
//================================================================ //================================================================
// Function : GEOMGUI_OCCSelector // Function : GEOMGUI_OCCSelector
@ -79,24 +80,24 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
return; return;
Handle(AIS_InteractiveContext) ic = vw->getAISContext(); Handle(AIS_InteractiveContext) ic = vw->getAISContext();
#if OCC_VERSION_LARGE <= 0x07030000
if (ic->HasOpenedContext()) if (ic->HasOpenedContext())
{ {
#endif
TopoDS_Shape curBigShape; TopoDS_Shape curBigShape;
TopTools_IndexedMapOfShape subShapes; TopTools_IndexedMapOfShape subShapes;
for (ic->InitSelected(); ic->MoreSelected(); ic->NextSelected()) 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); QString entryStr = entry(io);
int index = -1; 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(); TopoDS_Shape subShape = anOwner->Shape();
Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast(io); 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)); aList.append(SUIT_DataOwnerPtr(owner));
} }
} }
#if OCC_VERSION_LARGE <= 0x07030000
} }
else else
{ {
@ -145,6 +147,7 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
} }
} }
} }
#endif
// add externally selected objects // add externally selected objects
SUIT_DataOwnerPtrList::const_iterator anExtIter; SUIT_DataOwnerPtrList::const_iterator anExtIter;
@ -347,8 +350,8 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
if ( owner->State() ) if ( owner->State() )
continue; continue;
if ( ic->HasOpenedContext() ) if ( owner->ComesFromDecomposition() )
ic->AddOrRemoveSelected( owner, false ); ic->AddOrRemoveSelected( owner, false );
else else
ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false ); ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
} }

View File

@ -118,6 +118,7 @@
#include <vtkActorCollection.h> #include <vtkActorCollection.h>
#include <vtkProperty.h> #include <vtkProperty.h>
#include <Basics_OCCTVersion.hxx>
// CORBA Headers // CORBA Headers
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) #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(); Handle(AIS_InteractiveContext) ic = vf->getAISContext();
if ( !ic.IsNull() ) if ( !ic.IsNull() )
{ {
#if OCC_VERSION_LARGE <= 0x07030000
if ( ic->HasOpenedContext() ) if ( ic->HasOpenedContext() )
ic->CloseAllContexts(Standard_True); ic->CloseAllContexts(Standard_True);
#else
ic->Deactivate();
ic->Activate( 0 );
#endif
} }
} }
} }

View File

@ -47,6 +47,8 @@
#include <Material_ResourceMgr.h> #include <Material_ResourceMgr.h>
#include <Material_Model.h> #include <Material_Model.h>
#include <Basics_OCCTVersion.hxx>
#include <SUIT_Desktop.h> #include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h> #include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h> #include <SUIT_ResourceMgr.h>
@ -2428,10 +2430,16 @@ void GeometryGUI::createPreferences()
aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf"; aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf";
// add enginier font into combobox // add enginier font into combobox
/*int fontID =*/ QFontDatabase::addApplicationFont( aFontFile ); /*int fontID =*/ QFontDatabase::addApplicationFont( aFontFile );
#if OCC_VERSION_LARGE <= 0x07030000
Handle(Font_SystemFont) sf = new Font_SystemFont( Handle(Font_SystemFont) sf = new Font_SystemFont(
new TCollection_HAsciiString("Y14.5M-2009"), new TCollection_HAsciiString("Y14.5M-2009"),
Font_FA_Regular, Font_FA_Regular,
new TCollection_HAsciiString(aFontFile.toLatin1().data()) ); 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 // register font in OCC font manager
fmgr->RegisterFont( sf, Standard_False ); fmgr->RegisterFont( sf, Standard_False );

View File

@ -45,6 +45,8 @@
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#include <Basics_OCCTVersion.hxx>
//======================================================================= //=======================================================================
//function : GetID //function : GetID
//purpose : //purpose :
@ -128,7 +130,11 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(Handle(TFunction_Logbook)& log)
if (!BRepTools::IsReallyClosed(E, F) && if (!BRepTools::IsReallyClosed(E, F) &&
!BRep_Tool::Degenerated(E) && !BRep_Tool::Degenerated(E) &&
M.FindFromIndex(i).Extent() == 2) M.FindFromIndex(i).Extent() == 2)
#if OCC_VERSION_LARGE <= 0x07030000
fill.Add(aD, E, F); fill.Add(aD, E, F);
#else
fill.Add(aD, aD, E, F);
#endif
} }
} }
else if (aType == CHAMFER_SHAPE_EDGE || aType == CHAMFER_SHAPE_EDGE_AD) { else if (aType == CHAMFER_SHAPE_EDGE || aType == CHAMFER_SHAPE_EDGE_AD) {

View File

@ -48,6 +48,7 @@
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx> #include <TopTools_ListOfShape.hxx>
#include <BOPDS_DS.hxx> #include <BOPDS_DS.hxx>
#include <BRepTools_History.hxx>
// Depth of self-intersection check (see BOPAlgo_CheckerSI::SetLevelOfCheck() for more details) // 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; // 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; TopTools_IndexedMapOfShape aResIndices;
TopExp::MapShapes(aShape, 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 // history for all argument shapes
// be sure to use aCopyMap // be sure to use aCopyMap
TDF_LabelSequence aLabelSeq; TDF_LabelSequence aLabelSeq;
@ -467,37 +464,39 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(Handle(TFunction_Logbook)& lo
for (Standard_Integer ie = 1; ie <= nbArgumentEntities; ie++) { for (Standard_Integer ie = 1; ie <= nbArgumentEntities; ie++) {
TopoDS_Shape anEntity = anArgumentIndices.FindKey(ie); TopoDS_Shape anEntity = anArgumentIndices.FindKey(ie);
if (!BRepTools_History::IsSupportedType(anEntity))
continue;
// be sure to use aCopyMap here // be sure to use aCopyMap here
if (aCopyMap.IsBound(anEntity)) if (aCopyMap.IsBound(anEntity))
anEntity = aCopyMap.Find(anEntity); anEntity = aCopyMap.Find(anEntity);
// //
if (!aMR.Contains(anEntity)) continue; if (PS.IsDeleted(anEntity))
// The shape has been deleted
continue;
const TopTools_ListOfShape& aModified = aMR.FindFromKey(anEntity); // Check if the shape has been modified during the operation.
//const TopTools_ListOfShape& aModified = aMR.FindFromKey(anEntity); // If it was - use its splits, otherwise use the shape itself
Standard_Integer nbModified = aModified.Extent(); const TopTools_ListOfShape *pModified;
TopTools_ListOfShape aLItself;
if (nbModified > 0) { // Mantis issue 0021182 const TopTools_ListOfShape& aPSModified = PS.Modified(anEntity);
int ih = 1; if (!aPSModified.IsEmpty())
TopTools_ListIteratorOfListOfShape itM (aModified); pModified = &aPSModified;
for (; itM.More() && nbModified > 0; itM.Next(), ++ih) { else
if (!aResIndices.Contains(itM.Value())) { {
nbModified = 0; aLItself.Append(anEntity);
} pModified = &aLItself;
}
} }
if (nbModified > 0) {
TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(ie, Standard_True); TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(ie, Standard_True);
Handle(TDataStd_IntegerArray) anAttr = Handle(TDataStd_IntegerArray) anAttr =
TDataStd_IntegerArray::Set(aWhatHistoryLabel, 1, nbModified); TDataStd_IntegerArray::Set(aWhatHistoryLabel, 1, pModified->Extent());
int ih = 1; int ih = 1;
TopTools_ListIteratorOfListOfShape itM (aModified); TopTools_ListIteratorOfListOfShape itM (*pModified);
//TopTools_ListIteratorOfListOfShape itM (aModified); for (; itM.More(); itM.Next(), ++ih) {
for (; itM.More(); itM.Next(), ++ih) { int id = aResIndices.FindIndex(itM.Value());
int id = aResIndices.FindIndex(itM.Value()); anAttr->SetValue(ih, id);
anAttr->SetValue(ih, id);
}
} }
} }
} }

View File

@ -98,6 +98,8 @@
#include <SALOMEDS_wrap.hxx> #include <SALOMEDS_wrap.hxx>
#include <GEOMImpl_Types.hxx> #include <GEOMImpl_Types.hxx>
#include <Basics_OCCTVersion.hxx>
#ifdef max #ifdef max
#undef max #undef max
#endif #endif
@ -905,9 +907,11 @@ bool MeasureGUI_AnnotationDlg::getPickedPoint( gp_Pnt& thePnt, const TopoDS_Shap
Handle(AIS_InteractiveContext) anAISContext = aViewer->getAISContext(); Handle(AIS_InteractiveContext) anAISContext = aViewer->getAISContext();
Handle(SelectMgr_ViewerSelector) aSelector; Handle(SelectMgr_ViewerSelector) aSelector;
#if OCC_VERSION_LARGE <= 0x07030000
if ( anAISContext->HasOpenedContext() ) if ( anAISContext->HasOpenedContext() )
aSelector = anAISContext->LocalSelector(); aSelector = anAISContext->LocalSelector();
else else
#endif
aSelector = anAISContext->MainSelector(); aSelector = anAISContext->MainSelector();
if ( aSelector->NbPicked() < 1 ) if ( aSelector->NbPicked() < 1 )

View File

@ -52,6 +52,8 @@
#include <Aspect_PolygonOffsetMode.hxx> #include <Aspect_PolygonOffsetMode.hxx>
#include <Basics_OCCTVersion.hxx>
//================================================================================= //=================================================================================
// function : Constructor // function : Constructor
// purpose : // purpose :
@ -434,8 +436,9 @@ void MeasureGUI_CreateDimensionDlg::StartLocalEditing()
Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d(); Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d();
aViewer3d->AddZLayer( myEditingLayer ); aViewer3d->AddZLayer( myEditingLayer );
#if OCC_VERSION_LARGE <= 0x07030000
anAISContext->OpenLocalContext( Standard_False, Standard_False ); anAISContext->OpenLocalContext( Standard_False, Standard_False );
#endif
anAISContext->Load( myDimension, AIS_DSM_All ); anAISContext->Load( myDimension, AIS_DSM_All );
anAISContext->SetZLayer( myDimension, myEditingLayer ); anAISContext->SetZLayer( myDimension, myEditingLayer );
anAISContext->Activate( myDimension, AIS_DSM_Line ); anAISContext->Activate( myDimension, AIS_DSM_Line );
@ -460,7 +463,12 @@ void MeasureGUI_CreateDimensionDlg::StopLocalEditing()
Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d(); Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d();
aViewer3d->RemoveZLayer( myEditingLayer ); aViewer3d->RemoveZLayer( myEditingLayer );
#if OCC_VERSION_LARGE <= 0x07030000
anAISContext->CloseLocalContext( Standard_True ); anAISContext->CloseLocalContext( Standard_True );
#else
anAISContext->Deactivate();
anAISContext->Activate(0);
#endif
myEditingViewer = NULL; myEditingViewer = NULL;
} }

View File

@ -61,6 +61,8 @@
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QPixmap> #include <QPixmap>
#include <Basics_OCCTVersion.hxx>
//================================================================================= //=================================================================================
// function : Constructor // function : Constructor
// purpose : // purpose :
@ -196,8 +198,9 @@ void MeasureGUI_ManageDimensionsDlg::StartSelection( const Selection theSelectio
anAISContext->ClearCurrents( Standard_False ); anAISContext->ClearCurrents( Standard_False );
anAISContext->ClearSelected( Standard_False ); anAISContext->ClearSelected( Standard_False );
#if OCC_VERSION_LARGE <= 0x07030000
anAISContext->OpenLocalContext( Standard_True, Standard_False ); anAISContext->OpenLocalContext( Standard_True, Standard_False );
#endif
Handle(MeasureGUI_DimensionFilter) aFilter = new MeasureGUI_DimensionFilter( myEditObject->GetStudyEntry() ); Handle(MeasureGUI_DimensionFilter) aFilter = new MeasureGUI_DimensionFilter( myEditObject->GetStudyEntry() );
anAISContext->AddFilter( aFilter ); anAISContext->AddFilter( aFilter );
@ -261,8 +264,12 @@ void MeasureGUI_ManageDimensionsDlg::StopSelection()
* ------------------------------------------------ */ * ------------------------------------------------ */
Handle(AIS_InteractiveContext) anAISContext = myOperatedViewer->getAISContext(); Handle(AIS_InteractiveContext) anAISContext = myOperatedViewer->getAISContext();
#if OCC_VERSION_LARGE <= 0x07030000
anAISContext->CloseLocalContext(); anAISContext->CloseLocalContext();
#else
anAISContext->Deactivate();
anAISContext->Activate(0);
#endif
LightApp_SelectionMgr* aSelectionMgr = myGeomGUI->getApp()->selectionMgr(); LightApp_SelectionMgr* aSelectionMgr = myGeomGUI->getApp()->selectionMgr();
@ -355,7 +362,7 @@ void MeasureGUI_ManageDimensionsDlg::SelectionIntoArgument( const Selection theS
anAISContext->InitSelected(); anAISContext->InitSelected();
Handle(AIS_InteractiveObject) anAIS; Handle(AIS_InteractiveObject) anAIS;
#if OCC_VERSION_LARGE <= 0x07030000
if ( anAISContext->HasOpenedContext() ) if ( anAISContext->HasOpenedContext() )
{ {
Handle(SelectMgr_EntityOwner) anAISOwner = anAISContext->SelectedOwner(); Handle(SelectMgr_EntityOwner) anAISOwner = anAISContext->SelectedOwner();
@ -363,8 +370,11 @@ void MeasureGUI_ManageDimensionsDlg::SelectionIntoArgument( const Selection theS
} }
else else
{ {
#endif
anAIS = anAISContext->Current(); anAIS = anAISContext->Current();
#if OCC_VERSION_LARGE <= 0x07030000
} }
#endif
int aDimensionId = IdFromPrs( anAIS ); int aDimensionId = IdFromPrs( anAIS );
@ -1239,7 +1249,7 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con
{ {
return; return;
} }
#if OCC_VERSION_LARGE <= 0x07030000
Standard_Boolean isLocal = anAISContext->HasOpenedContext(); Standard_Boolean isLocal = anAISContext->HasOpenedContext();
if ( isLocal ) if ( isLocal )
{ {
@ -1247,9 +1257,11 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con
} }
else else
{ {
#endif
anAISContext->ClearCurrents( Standard_False ); anAISContext->ClearCurrents( Standard_False );
#if OCC_VERSION_LARGE <= 0x07030000
} }
#endif
SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( theViewer->CreatePrs( myEditObject->GetStudyEntry() ) ); SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( theViewer->CreatePrs( myEditObject->GetStudyEntry() ) );
AIS_ListOfInteractive aListOfIO; AIS_ListOfInteractive aListOfIO;
@ -1261,24 +1273,32 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con
const Handle(AIS_InteractiveObject)& anIO = anIt.Value(); const Handle(AIS_InteractiveObject)& anIO = anIt.Value();
if ( IdFromPrs( anIO ) != theId ) if ( IdFromPrs( anIO ) != theId )
{ {
#if OCC_VERSION_LARGE <= 0x07030000
if ( isLocal ) if ( isLocal )
{ {
#endif
anAISContext->Deactivate( anIO, AIS_DSM_Line ); anAISContext->Deactivate( anIO, AIS_DSM_Line );
anAISContext->Deactivate( anIO, AIS_DSM_Text ); anAISContext->Deactivate( anIO, AIS_DSM_Text );
} }
continue; continue;
#if OCC_VERSION_LARGE <= 0x07030000
} }
if ( isLocal ) if ( isLocal )
{ {
#endif
anAISContext->AddOrRemoveSelected( anIO, Standard_False ); anAISContext->AddOrRemoveSelected( anIO, Standard_False );
anAISContext->Activate( anIO, AIS_DSM_Line ); anAISContext->Activate( anIO, AIS_DSM_Line );
anAISContext->Activate( anIO, AIS_DSM_Text ); anAISContext->Activate( anIO, AIS_DSM_Text );
#if OCC_VERSION_LARGE <= 0x07030000
} }
else else
{ {
#endif
anAISContext->AddOrRemoveCurrentObject( anIO, Standard_False ); anAISContext->AddOrRemoveCurrentObject( anIO, Standard_False );
#if OCC_VERSION_LARGE <= 0x07030000
} }
#endif
anAISContext->UpdateCurrentViewer(); anAISContext->UpdateCurrentViewer();
} }

View File

@ -70,6 +70,8 @@
#include <Prs3d_VertexDrawMode.hxx> #include <Prs3d_VertexDrawMode.hxx>
#include <StdPrs_WFShape.hxx> #include <StdPrs_WFShape.hxx>
#include <Basics_OCCTVersion.hxx>
#include <SalomeApp_Tools.h> #include <SalomeApp_Tools.h>
#include <SUIT_Session.h> #include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h> #include <SUIT_ResourceMgr.h>
@ -358,7 +360,11 @@ void GEOM_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndex
{ {
Handle(AIS_InteractiveObject) anObj = this; Handle(AIS_InteractiveObject) anObj = this;
Handle(AIS_InteractiveContext) anIC = GetContext(); Handle(AIS_InteractiveContext) anIC = GetContext();
if ( anIC.IsNull() || !anIC->HasOpenedContext() ) if ( anIC.IsNull()
#if OCC_VERSION_LARGE <= 0x07030000
|| !anIC->HasOpenedContext()
#endif
)
return; return;
Standard_Boolean isAutoHilight = anIC->AutomaticHilight(); Standard_Boolean isAutoHilight = anIC->AutomaticHilight();

View File

@ -44,6 +44,8 @@
#include <StdSelect_Shape.hxx> #include <StdSelect_Shape.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <Basics_OCCTVersion.hxx>
class OpenGl_GraphicDriver; class OpenGl_GraphicDriver;
class OpenGl_PrimitiveArray; class OpenGl_PrimitiveArray;
class OpenGl_Text; class OpenGl_Text;
@ -401,7 +403,11 @@ public:
const Standard_Boolean isMatches = Select3D_SensitiveBox::Matches( theMgr, thePickResult ); const Standard_Boolean isMatches = Select3D_SensitiveBox::Matches( theMgr, thePickResult );
if ( !myIsDepthCulling ) if ( !myIsDepthCulling )
{ {
#if OCC_VERSION_LARGE <= 0x07030000
thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter() ); thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter() );
#else
thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter(), thePickResult.PickedPoint() );
#endif
} }
return isMatches; return isMatches;
} }