Porting to OCCT 7.4.1dev

This commit is contained in:
jfa 2020-07-31 18:36:42 +03:00
parent 2a3778cbc2
commit 08f4a1d3d5
17 changed files with 46 additions and 194 deletions

View File

@ -41,10 +41,6 @@
#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>
#endif
#include <Geom_Point.hxx> #include <Geom_Point.hxx>
#include <Geom_BSplineCurve.hxx> #include <Geom_BSplineCurve.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
@ -653,9 +649,6 @@ 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 );
#endif
} }
//======================================================================= //=======================================================================
@ -670,15 +663,7 @@ 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
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*/ );
}
#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() )
@ -691,13 +676,8 @@ void CurveCreator_Utils::setLocalPointContext( const CurveCreator_ICurve* theCur
} }
} }
else { else {
#if OCC_VERSION_LARGE <= 0x07030000
if ( theContext->HasOpenedContext() )
theContext->CloseAllContexts( Standard_True );
#else
theContext->Deactivate(); theContext->Deactivate();
theContext->Activate(0); theContext->Activate(0);
#endif
} }
} }

View File

@ -1522,11 +1522,7 @@ 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() 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

@ -510,12 +510,8 @@ void GEOMAlgo_Gluer::MakeSolids()
myResult=aCmp; myResult=aCmp;
// //
if (aMS.Extent()) { if (aMS.Extent()) {
#if OCC_VERSION_LARGE > 0x07020001
TopTools_IndexedMapOfShape aMapToAvoid; TopTools_IndexedMapOfShape aMapToAvoid;
BOPTools_AlgoTools::CorrectCurveOnSurface(myResult, aMapToAvoid, 0.0001); BOPTools_AlgoTools::CorrectCurveOnSurface(myResult, aMapToAvoid, 0.0001);
#else
BOPTools_AlgoTools::CorrectCurveOnSurface(myResult, 0.0001);
#endif
} }
} }
//======================================================================= //=======================================================================

View File

