}
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)
}
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)
// 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>
//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
// 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
}
}
// 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"
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 );
#include <TColStd_IndexedMapOfInteger.hxx>
#include <NCollection_DataMap.hxx>
+#include <Basics_OCCTVersion.hxx>
//================================================================
// Function : GEOMGUI_OCCSelector
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);
aList.append(SUIT_DataOwnerPtr(owner));
}
}
+#if OCC_VERSION_LARGE <= 0x07030000
}
else
{
}
}
}
+#endif
// add externally selected objects
SUIT_DataOwnerPtrList::const_iterator anExtIter;
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 );
}
#include <vtkActorCollection.h>
#include <vtkProperty.h>
+#include <Basics_OCCTVersion.hxx>
// CORBA Headers
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
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
}
}
}
#include <Material_ResourceMgr.h>
#include <Material_Model.h>
+#include <Basics_OCCTVersion.hxx>
+
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
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 );
#include <StdFail_NotDone.hxx>
+#include <Basics_OCCTVersion.hxx>
+
//=======================================================================
//function : GetID
//purpose :
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 <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;
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;
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);
}
}
}
#include <SALOMEDS_wrap.hxx>
#include <GEOMImpl_Types.hxx>
+#include <Basics_OCCTVersion.hxx>
+
#ifdef max
#undef max
#endif
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 )
#include <Aspect_PolygonOffsetMode.hxx>
+#include <Basics_OCCTVersion.hxx>
+
//=================================================================================
// function : Constructor
// purpose :
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 );
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;
}
#include <QHBoxLayout>
#include <QPixmap>
+#include <Basics_OCCTVersion.hxx>
+
//=================================================================================
// function : Constructor
// purpose :
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();
}
else
{
+#endif
anAIS = anAISContext->Current();
+#if OCC_VERSION_LARGE <= 0x07030000
}
+#endif
int aDimensionId = IdFromPrs( anAIS );
{
return;
}
-
+#if OCC_VERSION_LARGE <= 0x07030000
Standard_Boolean isLocal = anAISContext->HasOpenedContext();
if ( isLocal )
{
}
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;
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();
}
#include <Prs3d_VertexDrawMode.hxx>
#include <StdPrs_WFShape.hxx>
+#include <Basics_OCCTVersion.hxx>
+
#include <SalomeApp_Tools.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
{
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();
#include <StdSelect_Shape.hxx>
#include <TCollection_ExtendedString.hxx>
+#include <Basics_OCCTVersion.hxx>
+
class OpenGl_GraphicDriver;
class OpenGl_PrimitiveArray;
class OpenGl_Text;
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;
}