#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>
#include <Geom_Line.hxx>
//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
}
//=======================================================================
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
+ theContext->ClearCurrents( false );
// load the curve AIS object to the local context with the point selection
Handle(AIS_InteractiveObject) anAIS = theCurve->getAISObject();
if ( !anAIS.IsNull() )
}
}
else {
-#if OCC_VERSION_LARGE <= 0x07030000
- if ( theContext->HasOpenedContext() )
- theContext->CloseAllContexts( Standard_True );
-#else
theContext->Deactivate();
theContext->Activate(0);
-#endif
}
}
if ( myDragStarted )
return;
Handle(AIS_InteractiveContext) aContext = getAISContext();
- if ( aContext.IsNull()
-#if OCC_VERSION_LARGE <= 0x07030000
- || !aContext->HasOpenedContext()
-#endif
- )
+ if ( aContext.IsNull() )
return;
CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );
myResult=aCmp;
//
if (aMS.Extent()) {
-#if OCC_VERSION_LARGE > 0x07020001
TopTools_IndexedMapOfShape aMapToAvoid;
BOPTools_AlgoTools::CorrectCurveOnSurface(myResult, aMapToAvoid, 0.0001);
-#else
- BOPTools_AlgoTools::CorrectCurveOnSurface(myResult, 0.0001);
-#endif
}
}
//=======================================================================
// function : Length::Init
// 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 )
#else
void GEOMGUI_DimensionProperty::Length::Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS )
// function : Length::Update
// purpose :
//=================================================================================
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
void GEOMGUI_DimensionProperty::Length::Update( Handle(PrsDim_LengthDimension)& theIO, const gp_Ax3& theLCS )
#else
void GEOMGUI_DimensionProperty::Length::Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS )
{
case DimensionType_Length :
{
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
Handle(PrsDim_LengthDimension) aLength =
Handle(PrsDim_LengthDimension)::DownCast( theIO );
#else
{
case DimensionType_Length :
{
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
Handle(PrsDim_LengthDimension) aLength =
Handle(PrsDim_LengthDimension)::DownCast( theIO );
#else
//=================================================================================
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 ) ) )
#else
if ( theIO->IsKind( STANDARD_TYPE( AIS_LengthDimension ) ) )
// OCCT includes
#include <AIS_Dimension.hxx>
#include <AIS_DiameterDimension.hxx>
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
#include <PrsDim_LengthDimension.hxx>
#else
#include <AIS_LengthDimension.hxx>
* \param theIO [in] the interactive presentation.
* \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 );
#else
void Init( const Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS );
* \param theIO [in/out] the interactive presentation.
* \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 );
#else
void Update( Handle(AIS_LengthDimension)& theIO, const gp_Ax3& theLCS );
return;
Handle(AIS_InteractiveContext) ic = vw->getAISContext();
-#if OCC_VERSION_LARGE <= 0x07030000
- if (ic->HasOpenedContext())
- {
-#endif
- TopoDS_Shape curBigShape;
- TopTools_IndexedMapOfShape subShapes;
+ TopoDS_Shape curBigShape;
+ TopTools_IndexedMapOfShape subShapes;
for (ic->InitSelected(); ic->MoreSelected(); ic->NextSelected())
{
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
SUIT_DataOwnerPtrList::const_iterator anExtIter;
#include <TColStd_HArray1OfByte.hxx>
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
#include <Image_SupportedFormats.hxx>
#endif
const Handle(Graphic3d_TextureMap)& aTexture = aAISShape->Attributes()->ShadingAspect()->Aspect()->TextureMap();
if ( aTexture.IsNull() )
continue;
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
Handle(Image_SupportedFormats) aFormats = new Image_SupportedFormats();
const Handle(Image_PixMap)& aPixmap = aTexture->GetImage(aFormats);
#else
if ( aUnitsAngle == "deg" )
{
aPrs->SetSpecialSymbol(0xB0);
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
aPrs->SetDisplaySpecialSymbol( isUnitsShown ? PrsDim_DisplaySpecialSymbol_After :
PrsDim_DisplaySpecialSymbol_No );
#else
}
else
{
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
aPrs->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No);
#else
aPrs->SetDisplaySpecialSymbol(AIS_DSS_No);
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
}
}
}
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 );
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) {
#include <gce_MakePln.hxx>
#include <Precision.hxx>
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
#include <PrsDim.hxx>
#else
#include <AIS.hxx>
Handle(Geom_Curve) extCurv;
Standard_Integer extShape;
Handle(Geom_Plane) aPlane;
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
if (PrsDim::ComputeGeometry (anEdge1, anEdge2,
#else
if (AIS::ComputeGeometry (anEdge1, anEdge2,
anIO->SetDimensionAspect( aDimensionStyle );
anIO->SetDisplayUnits( aUnitsAngle.toUtf8().data() );
if (aUnitsAngle == "rad")
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
anIO->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No);
#else
anIO->SetDisplaySpecialSymbol(AIS_DSS_No);
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();
+ aSelector = anAISContext->MainSelector();
if ( aSelector->NbPicked() < 1 )
return false;
Handle(V3d_Viewer) aViewer3d = myEditingViewer->getViewer3d();
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->SetZLayer( myDimension, myEditingLayer );
anAISContext->Activate( myDimension, PrsDim_DimensionSelectionMode_Line );
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;
}
if ( aUnitsAngle == "deg" )
{
aDimensionIO->SetSpecialSymbol(0xB0);
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
aDimensionIO->SetDisplaySpecialSymbol( isUnitsShown ? PrsDim_DisplaySpecialSymbol_After :
PrsDim_DisplaySpecialSymbol_No );
#else
}
else
{
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
aDimensionIO->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No);
#else
aDimensionIO->SetDisplaySpecialSymbol(AIS_DSS_No);
return Operation_None;
}
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
Handle(PrsDim_DimensionOwner) anOwner = Handle(PrsDim_DimensionOwner)::DownCast( theEntity );
#else
Handle(AIS_DimensionOwner) anOwner = Handle(AIS_DimensionOwner)::DownCast( theEntity );
switch ( anOwner->SelectionMode() )
{
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
case PrsDim_DimensionSelectionMode_Line :
#else
case AIS_DSM_Line :
return Operation_MoveFlyoutFree;
}
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
case PrsDim_DimensionSelectionMode_Text : return Operation_MoveText;
#else
case AIS_DSM_Text : return Operation_MoveText;
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 );
* ------------------------------------------------ */
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();
anAISContext->InitSelected();
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();
-#if OCC_VERSION_LARGE <= 0x07030000
- }
-#endif
+ anAIS = anAISContext->Current();
int aDimensionId = IdFromPrs( anAIS );
{
return;
}
-#if OCC_VERSION_LARGE <= 0x07030000
- Standard_Boolean isLocal = anAISContext->HasOpenedContext();
- if ( isLocal )
- {
- anAISContext->ClearSelected( Standard_False );
- }
- else
- {
-#endif
- anAISContext->ClearCurrents( Standard_False );
-#if OCC_VERSION_LARGE <= 0x07030000
- }
-#endif
+ anAISContext->ClearCurrents( Standard_False );
SOCC_Prs* aPrs = dynamic_cast<SOCC_Prs*>( theViewer->CreatePrs( myEditObject->GetStudyEntry() ) );
AIS_ListOfInteractive aListOfIO;
const Handle(AIS_InteractiveObject)& anIO = anIt.Value();
if ( IdFromPrs( anIO ) != theId )
{
-#if OCC_VERSION_LARGE <= 0x07030000
- if ( isLocal )
- {
-#endif
-
-#if OCC_VERSION_LARGE > 0x07040000
- anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Line );
- anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Text );
+#if OCC_VERSION_LARGE >= 0x070400ff
+ anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Line );
+ anAISContext->Deactivate( anIO, PrsDim_DimensionSelectionMode_Text );
#else
- anAISContext->Deactivate( anIO, AIS_DSM_Line );
- anAISContext->Deactivate( anIO, AIS_DSM_Text );
+ anAISContext->Deactivate( anIO, AIS_DSM_Line );
+ anAISContext->Deactivate( anIO, AIS_DSM_Text );
#endif
- }
continue;
-#if OCC_VERSION_LARGE <= 0x07030000
}
+ anAISContext->AddOrRemoveSelected( anIO, Standard_False );
- if ( isLocal )
- {
-#endif
- anAISContext->AddOrRemoveSelected( anIO, Standard_False );
-
-#if OCC_VERSION_LARGE > 0x07040000
- anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Line );
- anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Text );
+#if OCC_VERSION_LARGE >= 0x070400ff
+ anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Line );
+ anAISContext->Activate( anIO, PrsDim_DimensionSelectionMode_Text );
#else
- anAISContext->Activate( anIO, AIS_DSM_Line );
- anAISContext->Activate( anIO, AIS_DSM_Text );
-#endif
-
-#if OCC_VERSION_LARGE <= 0x07030000
- }
- else
- {
-#endif
- anAISContext->AddOrRemoveCurrentObject( anIO, Standard_False );
-#if OCC_VERSION_LARGE <= 0x07030000
- }
+ anAISContext->Activate( anIO, AIS_DSM_Line );
+ anAISContext->Activate( anIO, AIS_DSM_Text );
#endif
+ anAISContext->AddOrRemoveCurrentObject( anIO, Standard_False );
anAISContext->UpdateCurrentViewer();
}
}
#include <V3d_View.hxx>
#include <Basics_OCCTVersion.hxx>
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
#include <Graphic3d_Text.hxx>
#else
#include <StdSelect_DisplayMode.hxx>
{
Handle(AIS_InteractiveObject) anObj = this;
Handle(AIS_InteractiveContext) anIC = GetContext();
- if ( anIC.IsNull()
-#if OCC_VERSION_LARGE <= 0x07030000
- || !anIC->HasOpenedContext()
-#endif
- )
+ if ( anIC.IsNull() )
return;
Standard_Boolean isAutoHilight = anIC->AutomaticHilight();
anAspectText3d->SetColor( myLabelColor );
aGroup->SetPrimitivesAspect( anAspectText3d );
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
Handle(Graphic3d_Text) aText = new Graphic3d_Text (14.);
aText->SetText (aString.toUtf8().constData());
aText->SetPosition (aCenter);
aGroup->SetPrimitivesAspect( anAspectText3d );
const char* aName = getIO()->getName();
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400ff
Handle(Graphic3d_Text) aText = new Graphic3d_Text (16.);
aText->SetText (aName);
aText->SetPosition (aCenter);
{
Handle(Prs3d_TextAspect) anAsp = myDrawer->TextAspect();
Font_FTFont aFont;
-#if OCC_VERSION_LARGE > 0x07040000
+#if OCC_VERSION_LARGE >= 0x070400FF
Font_FTFontParams aFontParams;
aFontParams.PointSize = (unsigned int)anAsp->Height();
aFontParams.Resolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution;
const unsigned int aDPI = theWorkspace->View()->RenderingParams().Resolution;
if (myTextDPI != aDPI)
{
-#if OCC_VERSION_LARGE <= 0x07030000
- const OpenGl_AspectText* anAspect = theWorkspace->AspectText();
-#else
const OpenGl_Aspects* anAspect = theWorkspace->Aspects();
-#endif
// getting string size will also initialize font library
#if OCC_VERSION_LARGE >= 0x07040000
{
Handle(Graphic3d_PresentationAttributes) empty;
theWorkspace->SetHighlightStyle(empty);
-#if OCC_VERSION_LARGE <= 0x07030000
- theWorkspace->ApplyAspectLine();
-#else
theWorkspace->ApplyAspects();
-#endif
}
GLint myOldDepthMode = 0;
virtual void ComputeSelection( const Handle(SelectMgr_Selection)& theSelection,
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 {}
#else
virtual void setLocalTransformation( const Handle(Geom_Transformation)& /*theTransformation*/ ) Standard_OVERRIDE {}
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;
}