@ -74,7 +74,7 @@ namespace
// function : Length::Init // function : Length::Init
// purpose : // purpose :
//================================================================================= //=================================================================================
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
void GEOMGUI_DimensionProperty::Length::Init( const Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS ) void GEOMGUI_DimensionProperty::Length::Init( const Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS )
#else #else
void GEOMGUI_DimensionProperty::Length::Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS ) void GEOMGUI_DimensionProperty::Length::Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS )
@ -96,7 +96,7 @@ void GEOMGUI_DimensionProperty::Length::Init( const Handle(AIS_LengthDimension)&
// function : Length::Update // function : Length::Update
// purpose : // purpose :
//================================================================================= //=================================================================================
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
void GEOMGUI_DimensionProperty::Length::Update( Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS ) void GEOMGUI_DimensionProperty::Length::Update( Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS )
#else #else
void GEOMGUI_DimensionProperty::Length::Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS ) void GEOMGUI_DimensionProperty::Length::Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS )
@ -850,7 +850,7 @@ void GEOMGUI_DimensionProperty::AddRecord( const Handle(AIS_Dimension)& theIO, c
{ {
case DimensionType_Length : case DimensionType_Length :
{ {
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
Handle(PrsDim_LengthDimension) aLength = Handle(PrsDim_LengthDimension) aLength =
Handle(PrsDim_LengthDimension)::DownCast( theIO ); Handle(PrsDim_LengthDimension)::DownCast( theIO );
#else #else
@ -937,7 +937,7 @@ void GEOMGUI_DimensionProperty::SetRecord( const int theIndex,
{ {
case DimensionType_Length : case DimensionType_Length :
{ {
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
Handle(PrsDim_LengthDimension) aLength = Handle(PrsDim_LengthDimension) aLength =
Handle(PrsDim_LengthDimension)::DownCast( theIO ); Handle(PrsDim_LengthDimension)::DownCast( theIO );
#else #else
@ -1138,7 +1138,7 @@ void GEOMGUI_DimensionProperty::SaveToAttribute( const std::string &theEntry )
//================================================================================= //=================================================================================
int GEOMGUI_DimensionProperty::TypeFromIO( const Handle(AIS_Dimension)& theIO ) const int GEOMGUI_DimensionProperty::TypeFromIO( const Handle(AIS_Dimension)& theIO ) const
{ {
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
if ( theIO->IsKind( STANDARD_TYPE( PrsDim_LengthDimension ) ) ) if ( theIO->IsKind( STANDARD_TYPE( PrsDim_LengthDimension ) ) )
#else #else
if ( theIO->IsKind( STANDARD_TYPE( AIS_LengthDimension ) ) ) if ( theIO->IsKind( STANDARD_TYPE( AIS_LengthDimension ) ) )

View File

@ -32,7 +32,7 @@
// OCCT includes // OCCT includes
#include <AIS_Dimension.hxx> #include <AIS_Dimension.hxx>
#include <AIS_DiameterDimension.hxx> #include <AIS_DiameterDimension.hxx>
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
#include <PrsDim_LengthDimension.hxx> #include <PrsDim_LengthDimension.hxx>
#else #else
#include <AIS_LengthDimension.hxx> #include <AIS_LengthDimension.hxx>
@ -144,7 +144,7 @@ public:
* \param theIO [in] the interactive presentation. * \param theIO [in] the interactive presentation.
* \param theLCS [in] the local coordinate system of parent object. * \param theLCS [in] the local coordinate system of parent object.
*/ */
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
void Init( const Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS ); void Init( const Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS );
#else #else
void Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS ); void Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS );
@ -155,7 +155,7 @@ public:
* \param theIO [in/out] the interactive presentation. * \param theIO [in/out] the interactive presentation.
* \param theLCS [in] the local coordinate system of parent object. * \param theLCS [in] the local coordinate system of parent object.
*/ */
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
void Update( Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS ); void Update( Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS );
#else #else
void Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS ); void Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS );

View File

@ -80,10 +80,6 @@ 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())
{
#endif
TopoDS_Shape curBigShape; TopoDS_Shape curBigShape;
TopTools_IndexedMapOfShape subShapes; TopTools_IndexedMapOfShape subShapes;
@ -127,27 +123,6 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
aList.append(SUIT_DataOwnerPtr(owner)); aList.append(SUIT_DataOwnerPtr(owner));
} }
} }
#if OCC_VERSION_LARGE <= 0x07030000
}
else
{
for (ic->InitCurrent(); ic->MoreCurrent(); ic->NextCurrent())
{
Handle(AIS_InteractiveObject) io = ic->Current();
QString entryStr = entry( io );
if ( !entryStr.isEmpty() )
{
Handle(SALOME_InteractiveObject) anIO = Handle(SALOME_InteractiveObject)::DownCast(io->GetOwner());
if ( !anIO.IsNull() ) {
LightApp_DataOwner* owner = new LightApp_DataOwner( anIO );
aList.append( SUIT_DataOwnerPtr( owner ) );
}
}
}
}
#endif
// add externally selected objects // add externally selected objects
SUIT_DataOwnerPtrList::const_iterator anExtIter; SUIT_DataOwnerPtrList::const_iterator anExtIter;

View File

@ -126,7 +126,7 @@
#include <TColStd_HArray1OfByte.hxx> #include <TColStd_HArray1OfByte.hxx>
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
#include <Image_SupportedFormats.hxx> #include <Image_SupportedFormats.hxx>
#endif #endif
@ -246,7 +246,7 @@ namespace
const Handle(Graphic3d_TextureMap)& aTexture = aAISShape->Attributes()->ShadingAspect()->Aspect()->TextureMap(); const Handle(Graphic3d_TextureMap)& aTexture = aAISShape->Attributes()->ShadingAspect()->Aspect()->TextureMap();
if ( aTexture.IsNull() ) if ( aTexture.IsNull() )
continue; continue;
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
Handle(Image_SupportedFormats) aFormats = new Image_SupportedFormats(); Handle(Image_SupportedFormats) aFormats = new Image_SupportedFormats();
const Handle(Image_PixMap)& aPixmap = aTexture->GetImage(aFormats); const Handle(Image_PixMap)& aPixmap = aTexture->GetImage(aFormats);
#else #else
@ -1356,7 +1356,7 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t
if ( aUnitsAngle == "deg" ) if ( aUnitsAngle == "deg" )
{ {
aPrs->SetSpecialSymbol(0xB0); aPrs->SetSpecialSymbol(0xB0);
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
aPrs->SetDisplaySpecialSymbol( isUnitsShown ? PrsDim_DisplaySpecialSymbol_After : aPrs->SetDisplaySpecialSymbol( isUnitsShown ? PrsDim_DisplaySpecialSymbol_After :
PrsDim_DisplaySpecialSymbol_No ); PrsDim_DisplaySpecialSymbol_No );
#else #else
@ -1366,7 +1366,7 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t
} }
else else
{ {
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
aPrs->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No); aPrs->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No);
#else #else
aPrs->SetDisplaySpecialSymbol(AIS_DSS_No); aPrs->SetDisplaySpecialSymbol(AIS_DSS_No);
@ -2070,13 +2070,8 @@ 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() )
ic->CloseAllContexts(Standard_True);
#else
ic->Deactivate(); ic->Deactivate();
ic->Activate( 0 ); ic->Activate( 0 );
#endif
} }
} }
} }

View File

@ -2441,16 +2441,9 @@ 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(
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") ); Handle(Font_SystemFont) sf = new Font_SystemFont( TCollection_AsciiString("Y14.5M-2009") );
sf->SetFontPath( Font_FA_Regular, sf->SetFontPath( Font_FA_Regular,
TCollection_AsciiString( aFontFile.toLatin1().data() ) ); 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

@ -130,11 +130,7 @@ 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);
#else
fill.Add(aD, aD, E, F); 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

@ -55,7 +55,7 @@
#include <gce_MakePln.hxx> #include <gce_MakePln.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
#include <PrsDim.hxx> #include <PrsDim.hxx>
#else #else
#include <AIS.hxx> #include <AIS.hxx>
@ -331,7 +331,7 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
Standard_Integer extShape; Standard_Integer extShape;
Handle(Geom_Plane) aPlane; Handle(Geom_Plane) aPlane;
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
if (PrsDim::ComputeGeometry (anEdge1, anEdge2, if (PrsDim::ComputeGeometry (anEdge1, anEdge2,
#else #else
if (AIS::ComputeGeometry (anEdge1, anEdge2, if (AIS::ComputeGeometry (anEdge1, anEdge2,
@ -362,7 +362,7 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
anIO->SetDimensionAspect( aDimensionStyle ); anIO->SetDimensionAspect( aDimensionStyle );
anIO->SetDisplayUnits( aUnitsAngle.toUtf8().data() ); anIO->SetDisplayUnits( aUnitsAngle.toUtf8().data() );
if (aUnitsAngle == "rad") if (aUnitsAngle == "rad")
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
anIO->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No); anIO->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No);
#else #else
anIO->SetDisplaySpecialSymbol(AIS_DSS_No); anIO->SetDisplaySpecialSymbol(AIS_DSS_No);

View File

@ -907,11 +907,6 @@ 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() )
aSelector = anAISContext->LocalSelector();
else
#endif
aSelector = anAISContext->MainSelector(); aSelector = anAISContext->MainSelector();
if ( aSelector->NbPicked() < 1 ) if ( aSelector->NbPicked() < 1 )

View File

@ -438,11 +438,8 @@ 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 );
#endif
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
anAISContext->Load( myDimension, PrsDim_DimensionSelectionMode_All ); anAISContext->Load( myDimension, PrsDim_DimensionSelectionMode_All );
anAISContext->SetZLayer( myDimension, myEditingLayer ); anAISContext->SetZLayer( myDimension, myEditingLayer );
anAISContext->Activate( myDimension, PrsDim_DimensionSelectionMode_Line ); anAISContext->Activate( myDimension, PrsDim_DimensionSelectionMode_Line );
@ -473,12 +470,8 @@ 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 );
#else
anAISContext->Deactivate(); anAISContext->Deactivate();
anAISContext->Activate(0); anAISContext->Activate(0);
#endif
myEditingViewer = NULL; myEditingViewer = NULL;
} }
@ -644,7 +637,7 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension()
if ( aUnitsAngle == "deg" ) if ( aUnitsAngle == "deg" )
{ {
aDimensionIO->SetSpecialSymbol(0xB0); aDimensionIO->SetSpecialSymbol(0xB0);
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
aDimensionIO->SetDisplaySpecialSymbol( isUnitsShown ? PrsDim_DisplaySpecialSymbol_After : aDimensionIO->SetDisplaySpecialSymbol( isUnitsShown ? PrsDim_DisplaySpecialSymbol_After :
PrsDim_DisplaySpecialSymbol_No ); PrsDim_DisplaySpecialSymbol_No );
#else #else
@ -654,7 +647,7 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension()
} }
else else
{ {
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
aDimensionIO->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No); aDimensionIO->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No);
#else #else
aDimensionIO->SetDisplaySpecialSymbol(AIS_DSS_No); aDimensionIO->SetDisplaySpecialSymbol(AIS_DSS_No);

View File

@ -159,7 +159,7 @@ MeasureGUI_DimensionInteractor::Operation
return Operation_None; return Operation_None;
} }
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
Handle(PrsDim_DimensionOwner) anOwner = Handle(PrsDim_DimensionOwner)::DownCast( theEntity ); Handle(PrsDim_DimensionOwner) anOwner = Handle(PrsDim_DimensionOwner)::DownCast( theEntity );
#else #else
Handle(AIS_DimensionOwner) anOwner = Handle(AIS_DimensionOwner)::DownCast( theEntity ); Handle(AIS_DimensionOwner) anOwner = Handle(AIS_DimensionOwner)::DownCast( theEntity );
@ -173,7 +173,7 @@ MeasureGUI_DimensionInteractor::Operation
switch ( anOwner->SelectionMode() ) switch ( anOwner->SelectionMode() )
{ {
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
case PrsDim_DimensionSelectionMode_Line : case PrsDim_DimensionSelectionMode_Line :
#else #else
case AIS_DSM_Line : case AIS_DSM_Line :
@ -194,7 +194,7 @@ MeasureGUI_DimensionInteractor::Operation
return Operation_MoveFlyoutFree; return Operation_MoveFlyoutFree;
} }
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
case PrsDim_DimensionSelectionMode_Text : return Operation_MoveText; case PrsDim_DimensionSelectionMode_Text : return Operation_MoveText;
#else #else
case AIS_DSM_Text : return Operation_MoveText; case AIS_DSM_Text : return Operation_MoveText;

View File

@ -198,9 +198,6 @@ 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 );
#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 );
@ -267,12 +264,8 @@ void MeasureGUI_ManageDimensionsDlg::StopSelection()
* ------------------------------------------------ */ * ------------------------------------------------ */
Handle(AIS_InteractiveContext) anAISContext = myOperatedViewer->getAISContext(); Handle(AIS_InteractiveContext) anAISContext = myOperatedViewer->getAISContext();
#if OCC_VERSION_LARGE <= 0x07030000
anAISContext->CloseLocalContext();
#else
anAISContext->Deactivate(); anAISContext->Deactivate();
anAISContext->Activate(0); anAISContext->Activate(0);
#endif
LightApp_SelectionMgr* aSelectionMgr = myGeomGUI->getApp()->selectionMgr(); LightApp_SelectionMgr* aSelectionMgr = myGeomGUI->getApp()->selectionMgr();
@ -365,19 +358,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() )
{
Handle(SelectMgr_EntityOwner) anAISOwner = anAISContext->SelectedOwner();
anAIS = Handle(AIS_InteractiveObject)::DownCast( anAISOwner->Selectable() );
}
else
{
#endif
anAIS = anAISContext->Current(); anAIS = anAISContext->Current();
#if OCC_VERSION_LARGE <= 0x07030000
}
#endif
int aDimensionId = IdFromPrs( anAIS ); int aDimensionId = IdFromPrs( anAIS );
@ -1252,19 +1233,7 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con
{ {
return; return;
} }
#if OCC_VERSION_LARGE <= 0x07030000
Standard_Boolean isLocal = anAISContext->HasOpenedContext();
if ( isLocal )
{
anAISContext->ClearSelected( Standard_False );
}
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;
@ -1276,29 +1245,18 @@ 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 OCC_VERSION_LARGE >= 0x070400ff
if ( isLocal )
{
#endif
#if OCC_VERSION_LARGE > 0x07040000
anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Line ); anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Line );
anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Text ); anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Text );
#else #else
anAISContext->Deactivate( anIO, AIS_DSM_Line ); anAISContext->Deactivate( anIO, AIS_DSM_Line );
anAISContext->Deactivate( anIO, AIS_DSM_Text ); anAISContext->Deactivate( anIO, AIS_DSM_Text );
#endif #endif
}
continue; continue;
#if OCC_VERSION_LARGE <= 0x07030000
} }
if ( isLocal )
{
#endif
anAISContext->AddOrRemoveSelected( anIO, Standard_False ); anAISContext->AddOrRemoveSelected( anIO, Standard_False );
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Line ); anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Line );
anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Text ); anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Text );
#else #else
@ -1306,16 +1264,7 @@ void MeasureGUI_ManageDimensionsDlg::SelectInViewer( SOCC_Viewer* theViewer, con
anAISContext->Activate( anIO, AIS_DSM_Text ); anAISContext->Activate( anIO, AIS_DSM_Text );
#endif #endif
#if OCC_VERSION_LARGE <= 0x07030000
}
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,7 +70,7 @@
#include <V3d_View.hxx> #include <V3d_View.hxx>
#include <Basics_OCCTVersion.hxx> #include <Basics_OCCTVersion.hxx>
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
#include <Graphic3d_Text.hxx> #include <Graphic3d_Text.hxx>
#else #else
#include <StdSelect_DisplayMode.hxx> #include <StdSelect_DisplayMode.hxx>
@ -372,11 +372,7 @@ 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() if ( anIC.IsNull() )
#if OCC_VERSION_LARGE <= 0x07030000
|| !anIC->HasOpenedContext()
#endif
)
return; return;
Standard_Boolean isAutoHilight = anIC->AutomaticHilight(); Standard_Boolean isAutoHilight = anIC->AutomaticHilight();
@ -603,7 +599,7 @@ void GEOM_AISShape::drawField( const Handle(Prs3d_Presentation)& thePrs,
anAspectText3d->SetColor( myLabelColor ); anAspectText3d->SetColor( myLabelColor );
aGroup->SetPrimitivesAspect( anAspectText3d ); aGroup->SetPrimitivesAspect( anAspectText3d );
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
Handle(Graphic3d_Text) aText = new Graphic3d_Text (14.); Handle(Graphic3d_Text) aText = new Graphic3d_Text (14.);
aText->SetText (aString.toUtf8().constData()); aText->SetText (aString.toUtf8().constData());
aText->SetPosition (aCenter); aText->SetPosition (aCenter);
@ -678,7 +674,7 @@ void GEOM_AISShape::drawName( const Handle(Prs3d_Presentation)& thePrs )
aGroup->SetPrimitivesAspect( anAspectText3d ); aGroup->SetPrimitivesAspect( anAspectText3d );
const char* aName = getIO()->getName(); const char* aName = getIO()->getName();
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
Handle(Graphic3d_Text) aText = new Graphic3d_Text (16.); Handle(Graphic3d_Text) aText = new Graphic3d_Text (16.);
aText->SetText (aName); aText->SetText (aName);
aText->SetPosition (aCenter); aText->SetPosition (aCenter);

View File

@ -538,7 +538,7 @@ Bnd_Box GEOM_Annotation::TextBoundingBox() const
{ {
Handle(Prs3d_TextAspect) anAsp = myDrawer->TextAspect(); Handle(Prs3d_TextAspect) anAsp = myDrawer->TextAspect();
Font_FTFont aFont; Font_FTFont aFont;
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400FF
Font_FTFontParams aFontParams; Font_FTFontParams aFontParams;
aFontParams.PointSize = (unsigned int)anAsp->Height(); aFontParams.PointSize = (unsigned int)anAsp->Height();
aFontParams.Resolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution; aFontParams.Resolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution;
@ -708,11 +708,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
const unsigned int aDPI = theWorkspace->View()->RenderingParams().Resolution; const unsigned int aDPI = theWorkspace->View()->RenderingParams().Resolution;
if (myTextDPI != aDPI) if (myTextDPI != aDPI)
{ {
#if OCC_VERSION_LARGE <= 0x07030000
const OpenGl_AspectText* anAspect = theWorkspace->AspectText();
#else
const OpenGl_Aspects* anAspect = theWorkspace->Aspects(); const OpenGl_Aspects* anAspect = theWorkspace->Aspects();
#endif
// getting string size will also initialize font library // getting string size will also initialize font library
#if OCC_VERSION_LARGE >= 0x07040000 #if OCC_VERSION_LARGE >= 0x07040000
@ -790,11 +786,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
{ {
Handle(Graphic3d_PresentationAttributes) empty; Handle(Graphic3d_PresentationAttributes) empty;
theWorkspace->SetHighlightStyle(empty); theWorkspace->SetHighlightStyle(empty);
#if OCC_VERSION_LARGE <= 0x07030000
theWorkspace->ApplyAspectLine();
#else
theWorkspace->ApplyAspects(); theWorkspace->ApplyAspects();
#endif
} }
GLint myOldDepthMode = 0; GLint myOldDepthMode = 0;

View File

@ -274,7 +274,7 @@ private:
virtual void ComputeSelection( const Handle(SelectMgr_Selection)& theSelection, virtual void ComputeSelection( const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode ) Standard_OVERRIDE; const Standard_Integer theMode ) Standard_OVERRIDE;
#if OCC_VERSION_LARGE > 0x07040000 #if OCC_VERSION_LARGE >= 0x070400ff
virtual void setLocalTransformation( const Handle(TopLoc_Datum3D)& /*theTransformation*/ ) Standard_OVERRIDE {} virtual void setLocalTransformation( const Handle(TopLoc_Datum3D)& /*theTransformation*/ ) Standard_OVERRIDE {}
#else #else
virtual void setLocalTransformation( const Handle(Geom_Transformation)& /*theTransformation*/ ) Standard_OVERRIDE {} virtual void setLocalTransformation( const Handle(Geom_Transformation)& /*theTransformation*/ ) Standard_OVERRIDE {}
@ -415,11 +415,7 @@ 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() );
#else
thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter(), thePickResult.PickedPoint() ); thePickResult = SelectBasics_PickResult( -DBL_MAX, thePickResult.DistToGeomCenter(), thePickResult.PickedPoint() );
#endif
} }
return isMatches; return isMatches;
} }