From: mpa Date: Mon, 10 Oct 2016 14:09:43 +0000 (+0300) Subject: - delete dependency from study id X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmpa%2F23299_rebase;p=modules%2Fgeom.git - delete dependency from study id --- diff --git a/resources/GEOMCatalog.xml.in b/resources/GEOMCatalog.xml.in index e45d62e9e..dc67e1478 100644 --- a/resources/GEOMCatalog.xml.in +++ b/resources/GEOMCatalog.xml.in @@ -214,11 +214,6 @@ unknown 0 - - theStudy - Study - unknown - theObject GEOM/GEOM_BaseObject @@ -251,11 +246,6 @@ unknown 0 - - theStudy - Study - unknown - theObject GEOM/GEOM_Object @@ -298,11 +288,6 @@ unknown 0 - - theStudy - Study - unknown - theObject GEOM/GEOM_Object @@ -345,11 +330,6 @@ unknown 0 - - theStudy - Study - unknown - theSObject SObject @@ -730,13 +710,7 @@ @SALOMEGEOM_VERSION@ unknown 0 - - - theStudyEntry - string - unknown - - + return @@ -769,11 +743,6 @@ unknown 0 - - theStudy - Study - unknown - theObject CORBA/Object diff --git a/src/AdvancedEngine/AdvancedEngine_IOperations.cxx b/src/AdvancedEngine/AdvancedEngine_IOperations.cxx index 88bd4a37f..2ae8db0ba 100644 --- a/src/AdvancedEngine/AdvancedEngine_IOperations.cxx +++ b/src/AdvancedEngine/AdvancedEngine_IOperations.cxx @@ -118,19 +118,19 @@ * Constructor */ //============================================================================= -AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID) : - GEOM_IOperations(theEngine, theDocID) +AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine) : + GEOM_IOperations(theEngine) { MESSAGE("AdvancedEngine_IOperations::AdvancedEngine_IOperations"); - myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID()); - myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine(), GetDocID()); - myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID()); - myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine(), GetDocID()); - myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID()); - my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID()); - myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID()); - myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID()); - myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID()); + myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine()); + myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine()); + myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine()); + myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine()); + myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine()); + my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine()); + myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine()); + myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine()); + myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine()); } //============================================================================= @@ -1076,7 +1076,7 @@ bool AdvancedEngine_IOperations::MakeInternalGroup // Get faces that are laying on conical faces. if (aConicalFaces.IsEmpty() == Standard_False) { Handle(GEOM_Object) aCone = - GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + GetEngine()->AddObject(GEOM_TSHAPE); Handle(GEOM_Function) aFunction = aCone->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC); TopTools_ListIteratorOfListOfShape aFIter(aConicalFaces); @@ -1915,7 +1915,7 @@ Handle(TColStd_HSequenceOfTransient) MESSAGE("AdvancedEngine_IOperations::MakePipeTShape"); SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC); @@ -2070,7 +2070,7 @@ AdvancedEngine_IOperations::MakePipeTShapeWithPosition { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); ///////////////// // TSHAPE CODE ///////////////// @@ -2238,7 +2238,7 @@ AdvancedEngine_IOperations::MakePipeTShapeChamfer { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER); if (aFunction.IsNull()) return NULL; @@ -2468,7 +2468,7 @@ AdvancedEngine_IOperations::MakePipeTShapeChamferWithPosition { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER); if (aFunction.IsNull()) return NULL; @@ -2699,7 +2699,7 @@ AdvancedEngine_IOperations::MakePipeTShapeFillet { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_FILLET); if (aFunction.IsNull()) return NULL; @@ -2951,7 +2951,7 @@ AdvancedEngine_IOperations::MakePipeTShapeFilletWithPosition { SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_FILLET); if (aFunction.IsNull()) return NULL; @@ -3202,7 +3202,7 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDisk (double theR, do return NULL; } //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDDISK); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_RATIO); @@ -3270,7 +3270,7 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDiskPntVecR (Handle(G SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDDISK); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_VECTOR_PNT); @@ -3343,7 +3343,7 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedCylinder (double theR SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDCYLINDER); Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 67.0, 1, thePattern); aBaseShape->GetLastFunction()->SetDescription(""); // Erase dump of MakeDividedDisk @@ -3391,7 +3391,7 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeSmoothingSurface (std::list< SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_SMOOTHINGSURFACE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_SMOOTHINGSURFACE); //Add a new shape function with parameters Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_SmoothingSurfaceDriver::GetID(), SMOOTHINGSURFACE_LPOINTS); diff --git a/src/AdvancedEngine/AdvancedEngine_IOperations.hxx b/src/AdvancedEngine/AdvancedEngine_IOperations.hxx index 8a28dded3..58c3a269e 100644 --- a/src/AdvancedEngine/AdvancedEngine_IOperations.hxx +++ b/src/AdvancedEngine/AdvancedEngine_IOperations.hxx @@ -165,7 +165,7 @@ public: bool fuse); public: - AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID); + AdvancedEngine_IOperations(GEOM_Engine* theEngine); ~AdvancedEngine_IOperations(); Handle(TColStd_HSequenceOfTransient) diff --git a/src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx b/src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx index f1c5e1a39..40c79e210 100644 --- a/src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx +++ b/src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx @@ -56,11 +56,12 @@ GEOM_IOperations_i* AdvancedEngine_OperationsCreator::Create (PortableServer::PO { Unexpect aCatch(SALOME_SalomeException); MESSAGE( "AdvancedEngine_OperationsCreator::Create" ); - _operation = new AdvancedEngine_IOperations( theGenImpl ); - return new AdvancedEngine_IOperations_i( thePOA, theEngine, _operation ); + return new AdvancedEngine_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get() +AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { + if( !_operation ) + _operation = new AdvancedEngine_IOperations( theGenImpl ); return _operation; } diff --git a/src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx b/src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx index 5971fb086..b1b3b3c04 100755 --- a/src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx +++ b/src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx @@ -45,9 +45,9 @@ public: ::GEOMImpl_Gen* theGenImpl); private: - static AdvancedEngine_IOperations* get(); + static AdvancedEngine_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - static AdvancedEngine_IOperations*_operation; + static AdvancedEngine_IOperations* _operation; }; #endif diff --git a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx index 4008b5736..5216a5b1f 100644 --- a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx @@ -1217,8 +1217,7 @@ bool AdvancedGUI_PipeTShapeDlg::executeNoCheck (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { SALOMEDS::GenericAttribute_var anAttr; if (!theSObject->FindAttribute(anAttr, "AttributeIOR")) @@ -1236,7 +1235,7 @@ void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, ObjectList::iterator it = pipeTShapeGroupObjects.begin(); for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) { - getGeomEngine()->AddInStudy(theStudy, (*it), tr((*it)->GetName()).toStdString().c_str(), theFather); + getGeomEngine()->AddInStudy((*it), tr((*it)->GetName()).toStdString().c_str(), theFather); } } diff --git a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h index ad188a489..7518c36fd 100644 --- a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h +++ b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h @@ -78,7 +78,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes (SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/BREPPlugin/BREPPlugin_GUI.cxx b/src/BREPPlugin/BREPPlugin_GUI.cxx index f47b3bd7c..3d28b8177 100644 --- a/src/BREPPlugin/BREPPlugin_GUI.cxx +++ b/src/BREPPlugin/BREPPlugin_GUI.cxx @@ -143,7 +143,7 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent ) entryList.append( so->GetID() ); transaction.commit(); - GEOM_Displayer( study ).Display( main.in() ); + GEOM_Displayer().Display( main.in() ); main->UnRegister(); } else diff --git a/src/BREPPlugin/BREPPlugin_IECallBack.cxx b/src/BREPPlugin/BREPPlugin_IECallBack.cxx index dd8c27197..0d5461955 100755 --- a/src/BREPPlugin/BREPPlugin_IECallBack.cxx +++ b/src/BREPPlugin/BREPPlugin_IECallBack.cxx @@ -46,12 +46,11 @@ BREPPlugin_IECallBack::~BREPPlugin_IECallBack() */ //============================================================================= bool -BREPPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +BREPPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine() ); aPluginOperations->ExportBREP( theOriginal, theFileName ); return true; } @@ -62,11 +61,10 @@ BREPPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -BREPPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +BREPPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine() ); return aPluginOperations->ImportBREP( theFileName ); } diff --git a/src/BREPPlugin/BREPPlugin_IECallBack.hxx b/src/BREPPlugin/BREPPlugin_IECallBack.hxx index a718d0f8b..9d59d79bc 100644 --- a/src/BREPPlugin/BREPPlugin_IECallBack.hxx +++ b/src/BREPPlugin/BREPPlugin_IECallBack.hxx @@ -36,14 +36,12 @@ public: BREPPlugin_IECallBack(); ~BREPPlugin_IECallBack(); - bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ); + bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ); - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); }; #endif diff --git a/src/BREPPlugin/BREPPlugin_IOperations.cxx b/src/BREPPlugin/BREPPlugin_IOperations.cxx index 43f72dac5..3ed5736f6 100644 --- a/src/BREPPlugin/BREPPlugin_IOperations.cxx +++ b/src/BREPPlugin/BREPPlugin_IOperations.cxx @@ -38,8 +38,8 @@ * Constructor */ //============================================================================= -BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "BREPPlugin_IOperations::BREPPlugin_IOperations" ); } @@ -74,7 +74,7 @@ void BREPPlugin_IOperations::ExportBREP( const Handle(GEOM_Object) theOrigi if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( BREPPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); @@ -124,7 +124,7 @@ BREPPlugin_IOperations::ImportBREP( const TCollection_AsciiString& theFileName ) if( theFileName.IsEmpty() ) return NULL; //Add a new result object - Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT ); + Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT ); //Add an Import function Handle(GEOM_Function) aFunction = diff --git a/src/BREPPlugin/BREPPlugin_IOperations.hxx b/src/BREPPlugin/BREPPlugin_IOperations.hxx index d2eaebd50..831b1c792 100644 --- a/src/BREPPlugin/BREPPlugin_IOperations.hxx +++ b/src/BREPPlugin/BREPPlugin_IOperations.hxx @@ -30,7 +30,7 @@ class BREPPLUGINENGINE_EXPORT BREPPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - BREPPlugin_IOperations( GEOM_Engine*, int ); + BREPPlugin_IOperations( GEOM_Engine* ); ~BREPPlugin_IOperations(); void ExportBREP( const Handle(GEOM_Object), diff --git a/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx b/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx index 84c05014c..f1b96159b 100644 --- a/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx +++ b/src/BREPPlugin/BREPPlugin_OperationsCreator.cxx @@ -56,11 +56,12 @@ GEOM_IOperations_i* BREPPlugin_OperationsCreator::Create( PortableServer::POA_pt { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "BREPPlugin_OperationsCreator::Create" ); - _operation = new BREPPlugin_IOperations( theGenImpl ); - return new BREPPlugin_IOperations_i( thePOA, theEngine, _operation ); + return new BREPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get() +BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { + if( !_operation ) + _operation = new BREPPlugin_IOperations( theGenImpl ); return _operation; } diff --git a/src/BREPPlugin/BREPPlugin_OperationsCreator.hxx b/src/BREPPlugin/BREPPlugin_OperationsCreator.hxx index c0997b516..e49c6cb53 100755 --- a/src/BREPPlugin/BREPPlugin_OperationsCreator.hxx +++ b/src/BREPPlugin/BREPPlugin_OperationsCreator.hxx @@ -44,10 +44,10 @@ public: GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ); private: - static BREPPlugin_IOperations* get(); + static BREPPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - static BREPPlugin_IOperations* _operation; + static BREPPlugin_IOperations* _operation; friend class BREPPlugin_IECallBack; }; diff --git a/src/BooleanGUI/BooleanGUI_Dialog.cxx b/src/BooleanGUI/BooleanGUI_Dialog.cxx index e148cc3aa..c2d1d97da 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.cxx +++ b/src/BooleanGUI/BooleanGUI_Dialog.cxx @@ -457,12 +457,11 @@ bool BooleanGUI_Dialog::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame /*theInheritFirstArg=*/myOperation == BooleanGUI::CUT, mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false diff --git a/src/BooleanGUI/BooleanGUI_Dialog.h b/src/BooleanGUI/BooleanGUI_Dialog.h index e2f535595..a009ddecb 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.h +++ b/src/BooleanGUI/BooleanGUI_Dialog.h @@ -50,7 +50,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual void addSubshapesToStudy(); virtual QList getSourceObjects(); diff --git a/src/BuildGUI/BuildGUI_CompoundDlg.cxx b/src/BuildGUI/BuildGUI_CompoundDlg.cxx index 7cf57c914..f64a92bf7 100644 --- a/src/BuildGUI/BuildGUI_CompoundDlg.cxx +++ b/src/BuildGUI/BuildGUI_CompoundDlg.cxx @@ -244,12 +244,11 @@ bool BuildGUI_CompoundDlg::execute( ObjectList& objects ) // function : restoreSubShapes // purpose : //================================================================================= -void BuildGUI_CompoundDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void BuildGUI_CompoundDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject ) { if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame /*theInheritFirstArg=*/false, mainFrame()->CheckBoxAddPrefix->isChecked() ); diff --git a/src/BuildGUI/BuildGUI_CompoundDlg.h b/src/BuildGUI/BuildGUI_CompoundDlg.h index 280737050..75737c1ad 100644 --- a/src/BuildGUI/BuildGUI_CompoundDlg.h +++ b/src/BuildGUI/BuildGUI_CompoundDlg.h @@ -49,7 +49,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/DependencyTree/DependencyTree_ViewModel.cxx b/src/DependencyTree/DependencyTree_ViewModel.cxx index 1b3d58c3f..aae7fe5fb 100644 --- a/src/DependencyTree/DependencyTree_ViewModel.cxx +++ b/src/DependencyTree/DependencyTree_ViewModel.cxx @@ -66,8 +66,7 @@ void DependencyTree_ViewModel::onShowSelected() SALOME_ListIO aSelList; aSelMgr->selectedObjects(aSelList); - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - GEOM_Displayer disp( appStudy ); + GEOM_Displayer disp; OCCViewer_ViewManager* anOCCVM = ( OCCViewer_ViewManager* ) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true ); @@ -96,8 +95,7 @@ void DependencyTree_ViewModel::onShowOnlySelected() SALOME_ListIO aSelList; aSelMgr->selectedObjects( aSelList ); - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - GEOM_Displayer disp( appStudy ); + GEOM_Displayer disp; OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true ); diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index f1c83f1fb..0552e3588 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -87,9 +87,6 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) SalomeApp_Application* app = getGeometryGUI()->getApp(); if (!app) return false; - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if ( !appStudy ) return false; - LightApp_SelectionMgr *Sel = app->selectionMgr(); SALOME_ListIO selected; Sel->selectedObjects( selected ); @@ -173,7 +170,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) break; } Sel->setSelectedObjects( selected ); - GEOM_Displayer( appStudy ).UpdateColorScale(); + GEOM_Displayer().UpdateColorScale(); return true; } @@ -210,7 +207,7 @@ void DisplayGUI::DisplayAll() } anIter->Next(); } - GEOM_Displayer( appStudy ).Display( listIO, true ); + GEOM_Displayer().Display( listIO, true ); } //===================================================================================== @@ -225,11 +222,10 @@ void DisplayGUI::EraseAll() if ( app ) { SUIT_ViewWindow* vw = app->desktop()->activeWindow(); if ( vw ) { - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); SUIT_ViewManager* vman = vw->getViewManager(); if ( vman->getType() == OCCViewer_Viewer::Type() || vman->getType() == SVTK_Viewer::Type() ) { - GEOM_Displayer( appStudy ).EraseAll(true); + GEOM_Displayer().EraseAll(true); } } } @@ -258,8 +254,8 @@ void DisplayGUI::DisplayOnlyChildren() SalomeApp_Application* app = getGeometryGUI()->getApp(); if (!app) return; - SalomeApp_Study* anActiveStudy = dynamic_cast(app->activeStudy()); - if (!anActiveStudy) return; + SalomeApp_Study* aStudy = dynamic_cast(app->activeStudy()); + if (!aStudy) return; LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if (!aSelMgr) return; @@ -275,14 +271,14 @@ void DisplayGUI::DisplayOnlyChildren() for (; It.More(); It.Next()) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); if (anIObject->hasEntry()) { - _PTR(SObject) SO (anActiveStudy->studyDS()->FindObjectID(anIObject->getEntry())); + _PTR(SObject) SO (aStudy->studyDS()->FindObjectID(anIObject->getEntry())); if (SO) { _PTR(SComponent) SC (SO->GetFatherComponent()); if (QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str())) { // if component is selected, pass it } else { - _PTR(ChildIterator) anIter (anActiveStudy->studyDS()->NewChildIterator(SO)); + _PTR(ChildIterator) anIter (aStudy->studyDS()->NewChildIterator(SO)); anIter->InitEx(true); while (anIter->More()) { _PTR(SObject) valSO (anIter->Value()); @@ -298,7 +294,7 @@ void DisplayGUI::DisplayOnlyChildren() } } } - GEOM_Displayer(anActiveStudy).Display(listIO, true); + GEOM_Displayer().Display(listIO, true); } //===================================================================================== @@ -312,8 +308,8 @@ void DisplayGUI::Display() SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; - SalomeApp_Study* anActiveStudy = dynamic_cast( app->activeStudy() ); - if ( !anActiveStudy ) return; + SalomeApp_Study* aStudy = dynamic_cast( app->activeStudy() ); + if ( !aStudy ) return; //get SalomeApp selection manager LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); @@ -328,12 +324,12 @@ void DisplayGUI::Display() for( ;It.More();It.Next() ) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); if ( anIObject->hasEntry() ) { - _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); + _PTR(SObject) SO ( aStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) { _PTR(SComponent) SC ( SO->GetFatherComponent() ); // if component is selected listIO.Clear(); - _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) ); + _PTR(ChildIterator) anIter ( aStudy->studyDS()->NewChildIterator( SO ) ); anIter->InitEx( true ); while( anIter->More() ) { _PTR(SObject) valSO ( anIter->Value() ); @@ -355,7 +351,7 @@ void DisplayGUI::Display() listIO.Append( anIObject ); } } - GEOM_Displayer( anActiveStudy ).Display( listIO, true ); + GEOM_Displayer().Display( listIO, true ); } @@ -370,8 +366,8 @@ void DisplayGUI::Erase() SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return; - SalomeApp_Study* anActiveStudy = dynamic_cast( app->activeStudy() ); - if ( !anActiveStudy ) return; + SalomeApp_Study* aStudy = dynamic_cast( app->activeStudy() ); + if ( !aStudy ) return; //get SalomeApp selection manager LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); @@ -386,12 +382,12 @@ void DisplayGUI::Erase() for( ; It.More(); It.Next() ) { Handle(SALOME_InteractiveObject) anIObject = It.Value(); if ( anIObject->hasEntry() ) { - _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); + _PTR(SObject) SO ( aStudy->studyDS()->FindObjectID( anIObject->getEntry() ) ); if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) { _PTR(SComponent) SC ( SO->GetFatherComponent() ); // if component is selected listIO.Clear(); - _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) ); + _PTR(ChildIterator) anIter ( aStudy->studyDS()->NewChildIterator( SO ) ); anIter->InitEx( true ); while( anIter->More() ) { _PTR(SObject) valSO ( anIter->Value() ); @@ -419,7 +415,7 @@ void DisplayGUI::Erase() if(viewWindow->getViewManager()->getType() == SVTK_Viewer::Type()) aIsForced = false; - GEOM_Displayer(anActiveStudy).Erase( listIO, aIsForced); + GEOM_Displayer().Erase( listIO, aIsForced); getGeometryGUI()->getApp()->selectionMgr()->clearSelected(); } @@ -440,7 +436,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() ); if ( !aStudy ) return; - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; int mgrId = viewWindow->getViewManager()->getGlobalId(); @@ -476,7 +472,7 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow ) if ( !viewWindow ) viewWindow = app->desktop()->activeWindow(); - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; viewWindow->setProperty( "VectorsMode", mode ); @@ -525,7 +521,7 @@ void DisplayGUI::SetVerticesMode( const bool mode, SUIT_ViewWindow* viewWindow ) if ( !viewWindow ) viewWindow = app->desktop()->activeWindow(); - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; viewWindow->setProperty( "VerticesMode", mode ); @@ -576,7 +572,7 @@ void DisplayGUI::SetNameMode( const bool mode, SUIT_ViewWindow* viewWindow ) viewWindow->setProperty( "NameMode", mode ); - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; int aMgrId = viewWindow->getViewManager()->getGlobalId(); @@ -631,7 +627,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; int mgrId = viewWindow->getViewManager()->getGlobalId(); diff --git a/src/GEOM/GEOM_BaseDriver.cxx b/src/GEOM/GEOM_BaseDriver.cxx index 314c65760..731acd999 100644 --- a/src/GEOM/GEOM_BaseDriver.cxx +++ b/src/GEOM/GEOM_BaseDriver.cxx @@ -35,21 +35,6 @@ OCCT_IMPLEMENT_STANDARD_RTTIEXT(GEOM_BaseDriver,TFunction_Driver); -//================================================================================ -/*! - * Returns document id - */ -//================================================================================ -int GEOM_BaseDriver::GetDocID() const -{ - int docId = 0; - if (!Label().IsNull()) { - Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(Label().Data()); - docId = GEOM_Engine::GetEngine()->GetDocID(aDoc); - } - return docId; -} - //================================================================================ /*! * \brief Returns a name of creation operation and names and values of creation parameters diff --git a/src/GEOM/GEOM_BaseDriver.hxx b/src/GEOM/GEOM_BaseDriver.hxx index 61aa70f6a..ea27b5635 100644 --- a/src/GEOM/GEOM_BaseDriver.hxx +++ b/src/GEOM/GEOM_BaseDriver.hxx @@ -76,8 +76,6 @@ struct GEOM_Param class GEOM_BaseDriver : public TFunction_Driver { public: - // Returns document id - Standard_EXPORT int GetDocID() const; // Returns a name of creation operation and names and values of creation parameters // (Use AddParam() methods declared below to fill params vector while implementing diff --git a/src/GEOM/GEOM_BaseObject.cxx b/src/GEOM/GEOM_BaseObject.cxx index 28e98d7ab..3fe3857e1 100644 --- a/src/GEOM/GEOM_BaseObject.cxx +++ b/src/GEOM/GEOM_BaseObject.cxx @@ -85,15 +85,9 @@ Handle(GEOM_BaseObject) GEOM_BaseObject::GetObject(const TDF_Label& theLabel) TCollection_AsciiString anEntry; TDF_Tool::Entry(theLabel, anEntry); - Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(theLabel.Data()); - if(aDoc.IsNull()) return NULL; - - Handle(TDataStd_Integer) anID; - if(!aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) return NULL; - GEOM_Engine* anEngine = GEOM_Engine::GetEngine(); if(anEngine == NULL) return NULL; - return anEngine->GetObject(anID->Get(), anEntry.ToCString()); + return anEngine->GetObject(anEntry.ToCString()); } //============================================================================= @@ -167,14 +161,8 @@ int GEOM_BaseObject::GetType(const TDF_Label& theLabel) */ //============================================================================= GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry) - : _label(theEntry), _ior(""), _docID(-1) + : _label(theEntry), _ior("") { - Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data()); - if(!aDoc.IsNull()) { - Handle(TDataStd_Integer) anID; - if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get(); - } - if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root)) _root = TDataStd_TreeNode::Set(theEntry); } @@ -185,14 +173,8 @@ GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry) */ //============================================================================= GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry, int theType) -: _label(theEntry), _ior(""), _docID(-1) +: _label(theEntry), _ior("") { - Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data()); - if(!aDoc.IsNull()) { - Handle(TDataStd_Integer) anID; - if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get(); - } - theEntry.ForgetAllAttributes(Standard_True); if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root)) @@ -288,17 +270,6 @@ void GEOM_BaseObject::IncrementTic() TDataStd_Integer::Set(aTicLabel, aTic + 1); } - -//============================================================================= -/*! - * GetDocID - */ -//============================================================================= -int GEOM_BaseObject::GetDocID() -{ - return _docID; -} - //============================================================================= /*! * SetName diff --git a/src/GEOM/GEOM_BaseObject.hxx b/src/GEOM/GEOM_BaseObject.hxx index 0c7a65dfc..4c9ed3cf8 100644 --- a/src/GEOM/GEOM_BaseObject.hxx +++ b/src/GEOM/GEOM_BaseObject.hxx @@ -92,9 +92,6 @@ public: Standard_EXPORT void SetTic(int theTic); Standard_EXPORT void IncrementTic(); - //Returns an ID of the OCAF document where this GEOM_BaseObject is stored - Standard_EXPORT int GetDocID(); - //Sets a name of this GEOM_BaseObject Standard_EXPORT void SetName(const char* theName); @@ -163,7 +160,6 @@ public: TDF_Label _label; TCollection_AsciiString _ior; TCollection_AsciiString _parameters; - int _docID; public: OCCT_DEFINE_STANDARD_RTTIEXT(GEOM_BaseObject,Standard_Transient) diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index bfd101415..1386f6c77 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -100,24 +100,9 @@ static GEOM_Engine* TheEngine = NULL; static TCollection_AsciiString BuildIDFromObject(Handle(GEOM_BaseObject)& theObject) { - TCollection_AsciiString anID(theObject->GetDocID()), anEntry; + TCollection_AsciiString anEntry; TDF_Tool::Entry(theObject->GetEntry(), anEntry); - anID+=(TCollection_AsciiString("_")+anEntry); - return anID; -} - -static TCollection_AsciiString BuildID(Standard_Integer theDocID, const char* theEntry) -{ - TCollection_AsciiString anID(theDocID); - anID+=(TCollection_AsciiString("_")+theEntry); - return anID; -} - -static Standard_Integer ExtractDocID(TCollection_AsciiString& theID) -{ - TCollection_AsciiString aDocID = theID.Token("_"); - if(aDocID.Length() < 1) return -1; - return aDocID.IntegerValue(); + return anEntry; } bool ProcessFunction(Handle(GEOM_Function)& theFunction, @@ -146,11 +131,10 @@ void ReplaceEntriesByNames (TCollection_AsciiString& theScript, Standard_Integer& objectCounter, Resource_DataMapOfAsciiStringAsciiString& aNameToEntry); -void AddObjectColors (int theDocID, - TCollection_AsciiString& theScript, +void AddObjectColors (TCollection_AsciiString& theScript, const TSting2ObjDataMap& theEntry2ObjData); -void AddTextures (int theDocID, TCollection_AsciiString& theScript); +void AddTextures (TCollection_AsciiString& theScript); void PublishObject (TObjectData& theObjectData, TSting2ObjDataMap& theEntry2ObjData, @@ -252,14 +236,8 @@ GEOM_Engine::~GEOM_Engine() for(objit = objs.begin(); objit != objs.end(); ++objit) RemoveObject(*objit); - //Close all documents not closed - TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr (_mapIDDocument); - for (; anItr.More(); anItr.Next()) - { - Close(anItr.Key()); - anItr.Initialize( _mapIDDocument ); // anItr becomes invalid at _mapIDDocument.UnBind(docId) - } - _mapIDDocument.Clear(); + //Close document + Close(); _objects.Clear(); } @@ -268,11 +246,11 @@ GEOM_Engine::~GEOM_Engine() * GetDocument */ //============================================================================= -Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force) +Handle(TDocStd_Document) GEOM_Engine::GetDocument(bool force) { Handle(TDocStd_Document) aDoc; - if(_mapIDDocument.IsBound(theDocID)) { - aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID)); + if (_document) { + aDoc = _document; } else if (force) { #if OCC_VERSION_MAJOR > 6 @@ -281,44 +259,26 @@ Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force) _OCAFApp->NewDocument("SALOME_GEOM", aDoc); #endif aDoc->SetUndoLimit(_UndoLimit); - _mapIDDocument.Bind(theDocID, aDoc); - TDataStd_Integer::Set(aDoc->Main(), theDocID); + _document = aDoc; } return aDoc; } -//============================================================================= -/*! - * GetDocID - */ -//============================================================================= -int GEOM_Engine::GetDocID(Handle(TDocStd_Document) theDocument) -{ - if (theDocument.IsNull()) return -1; - TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr (_mapIDDocument); - for (; anItr.More(); anItr.Next()) - if (anItr.Value() == theDocument) return anItr.Key(); - - return -1; -} - //============================================================================= /*! * GetObject */ //============================================================================= -Handle(GEOM_BaseObject) GEOM_Engine::GetObject(int theDocID, const char* theEntry, bool force) +Handle(GEOM_BaseObject) GEOM_Engine::GetObject(const char* theEntry, bool force) { Handle(GEOM_BaseObject) anObject; - TCollection_AsciiString anID = BuildID(theDocID, theEntry); - - if (_objects.IsBound(anID)) { - anObject = Handle(GEOM_BaseObject)::DownCast(_objects(anID)); + if (_objects.IsBound(theEntry)) { + anObject = Handle(GEOM_BaseObject)::DownCast(_objects(theEntry)); } else if (force) { - Handle(TDocStd_Document) aDoc = GetDocument(theDocID, force); + Handle(TDocStd_Document) aDoc = GetDocument(force); if ( !aDoc.IsNull()) { TDF_Label aLabel; TDF_Tool::Label(aDoc->Main().Data(), theEntry, aLabel, Standard_True); @@ -329,7 +289,7 @@ Handle(GEOM_BaseObject) GEOM_Engine::GetObject(int theDocID, const char* theEntr case GEOM_FIELD_STEP_OBJTYPE: anObject = new GEOM_FieldStep(aLabel); break; default: anObject = new GEOM_Object (aLabel); } - _objects.Bind(anID, anObject); + _objects.Bind(theEntry, anObject); } } } @@ -343,22 +303,19 @@ Handle(GEOM_BaseObject) GEOM_Engine::GetObject(int theDocID, const char* theEntr */ //============================================================================= -Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theDocID, int theType) +Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theType) { - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); // NPAL18604: use existing label to decrease memory usage, // if this label has been freed (object deleted) bool useExisting = false; TDF_Label aChild; - if (_freeLabels.find(theDocID) != _freeLabels.end()) { - std::list& aFreeLabels = _freeLabels[theDocID]; - if (!aFreeLabels.empty()) { - useExisting = true; - aChild = aFreeLabels.front(); - aFreeLabels.pop_front(); - } + if (!_freeLabels.empty()) { + useExisting = true; + aChild = _freeLabels.front(); + _freeLabels.pop_front(); } if (!useExisting) { // create new label @@ -386,9 +343,9 @@ Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theDocID, int theType) */ //================================================================================ -Handle(GEOM_Object) GEOM_Engine::AddObject(int theDocID, int theType) +Handle(GEOM_Object) GEOM_Engine::AddObject(int theType) { - return Handle(GEOM_Object)::DownCast( AddBaseObject(theDocID, theType) ); + return Handle(GEOM_Object)::DownCast( AddBaseObject(theType) ); } //============================================================================= @@ -403,21 +360,17 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) th { if (theMainShape.IsNull() || theIndices.IsNull()) return NULL; - Handle(TDocStd_Document) aDoc = GetDocument(theMainShape->GetDocID()); + Handle(TDocStd_Document) aDoc = GetDocument(); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); // NPAL18604: use existing label to decrease memory usage, // if this label has been freed (object deleted) bool useExisting = false; - TDF_Label aChild; - int aDocID = theMainShape->GetDocID(); - if (_freeLabels.find(aDocID) != _freeLabels.end()) { - std::list& aFreeLabels = _freeLabels[aDocID]; - if (!aFreeLabels.empty()) { - useExisting = true; - aChild = aFreeLabels.front(); - aFreeLabels.pop_front(); - } + TDF_Label aChild;; + if (!_freeLabels.empty()) { + useExisting = true; + aChild = _freeLabels.front(); + _freeLabels.pop_front(); } if (!useExisting) { // create new label @@ -479,8 +432,7 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_BaseObject)& theObject) { if (theObject.IsNull()) return false; - int aDocID = theObject->GetDocID(); - if(!_mapIDDocument.IsBound(aDocID)) + if(!_document) return false; // document is closed... //Remove an object from the map of available objects @@ -515,16 +467,14 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_BaseObject)& theObject) aLabel.ForgetAllAttributes(Standard_True); // Remember the label to reuse it then - std::list& aFreeLabels = _freeLabels[aDocID]; - if ( aFreeLabels.empty() || aFreeLabels.back() != aLabel ) - aFreeLabels.push_back(aLabel); + if ( _freeLabels.empty() || _freeLabels.back() != aLabel ) + _freeLabels.push_back(aLabel); // we can't explicitely delete theObject. At least prevent its functioning // as an alive object when aLabel is reused for a new object theObject->_label = aLabel.Root(); theObject->_ior.Clear(); - theObject->_parameters.Clear(); - theObject->_docID = -1; + theObject->_parameters.Clear();; theObject.Nullify(); @@ -536,9 +486,9 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_BaseObject)& theObject) * Undo */ //============================================================================= -void GEOM_Engine::Undo(int theDocID) +void GEOM_Engine::Undo() { - GetDocument(theDocID)->Undo(); + GetDocument()->Undo(); } //============================================================================= @@ -546,9 +496,9 @@ void GEOM_Engine::Undo(int theDocID) * Redo */ //============================================================================= -void GEOM_Engine::Redo(int theDocID) +void GEOM_Engine::Redo() { - GetDocument(theDocID)->Redo(); + GetDocument()->Redo(); } //============================================================================= @@ -556,12 +506,11 @@ void GEOM_Engine::Redo(int theDocID) * Save */ //============================================================================= -bool GEOM_Engine::Save(int theDocID, const char* theFileName) +bool GEOM_Engine::Save(const char* theFileName) { - if(!_mapIDDocument.IsBound(theDocID)) return false; - Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID)); + if(!_document) return false; - _OCAFApp->SaveAs(aDoc, theFileName); + _OCAFApp->SaveAs(_document, theFileName); return true; } @@ -571,7 +520,7 @@ bool GEOM_Engine::Save(int theDocID, const char* theFileName) * Load */ //============================================================================= -bool GEOM_Engine::Load(int theDocID, const char* theFileName) +bool GEOM_Engine::Load(const char* theFileName) { Handle(TDocStd_Document) aDoc; if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) { @@ -587,10 +536,7 @@ bool GEOM_Engine::Load(int theDocID, const char* theFileName) aDoc->SetUndoLimit(_UndoLimit); - if(_mapIDDocument.IsBound(theDocID)) _mapIDDocument.UnBind(theDocID); - _mapIDDocument.Bind(theDocID, aDoc); - - TDataStd_Integer::Set(aDoc->Main(), theDocID); + _document = aDoc; return true; } @@ -600,30 +546,19 @@ bool GEOM_Engine::Load(int theDocID, const char* theFileName) * Close */ //============================================================================= -void GEOM_Engine::Close(int theDocID) +void GEOM_Engine::Close() { - if (_mapIDDocument.IsBound(theDocID)) { - Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID)); - - //Remove all GEOM Objects associated to the given document - TColStd_SequenceOfAsciiString aSeq; + if (_document) { + //Remove all GEOM Objects associated to the document GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It (_objects); - for (; It.More(); It.Next()) { - TCollection_AsciiString anObjID (It.Key()); - Standard_Integer anID = ExtractDocID(anObjID); - if (theDocID == anID) aSeq.Append(It.Key()); - } - for (Standard_Integer i=1; i<=aSeq.Length(); i++) _objects.UnBind(aSeq.Value(i)); + for (; It.More(); It.Next()) + _objects.UnBind(It.Key()); - // Forget free labels for this document - TFreeLabelsList::iterator anIt = _freeLabels.find(theDocID); - if (anIt != _freeLabels.end()) { - _freeLabels.erase(anIt); - } + // Forget free labels for document + _freeLabels.clear(); - _mapIDDocument.UnBind(theDocID); - _OCAFApp->Close(aDoc); - aDoc.Nullify(); + _OCAFApp->Close(_document); + _document.Nullify(); } } @@ -632,8 +567,7 @@ void GEOM_Engine::Close(int theDocID) * DumpPython */ //============================================================================= -TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, - std::vector& theObjectData, +TCollection_AsciiString GEOM_Engine::DumpPython(std::vector& theObjectData, TVariablesList theVariables, bool isPublished, bool isMultiFile, @@ -643,7 +577,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, Kernel_Utils::Localizer loc; TCollection_AsciiString aScript; - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); if (aDoc.IsNull()) { @@ -662,7 +596,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, aScript += "\n\tgeompy = geomBuilder.New(theStudy)\n"; - AddTextures(theDocID, aScript); + AddTextures(aScript); Standard_Integer posToInsertGlobalVars = aScript.Length() + 1; @@ -798,7 +732,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, aScript += aFuncScript; // ouv : NPAL12872 - AddObjectColors( theDocID, aScript, aEntry2ObjData ); + AddObjectColors(aScript, aEntry2ObjData ); // Make script to publish in study TSting2ObjDataPtrMap::iterator aStEntry2ObjDataPtrIt; @@ -908,24 +842,21 @@ Handle(TColStd_HSequenceOfAsciiString) GEOM_Engine::GetAllDumpNames() const #define TEXTURE_LABEL_HEIGHT 4 #define TEXTURE_LABEL_DATA 5 -int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight, +int GEOM_Engine::addTexture(int theWidth, int theHeight, const Handle(TColStd_HArray1OfByte)& theTexture, const TCollection_AsciiString& theFileName) { - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); // NPAL18604: use existing label to decrease memory usage, // if this label has been freed (object deleted) bool useExisting = false; TDF_Label aChild; - if (_freeLabels.find(theDocID) != _freeLabels.end()) { - std::list& aFreeLabels = _freeLabels[theDocID]; - if (!aFreeLabels.empty()) { - useExisting = true; - aChild = aFreeLabels.front(); - aFreeLabels.pop_front(); - } + if (!_freeLabels.empty()) { + useExisting = true; + aChild = _freeLabels.front(); + _freeLabels.pop_front(); } if (!useExisting) { // create new label @@ -954,14 +885,14 @@ int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight, return aTextureID; } -Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextureID, +Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theTextureID, int& theWidth, int& theHeight, TCollection_AsciiString& theFileName) { Handle(TColStd_HArray1OfByte) anArray; theWidth = theHeight = 0; - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); TDF_ChildIterator anIterator(aDoc->Main(), Standard_True); bool found = false; @@ -995,11 +926,11 @@ Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextu return anArray; } -std::list GEOM_Engine::getAllTextures(int theDocID) +std::list GEOM_Engine::getAllTextures() { std::list id_list; - Handle(TDocStd_Document) aDoc = GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = GetDocument(); TDF_ChildIterator anIterator(aDoc->Main(), Standard_True); for (; anIterator.More(); anIterator.Next()) { @@ -1014,17 +945,6 @@ std::list GEOM_Engine::getAllTextures(int theDocID) return id_list; } -void GEOM_Engine::DocumentModified(const int theDocId, const bool isModified) -{ - if (isModified) _mapModifiedDocs.Add(theDocId); - else _mapModifiedDocs.Remove(theDocId); -} - -bool GEOM_Engine::DocumentModified(const int theDocId) -{ - return _mapModifiedDocs.Contains(theDocId); -} - //=========================================================================== // Internal functions //=========================================================================== @@ -1665,12 +1585,11 @@ void ReplaceEntriesByNames (TCollection_AsciiString& theScript, * AddObjectColors: Add color to objects */ //============================================================================= -void AddObjectColors (int theDocID, - TCollection_AsciiString& theScript, +void AddObjectColors (TCollection_AsciiString& theScript, const TSting2ObjDataMap& theEntry2ObjData) { GEOM_Engine* engine = GEOM_Engine::GetEngine(); - Handle(TDocStd_Document) aDoc = engine->GetDocument(theDocID); + Handle(TDocStd_Document) aDoc = engine->GetDocument(); TSting2ObjDataMap::const_iterator anEntryToNameIt; for (anEntryToNameIt = theEntry2ObjData.begin(); @@ -1774,10 +1693,10 @@ static TCollection_AsciiString pack_data (const Handle(TColStd_HArray1OfByte)& a return stream; } -void AddTextures (int theDocID, TCollection_AsciiString& theScript) +void AddTextures (TCollection_AsciiString& theScript) { GEOM_Engine* engine = GEOM_Engine::GetEngine(); - std::list allTextures = engine->getAllTextures(theDocID); + std::list allTextures = engine->getAllTextures(); std::list::const_iterator it; if (allTextures.size() > 0) { @@ -1788,7 +1707,7 @@ void AddTextures (int theDocID, TCollection_AsciiString& theScript) Standard_Integer aWidth, aHeight; TCollection_AsciiString aFileName; Handle(TColStd_HArray1OfByte) aTexture = - engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName); + engine->getTexture(*it, aWidth, aHeight, aFileName); if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) { TCollection_AsciiString aCommand = "\n\t"; aCommand += "texture_map["; aCommand += *it; aCommand += "] = "; diff --git a/src/GEOM/GEOM_Engine.hxx b/src/GEOM/GEOM_Engine.hxx index 564774078..b9bef5fbf 100644 --- a/src/GEOM/GEOM_Engine.hxx +++ b/src/GEOM/GEOM_Engine.hxx @@ -99,53 +99,48 @@ class GEOM_Engine Standard_EXPORT static GEOM_Engine* GetEngine(); //Returns the OCAF document by its ID, if document doesn't exists it will be created - Standard_EXPORT Handle(TDocStd_Document) GetDocument(int theDocID, bool force=true); - - //Returns the ID of the given OCAF document - Standard_EXPORT int GetDocID(Handle(TDocStd_Document) theDocument); + Standard_EXPORT Handle(TDocStd_Document) GetDocument(bool force=true); //Returns the OCAF appliaction Standard_EXPORT Handle(TDocStd_Application) GetApplication() { return _OCAFApp; } //Returns a pointer to GEOM_BaseObject defined by a document and the entry - Standard_EXPORT Handle(GEOM_BaseObject) GetObject(int theDocID, - const char* theEntry, + Standard_EXPORT Handle(GEOM_BaseObject) GetObject(const char* theEntry, bool force=true); //Adds a new object of the type theType in the OCAF document - Standard_EXPORT Handle(GEOM_BaseObject) AddBaseObject(int theDocID, int theType); + Standard_EXPORT Handle(GEOM_BaseObject) AddBaseObject(int theType); //Adds a new object of the type theType in the OCAF document - Standard_EXPORT Handle(GEOM_Object) AddObject(int theDocID, int theType); + Standard_EXPORT Handle(GEOM_Object) AddObject(int theType); //Removes the object from the OCAF document Standard_EXPORT bool RemoveObject(Handle(GEOM_BaseObject)& theObject); - //Saves the OCAF document with ID = theDocID with file with name theFileName - Standard_EXPORT bool Save(int theDocID, const char* theFileName); + //Saves the OCAF document with file with name theFileName + Standard_EXPORT bool Save(const char* theFileName); - //Loads the OCAF document into the application and assigns to it an ID = theDocID - Standard_EXPORT bool Load(int theDocID, const char* theFileName); + //Loads the OCAF document into the application + Standard_EXPORT bool Load(const char* theFileName); - //Closes the document with ID = theDocID - Standard_EXPORT void Close(int theDocID); + //Closes the document + Standard_EXPORT void Close(); //Sets the number of Undos (default value = 10) Standard_EXPORT void SetUndoLimit(int theLimit) { _UndoLimit = theLimit; } - //Applies an Undo to document with ID = theDocID - Standard_EXPORT void Undo(int theDocID); + //Applies an Undo to document + Standard_EXPORT void Undo(); - //Applies an Redo to document with ID = theDocID - Standard_EXPORT void Redo(int theDocID); + //Applies an Redo to document + Standard_EXPORT void Redo(); //Adds a new sub-shape object of the MainShape object Standard_EXPORT Handle(GEOM_Object) AddSubShape(Handle(GEOM_Object) theMainShape, Handle(TColStd_HArray1OfInteger) theIndices, bool isStandaloneOperation = false); - Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID, - std::vector& theObjectData, + Standard_EXPORT TCollection_AsciiString DumpPython(std::vector& theObjectData, TVariablesList theVariables, bool isPublished, bool isMultiFile, @@ -155,15 +150,15 @@ class GEOM_Engine Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const; - Standard_EXPORT int addTexture(int theDocID, int theWidth, int theHeight, + Standard_EXPORT int addTexture(int theWidth, int theHeight, const Handle(TColStd_HArray1OfByte)& theTexture, const TCollection_AsciiString& theFileName = ""); - Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theDocID, int theTextureID, + Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theTextureID, int& theWidth, int& theHeight, TCollection_AsciiString& theFileName); - Standard_EXPORT std::list getAllTextures(int theDocID); + Standard_EXPORT std::list getAllTextures(); static const Standard_GUID& GetTextureGUID(); @@ -171,25 +166,20 @@ class GEOM_Engine const TCollection_AsciiString& anEntry, Resource_DataMapOfAsciiStringAsciiString& aNameToEntry); - Standard_EXPORT void DocumentModified(const int theDocId, const bool isModified); - - Standard_EXPORT bool DocumentModified(const int theDocId); - protected: Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine); private: Handle(GEOM_Application) _OCAFApp; - TColStd_DataMapOfIntegerTransient _mapIDDocument; - TColStd_MapOfInteger _mapModifiedDocs; // keeps the identifiers of the modified document ids + Handle(TDocStd_Document) _document; int _UndoLimit; GEOM_DataMapOfAsciiStringTransient _objects; Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap; - TFreeLabelsList _freeLabels; + std::list _freeLabels; }; #endif diff --git a/src/GEOM/GEOM_Field.cxx b/src/GEOM/GEOM_Field.cxx index b975e5d08..7d77da1f3 100644 --- a/src/GEOM/GEOM_Field.cxx +++ b/src/GEOM/GEOM_Field.cxx @@ -364,7 +364,7 @@ Handle(GEOM_FieldStep) GEOM_Field::AddStep(const int stepID, const int stamp) if(anEngine == NULL) return NULL; step = Handle(GEOM_FieldStep)::DownCast - ( anEngine->AddBaseObject( GetDocID(),GEOM_FIELD_STEP_OBJTYPE )); + ( anEngine->AddBaseObject( GEOM_FIELD_STEP_OBJTYPE )); if ( step.IsNull()) return step; diff --git a/src/GEOM/GEOM_IOperations.cxx b/src/GEOM/GEOM_IOperations.cxx index 66fe4791b..0ca233d0a 100644 --- a/src/GEOM/GEOM_IOperations.cxx +++ b/src/GEOM/GEOM_IOperations.cxx @@ -38,8 +38,8 @@ */ //============================================================================= -GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine, int theDocID) -: _engine(theEngine), _docID(theDocID) +GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine) +: _engine(theEngine) { _solver = new GEOM_Solver(theEngine); } @@ -64,7 +64,7 @@ GEOM_IOperations::~GEOM_IOperations() //============================================================================= void GEOM_IOperations::StartOperation() { - Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID); + Handle(TDocStd_Document) aDoc = _engine->GetDocument(); if(aDoc->GetUndoLimit() > 0) aDoc->NewCommand(); } @@ -76,10 +76,9 @@ void GEOM_IOperations::StartOperation() //============================================================================= void GEOM_IOperations::FinishOperation() { - Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID); + Handle(TDocStd_Document) aDoc = _engine->GetDocument(); if(aDoc->GetUndoLimit() > 0) aDoc->CommitCommand(); - _engine->DocumentModified(_docID, true); } //============================================================================= @@ -89,7 +88,7 @@ void GEOM_IOperations::FinishOperation() //============================================================================= void GEOM_IOperations::AbortOperation() { - Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID); + Handle(TDocStd_Document) aDoc = _engine->GetDocument(); aDoc->AbortCommand(); } diff --git a/src/GEOM/GEOM_IOperations.hxx b/src/GEOM/GEOM_IOperations.hxx index 098587a85..a4e16776e 100644 --- a/src/GEOM/GEOM_IOperations.hxx +++ b/src/GEOM/GEOM_IOperations.hxx @@ -39,7 +39,7 @@ class GEOM_IOperations { public: - Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOM_IOperations(); //Starts a new operation (opens a tansaction) @@ -73,15 +73,11 @@ class GEOM_IOperations //Return a pointer to Solver associated with this operation interface Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; } - //Returns an ID of the OCAF document where this operation stores the data - Standard_EXPORT int GetDocID() { return _docID; } - private: TCollection_AsciiString _errorCode; GEOM_Engine* _engine; GEOM_Solver* _solver; - int _docID; }; diff --git a/src/GEOM/GEOM_Solver.cxx b/src/GEOM/GEOM_Solver.cxx index 2e6475362..5d6d5b212 100644 --- a/src/GEOM/GEOM_Solver.cxx +++ b/src/GEOM/GEOM_Solver.cxx @@ -34,7 +34,7 @@ * Update */ //============================================================================= -bool GEOM_Solver::Update(int theDocID, TDF_LabelSequence& theSeq) +bool GEOM_Solver::Update(TDF_LabelSequence& theSeq) { return false; } diff --git a/src/GEOM/GEOM_Solver.hxx b/src/GEOM/GEOM_Solver.hxx index 8d6b84c15..c3518ca34 100644 --- a/src/GEOM/GEOM_Solver.hxx +++ b/src/GEOM/GEOM_Solver.hxx @@ -35,9 +35,9 @@ class GEOM_Solver Standard_EXPORT GEOM_Solver(GEOM_Engine* theEngine) :_engine(theEngine) {} Standard_EXPORT ~GEOM_Solver() {} - //Update the values of all GEOM_Object in the document theDocID, theSeq will contain a list of touched labels + //Update the values of all GEOM_Object in the document, theSeq will contain a list of touched labels //Note: not Implemented - Standard_EXPORT bool Update(int theDocID, TDF_LabelSequence& theSeq); + Standard_EXPORT bool Update(TDF_LabelSequence& theSeq); //Updates a value of theObject, theSeq will contain a list of touched labels //Note: not implemented diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index ca3e73bda..145b6b8e5 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -704,7 +704,7 @@ QString GEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const GEOM_Displayer* GEOMBase_Helper::getDisplayer() { if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( getStudy() ); + myDisplayer = new GEOM_Displayer(); return myDisplayer; } diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx index 2e3218b1e..6af17acd2 100644 --- a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx +++ b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx @@ -50,10 +50,9 @@ #include GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app ) - : myDisplayer(NULL) { myStudy = dynamic_cast( app->activeStudy() ); - myDisplayer = GEOM_Displayer( myStudy ); + myDisplayer = GEOM_Displayer(); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); myVisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) ); diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 3ed44e128..5ddf00ebc 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -459,15 +459,12 @@ static std::string getName( GEOM::GEOM_BaseObject_ptr object ) * Constructor */ //================================================================= -GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st ) +GEOM_Displayer::GEOM_Displayer() { - if( st ) - myApp = dynamic_cast( st->application() ); - else - myApp = 0; + SUIT_Session* session = SUIT_Session::session(); + myApp = dynamic_cast( session->activeApplication() ); /* Shading Color */ - SUIT_Session* session = SUIT_Session::session(); SUIT_ResourceMgr* resMgr = session->resourceMgr(); QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) ); @@ -779,7 +776,7 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1; // get presentation properties - PropMap propMap = getObjectProperties( study, entry, myViewFrame ); + PropMap propMap = getObjectProperties( entry, myViewFrame ); // Temporary staff: vertex must be infinite for correct visualization AISShape->SetInfiniteState( myShape.Infinite() ); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines) @@ -921,14 +918,14 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap aImagePath = GetTexture().c_str(); if ( ! entry.isEmpty() ) { // check that study is active - SalomeApp_Study* study = getActiveStudy(); + SalomeApp_Study* study = getStudy(); if ( study ) { // Store the texture in object properties for next displays study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::Texture ), QString( GetTexture().c_str() ) ); study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::DisplayMode ), 3 ); // Update propeties map - propMap = getObjectProperties( study, entry, myViewFrame ); + propMap = getObjectProperties( entry, myViewFrame ); } } } @@ -986,7 +983,7 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap int textureId = aList[0].toInt(); Standard_Integer aWidth, aHeight; Handle(TColStd_HArray1OfByte) aTexture = - GeometryGUI::getTexture( study, textureId, aWidth, aHeight ); + GeometryGUI::getTexture( textureId, aWidth, aHeight ); if ( !aTexture.IsNull() ) { Handle(Prs3d_PointAspect) aTextureAspect = new Prs3d_PointAspect( HasColor() ? @@ -1049,7 +1046,7 @@ void GEOM_Displayer::updateActorProperties( GEOM_Actor* actor, bool create ) int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1; // get presentation properties - PropMap propMap = getObjectProperties( study, entry, myViewFrame ); + PropMap propMap = getObjectProperties( entry, myViewFrame ); QColor c; ///////////////////////////////////////////////////////////////////////// @@ -1738,49 +1735,43 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry, // set interactive object setIO( theIO ); // Find SOBject (because shape should be published previously) - SUIT_Session* session = SUIT_Session::session(); - SUIT_Application* app = session->activeApplication(); - if ( app ) + if ( getStudy() ) { - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( study ) + _PTR(SObject) SO ( getStudy()->studyDS()->FindObjectID( theIO->getEntry() ) ); + if ( SO ) { - _PTR(SObject) SO ( study->studyDS()->FindObjectID( theIO->getEntry() ) ); - if ( SO ) + // get CORBA reference to data object + CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO); + if ( !CORBA::is_nil( object ) ) { - // get CORBA reference to data object - CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO); - if ( !CORBA::is_nil( object ) ) + // downcast to GEOM base object + GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object ); + if ( !GeomBaseObject->_is_nil() ) { - // downcast to GEOM base object - GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object ); - if ( !GeomBaseObject->_is_nil() ) - { - myType = GeomBaseObject->GetType(); + myType = GeomBaseObject->GetType(); - // downcast to GEOM object - GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject ); - if ( myType == GEOM_FIELD_STEP ) + // downcast to GEOM object + GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject ); + if ( myType == GEOM_FIELD_STEP ) + { + // get the GEOM object from the field's shape + GEOM::GEOM_FieldStep_var GeomFieldStep = GEOM::GEOM_FieldStep::_narrow( GeomBaseObject ); + if ( !GeomFieldStep->_is_nil() ) { - // get the GEOM object from the field's shape - GEOM::GEOM_FieldStep_var GeomFieldStep = GEOM::GEOM_FieldStep::_narrow( GeomBaseObject ); - if ( !GeomFieldStep->_is_nil() ) - { - GEOM::GEOM_Field_var GeomField = GeomFieldStep->GetField(); - if ( !GeomField->_is_nil() ) - GeomObject = GeomField->GetShape(); - } - - // read the field step information - readFieldStepInfo( GeomFieldStep ); + GEOM::GEOM_Field_var GeomField = GeomFieldStep->GetField(); + if ( !GeomField->_is_nil() ) + GeomObject = GeomField->GetShape(); } - if ( !GeomObject->_is_nil() ) - { - theIO->setName( GeomObject->GetName() ); - // finally set shape - setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) ); - } + // read the field step information + readFieldStepInfo( GeomFieldStep ); + } + + if ( !GeomObject->_is_nil() ) + { + theIO->setName( GeomObject->GetName() ); + // finally set shape + setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) ); } } } @@ -2459,21 +2450,20 @@ SALOMEDS::Color GEOM_Displayer::getUniqueColor( const QList& th return aSColor; } -PropMap GEOM_Displayer::getObjectProperties( SalomeApp_Study* study, - const QString& entry, +PropMap GEOM_Displayer::getObjectProperties( const QString& entry, SALOME_View* view ) { // get default properties for the explicitly specified default view type PropMap propMap = GEOM_Displayer::getDefaultPropertyMap(); - if ( study && view ) { + if ( getStudy() && view ) { SUIT_ViewModel* viewModel = dynamic_cast( view ); SUIT_ViewManager* viewMgr = ( viewModel != 0 ) ? viewModel->getViewManager() : 0; int viewId = ( viewMgr != 0 ) ? viewMgr->getGlobalId() : -1; if ( viewModel && viewId != -1 ) { // get properties from the study - PropMap storedMap = study->getObjectProperties( viewId, entry ); + PropMap storedMap = getStudy()->getObjectProperties( viewId, entry ); // overwrite default properties from stored ones (that are specified) for ( int prop = GEOM::Visibility; prop <= GEOM::LastProperty; prop++ ) { if ( storedMap.contains( GEOM::propertyName( (GEOM::Property)prop ) ) ) @@ -2493,7 +2483,7 @@ PropMap GEOM_Displayer::getObjectProperties( SalomeApp_Study* study, if ( !entry.isEmpty() ) { // get CORBA reference to geom object - _PTR(SObject) SO( study->studyDS()->FindObjectID( entry.toStdString() ) ); + _PTR(SObject) SO( getStudy()->studyDS()->FindObjectID( entry.toStdString() ) ); if ( SO ) { CORBA::Object_var object = GeometryGUI::ClientSObjectToObject( SO ); if ( !CORBA::is_nil( object ) ) { @@ -2691,16 +2681,9 @@ SALOMEDS::Color GEOM_Displayer::getColor(GEOM::GEOM_Object_var theGeomObject, bo void GEOM_Displayer::EraseWithChildren(const Handle(SALOME_InteractiveObject)& theIO, - const bool eraseOnlyChildren) { - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - if ( !app ) - return; - - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - if ( !appStudy ) - return; - - LightApp_DataObject* parent = appStudy->findObjectByEntry(theIO->getEntry()); + const bool eraseOnlyChildren) +{ + LightApp_DataObject* parent = getStudy()->findObjectByEntry(theIO->getEntry()); if( !parent) return; @@ -2708,7 +2691,7 @@ void GEOM_Displayer::EraseWithChildren(const Handle(SALOME_InteractiveObject)& t // Erase from all views QList views; SALOME_View* view; - ViewManagerList vmans = app->viewManagers(); + ViewManagerList vmans = myApp->viewManagers(); SUIT_ViewManager* vman; foreach ( vman, vmans ) { SUIT_ViewModel* vmod = vman->getViewModel(); @@ -2974,10 +2957,6 @@ Standard_Boolean GEOM_Displayer::FindColor( const Standard_Real aValue, void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, const bool updateViewer ) { - SalomeApp_Study* aStudy = dynamic_cast( myApp->activeStudy() ); - if( !aStudy ) - return; - SOCC_Viewer* aViewModel = dynamic_cast( GetActiveView() ); if( !aViewModel ) return; @@ -3092,14 +3071,14 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons if( theIsRedisplayFieldSteps ) { - _PTR(Study) aStudyDS = aStudy->studyDS(); + _PTR(Study) aStudyDS = getStudy()->studyDS(); QList vmList; myApp->viewManagers( vmList ); for( QList::Iterator vmIt = vmList.begin(); vmIt != vmList.end(); vmIt++ ) { if( SUIT_ViewManager* aViewManager = *vmIt ) { - const ObjMap& anObjects = aStudy->getObjectProperties( aViewManager->getGlobalId() ); + const ObjMap& anObjects = getStudy()->getObjectProperties( aViewManager->getGlobalId() ); for( ObjMap::ConstIterator objIt = anObjects.begin(); objIt != anObjects.end(); objIt++ ) { _PTR(SObject) aSObj( aStudyDS->FindObjectID( objIt.key().toLatin1().constData() ) ); diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index cf5a9df55..5bac64528 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -76,7 +76,7 @@ class GEOMGUI_EXPORT GEOM_Displayer : public LightApp_Displayer public: /* Constructor */ - GEOM_Displayer( SalomeApp_Study* app ); + GEOM_Displayer(); /* Destructor */ virtual ~GEOM_Displayer(); @@ -264,7 +264,7 @@ protected: void updateActorProperties( GEOM_Actor*, bool ); void updateDimensions( const Handle(SALOME_InteractiveObject)&, SALOME_OCCPrs*, const gp_Ax3& ); - PropMap getObjectProperties( SalomeApp_Study*, const QString&, SALOME_View* = 0 ); + PropMap getObjectProperties( const QString&, SALOME_View* = 0 ); PropMap getDefaultPropertyMap(); /* Methods for reading the field step information */ diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 20606e5e7..94325cb09 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -2094,7 +2094,7 @@ void GeometryGUI::onAutoBringToFront() SalomeApp_Study* appStudy = dynamic_cast< SalomeApp_Study* >( getApp()->activeStudy() ); if (!appStudy) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -2137,11 +2137,8 @@ void GeometryGUI::onAutoBringToFront() void GeometryGUI::updateFieldColorScale() { - if( SalomeApp_Study* aStudy = dynamic_cast( getApp()->activeStudy() ) ) - { - GEOM_Displayer aDisplayer( aStudy ); - aDisplayer.UpdateColorScale(); - } + GEOM_Displayer aDisplayer; + aDisplayer.UpdateColorScale(); } QString GeometryGUI::engineIOR() const @@ -2688,12 +2685,9 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par param == QString("scalar_bar_height") || param == QString("scalar_bar_text_height") || param == QString("scalar_bar_nb_intervals")) { - if( SalomeApp_Study* aStudy = dynamic_cast( getApp()->activeStudy() ) ) - { - GEOM_Displayer aDisplayer( aStudy ); - bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals"); - aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true ); - } + GEOM_Displayer aDisplayer; + bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals"); + aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true ); } else if ( param == QString("dimensions_color") || param == QString("dimensions_line_width") || @@ -2711,13 +2705,7 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par return; } - SalomeApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); - if ( !aStudy ) - { - return; - } - - GEOM_Displayer aDisplayer( aStudy ); + GEOM_Displayer aDisplayer; ViewManagerList aVMs; anApp->viewManagers( OCCViewer_Viewer::Type(), aVMs ); @@ -2760,7 +2748,7 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par LightApp_Displayer* GeometryGUI::displayer() { if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( dynamic_cast( getApp()->activeStudy() ) ); + myDisplayer = new GEOM_Displayer(); return myDisplayer; } @@ -3135,7 +3123,7 @@ void UpdateNameMode( SalomeApp_Application* app ) bool isMode = false; SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() ); SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow(); - GEOM_Displayer displayer( aStudy ); + GEOM_Displayer displayer; int aMgrId = viewWindow->getViewManager()->getGlobalId(); SALOME_View* window = displayer.GetActiveView(); @@ -3238,11 +3226,14 @@ void GeometryGUI::ClearShapeBuffer( GEOM::GEOM_Object_ptr theObj ) TCollection_AsciiString asciiIOR( (char *)IOR.in() ); GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR ); - SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); - if ( !appStudy ) - return; + SalomeApp_Application* app = + dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication()); + SalomeApp_Study* appStudy = app ? dynamic_cast( app->activeStudy() ) : 0; - _PTR(Study) aStudy = appStudy->studyDS(); + if (!appStudy) + return; + + _PTR(Study) aStudy = appStudy->studyDS(); if ( !aStudy ) return; diff --git a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx index 2ee22d9d9..5e089e578 100644 --- a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx @@ -85,7 +85,7 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(LOGBOOK& log) const if (aFileName.IsEmpty() || aFormatName.IsEmpty() || aLibName.IsEmpty()) return 0; - if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( GetDocID(), obj, aFileName, aFormatName ) ); + if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( obj, aFileName, aFormatName ) ); return 0; #if OCC_VERSION_MAJOR < 7 diff --git a/src/GEOMImpl/GEOMImpl_Gen.cxx b/src/GEOMImpl/GEOMImpl_Gen.cxx index d3a54575d..64aed53d2 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.cxx +++ b/src/GEOMImpl/GEOMImpl_Gen.cxx @@ -93,7 +93,6 @@ GEOMImpl_Gen::GEOMImpl_Gen() { MESSAGE("GEOMImpl_Gen::GEOMImpl_Gen"); - _mapOfBasicOperations.clear(); // Basic elements TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PointDriver::GetID(), new GEOMImpl_PointDriver()); @@ -182,57 +181,19 @@ GEOMImpl_Gen::~GEOMImpl_Gen() { MESSAGE("GEOMImpl_Gen::~GEOMImpl_Gen"); - std::map::iterator aBasicIter = _mapOfBasicOperations.begin(); - for (; aBasicIter != _mapOfBasicOperations.end(); aBasicIter++) - delete (*aBasicIter).second; - - std::map::iterator aTransformIter = _mapOfTransformOperations.begin(); - for (; aTransformIter != _mapOfTransformOperations.end(); aTransformIter++) - delete (*aTransformIter).second; - - std::map::iterator a3DPrimIter = _mapOf3DPrimOperations.begin(); - for (; a3DPrimIter != _mapOf3DPrimOperations.end(); a3DPrimIter++) - delete (*a3DPrimIter).second; - - std::map::iterator aShapesIter = _mapOfShapesOperations.begin(); - for (; aShapesIter != _mapOfShapesOperations.end(); aShapesIter++) - delete (*aShapesIter).second; - - std::map::iterator aBlocksIter = _mapOfBlocksOperations.begin(); - for (; aBlocksIter != _mapOfBlocksOperations.end(); aBlocksIter++) - delete (*aBlocksIter).second; - - std::map::iterator aBooleanIter = _mapOfBooleanOperations.begin(); - for (; aBooleanIter != _mapOfBooleanOperations.end(); aBooleanIter++) - delete (*aBooleanIter).second; - - std::map::iterator aHealingIter = _mapOfHealingOperations.begin(); - for (; aHealingIter != _mapOfHealingOperations.end(); aHealingIter++) - delete (*aHealingIter).second; - - std::map::iterator aCurvesIter = _mapOfCurvesOperations.begin(); - for (; aCurvesIter != _mapOfCurvesOperations.end(); aCurvesIter++) - delete (*aCurvesIter).second; - - std::map::iterator aLocalIter = _mapOfLocalOperations.begin(); - for (; aLocalIter != _mapOfLocalOperations.end(); aLocalIter++) - delete (*aLocalIter).second; - - std::map::iterator aInsertIter = _mapOfInsertOperations.begin(); - for (; aInsertIter != _mapOfInsertOperations.end(); aInsertIter++) - delete (*aInsertIter).second; - - std::map::iterator aMeasureIter = _mapOfMeasureOperations.begin(); - for (; aMeasureIter != _mapOfMeasureOperations.end(); aMeasureIter++) - delete (*aMeasureIter).second; - - std::map::iterator aGroupIter = _mapOfGroupOperations.begin(); - for (; aGroupIter != _mapOfGroupOperations.end(); aGroupIter++) - delete (*aGroupIter).second; - - std::map::iterator aFieldIter = _mapOfFieldOperations.begin(); - for (; aFieldIter != _mapOfFieldOperations.end(); aFieldIter++) - delete (*aFieldIter).second; + delete _BasicOperations; + delete _TransformOperations; + delete _3DPrimOperations; + delete _ShapesOperations; + delete _BlocksOperations; + delete _BooleanOperations; + delete _HealingOperations; + delete _CurvesOperations; + delete _LocalOperations; + delete _InsertOperations; + delete _MeasureOperations; + delete _GroupOperations; + delete _FieldOperations; } //============================================================================= @@ -240,13 +201,9 @@ GEOMImpl_Gen::~GEOMImpl_Gen() * GetIBasicOperations */ //============================================================================= -GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations(int theDocID) +GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations() { - if(_mapOfBasicOperations.find(theDocID) == _mapOfBasicOperations.end()) { - _mapOfBasicOperations[theDocID] = new GEOMImpl_IBasicOperations(this, theDocID); - } - - return _mapOfBasicOperations[theDocID]; + return _BasicOperations; } //============================================================================= @@ -254,13 +211,9 @@ GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations(int theDocID) * GetITransformOperations */ //============================================================================= -GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations(int theDocID) +GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations() { - if(_mapOfTransformOperations.find(theDocID) == _mapOfTransformOperations.end()) { - _mapOfTransformOperations[theDocID] = new GEOMImpl_ITransformOperations(this, theDocID); - } - - return _mapOfTransformOperations[theDocID]; + return _TransformOperations; } //============================================================================= @@ -268,13 +221,9 @@ GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations(int theDocI * GetIBooleanOperations */ //============================================================================= -GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations(int theDocID) +GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations() { - if(_mapOfBooleanOperations.find(theDocID) == _mapOfBooleanOperations.end()) { - _mapOfBooleanOperations[theDocID] = new GEOMImpl_IBooleanOperations(this, theDocID); - } - - return _mapOfBooleanOperations[theDocID]; + return _BooleanOperations; } //============================================================================= @@ -282,13 +231,9 @@ GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations(int theDocID) * GetIHealingOperations */ //============================================================================= -GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations(int theDocID) +GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations() { - if(_mapOfHealingOperations.find(theDocID) == _mapOfHealingOperations.end()) { - _mapOfHealingOperations[theDocID] = new GEOMImpl_IHealingOperations(this, theDocID); - } - - return _mapOfHealingOperations[theDocID]; + return _HealingOperations; } //============================================================================= @@ -296,13 +241,9 @@ GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations(int theDocID) * GetI3DPrimOperations */ //============================================================================= -GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations(int theDocID) +GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations() { - if(_mapOf3DPrimOperations.find(theDocID) == _mapOf3DPrimOperations.end()) { - _mapOf3DPrimOperations[theDocID] = new GEOMImpl_I3DPrimOperations(this, theDocID); - } - - return _mapOf3DPrimOperations[theDocID]; + return _3DPrimOperations; } //============================================================================= @@ -310,13 +251,9 @@ GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations(int theDocID) * GetIShapesOperations */ //============================================================================= -GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations(int theDocID) +GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations() { - if(_mapOfShapesOperations.find(theDocID) == _mapOfShapesOperations.end()) { - _mapOfShapesOperations[theDocID] = new GEOMImpl_IShapesOperations(this, theDocID); - } - - return _mapOfShapesOperations[theDocID]; + return _ShapesOperations; } //============================================================================= @@ -324,13 +261,9 @@ GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations(int theDocID) * GetIBlocksOperations */ //============================================================================= -GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations(int theDocID) +GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations() { - if(_mapOfBlocksOperations.find(theDocID) == _mapOfBlocksOperations.end()) { - _mapOfBlocksOperations[theDocID] = new GEOMImpl_IBlocksOperations(this, theDocID); - } - - return _mapOfBlocksOperations[theDocID]; + return _BlocksOperations; } //============================================================================= @@ -338,13 +271,9 @@ GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations(int theDocID) * GetICurvesOperations */ //============================================================================= -GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations(int theDocID) +GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations() { - if(_mapOfCurvesOperations.find(theDocID) == _mapOfCurvesOperations.end()) { - _mapOfCurvesOperations[theDocID] = new GEOMImpl_ICurvesOperations(this, theDocID); - } - - return _mapOfCurvesOperations[theDocID]; + return _CurvesOperations; } //============================================================================= @@ -352,13 +281,9 @@ GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations(int theDocID) * GetILocalOperations */ //============================================================================= -GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations(int theDocID) +GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations() { - if(_mapOfLocalOperations.find(theDocID) == _mapOfLocalOperations.end()) { - _mapOfLocalOperations[theDocID] = new GEOMImpl_ILocalOperations(this, theDocID); - } - - return _mapOfLocalOperations[theDocID]; + return _LocalOperations; } //============================================================================= @@ -366,13 +291,9 @@ GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations(int theDocID) * GetIInsertOperations */ //============================================================================= -GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations(int theDocID) +GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations() { - if(_mapOfInsertOperations.find(theDocID) == _mapOfInsertOperations.end()) { - _mapOfInsertOperations[theDocID] = new GEOMImpl_IInsertOperations(this, theDocID); - } - - return _mapOfInsertOperations[theDocID]; + return _InsertOperations; } //============================================================================= @@ -380,13 +301,9 @@ GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations(int theDocID) * GetIMeasureOperations */ //============================================================================= -GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations(int theDocID) +GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations() { - if(_mapOfMeasureOperations.find(theDocID) == _mapOfMeasureOperations.end()) { - _mapOfMeasureOperations[theDocID] = new GEOMImpl_IMeasureOperations(this, theDocID); - } - - return _mapOfMeasureOperations[theDocID]; + return _MeasureOperations; } //============================================================================= @@ -394,13 +311,9 @@ GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations(int theDocID) * GetIGroupOperations */ //============================================================================= -GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID) +GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations() { - if(_mapOfGroupOperations.find(theDocID) == _mapOfGroupOperations.end()) { - _mapOfGroupOperations[theDocID] = new GEOMImpl_IGroupOperations(this, theDocID); - } - - return _mapOfGroupOperations[theDocID]; + return _GroupOperations; } //============================================================================= @@ -408,11 +321,7 @@ GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID) * GetIFieldOperations */ //============================================================================= -GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations(int theDocID) +GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations() { - if(_mapOfFieldOperations.find(theDocID) == _mapOfFieldOperations.end()) { - _mapOfFieldOperations[theDocID] = new GEOMImpl_IFieldOperations(this, theDocID); - } - - return _mapOfFieldOperations[theDocID]; + return _FieldOperations; } diff --git a/src/GEOMImpl/GEOMImpl_Gen.hxx b/src/GEOMImpl/GEOMImpl_Gen.hxx index a6ba04777..48b1463cc 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.hxx +++ b/src/GEOMImpl/GEOMImpl_Gen.hxx @@ -48,47 +48,47 @@ class GEOMIMPL_EXPORT GEOMImpl_Gen : public GEOM_Engine GEOMImpl_Gen(); ~GEOMImpl_Gen(); - GEOMImpl_IBasicOperations* GetIBasicOperations(int theDocID); + GEOMImpl_IBasicOperations* GetIBasicOperations(); - GEOMImpl_ITransformOperations* GetITransformOperations(int theDocID); + GEOMImpl_ITransformOperations* GetITransformOperations(); - GEOMImpl_I3DPrimOperations* GetI3DPrimOperations(int theDocID); + GEOMImpl_I3DPrimOperations* GetI3DPrimOperations(); - GEOMImpl_IShapesOperations* GetIShapesOperations(int theDocID); + GEOMImpl_IShapesOperations* GetIShapesOperations(); - GEOMImpl_IBlocksOperations* GetIBlocksOperations(int theDocID); + GEOMImpl_IBlocksOperations* GetIBlocksOperations(); - GEOMImpl_IMeasureOperations* GetIMeasureOperations(int theDocID); + GEOMImpl_IMeasureOperations* GetIMeasureOperations(); - GEOMImpl_IBooleanOperations* GetIBooleanOperations(int theDocID); + GEOMImpl_IBooleanOperations* GetIBooleanOperations(); - GEOMImpl_ICurvesOperations* GetICurvesOperations(int theDocID); + GEOMImpl_ICurvesOperations* GetICurvesOperations(); - GEOMImpl_ILocalOperations* GetILocalOperations(int theDocID); + GEOMImpl_ILocalOperations* GetILocalOperations(); - GEOMImpl_IInsertOperations* GetIInsertOperations(int theDocID); + GEOMImpl_IInsertOperations* GetIInsertOperations(); - GEOMImpl_IHealingOperations* GetIHealingOperations(int theDocID); + GEOMImpl_IHealingOperations* GetIHealingOperations(); - GEOMImpl_IGroupOperations* GetIGroupOperations(int theDocID); + GEOMImpl_IGroupOperations* GetIGroupOperations(); - GEOMImpl_IFieldOperations* GetIFieldOperations(int theDocID); + GEOMImpl_IFieldOperations* GetIFieldOperations(); private: - std::map _mapOfBasicOperations; - std::map _mapOfTransformOperations; - std::map _mapOf3DPrimOperations; - std::map _mapOfShapesOperations; - std::map _mapOfBlocksOperations; - std::map _mapOfBooleanOperations; - std::map _mapOfHealingOperations; - std::map _mapOfCurvesOperations; - std::map _mapOfLocalOperations; - std::map _mapOfInsertOperations; - std::map _mapOfMeasureOperations; - std::map _mapOfGroupOperations; - std::map _mapOfFieldOperations; + GEOMImpl_IBasicOperations* _BasicOperations; + GEOMImpl_ITransformOperations* _TransformOperations; + GEOMImpl_I3DPrimOperations* _3DPrimOperations; + GEOMImpl_IShapesOperations* _ShapesOperations; + GEOMImpl_IBlocksOperations* _BlocksOperations; + GEOMImpl_IBooleanOperations* _BooleanOperations; + GEOMImpl_IHealingOperations* _HealingOperations; + GEOMImpl_ICurvesOperations* _CurvesOperations; + GEOMImpl_ILocalOperations* _LocalOperations; + GEOMImpl_IInsertOperations* _InsertOperations; + GEOMImpl_IMeasureOperations* _MeasureOperations; + GEOMImpl_IGroupOperations* _GroupOperations; + GEOMImpl_IFieldOperations* _FieldOperations; }; #endif diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx index ba87e9c4f..c94446895 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx @@ -85,11 +85,11 @@ * constructor: */ //============================================================================= -GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations"); - myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID()); + myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine()); } //============================================================================= @@ -114,7 +114,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxDXDYDZ (double theDX, dou SetErrorCode(KO); //Add a new Box object - Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX); + Handle(GEOM_Object) aBox = GetEngine()->AddObject(GEOM_BOX); //Add a new Box function with DX_DY_DZ parameters Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_DX_DY_DZ); @@ -165,7 +165,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeBoxTwoPnt (Handle(GEOM_Objec if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL; //Add a new Box object - Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX); + Handle(GEOM_Object) aBox = GetEngine()->AddObject(GEOM_BOX); //Add a new Box function for creation a box relatively to two points Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_TWO_PNT); @@ -218,7 +218,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceHW (double theH, double if (theH == 0 || theW == 0) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Box function for creation a box relatively to two points Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_H_W); @@ -268,7 +268,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFaceObjHW (Handle(GEOM_Objec if (theObj.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Box function for creation a box relatively to two points Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_OBJ_H_W); @@ -323,7 +323,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskPntVecR if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Disk object - Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE); //Add a new Disk function for creation a disk relatively to point and vector Handle(GEOM_Function) aFunction = @@ -380,7 +380,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskThreePnt (Handle(GEOM_Ob if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Disk object - Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE); //Add a new Disk function for creation a disk relatively to three points Handle(GEOM_Function) aFunction = @@ -436,7 +436,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDiskR (double theR, int theO if (theR == 0 ) return NULL; //Add a new Disk object - Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE); //Add a new Box function for creation a box relatively to two points Handle(GEOM_Function) aFunction = aDisk->AddFunction(GEOMImpl_DiskDriver::GetID(), DISK_R); @@ -482,7 +482,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRH (double theR, dou SetErrorCode(KO); //Add a new Cylinder object - Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER); + Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER); //Add a new Cylinder function with R and H parameters Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H); @@ -528,7 +528,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderRHA (double theR, do SetErrorCode(KO); //Add a new Cylinder object - Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER); + Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER); //Add a new Cylinder function with R and H parameters Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H_A); @@ -579,7 +579,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Cylinder object - Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER); + Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER); //Add a new Cylinder function for creation a cylinder relatively to point and vector Handle(GEOM_Function) aFunction = @@ -637,7 +637,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRHA (Handle(GE if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Cylinder object - Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER); + Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER); //Add a new Cylinder function for creation a cylinder relatively to point and vector Handle(GEOM_Function) aFunction = @@ -694,7 +694,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConeR1R2H (double theR1, dou SetErrorCode(KO); //Add a new Cone object - Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE); + Handle(GEOM_Object) aCone = GetEngine()->AddObject(GEOM_CONE); //Add a new Cone function with R and H parameters Handle(GEOM_Function) aFunction = @@ -748,7 +748,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeConePntVecR1R2H (Handle(GEOM if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Cone object - Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE); + Handle(GEOM_Object) aCone = GetEngine()->AddObject(GEOM_CONE); //Add a new Cone function for creation a cone relatively to point and vector Handle(GEOM_Function) aFunction = @@ -804,7 +804,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSphereR (double theR) SetErrorCode(KO); //Add a new Sphere object - Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE); + Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GEOM_SPHERE); //Add a new Sphere function with R parameter Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_R); @@ -852,7 +852,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeSpherePntR (Handle(GEOM_Obje if (thePnt.IsNull()) return NULL; //Add a new Point object - Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE); + Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GEOM_SPHERE); //Add a new Sphere function for creation a sphere relatively to point Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_PNT_R); @@ -904,7 +904,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusRR SetErrorCode(KO); //Add a new Torus object - Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS); + Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_TORUS); //Add a new Torus function Handle(GEOM_Function) aFunction = @@ -955,7 +955,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeTorusPntVecRR if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Torus object - Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS); + Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_TORUS); //Add a new Torus function Handle(GEOM_Function) aFunction = @@ -1014,7 +1014,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH (Handle(GEOM_Objec if (theBase.IsNull() || theVec.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism relatively to vector Handle(GEOM_Function) aFunction = @@ -1077,7 +1077,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismVecH2Ways (Handle(GEOM_ if (theBase.IsNull() || theVec.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism relatively to vector Handle(GEOM_Function) aFunction = @@ -1136,7 +1136,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism relatively to two points Handle(GEOM_Function) aFunction = @@ -1200,7 +1200,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt2Ways if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism relatively to two points Handle(GEOM_Function) aFunction = @@ -1259,7 +1259,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ if (theBase.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism by DXDYDZ Handle(GEOM_Function) aFunction = @@ -1321,7 +1321,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ2Ways if (theBase.IsNull()) return NULL; //Add a new Prism object - Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM); + Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM); //Add a new Prism function for creation a Prism by DXDYDZ Handle(GEOM_Function) aFunction = @@ -1381,12 +1381,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism if ( theFuse ) { //Add a new Extruded Boss object - aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_BOSS); + aPrism = GetEngine()->AddObject(GEOM_EXTRUDED_BOSS); } else { //Add a new Extruded Cut object - aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_CUT); + aPrism = GetEngine()->AddObject(GEOM_EXTRUDED_CUT); } //Add a new Prism function for the creation of a Draft Prism feature @@ -1464,7 +1464,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_I3DPrimOperations::MakePipe if (theBase.IsNull() || thePath.IsNull()) return NULL; //Add a new Pipe object - Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function Handle(GEOM_Function) aFunction = @@ -1541,7 +1541,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle (Handle( if (theBase.IsNull() || theAxis.IsNull()) return NULL; //Add a new Revolution object - Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION); + Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GEOM_REVOLUTION); //Add a new Revolution function for creation a revolution relatively to axis Handle(GEOM_Function) aFunction = @@ -1597,7 +1597,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways if (theBase.IsNull() || theAxis.IsNull()) return NULL; //Add a new Revolution object - Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION); + Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GEOM_REVOLUTION); //Add a new Revolution function for creation a revolution relatively to axis Handle(GEOM_Function) aFunction = @@ -1659,7 +1659,7 @@ GEOMImpl_I3DPrimOperations::MakeFilling (std::list< Handle(GEOM_Object)> & theCo return NULL; } //Add a new Filling object - Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GetDocID(), GEOM_FILLING); + Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GEOM_FILLING); //Add a new Filling function for creation a filling from a compound Handle(GEOM_Function) aFunction = aFilling->AddFunction(GEOMImpl_FillingDriver::GetID(), BASIC_FILLING); @@ -1735,7 +1735,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections( return anObj; //Add a new ThruSections object - Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GetDocID(), GEOM_THRUSECTIONS); + Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GEOM_THRUSECTIONS); //Add a new ThruSections function @@ -1840,7 +1840,7 @@ Handle(TColStd_HSequenceOfTransient) Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length()); //Add a new Pipe object - Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function @@ -2016,7 +2016,7 @@ Handle(TColStd_HSequenceOfTransient) Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length()); //Add a new Pipe object - Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function @@ -2205,7 +2205,7 @@ Handle(TColStd_HSequenceOfTransient) Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length()); //Add a new Pipe object - Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function @@ -2348,7 +2348,7 @@ Handle(TColStd_HSequenceOfTransient) if (theBase.IsNull() || thePath.IsNull() || theVec.IsNull()) return NULL; //Add a new Pipe object - Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE); + Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GEOM_PIPE); //Add a new Pipe function Handle(GEOM_Function) aFunction = @@ -2438,7 +2438,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening if (isCopy) { //Add a new Copy object - aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + aCopy = GetEngine()->AddObject(theObject->GetType()); aFunction = aCopy->AddFunction(GEOMImpl_OffsetDriver::GetID(), OFFSET_THICKENING_COPY); } else @@ -2521,7 +2521,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath (Handle(GEOM_Object) if (theShape.IsNull() || theBase1.IsNull() || theBase2.IsNull()) return NULL; // Add a new Path object - Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH); + Handle(GEOM_Object) aPath = GetEngine()->AddObject(GEOM_PIPE_PATH); // Add a new Path function Handle(GEOM_Function) aFunction = @@ -2586,7 +2586,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath return NULL; // Add a new Path object - Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH); + Handle(GEOM_Object) aPath = GetEngine()->AddObject(GEOM_PIPE_PATH); // Add a new Path function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx index a65ac384a..7bf581c67 100644 --- a/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx @@ -36,7 +36,7 @@ class GEOMImpl_IPipe; class GEOMImpl_I3DPrimOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_I3DPrimOperations(); Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ); diff --git a/src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx b/src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx index ce1f61068..25ceb6d3f 100755 --- a/src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx @@ -39,12 +39,12 @@ typedef NCollection_DataMap< TCollection_ExtendedString, NCollection_ListAddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT); //Add a new Point function with XYZ parameters Handle(GEOM_Function) aFunction = @@ -138,7 +138,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference if (theReference.IsNull()) return NULL; //Add a new Point object - Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT); //Add a new Point function for creation a point relativley another point Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_XYZ_REF); @@ -197,7 +197,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom if (theGeomObj.IsNull()) return NULL; //Add a new Point object - Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT); //Add a new Point function for creation a point relativley another point int fType = POINT_CURVE_PAR; @@ -403,7 +403,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnLinesIntersection if (theLine1.IsNull() || theLine2.IsNull()) return NULL; //Add a new Point object - Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT); //Add a new Point function for creation a point relativley another point Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_LINES_INTERSECTION); @@ -455,7 +455,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentOnCurve if (theCurve.IsNull()) return NULL; //Add a new Vector object - Handle(GEOM_Object) aVec = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR); + Handle(GEOM_Object) aVec = GetEngine()->AddObject(GEOM_VECTOR); //Add a new Point function for creation a point relativley another point Handle(GEOM_Function) aFunction = aVec->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TANGENT_CURVE_PAR); @@ -504,7 +504,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorDXDYDZ SetErrorCode(KO); //Add a new Vector object - Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR); + Handle(GEOM_Object) aVector = GetEngine()->AddObject(GEOM_VECTOR); //Add a new Vector function with DXDYDZ parameters Handle(GEOM_Function) aFunction = @@ -555,7 +555,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeVectorTwoPnt if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL; //Add a new Vector object - Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR); + Handle(GEOM_Object) aVector = GetEngine()->AddObject(GEOM_VECTOR); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -609,7 +609,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLine if (thePnt.IsNull() || theDir.IsNull()) return NULL; //Add a new Line object - Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE); + Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE); //Add a new Line function Handle(GEOM_Function) aFunction = @@ -662,7 +662,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoPnt if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL; //Add a new Line object - Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE); + Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE); //Add a new Line function Handle(GEOM_Function) aFunction = @@ -715,7 +715,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeLineTwoFaces if (theFace1.IsNull() || theFace2.IsNull()) return NULL; //Add a new Line object - Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE); + Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE); //Add a new Line function Handle(GEOM_Function) aFunction = @@ -769,7 +769,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneThreePnt if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -826,7 +826,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlanePntVec if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -880,7 +880,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneFace if (theFace.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -933,7 +933,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlane2Vec if (theVec1.IsNull() || theVec2.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -985,7 +985,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePlaneLCS SetErrorCode(KO); //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = @@ -1040,7 +1040,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarker SetErrorCode(KO); //Add a new Marker object - Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER); + Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER); //Add a new Marker function Handle(GEOM_Function) aFunction = @@ -1091,7 +1091,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarkerFromShape SetErrorCode(KO); //Add a new Marker object - Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER); + Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER); //Add a new Marker function Handle(GEOM_Function) aFunction = @@ -1142,7 +1142,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeMarkerPntTwoVec SetErrorCode(KO); //Add a new Marker object - Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER); + Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER); //Add a new Marker function Handle(GEOM_Function) aFunction = @@ -1201,7 +1201,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakeTangentPlaneOnFace(const Hand if (theFace.IsNull()) return NULL; //Add a new Plane object - Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE); + Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE); //Add a new Plane function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IBasicOperations.hxx b/src/GEOMImpl/GEOMImpl_IBasicOperations.hxx index d19f875ef..89329c61e 100644 --- a/src/GEOMImpl/GEOMImpl_IBasicOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IBasicOperations.hxx @@ -31,7 +31,7 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IBasicOperations(); // Point diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx index db35fe4a4..7e0e24994 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx @@ -249,8 +249,8 @@ static Standard_Boolean IsQuadrangle(const TopoDS_Face &theFace, * constructor: */ //============================================================================= -GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations"); } @@ -281,7 +281,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad theEdge3.IsNull() || theEdge4.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Face function Handle(GEOM_Function) aFunction = @@ -342,7 +342,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad2Edges if (theEdge1.IsNull() || theEdge2.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Face function Handle(GEOM_Function) aFunction = @@ -400,7 +400,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeQuad4Vertices thePnt3.IsNull() || thePnt4.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Face function Handle(GEOM_Function) aFunction = @@ -465,7 +465,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa theFace5.IsNull() || theFace6.IsNull()) return NULL; //Add a new Solid object - Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK); + Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK); //Add a new Block function Handle(GEOM_Function) aFunction = @@ -532,7 +532,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeHexa2Faces if (theFace1.IsNull() || theFace2.IsNull()) return NULL; //Add a new Solid object - Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK); + Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK); //Add a new Block function Handle(GEOM_Function) aFunction = @@ -588,7 +588,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeBlockCompound if (theCompound.IsNull()) return NULL; //Add a new object - Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GetDocID(), GEOM_COMPOUND); + Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GEOM_COMPOUND); //Add a new BlocksComp function Handle(GEOM_Function) aFunction = @@ -2430,7 +2430,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::RemoveExtraEdges if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a function Handle(GEOM_Function) aFunction = @@ -2482,7 +2482,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::UnionFaces if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a function Handle(GEOM_Function) aFunction = @@ -2532,7 +2532,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::CheckAndImprove if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a function Handle(GEOM_Function) aFunction = @@ -3091,7 +3091,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation1D if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = @@ -3150,7 +3150,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::MakeMultiTransformation2D if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx index 37d69f74e..a11a4a311 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx @@ -36,7 +36,7 @@ class GEOM_Object; class GEOMImpl_IBlocksOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IBlocksOperations(); // Creation of blocks and block faces diff --git a/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx b/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx index 19812c257..3c86c5fb8 100644 --- a/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx @@ -49,8 +49,8 @@ * constructor: */ //============================================================================= -GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations"); } @@ -82,7 +82,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean if (theShape1.IsNull() || theShape2.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction; @@ -162,7 +162,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuse if (theShape1.IsNull() || theShape2.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction = @@ -225,7 +225,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList if (theShapes.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction = @@ -286,7 +286,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeCommonList if (theShapes.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction = @@ -353,7 +353,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeCutList if (theShapes.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN); + Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN); //Add a new Boolean function Handle(GEOM_Function) aFunction = @@ -429,7 +429,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition SetErrorCode(KO); //Add a new Partition object - Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GetDocID(), GEOM_PARTITION); + Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GEOM_PARTITION); //Add a new Partition function Handle(GEOM_Function) aFunction; @@ -565,7 +565,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeHalfPartition if (theShape.IsNull() || thePlane.IsNull()) return NULL; //Add a new Boolean object - Handle(GEOM_Object) aPart = GetEngine()->AddObject(GetDocID(), GEOM_PARTITION); + Handle(GEOM_Object) aPart = GetEngine()->AddObject(GEOM_PARTITION); //Add a new Partition function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx b/src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx index af3e46d3b..602f0132f 100644 --- a/src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx @@ -33,7 +33,7 @@ class GEOM_Object; class GEOMImpl_IBooleanOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IBooleanOperations(); Standard_EXPORT Handle(GEOM_Object) MakeBoolean diff --git a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx index 3d9bf31ad..1e7bc9f8e 100644 --- a/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx @@ -183,8 +183,8 @@ namespace * constructor: */ //============================================================================= -GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations"); } @@ -214,7 +214,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCircleThreePnt (Handle(GEOM_ if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle object - Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE); + Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE); //Add a new Circle function for creation a circle relatively to three points Handle(GEOM_Function) aFunction = @@ -272,7 +272,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCircleCenter2Pnt (Handle(GEO if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle object - Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE); + Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE); //Add a new Circle function for creation a circle relatively to center and 2 points Handle(GEOM_Function) aFunction = @@ -331,7 +331,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCirclePntVecR //if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Circle object - Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE); + Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE); //Add a new Circle function for creation a circle relatively to point and vector Handle(GEOM_Function) aFunction = @@ -397,7 +397,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeEllipse //if (thePnt.IsNull() || theVec.IsNull()) return NULL; //Add a new Ellipse object - Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_ELLIPSE); + Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_ELLIPSE); //Add a new Ellipse function Handle(GEOM_Function) aFunction = @@ -473,7 +473,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArc (Handle(GEOM_Object) the if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle Arc object - Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC); + Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_CIRC_ARC); //Add a new Circle Arc function Handle(GEOM_Function) aFunction = @@ -531,7 +531,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArcCenter (Handle(GEOM_Objec if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle Arc object - Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC); + Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_CIRC_ARC); //Add a new Circle Arc function Handle(GEOM_Function) aFunction = @@ -589,7 +589,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeArcOfEllipse (Handle(GEOM_Ob if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL; //Add a new Circle Arc object - Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_ELLIPSE_ARC); + Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_ELLIPSE_ARC); //Add a new Circle Arc function Handle(GEOM_Function) aFunction = @@ -644,7 +644,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline (std::listAddObject(GetDocID(), GEOM_POLYLINE); + Handle(GEOM_Object) aPolyline = GetEngine()->AddObject(GEOM_POLYLINE); //Add a new Polyline function for creation a polyline relatively to points set Handle(GEOM_Function) aFunction = @@ -714,7 +714,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineBezier SetErrorCode(KO); //Add a new Spline object - Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for creation a bezier curve relatively to points set Handle(GEOM_Function) aFunction = @@ -784,7 +784,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolation SetErrorCode(KO); //Add a new Spline object - Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for interpolation type Handle(GEOM_Function) aFunction = @@ -855,7 +855,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSplineInterpolWithTangents SetErrorCode(KO); //Add a new Spline object - Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for interpolation type Handle(GEOM_Function) aFunction = @@ -1069,7 +1069,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric switch(theCurveType) { case Polyline: { //Add a new Polyline object - aCurve = GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE); + aCurve = GetEngine()->AddObject(GEOM_POLYLINE); //Add a new Polyline function for creation a polyline relatively to points set aFunction = aCurve->AddFunction(GEOMImpl_PolylineDriver::GetID(), POLYLINE_POINTS); @@ -1089,7 +1089,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric } case Bezier: { //Add a new Spline object - aCurve = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + aCurve = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for creation a bezier curve relatively to points set aFunction = aCurve->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_BEZIER); @@ -1108,7 +1108,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric } case Interpolation: { //Add a new Spline object - aCurve = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE); + aCurve = GetEngine()->AddObject(GEOM_SPLINE); //Add a new Spline function for creation a bezier curve relatively to points set aFunction = aCurve->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_INTERPOLATION); @@ -1185,7 +1185,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcher (const char* theCom if (!theCommand || strcmp(theCommand, "") == 0) return NULL; //Add a new Sketcher object - Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER); + Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_SKETCHER); //Add a new Sketcher function Handle(GEOM_Function) aFunction = @@ -1248,7 +1248,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeSketcherOnPlane if (!theCommand || strcmp(theCommand, "") == 0) return NULL; //Add a new Sketcher object - Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER); + Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_SKETCHER); //Add a new Sketcher function Handle(GEOM_Function) aFunction = @@ -1301,7 +1301,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::Make3DSketcherCommand (const cha if (!theCommand || strcmp(theCommand, "") == 0) return NULL; //Add a new Sketcher object - Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_3DSKETCHER); + Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_3DSKETCHER); //Add a new Sketcher function Handle(GEOM_Function) aFunction = @@ -1348,7 +1348,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::Make3DSketcher (std::listAddObject(GetDocID(), GEOM_3DSKETCHER); + Handle(GEOM_Object) a3DSketcher = GetEngine()->AddObject(GEOM_3DSKETCHER); //Add a new Sketcher function Handle(GEOM_Function) aFunction = @@ -1421,7 +1421,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeIsoline //Add a new Spline object Handle(GEOM_Object) anIsoline = - GetEngine()->AddObject(GetDocID(), GEOM_ISOLINE); + GetEngine()->AddObject(GEOM_ISOLINE); //Add a new Spline function for interpolation type Handle(GEOM_Function) aFunction = @@ -1490,7 +1490,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline2D // Add a new Polyline object Handle(GEOM_Object) aResult = - GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D); + GetEngine()->AddObject(GEOM_POLYLINE2D); Handle(GEOM_Function) aFunction = aResult->AddFunction (GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_COORDS); @@ -1563,7 +1563,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakePolyline2DOnPlane //Add a new Polyline object Handle(GEOM_Object) aResult = - GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D); + GetEngine()->AddObject(GEOM_POLYLINE2D); Handle(GEOM_Function) aFunction = aResult->AddFunction (GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_OBJECT); diff --git a/src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx b/src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx index 2eb9459aa..2d7c58fe1 100644 --- a/src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx @@ -38,7 +38,7 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations { enum CurveType { Polyline, Bezier, Interpolation }; - Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_ICurvesOperations(); Standard_EXPORT Handle(GEOM_Object) MakeCircleThreePnt (Handle(GEOM_Object) thePnt1, diff --git a/src/GEOMImpl/GEOMImpl_IECallBack.cxx b/src/GEOMImpl/GEOMImpl_IECallBack.cxx index 77575f7e1..6fccfba52 100755 --- a/src/GEOMImpl/GEOMImpl_IECallBack.cxx +++ b/src/GEOMImpl/GEOMImpl_IECallBack.cxx @@ -56,8 +56,7 @@ GEOMImpl_Gen* GEOMImpl_IECallBack::GetEngine() * Export */ //============================================================================= -bool GEOMImpl_IECallBack::Export( int /*theDocId*/, - const Handle(GEOM_Object) /*theOriginal*/, +bool GEOMImpl_IECallBack::Export( const Handle(GEOM_Object) /*theOriginal*/, const TCollection_AsciiString& /*theFileName*/, const TCollection_AsciiString& /*theFormatName*/ ) { @@ -70,8 +69,7 @@ bool GEOMImpl_IECallBack::Export( int /*theDocId*/, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -GEOMImpl_IECallBack::Import( int /*theDocId*/, - const TCollection_AsciiString& /*theFormatName*/, +GEOMImpl_IECallBack::Import( const TCollection_AsciiString& /*theFormatName*/, const TCollection_AsciiString& /*theFileName*/ ) { return NULL; @@ -83,8 +81,7 @@ GEOMImpl_IECallBack::Import( int /*theDocId*/, */ //============================================================================= TCollection_AsciiString -GEOMImpl_IECallBack::ReadValue( int /*theDocId*/, - const TCollection_AsciiString& /*theFileName*/, +GEOMImpl_IECallBack::ReadValue( const TCollection_AsciiString& /*theFileName*/, const TCollection_AsciiString& /*theFormatName*/, const TCollection_AsciiString& /*theParameterName*/ ) { diff --git a/src/GEOMImpl/GEOMImpl_IECallBack.hxx b/src/GEOMImpl/GEOMImpl_IECallBack.hxx index ef7a7d06d..6373aa600 100644 --- a/src/GEOMImpl/GEOMImpl_IECallBack.hxx +++ b/src/GEOMImpl/GEOMImpl_IECallBack.hxx @@ -37,21 +37,18 @@ class GEOMImpl_IECallBack Standard_EXPORT GEOMImpl_IECallBack(); Standard_EXPORT ~GEOMImpl_IECallBack(); - Standard_EXPORT virtual bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, + Standard_EXPORT virtual bool Export( const Handle(GEOM_Object) theOriginal, const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName ); Standard_EXPORT virtual - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); Standard_EXPORT virtual - TCollection_AsciiString ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theParameterName ); + TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theParameterName ); Standard_EXPORT static void Register( const TCollection_AsciiString& theFormatName, GEOMImpl_IECallBack* theCallBack ); diff --git a/src/GEOMImpl/GEOMImpl_IFieldOperations.cxx b/src/GEOMImpl/GEOMImpl_IFieldOperations.cxx index c0b219e29..f6ad9f493 100644 --- a/src/GEOMImpl/GEOMImpl_IFieldOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IFieldOperations.cxx @@ -39,8 +39,8 @@ * constructor: */ //============================================================================= -GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations"); } @@ -96,7 +96,7 @@ CreateField( const Handle(GEOM_Object)& theShape, // make a field Handle(GEOM_Field) aField = Handle(GEOM_Field)::DownCast - ( GetEngine()->AddBaseObject( GetDocID(), GEOM_FIELD )); + ( GetEngine()->AddBaseObject( GEOM_FIELD )); // set field data aField->Init( theShape, theName, theType, theDimension, theComponentNames ); @@ -142,7 +142,7 @@ int GEOMImpl_IFieldOperations::CountFields( const Handle(GEOM_Object)& theShape for (; anIt.More(); anIt.Next()) { TCollection_ExtendedString& anEntry = anIt.Value(); anEntry.ToUTF8CString( (Standard_PCharacter&) pentry ); - Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), entry, false); + Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(entry, false); nbFields += ( !anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Field)) ); } @@ -178,7 +178,7 @@ GEOMImpl_IFieldOperations::GetFields( const Handle(GEOM_Object)& theShape ) for (; anIt.More(); anIt.Next()) { TCollection_ExtendedString& anEntry = anIt.Value(); anEntry.ToUTF8CString( (Standard_PCharacter&) pentry ); - Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), entry, false); + Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(entry, false); if ( !anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Field)) ) { Handle(GEOM_Field) field = Handle(GEOM_Field)::DownCast( anObj ); @@ -222,7 +222,7 @@ GEOMImpl_IFieldOperations::GetField( const Handle(GEOM_Object)& theShape, for (; anIt.More(); anIt.Next()) { TCollection_ExtendedString& anEntry = anIt.Value(); anEntry.ToUTF8CString( (Standard_PCharacter&) pentry ); - field = Handle(GEOM_Field)::DownCast( GetEngine()->GetObject( GetDocID(), entry, false )); + field = Handle(GEOM_Field)::DownCast( GetEngine()->GetObject( entry, false )); if ( !field.IsNull() && field->GetName() == theName ) { SetErrorCode(OK); break; diff --git a/src/GEOMImpl/GEOMImpl_IFieldOperations.hxx b/src/GEOMImpl/GEOMImpl_IFieldOperations.hxx index 4a4cd3ae2..4358141eb 100644 --- a/src/GEOMImpl/GEOMImpl_IFieldOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IFieldOperations.hxx @@ -34,7 +34,7 @@ class GEOM_Object; class GEOMImpl_IFieldOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IFieldOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IFieldOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IFieldOperations(); Standard_EXPORT Handle(GEOM_Field) diff --git a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx index 4e6965c4f..46f57fac8 100644 --- a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx @@ -53,8 +53,8 @@ * constructor: */ //============================================================================= -GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations"); } diff --git a/src/GEOMImpl/GEOMImpl_IGroupOperations.hxx b/src/GEOMImpl/GEOMImpl_IGroupOperations.hxx index 68556eb13..3145e799c 100644 --- a/src/GEOMImpl/GEOMImpl_IGroupOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IGroupOperations.hxx @@ -34,7 +34,7 @@ class GEOMImpl_IGroupOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IGroupOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IGroupOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IGroupOperations(); Standard_EXPORT Handle(GEOM_Object) CreateGroup(Handle(GEOM_Object) theMainShape, TopAbs_ShapeEnum theShapeType); diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx index baf47d45d..f897d9573 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx @@ -60,8 +60,8 @@ * constructor: */ //============================================================================= -GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { myModifStats = new ShHealOper_ModifStats; MESSAGE("GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations"); @@ -117,7 +117,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ShapeProcess (Handle(GEOM_Objec if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SHAPE_PROCESS); @@ -334,7 +334,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::SuppressFaces if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SUPPRESS_FACES); @@ -402,7 +402,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CLOSE_CONTOUR); @@ -471,7 +471,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveIntWires if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INT_WIRES); @@ -538,7 +538,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), FILL_HOLES); @@ -611,7 +611,7 @@ GEOMImpl_IHealingOperations::Sew (std::list& theObjects, } // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function int aFunctionType = (isAllowNonManifold ? SEWING_NON_MANIFOLD : SEWING); @@ -680,7 +680,7 @@ GEOMImpl_IHealingOperations::RemoveInternalFaces (std::list< Handle(GEOM_Object) } // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY); //Add the function Handle(GEOM_Function) @@ -738,7 +738,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE); @@ -805,7 +805,7 @@ GEOMImpl_IHealingOperations::DivideEdgeByPoint (Handle(GEOM_Object) } // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY ); //Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE_BY_POINT); @@ -860,7 +860,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FuseCollinearEdgesWithinWire if (theWire.IsNull()) return NULL; // Add a new object - Handle(GEOM_Object) aRes = GetEngine()->AddObject(GetDocID(), theWire->GetType()); + Handle(GEOM_Object) aRes = GetEngine()->AddObject(theWire->GetType()); // Add a new function Handle(GEOM_Function) aFunction; @@ -973,7 +973,7 @@ bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(TColStd_HSequenceOfTra TopExp_Explorer anExp; for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() ) { - anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS ); + anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS ); aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF ); TopoDS_Shape aValueShape = anExp.Current(); aFunction->SetValue( aValueShape ); @@ -981,7 +981,7 @@ bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(TColStd_HSequenceOfTra } for ( anExp.Init( anOpen, TopAbs_WIRE ); anExp.More(); anExp.Next() ) { - anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS ); + anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS ); aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF ); TopoDS_Shape aValueShape = anExp.Current(); aFunction->SetValue( aValueShape ); @@ -1116,7 +1116,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G return NULL; //There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY); if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066 //Add the function @@ -1189,7 +1189,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Obj return NULL; // There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(theObject->GetType()); // Add the function aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), LIMIT_TOLERANCE); diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx index 8412c79f8..d29456e89 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx @@ -37,7 +37,7 @@ class ShHealOper_ModifStats; class GEOMImpl_IHealingOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IHealingOperations(); // Apply Shape Processing to the selected Object diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx index 6b12c9bf2..d41f1825d 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx @@ -73,13 +73,13 @@ * constructor */ //============================================================================= -GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations"); - myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID()); - myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID()); - myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine(), GetDocID()); + myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine()); + myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine()); + myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine()); } //============================================================================= @@ -107,7 +107,7 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::MakeCopy (Handle(GEOM_Object) th if (theOriginal.IsNull()) return NULL; //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a Copy function for creation a copy object Handle(GEOM_Function) aFunction = aCopy->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITH_REF); @@ -157,7 +157,7 @@ void GEOMImpl_IInsertOperations::Export if (theOriginal.IsNull()) return; - if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( GetDocID(), theOriginal, theFileName, theFormatName ) ) + if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( theOriginal, theFileName, theFormatName ) ) return; SetErrorCode(OK); } @@ -176,7 +176,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IInsertOperations::Import if (theFileName.IsEmpty() || theFormatName.IsEmpty()) return NULL; Handle(TColStd_HSequenceOfTransient) aSeq = - GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( GetDocID(), theFormatName, theFileName ); + GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( theFormatName, theFileName ); SetErrorCode(OK); return aSeq; } @@ -195,7 +195,7 @@ TCollection_AsciiString GEOMImpl_IInsertOperations::ReadValue TCollection_AsciiString aValue; if (theFileName.IsEmpty() || theFormatName.IsEmpty() || theParameterName.IsEmpty()) return aValue; - aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( GetDocID(), theFileName, theFormatName, theParameterName ); + aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( theFileName, theFormatName, theParameterName ); SetErrorCode(OK); return aValue; @@ -211,7 +211,7 @@ Handle(GEOM_Object) GEOMImpl_IInsertOperations::RestoreShape (std::istringstream SetErrorCode(KO); //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_COPY); //Add a Copy function Handle(GEOM_Function) aFunction = result->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF); @@ -298,7 +298,7 @@ int GEOMImpl_IInsertOperations::LoadTexture(const TCollection_AsciiString& theTe for (i = 1, bdit = bytedata.begin(); bdit != bytedata.end(); ++bdit, ++i) aTexture->SetValue(i, (Standard_Byte)(*bdit)); - int aTextureId = GetEngine()->addTexture(GetDocID(), lenbytes*8, lines.size(), aTexture, theTextureFile); + int aTextureId = GetEngine()->addTexture(lenbytes*8, lines.size(), aTexture, theTextureFile); if (aTextureId > 0) SetErrorCode(OK); return aTextureId; } @@ -307,7 +307,7 @@ int GEOMImpl_IInsertOperations::AddTexture(int theWidth, int theHeight, const Handle(TColStd_HArray1OfByte)& theTexture) { SetErrorCode(KO); - int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture); + int aTextureId = GetEngine()->addTexture(theWidth, theHeight, theTexture); if (aTextureId > 0) SetErrorCode(OK); return aTextureId; } @@ -325,7 +325,7 @@ Handle(TColStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theText if (theTextureId <= 0) return aTexture; - aTexture = GetEngine()->getTexture(GetDocID(), theTextureId, theWidth, theHeight, aFileName); + aTexture = GetEngine()->getTexture(theTextureId, theWidth, theHeight, aFileName); if (theWidth > 0 && theHeight > 0 && aTexture->Length() > 0) SetErrorCode(OK); @@ -335,7 +335,7 @@ Handle(TColStd_HArray1OfByte) GEOMImpl_IInsertOperations::GetTexture(int theText std::list GEOMImpl_IInsertOperations::GetAllTextures() { SetErrorCode(KO); - std::list id_list = GetEngine()->getAllTextures(GetDocID()); + std::list id_list = GetEngine()->getAllTextures(); SetErrorCode(OK); return id_list; } @@ -359,7 +359,7 @@ bool GEOMImpl_IInsertOperations::TransferData //Add a new Transfer Data object object Handle(GEOM_Object) aTDObj = - GetEngine()->AddObject(GetDocID(), GEOM_TRANSFER_DATA); + GetEngine()->AddObject(GEOM_TRANSFER_DATA); //Add a Transfer Data function for created object Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx index c4e41b09b..7552ba4a9 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx @@ -56,7 +56,7 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations { long myMaxNumber; }; - Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IInsertOperations(); diff --git a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx index fdd3c307b..726b82719 100644 --- a/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ILocalOperations.cxx @@ -67,8 +67,8 @@ * constructor: */ //============================================================================= -GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations"); } @@ -95,7 +95,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletAll SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -146,7 +146,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdges SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -213,7 +213,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletEdgesR1R2 SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -282,7 +282,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFaces SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -349,7 +349,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFilletFacesR1R2 SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET); + Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -417,7 +417,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet2D SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_2D); + Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GEOM_FILLET_2D); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -485,7 +485,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeFillet1D SetErrorCode(KO); //Add a new Fillet object - Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_1D); + Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GEOM_FILLET_1D); //Add a new Fillet function Handle(GEOM_Function) aFunction = @@ -553,7 +553,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferAll (Handle(GEOM_Objec SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -605,7 +605,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdge SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -661,7 +661,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdgeAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -716,7 +716,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFaces SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -785,7 +785,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferFacesAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -854,7 +854,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdges SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -924,7 +924,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeChamferEdgesAD SetErrorCode(KO); //Add a new Chamfer object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER); //Add a new Chamfer function Handle(GEOM_Function) aFunction = @@ -995,7 +995,7 @@ Handle(GEOM_Object) GEOMImpl_ILocalOperations::MakeArchimede (Handle(GEOM_Object SetErrorCode(KO); //Add a new Archimede object - Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_ARCHIMEDE); + Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_ARCHIMEDE); //Add a new Archimede function Handle(GEOM_Function) aFunction = aChamfer->AddFunction(GEOMImpl_ArchimedeDriver::GetID(), ARCHIMEDE_TYPE); @@ -1073,7 +1073,7 @@ Standard_Integer GEOMImpl_ILocalOperations::GetSubShapeIndex (Handle(GEOM_Object if (aGen) { GEOMImpl_IShapesOperations* anIShapesOperations = - aGen->GetIShapesOperations(GetDocID()); + aGen->GetIShapesOperations(); anInd = anIShapesOperations->GetSubShapeIndex(theShape, theSubShape); SetErrorCode(anIShapesOperations->GetErrorCode()); } diff --git a/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx b/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx index 672e7daf4..371671f40 100644 --- a/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_ILocalOperations.hxx @@ -33,7 +33,7 @@ class GEOMImpl_ILocalOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_ILocalOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_ILocalOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_ILocalOperations(); Standard_EXPORT Handle(GEOM_Object) MakeFilletAll (Handle(GEOM_Object) theShape, double theR); diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index 080d8b858..5ba7548b4 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -86,8 +86,8 @@ * Constructor */ //============================================================================= -GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations"); } @@ -807,7 +807,7 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetCentreOfMass if (theShape.IsNull()) return NULL; //Add a new CentreOfMass object - Handle(GEOM_Object) aCDG = GetEngine()->AddObject(GetDocID(), GEOM_CDG); + Handle(GEOM_Object) aCDG = GetEngine()->AddObject(GEOM_CDG); //Add a new CentreOfMass function Handle(GEOM_Function) aFunction = @@ -862,7 +862,7 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetVertexByIndex if (aRefShape.IsNull()) return NULL; //Add a new Vertex object - Handle(GEOM_Object) aVertex = GetEngine()->AddObject(GetDocID(), GEOM_POINT); + Handle(GEOM_Object) aVertex = GetEngine()->AddObject(GEOM_POINT); //Add a function Handle(GEOM_Function) aFunction = @@ -911,7 +911,7 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetNormal if (theFace.IsNull()) return NULL; //Add a new Normale object - Handle(GEOM_Object) aNorm = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR); + Handle(GEOM_Object) aNorm = GetEngine()->AddObject(GEOM_VECTOR); //Add a new Normale function Handle(GEOM_Function) aFunction = @@ -1152,7 +1152,7 @@ Handle(GEOM_Object) GEOMImpl_IMeasureOperations::GetBoundingBox if (theShape.IsNull()) return NULL; //Add a new BoundingBox object - Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GetDocID(), GEOM_BOX); + Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GEOM_BOX); //Add a new BoundingBox function const int aType = (precise ? BND_BOX_MEASURE_PRECISE : BND_BOX_MEASURE); diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx index 3ee231128..29bb2ba21 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx @@ -41,7 +41,7 @@ class GEOM_Object; class GEOMImpl_IMeasureOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IMeasureOperations(); enum ShapeKind { diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index fd5f459f9..d24cc9c8a 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -168,8 +168,8 @@ namespace * constructor: */ //============================================================================= -GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations"); } @@ -197,7 +197,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdge if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL; //Add a new Edge object - Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -252,7 +252,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdgeOnCurveByLength if (theRefCurve.IsNull()) return NULL; //Add a new Edge object - Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -311,7 +311,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdgeWire if (theWire.IsNull()) return NULL; //Add a new Edge object - Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -377,7 +377,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeWire SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aWire = GetEngine()->AddObject(GetDocID(), GEOM_WIRE); + Handle(GEOM_Object) aWire = GetEngine()->AddObject(GEOM_WIRE); //Add a new function Handle(GEOM_Function) aFunction = @@ -449,7 +449,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFace (Handle(GEOM_Object) th if (theWire.IsNull()) return NULL; //Add a new Face object - Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Shape function for creation of a face from a wire Handle(GEOM_Function) aFunction = @@ -509,7 +509,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWires SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE); //Add a new function Handle(GEOM_Function) aFunction = @@ -588,7 +588,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceFromSurface SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE); //Add a new function Handle(GEOM_Function) aFunction = @@ -658,7 +658,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWithConstraints SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FILLING); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FILLING); //Add a new function Handle(GEOM_Function) aFunction = @@ -799,7 +799,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShape SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), theObjectType); + Handle(GEOM_Object) aShape = GetEngine()->AddObject(theObjectType); //Add a new function Handle(GEOM_Function) aFunction = @@ -869,7 +869,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidFromConnectedFaces SetErrorCode(KO); //Add a new object - Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID); + Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GEOM_SOLID); //Add a new function Handle(GEOM_Function) aFunction = @@ -947,7 +947,7 @@ GEOMImpl_IShapesOperations::MakeGlueFaces (std::list< Handle(GEOM_Object) >& the } //Add a new Glued object - Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED); + Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED); //Add a new Glue function Handle(GEOM_Function) aFunction; @@ -1095,7 +1095,7 @@ GEOMImpl_IShapesOperations::MakeGlueFacesByList(std::list< Handle(GEOM_Object) > } //Add a new Glued object - Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED); + Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED); //Add a new Glue function Handle(GEOM_Function) aFunction; @@ -1163,7 +1163,7 @@ GEOMImpl_IShapesOperations::MakeGlueEdges (std::list< Handle(GEOM_Object) >& the } //Add a new Glued object - Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED); + Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED); //Add a new Glue function Handle(GEOM_Function) aFunction; @@ -1344,7 +1344,7 @@ GEOMImpl_IShapesOperations::MakeGlueEdgesByList (std::list< Handle(GEOM_Object) return NULL; } //Add a new Glued object - Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED); + Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED); //Add a new Glue function Handle(GEOM_Function) aFunction; @@ -1452,7 +1452,7 @@ GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object) theShap Standard_Integer aStrLen = anEntry.LengthOfCString(); char* anEntryStr = new char[aStrLen+1]; anEntry.ToUTF8CString(anEntryStr); - Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), anEntryStr, false); + Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(anEntryStr, false); if (!anObj.IsNull() ) { bool isGroup = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() == GEOM_GROUP; bool isSubShape = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() != GEOM_GROUP; @@ -1553,7 +1553,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode //anObj = GetEngine()->AddSubShape(theShape, anArray); { - anObj = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE); + anObj = GetEngine()->AddObject(GEOM_SUBSHAPE); Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1); if (aFunction.IsNull()) return aSeq; @@ -1766,7 +1766,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeSubShapes anArray = new TColStd_HArray1OfInteger(1,1); anArray->SetValue(1, id); - anObj = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE); + anObj = GetEngine()->AddObject(GEOM_SUBSHAPE); if (!anObj.IsNull()) { Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1); if (aFunction.IsNull()) return aSeq; @@ -2155,7 +2155,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object) /* //Add a new reversed object - Handle(GEOM_Object) aReversed = GetEngine()->AddObject(GetDocID(), theShape->GetType()); + Handle(GEOM_Object) aReversed = GetEngine()->AddObject(theShape->GetType()); //Add a new Revese function Handle(GEOM_Function) aFunction; @@ -2201,7 +2201,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object) if (aGen) { GEOMImpl_IHealingOperations* anIHealingOperations = - aGen->GetIHealingOperations(GetDocID()); + aGen->GetIHealingOperations(); aReversed = anIHealingOperations->ChangeOrientationCopy(theShape); SetErrorCode(anIHealingOperations->GetErrorCode()); } @@ -3000,7 +3000,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetShapesOnShapeAsCompound } //Add a new result object - Handle(GEOM_Object) aRes = GetEngine()->AddObject(GetDocID(), GEOM_SHAPES_ON_SHAPE); + Handle(GEOM_Object) aRes = GetEngine()->AddObject(GEOM_SHAPES_ON_SHAPE); Handle(GEOM_Function) aFunction = aRes->AddFunction(GEOMImpl_ShapeDriver::GetID(), SHAPES_ON_SHAPE); aFunction->SetValue(aCompound); @@ -3182,7 +3182,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeExtraction //Add a new Result object Handle(GEOM_Object) aResult = - GetEngine()->AddObject(GetDocID(), GEOM_EXTRACTION); + GetEngine()->AddObject(GEOM_EXTRACTION); //Add a new Extraction function Handle(GEOM_Function) aFunction = @@ -5140,7 +5140,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ExtendEdge } //Add a new Edge object - Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GEOM_EDGE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -5207,7 +5207,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ExtendFace } //Add a new Face object - Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Vector function Handle(GEOM_Function) aFunction = @@ -5273,7 +5273,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSurfaceFromFace } //Add a new Face object - Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE); + Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GEOM_FACE); //Add a new Vector function Handle(GEOM_Function) aFunction = diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx index 2b2631cd6..b6d11a822 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx @@ -78,7 +78,7 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations std::list indices; ///< Shape indices touched by this type of modification. }; - Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_IShapesOperations(); Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1, diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx index 34af46dff..e2046fb0f 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx @@ -77,8 +77,8 @@ */ //============================================================================= -GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine, int theDocID) -: GEOM_IOperations(theEngine, theDocID) +GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine) +: GEOM_IOperations(theEngine) { MESSAGE("GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations"); } @@ -217,7 +217,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPointsCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = @@ -270,7 +270,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = @@ -375,7 +375,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a translate function Handle(GEOM_Function) aFunction = @@ -431,7 +431,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorDistance //Add a translate function if (theCopy) { - aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + aCopy = GetEngine()->AddObject(theObject->GetType()); aFunction = aCopy->AddFunction(GEOMImpl_TranslateDriver::GetID(), TRANSLATE_VECTOR_DISTANCE); } else { @@ -493,7 +493,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate1D if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a translate function Handle(GEOM_Function) aFunction = @@ -552,7 +552,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate2D (Handle(GEOM_Obje if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a translate function Handle(GEOM_Function) aFunction = @@ -806,7 +806,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlaneCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a mirror function Handle(GEOM_Function) aFunction = @@ -909,7 +909,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPointCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a mirror function Handle(GEOM_Function) aFunction = @@ -1012,7 +1012,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxisCopy if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a mirror function Handle(GEOM_Function) aFunction = @@ -1113,7 +1113,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a new Offset function Handle(GEOM_Function) aFunction = @@ -1184,7 +1184,7 @@ GEOMImpl_ITransformOperations::ProjectShapeCopy (Handle(GEOM_Object) theSource, else { //Add a new Projection object - aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION); + aCopy = GetEngine()->AddObject(GEOM_PROJECTION); //Add a Projection function Handle(GEOM_Function) aFunction = @@ -1248,7 +1248,7 @@ Standard_Real GEOMImpl_ITransformOperations::ProjectPointOnWire } //Add a new Projection object - thePointOnEdge = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION); + thePointOnEdge = GetEngine()->AddObject(GEOM_PROJECTION); //Add a Projection function Handle(GEOM_Function) aFunction = thePointOnEdge->AddFunction @@ -1363,7 +1363,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeCopy if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be scaled //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a scale function Handle(GEOM_Function) aFunction = @@ -1429,7 +1429,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeAlongAxes (Handle(G Handle(GEOM_Object) aCopy; //Add a new Copy object Handle(GEOM_Function) aFunction; if (doCopy) { - aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + aCopy = GetEngine()->AddObject(theObject->GetType()); aFunction = aCopy->AddFunction(GEOMImpl_ScaleDriver::GetID(), SCALE_SHAPE_AXES_COPY); } else { @@ -1554,7 +1554,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a position function Standard_Integer aType = POSITION_SHAPE_COPY; @@ -1616,7 +1616,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionAlongPath Handle(GEOM_Object) aCopy; if (theCopy) { - aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + aCopy = GetEngine()->AddObject(theObject->GetType()); aFunction = aCopy->AddFunction(GEOMImpl_PositionDriver::GetID(), POSITION_ALONG_PATH); } else @@ -1733,7 +1733,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_COPY); @@ -1786,7 +1786,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D); @@ -1841,7 +1841,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate1D (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D_STEP); @@ -1902,7 +1902,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D); @@ -1965,7 +1965,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate2D (Handle(GEOM_Object) if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType()); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D); @@ -2087,7 +2087,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePointsCopy (Handle if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated //Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); //Add a rotate function aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_THREE_POINTS_COPY); @@ -2144,7 +2144,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object // Add a new Copy object - Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY); + Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY); // Add a transform function (depends on theSample function) Handle(GEOM_Function) aFunction = @@ -2295,7 +2295,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MakeProjectionOnCylinder //Add a new Projection object Handle(GEOM_Object) aResult = - GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION); + GetEngine()->AddObject(GEOM_PROJECTION); //Add a Projection function Handle(GEOM_Function) aFunction = aResult->AddFunction diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx index 46fb60dcb..c29d1c780 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.hxx @@ -37,7 +37,7 @@ class GEOMImpl_IRotate; class GEOMImpl_ITransformOperations : public GEOM_IOperations { public: - Standard_EXPORT GEOMImpl_ITransformOperations(GEOM_Engine* theEngine, int theDocID); + Standard_EXPORT GEOMImpl_ITransformOperations(GEOM_Engine* theEngine); Standard_EXPORT ~GEOMImpl_ITransformOperations(); Standard_EXPORT Handle(GEOM_Object) TranslateTwoPoints (Handle(GEOM_Object) theObject, diff --git a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx index 867845185..f512eabd5 100644 --- a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx @@ -69,7 +69,7 @@ Standard_Integer GEOMImpl_ImportDriver::Execute(LOGBOOK& log) const return 0; Handle(TColStd_HSequenceOfTransient) aSeq = - GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( GetDocID(), aFormatName, aFileName ); + GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( aFormatName, aFileName ); if( aSeq.IsNull() ) return 0; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index a5e9d98fe..f5a2dd843 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -457,7 +457,7 @@ void GEOMToolsGUI::OnEditDelete() } _PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder()); - GEOM_Displayer* disp = new GEOM_Displayer( appStudy ); + GEOM_Displayer* disp = new GEOM_Displayer(); if ( isComponentSelected ) { // GEOM component is selected: delete all objects recursively @@ -572,8 +572,7 @@ void GEOMToolsGUI::deactivate() { SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( app ) { - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - GEOM_Displayer aDisp (appStudy); + GEOM_Displayer aDisp; aDisp.GlobalSelection(); getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS); } diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 5b4273c95..28dc3571e 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -168,7 +168,7 @@ void GEOMToolsGUI::OnAutoColor() QList aReservedColors; - GEOM_Displayer displayer ( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -256,7 +256,7 @@ void GEOMToolsGUI::OnColor() aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; // get active view SALOME_View* window = displayer.GetActiveView(); @@ -308,7 +308,7 @@ void GEOMToolsGUI::OnTexture() aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -351,7 +351,7 @@ void GEOMToolsGUI::OnChangeTransparency( bool increase ) aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -396,7 +396,7 @@ void GEOMToolsGUI::OnNbIsos( ActionType actionType ) aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -466,7 +466,7 @@ void GEOMToolsGUI::OnDeflection() aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -496,8 +496,7 @@ void GEOMToolsGUI::OnSelectOnly(int mode) { SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if ( app ) { - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - GEOM_Displayer aDisp (appStudy); + GEOM_Displayer aDisp; aDisp.GlobalSelection(mode); getGeometryGUI()->setLocalSelectionMode(mode); } @@ -665,7 +664,7 @@ void GEOMToolsGUI::OnEdgeWidth() aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -708,7 +707,7 @@ void GEOMToolsGUI::OnIsosWidth() { aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -750,7 +749,7 @@ void GEOMToolsGUI::OnBringToFront() { aSelMgr->selectedObjects( selected ); if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -776,7 +775,7 @@ void GEOMToolsGUI::OnClsBringToFront() { SalomeApp_Study* appStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() ); if ( !appStudy ) return; - GEOM_Displayer displayer( appStudy ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; @@ -815,7 +814,7 @@ void GEOMToolsGUI::OnSetMaterial( const QVariant& theParam ) if ( selected.IsEmpty() ) return; - GEOM_Displayer displayer( study ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx index 58a79a562..1773209c1 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx @@ -237,7 +237,7 @@ void GEOMToolsGUI_MarkerDlg::accept() } } } - GEOM_Displayer displayer( getStudy() ); + GEOM_Displayer displayer; displayer.Redisplay( selected, true ); selMgr->setSelectedObjects( selected ); } @@ -277,7 +277,7 @@ void GEOMToolsGUI_MarkerDlg::init() // --- GEOM::GEOM_Gen_var engine = GeometryGUI::GetGeomGen(); - myOperation = engine->GetIInsertOperations( getStudy()->id() ); + myOperation = engine->GetIInsertOperations(); GEOM::ListOfLong_var ids = myOperation->GetAllTextures(); for ( int i = 0; i < ids->length(); i++ ) addTexture( ids[i] ); @@ -339,7 +339,7 @@ void GEOMToolsGUI_MarkerDlg::addTexture( int id, bool select ) const if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) { int tWidth, tHeight; - Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(getStudy(), id, tWidth, tHeight); + Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(id, tWidth, tHeight); if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) { QImage image( tWidth, tHeight, QImage::Format_Mono ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx index 0984331aa..a6715a0ed 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx @@ -141,22 +141,22 @@ GEOMToolsGUI_PublishDlg::~GEOMToolsGUI_PublishDlg() if ( appStudy ) { _PTR(Study) aStudy = appStudy->studyDS(); if ( aStudy ) { - GEOM_Displayer displayer ( appStudy ); - QTreeWidgetItemIterator it( myTreeWidget ); - while ( *it ) { - QString entry = myEntryToItem.key( *it ); - _PTR(SObject) SO ( aStudy->FindObjectID( qPrintable( entry ) ) ); - if ( SO ) { - GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) ); - if ( CORBA::is_nil( aGeomObject ) ) continue; - if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) { - Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" ); - displayer.Erase( io ); + GEOM_Displayer displayer; + QTreeWidgetItemIterator it( myTreeWidget ); + while ( *it ) { + QString entry = myEntryToItem.key( *it ); + _PTR(SObject) SO ( aStudy->FindObjectID( qPrintable( entry ) ) ); + if ( SO ) { + GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) ); + if ( CORBA::is_nil( aGeomObject ) ) continue; + if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) { + Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" ); + displayer.Erase( io ); + } + } + ++it; } - } - ++it; - } - displayer.UpdateViewer(); + displayer.UpdateViewer(); } } } @@ -458,7 +458,7 @@ void GEOMToolsGUI_PublishDlg::onItemClicked(QTreeWidgetItem* theItem, int theCol if ( !SO ) return; GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) ); if ( CORBA::is_nil( aGeomObject ) ) return; - GEOM_Displayer displayer ( appStudy ); + GEOM_Displayer displayer; SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" ); if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) { diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx index 3ae643a58..f965bd210 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx @@ -42,8 +42,7 @@ #include GEOMToolsGUI_ReduceStudyDlg::GEOMToolsGUI_ReduceStudyDlg( QWidget* parent ) -:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), -myDisplayer(NULL) +:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); myVisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) ); @@ -53,7 +52,7 @@ myDisplayer(NULL) if ( !myApp ) return; SalomeApp_Study* study = dynamic_cast( myApp->activeStudy() ); myStudy = study->studyDS(); - myDisplayer = GEOM_Displayer( study ); + myDisplayer = GEOM_Displayer(); setWindowTitle( tr( "GEOM_REDUCE_STUDY_TITLE" ) ); setAttribute(Qt::WA_DeleteOnClose); diff --git a/src/GEOM_I/GEOM_DumpPython.cc b/src/GEOM_I/GEOM_DumpPython.cc index 35254bf90..15f4ea8f9 100644 --- a/src/GEOM_I/GEOM_DumpPython.cc +++ b/src/GEOM_I/GEOM_DumpPython.cc @@ -83,12 +83,11 @@ void ConvertV6toV7( TCollection_AsciiString& theScript ) //purpose : //======================================================================= -Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, - CORBA::Boolean isMultiFile, +Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Boolean isPublished, + CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript) { - SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy); + SALOMEDS::Study_var aStudy = GetStudy(); if(CORBA::is_nil(aStudy)) return new Engines::TMPFile(0); diff --git a/src/GEOM_I/GEOM_Field_i.cc b/src/GEOM_I/GEOM_Field_i.cc index 6b0f6ca44..bd127842c 100644 --- a/src/GEOM_I/GEOM_Field_i.cc +++ b/src/GEOM_I/GEOM_Field_i.cc @@ -69,8 +69,7 @@ GEOM::GEOM_Object_ptr GEOM_Field_i::GetShape() HANDLE_NAMESPACE(GEOM_Object) shape = _impl->GetShape(); if ( !shape.IsNull() ) { - GEOM::GEOM_BaseObject_var obj = _engine->GetObject( shape->GetDocID(), - shape->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject( shape->GetEntryString().ToCString()); shapeVar = GEOM::GEOM_Object::_narrow( obj ); } return shapeVar._retn(); @@ -138,8 +137,7 @@ GEOM::GEOM_FieldStep_ptr GEOM_Field_i::AddStep(::CORBA::Long stepID, ::CORBA::Lo HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->AddStep( stepID, stamp ); if ( !step.IsNull() ) { - GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetDocID(), - step->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetEntryString().ToCString()); stepVar = GEOM::GEOM_FieldStep::_narrow( obj ); } return stepVar._retn(); @@ -201,8 +199,7 @@ GEOM::GEOM_FieldStep_ptr GEOM_Field_i::GetStep(CORBA::Long stepID) HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->GetStep(stepID); if ( !step.IsNull() ) { - GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetDocID(), - step->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetEntryString().ToCString()); stepVar = GEOM::GEOM_FieldStep::_narrow( obj ); } return stepVar._retn(); @@ -291,8 +288,7 @@ GEOM::GEOM_Field_ptr GEOM_FieldStep_i::GetField() HANDLE_NAMESPACE(GEOM_Field) field = _impl->GetField(); if ( !field.IsNull() ) { - GEOM::GEOM_BaseObject_var obj = _engine->GetObject( field->GetDocID(), - field->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject( field->GetEntryString().ToCString()); fieldVar = GEOM::GEOM_Field::_narrow( obj ); } return fieldVar._retn(); diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index dd3ec455e..b01845065 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -171,7 +171,8 @@ char* GEOM_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, // : Used when a study is loaded // : The IOR (IORName) of object created is returned //============================================================================ -char* GEOM_Gen_i::LocalPersistentIDToIOR(const char* aLocalPersistentID, +char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, + const char* aLocalPersistentID, CORBA::Boolean isMultiFile, CORBA::Boolean isASCII) { @@ -181,7 +182,7 @@ char* GEOM_Gen_i::LocalPersistentIDToIOR(const char* aLocalPersistentID, { TCollection_AsciiString anEntry; TDF_Tool::Entry(anObject->GetEntry(), anEntry); - GEOM::GEOM_BaseObject_var obj = GetObject(anObject->GetDocID(), anEntry.ToCString()); + GEOM::GEOM_BaseObject_var obj = GetObject(anEntry.ToCString()); CORBA::String_var aPersRefString = _orb->object_to_string(obj); return CORBA::string_dup(aPersRefString); @@ -419,7 +420,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObjec //Set NoteBook variables used in the object creation TCollection_AsciiString aVars; CORBA::String_var aString=aBaseObj->GetParameters(); - SALOMEDS::ListOfListOfStrings_var aSections = theStudy->ParseVariables(aString); + SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aString); for(int i = 0, n = aSections->length(); i < n; i++) { SALOMEDS::ListOfStrings aListOfVars = aSections[i]; for(int j = 0, m = aListOfVars.length(); j < m; j++) { @@ -474,7 +475,7 @@ void GEOM_Gen_i::CreateAndPublishGroup(GEOM::GEOM_Object_var theMainShape, Standard_Integer anIndex = anIndices.FindIndex(aValue); //anArray->SetValue(1, anIndex); GOp->AddObject(GrObj,anIndex); - //anObj = GEOM_Engine::GetEngine()->AddObject(aMainShape->GetDocID(), GEOM_SUBSHAPE); + //anObj = GEOM_Engine::GetEngine()->AddObject(GEOM_SUBSHAPE); //if (anObj.IsNull()) continue; //HANDLE_NAMESPACE(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1); //if (aFunction.IsNull()) continue; @@ -486,8 +487,8 @@ void GEOM_Gen_i::CreateAndPublishGroup(GEOM::GEOM_Object_var theMainShape, //SALOMEDS::SObject_var aResultSO; //TCollection_AsciiString anEntry; //TDF_Tool::Entry(anObj->GetEntry(),anEntry); - //GEOM::GEOM_Object_var aGObj = GetObject(anObj->GetDocID(), anEntry.ToCString()); - //AddInStudy(theStudy, aGObj._retn(), SeqN.Value(i).ToCString(), GrObj); + //GEOM::GEOM_Object_var aGObj = GetObject(anEntry.ToCString()); + //AddInStudy(aGObj._retn(), SeqN.Value(i).ToCString(), GrObj); } } } @@ -730,7 +731,7 @@ CORBA::Boolean GEOM_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, // function : Close() // purpose : //============================================================================ -void GEOM_Gen_i::Close() +void GEOM_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent) { _impl->Close(); } @@ -826,7 +827,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, TCollection_AsciiString anEntry; TDF_Tool::Entry(anObj->GetEntry(), anEntry); - GEOM::GEOM_BaseObject_var obj = GetObject(anObj->GetDocID(), anEntry.ToCString()); + GEOM::GEOM_BaseObject_var obj = GetObject(anEntry.ToCString()); //Set the study entry of the published GEOM_Object obj->SetStudyEntry(aNewSO->GetID()); @@ -865,7 +866,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (GEOM::GEOM_BaseObject_ptr theObjec { SALOMEDS::SObject_var aResultSO; SALOMEDS::Study_var aStudy = GetStudy(); - if(theObject->_is_nil() || theStudy->_is_nil()) return aResultSO; + if(theObject->_is_nil() || aStudy->_is_nil()) return aResultSO; SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); CORBA::String_var IOR; @@ -951,7 +952,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesO (GEOM::GEOM_Object_ptr theO // find SObject in the study if it is already published CORBA::String_var anIORo = _orb->object_to_string(theObject); - SALOMEDS::SObject_var aSO = theStudy->FindObjectIOR(anIORo.in()); + SALOMEDS::SObject_var aSO = GetStudy()->FindObjectIOR(anIORo.in()); //PTv, IMP 0020001, The salome object // is not obligatory in case of invokation from script // if (CORBA::is_nil(aSO)) @@ -2567,7 +2568,7 @@ GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape (GEOM::GEOM_Object_ptr theMainSh TCollection_AsciiString anEntry; TDF_Tool::Entry(anObject->GetEntry(), anEntry); - return GEOM::GEOM_Object::_narrow( GetObject(anObject->GetDocID(), anEntry.ToCString())); + return GEOM::GEOM_Object::_narrow( GetObject(anEntry.ToCString())); } //============================================================================= diff --git a/src/GEOM_I/GEOM_IOperations_i.cc b/src/GEOM_I/GEOM_IOperations_i.cc index 003abfaa6..b71199220 100644 --- a/src/GEOM_I/GEOM_IOperations_i.cc +++ b/src/GEOM_I/GEOM_IOperations_i.cc @@ -131,7 +131,7 @@ GEOM_IOperations_i::GetBaseObject(HANDLE_NAMESPACE(GEOM_BaseObject) theObject) if (theObject.IsNull()) return GO._retn(); TCollection_AsciiString anEntry; TDF_Tool::Entry(theObject->GetEntry(), anEntry); - GO = _engine->GetObject(theObject->GetDocID(), (char*) anEntry.ToCString()); + GO = _engine->GetObject((char*) anEntry.ToCString()); return GO._retn(); } diff --git a/src/GEOM_I/GEOM_Object_i.cc b/src/GEOM_I/GEOM_Object_i.cc index 5ba47b14a..7c554c795 100644 --- a/src/GEOM_I/GEOM_Object_i.cc +++ b/src/GEOM_I/GEOM_Object_i.cc @@ -178,7 +178,7 @@ char* GEOM_Object_i::GetSubShapeName(CORBA::Long subID) { TCollection_AsciiString anEntry = anIt.Value(); HANDLE_NAMESPACE(GEOM_BaseObject) anObj = - GEOM_Engine::GetEngine()->GetObject( _impl->GetDocID(), anEntry.ToCString(), false ); + GEOM_Engine::GetEngine()->GetObject( anEntry.ToCString(), false ); if ( anObj.IsNull() ) continue; TCollection_AsciiString aSubName = anObj->GetName(); diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index 3b2f724c6..ac0d831f8 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -891,10 +891,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): """ # Example: see GEOM_TestAll.py try: - aSObject = self.AddInStudy(self.myStudy, aShape, aName, None) + aSObject = self.AddInStudy(aShape, aName, None) if aSObject and aName: aSObject.SetAttrString("AttributeName", aName) if doRestoreSubShapes: - self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs, + self.RestoreSubShapesSO(aSObject, theArgs, theFindMethod, theInheritFirstArg, True ) except: print "addToStudy() failed" @@ -1010,7 +1010,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): list of published sub-shapes """ # Example: see GEOM_TestAll.py - return self.RestoreSubShapesO(self.myStudy, theObject, theArgs, + return self.RestoreSubShapesO(theObject, theArgs, theFindMethod, theInheritFirstArg, theAddPrefix) ## Publish sub-shapes, standing for arguments and sub-shapes of arguments diff --git a/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx b/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx index 7a0e4450d..9ecc7722e 100644 --- a/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx +++ b/src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx @@ -124,14 +124,9 @@ void GEOM_Swig::createAndDisplayGO( const char* theEntry, bool theUpdateViewer ) {} virtual void Execute() { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( !app ) return; - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( !study ) return; - Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" ); - GEOM_Displayer( study ).Display( io, myUpdateViewer ); + GEOM_Displayer().Display( io, myUpdateViewer ); } }; @@ -186,14 +181,9 @@ void GEOM_Swig::eraseGO( const char* theEntry, bool theUpdateViewer ) {} virtual void Execute() { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( !app ) return; - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( !study ) return; - Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" ); - GEOM_Displayer( study ).Erase( io, true, myUpdateViewer ); + GEOM_Displayer().Erase( io, true, myUpdateViewer ); } }; @@ -212,13 +202,7 @@ void GEOM_Swig::UpdateViewer() {} virtual void Execute() { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( !app ) return; - - SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( !study ) return; - - GEOM_Displayer( study ).UpdateViewer(); + GEOM_Displayer().UpdateViewer(); } }; @@ -354,7 +338,7 @@ void TSetPropertyEvent::Execute() SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); if ( !study ) return; - GEOM_Displayer displayer( study ); + GEOM_Displayer displayer; SALOME_View* window = displayer.GetActiveView(); if ( !window ) return; diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx index c0c21aa0e..e02b2c498 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx @@ -642,8 +642,7 @@ bool GenerationGUI_PipeDlg::extractPrefix() const // purpose : virtual method to restore tree of argument's sub-shapes under // the resulting shape. Redefined from GEOMBase_Helper class. //================================================================================= -void GenerationGUI_PipeDlg::restoreSubShapes - (SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject) +void GenerationGUI_PipeDlg::restoreSubShapes(SALOMEDS::SObject_ptr theSObject) { QCheckBox *aGenGroupCheck = NULL; QLineEdit *aPrefixEdit = NULL; @@ -691,8 +690,7 @@ void GenerationGUI_PipeDlg::restoreSubShapes } aName += tr((*it)->GetName()); - getGeomEngine()->AddInStudy(theStudy, (*it).get(), - aName.toStdString().c_str(), aFather); + getGeomEngine()->AddInStudy((*it).get(), aName.toStdString().c_str(), aFather); } } } diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.h b/src/GenerationGUI/GenerationGUI_PipeDlg.h index c9b2f0833..1e7f53e6e 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.h +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.h @@ -55,8 +55,7 @@ protected: virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); virtual bool extractPrefix() const; - virtual void restoreSubShapes - (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes(SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/IGESPlugin/IGESPlugin_GUI.cxx b/src/IGESPlugin/IGESPlugin_GUI.cxx index ba8b743e1..78bfd9b14 100644 --- a/src/IGESPlugin/IGESPlugin_GUI.cxx +++ b/src/IGESPlugin/IGESPlugin_GUI.cxx @@ -107,8 +107,6 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "IGESPluginEngine" ); IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op ); @@ -182,7 +180,7 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent ) entryList.append( so->GetID() ); transaction.commit(); - GEOM_Displayer( study ).Display( main.in() ); + GEOM_Displayer().Display( main.in() ); main->UnRegister(); } else diff --git a/src/IGESPlugin/IGESPlugin_IECallBack.cxx b/src/IGESPlugin/IGESPlugin_IECallBack.cxx index 0bca95a5d..9fda7a6b6 100755 --- a/src/IGESPlugin/IGESPlugin_IECallBack.cxx +++ b/src/IGESPlugin/IGESPlugin_IECallBack.cxx @@ -45,12 +45,11 @@ IGESPlugin_IECallBack::~IGESPlugin_IECallBack() * Export */ //============================================================================= -bool IGESPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +bool IGESPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId ); + IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() ); TCollection_AsciiString aVersion = ( theFormatName == "IGES_5_3" ) ? "5.3" : "5.1"; aPluginOperations->ExportIGES( theOriginal, theFileName, aVersion ); return true; @@ -62,11 +61,10 @@ bool IGESPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -IGESPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +IGESPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId ); + IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() ); bool anIsIgnoreUnits = ( theFormatName == "IGES_SCALE" ) ? true : false; return aPluginOperations->ImportIGES( theFileName, anIsIgnoreUnits ); } @@ -77,11 +75,10 @@ IGESPlugin_IECallBack::Import( int theDocId, */ //============================================================================= TCollection_AsciiString -IGESPlugin_IECallBack::ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theParameterName ) +IGESPlugin_IECallBack::ReadValue( const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theParameterName ) { - IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId ); + IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() ); return aPluginOperations->ReadValue( theFileName, theParameterName ); } diff --git a/src/IGESPlugin/IGESPlugin_IECallBack.hxx b/src/IGESPlugin/IGESPlugin_IECallBack.hxx index 716d55a1b..dde69bdcf 100644 --- a/src/IGESPlugin/IGESPlugin_IECallBack.hxx +++ b/src/IGESPlugin/IGESPlugin_IECallBack.hxx @@ -36,17 +36,14 @@ public: IGESPlugin_IECallBack(); ~IGESPlugin_IECallBack(); - bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, + bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName ); - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); - TCollection_AsciiString ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, + TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName, const TCollection_AsciiString& theParameterName ); }; diff --git a/src/IGESPlugin/IGESPlugin_IOperations.cxx b/src/IGESPlugin/IGESPlugin_IOperations.cxx index c53752cf4..1857d6a6b 100644 --- a/src/IGESPlugin/IGESPlugin_IOperations.cxx +++ b/src/IGESPlugin/IGESPlugin_IOperations.cxx @@ -38,8 +38,8 @@ * Constructor */ //============================================================================= -IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "IGESPlugin_IOperations::IGESPlugin_IOperations" ); } @@ -77,7 +77,7 @@ void IGESPlugin_IOperations::ExportIGES( const Handle(GEOM_Object) theOrigi if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( IGESPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); @@ -129,7 +129,7 @@ IGESPlugin_IOperations::ImportIGES( const TCollection_AsciiString& theFileName, if( theFileName.IsEmpty() ) return NULL; //Add a new result object - Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT ); + Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT ); //Add an Import function Handle(GEOM_Function) aFunction = diff --git a/src/IGESPlugin/IGESPlugin_IOperations.hxx b/src/IGESPlugin/IGESPlugin_IOperations.hxx index 0fea3f36b..5573a210b 100644 --- a/src/IGESPlugin/IGESPlugin_IOperations.hxx +++ b/src/IGESPlugin/IGESPlugin_IOperations.hxx @@ -30,7 +30,7 @@ class IGESPLUGINENGINE_EXPORT IGESPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - IGESPlugin_IOperations( GEOM_Engine*, int ); + IGESPlugin_IOperations( GEOM_Engine* ); ~IGESPlugin_IOperations(); void ExportIGES( const Handle(GEOM_Object), diff --git a/src/IGESPlugin/IGESPlugin_OperationsCreator.cxx b/src/IGESPlugin/IGESPlugin_OperationsCreator.cxx index e2f964390..9f33d8323 100644 --- a/src/IGESPlugin/IGESPlugin_OperationsCreator.cxx +++ b/src/IGESPlugin/IGESPlugin_OperationsCreator.cxx @@ -59,11 +59,12 @@ GEOM_IOperations_i* IGESPlugin_OperationsCreator::Create( PortableServer::POA_pt { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "IGESPlugin_OperationsCreator::Create" ); - _operation = new IGESPlugin_IOperations( theGenImpl ); - return new IGESPlugin_IOperations_i( thePOA, theEngine, _operation ); + return new IGESPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); } -IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get() +IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) { + if( !_operation ) + _operation = new IGESPlugin_IOperations( theGenImpl ); return _operation; } diff --git a/src/IGESPlugin/IGESPlugin_OperationsCreator.hxx b/src/IGESPlugin/IGESPlugin_OperationsCreator.hxx index 066bcb543..ea3270481 100755 --- a/src/IGESPlugin/IGESPlugin_OperationsCreator.hxx +++ b/src/IGESPlugin/IGESPlugin_OperationsCreator.hxx @@ -44,10 +44,10 @@ public: GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ); private: - static IGESPlugin_IOperations* get(); + static IGESPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); private: - IGESPlugin_IOperations* _operation; + static IGESPlugin_IOperations* _operation; friend class IGESPlugin_IECallBack; }; diff --git a/src/MeasureGUI/MeasureGUI.cxx b/src/MeasureGUI/MeasureGUI.cxx index 38a6f3be7..7547b4266 100644 --- a/src/MeasureGUI/MeasureGUI.cxx +++ b/src/MeasureGUI/MeasureGUI.cxx @@ -178,8 +178,8 @@ void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible ) return; } - SalomeApp_Study* anActiveStudy = dynamic_cast( anApp->activeStudy() ); - if ( !anActiveStudy ) + SalomeApp_Study* aStudy = dynamic_cast( anApp->activeStudy() ); + if ( !aStudy ) { return; } @@ -205,16 +205,16 @@ void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible ) SUIT_OverrideCursor wc; - GEOMGUI_DimensionProperty aDimensions( anActiveStudy, anIObject->getEntry() ); + GEOMGUI_DimensionProperty aDimensions( aStudy, anIObject->getEntry() ); for ( int anIt = 0; anIt < aDimensions.GetNumber(); ++anIt ) { aDimensions.SetVisible( anIt, theIsVisible ); } - aDimensions.SaveToAttribute( anActiveStudy, anIObject->getEntry() ); + aDimensions.SaveToAttribute( aStudy, anIObject->getEntry() ); - GEOM_Displayer( anActiveStudy ).Redisplay( anIObject, true ); + GEOM_Displayer().Redisplay( anIObject, true ); } //======================================================================= diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.cxx b/src/MeasureGUI/MeasureGUI_Skeleton.cxx index 8aa674d3e..387648140 100644 --- a/src/MeasureGUI/MeasureGUI_Skeleton.cxx +++ b/src/MeasureGUI/MeasureGUI_Skeleton.cxx @@ -363,7 +363,7 @@ bool MeasureGUI_Skeleton::isValid( QString& ) GEOM_Displayer* MeasureGUI_Skeleton::getDisplayer() { if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( getStudy() ); + myDisplayer = new GEOM_Displayer(); return myDisplayer; } diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.cxx b/src/OperationGUI/OperationGUI_PartitionDlg.cxx index 446d72564..fa5bdbfdf 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.cxx +++ b/src/OperationGUI/OperationGUI_PartitionDlg.cxx @@ -505,12 +505,11 @@ bool OperationGUI_PartitionDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject ) { if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory, /*theInheritFirstArg=*/myListShapes.length() == 1 && myListTools.length() == 0, mainFrame()->CheckBoxAddPrefix->isChecked() ); // ? false diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.h b/src/OperationGUI/OperationGUI_PartitionDlg.h index 294a8d554..11065a223 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.h +++ b/src/OperationGUI/OperationGUI_PartitionDlg.h @@ -50,7 +50,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx index cfb765be3..73c99830e 100644 --- a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx @@ -364,7 +364,7 @@ bool RepairGUI_FreeFacesDlg::execute( ObjectList& objects ) GEOM_Displayer* RepairGUI_FreeFacesDlg::getDisplayer() { if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( getStudy() ); + myDisplayer = new GEOM_Displayer(); return myDisplayer; } diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index cf2472ab8..9e789f72c 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -542,8 +542,7 @@ bool RepairGUI_GlueDlg::execute(ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_GlueDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void RepairGUI_GlueDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { GEOM::find_shape_method aFindMethod = GEOM::FSM_GetInPlace; @@ -551,7 +550,7 @@ void RepairGUI_GlueDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, aFindMethod = GEOM::FSM_GetInPlaceByHistory; // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), aFindMethod, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); } diff --git a/src/RepairGUI/RepairGUI_GlueDlg.h b/src/RepairGUI/RepairGUI_GlueDlg.h index bf8ff96b5..92321bdc7 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.h +++ b/src/RepairGUI/RepairGUI_GlueDlg.h @@ -55,7 +55,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes (SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx index be7990f2f..554c68c9e 100644 --- a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx +++ b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx @@ -433,12 +433,11 @@ void RepairGUI_LimitToleranceDlg::updateButtonState() // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), GEOM::FSM_GetInPlace, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); } diff --git a/src/RepairGUI/RepairGUI_LimitToleranceDlg.h b/src/RepairGUI/RepairGUI_LimitToleranceDlg.h index 5ec1ab29f..53ef961e8 100644 --- a/src/RepairGUI/RepairGUI_LimitToleranceDlg.h +++ b/src/RepairGUI/RepairGUI_LimitToleranceDlg.h @@ -48,7 +48,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes (SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx index 815876001..09a2975d8 100644 --- a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx @@ -303,12 +303,11 @@ bool RepairGUI_RemoveExtraEdgesDlg::execute( ObjectList& objects ) // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject ) { if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked() ); diff --git a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h index c14ed88c2..83e3eb74a 100644 --- a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h +++ b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h @@ -45,7 +45,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx b/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx index 7dcbadc49..e679ba1bb 100755 --- a/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx @@ -272,12 +272,11 @@ bool RepairGUI_RemoveWebsDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/RepairGUI/RepairGUI_RemoveWebsDlg.h b/src/RepairGUI/RepairGUI_RemoveWebsDlg.h index a5ce390be..71e55acf6 100755 --- a/src/RepairGUI/RepairGUI_RemoveWebsDlg.h +++ b/src/RepairGUI/RepairGUI_RemoveWebsDlg.h @@ -44,7 +44,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid (QString&); virtual bool execute (ObjectList&); - virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + virtual void restoreSubShapes (SALOMEDS::SObject_ptr); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx index 8f944bf57..b34504186 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx @@ -414,12 +414,11 @@ void RepairGUI_SuppressFacesDlg::initSelection() // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_SuppressFacesDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void RepairGUI_SuppressFacesDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.h b/src/RepairGUI/RepairGUI_SuppressFacesDlg.h index 215963785..09f5506d8 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.h +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.h @@ -48,7 +48,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/RepairGUI/RepairGUI_UnionFacesDlg.cxx b/src/RepairGUI/RepairGUI_UnionFacesDlg.cxx index 1748675bc..b03a105a1 100755 --- a/src/RepairGUI/RepairGUI_UnionFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_UnionFacesDlg.cxx @@ -294,12 +294,11 @@ bool RepairGUI_UnionFacesDlg::execute( ObjectList& objects ) // function : restoreSubShapes // purpose : //================================================================================= -void RepairGUI_UnionFacesDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void RepairGUI_UnionFacesDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject ) { if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked() ); diff --git a/src/RepairGUI/RepairGUI_UnionFacesDlg.h b/src/RepairGUI/RepairGUI_UnionFacesDlg.h index 0d74105a1..1e8c68d25 100755 --- a/src/RepairGUI/RepairGUI_UnionFacesDlg.h +++ b/src/RepairGUI/RepairGUI_UnionFacesDlg.h @@ -45,7 +45,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/STEPPlugin/STEPPlugin_GUI.cxx b/src/STEPPlugin/STEPPlugin_GUI.cxx index 3db28bb46..284e8fba0 100644 --- a/src/STEPPlugin/STEPPlugin_GUI.cxx +++ b/src/STEPPlugin/STEPPlugin_GUI.cxx @@ -111,8 +111,6 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STEPPluginEngine" ); STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op ); @@ -193,7 +191,7 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent ) GeometryGUI::GetGeomGen()->AddInStudy( group, grpName.in(), main ); } transaction.commit(); - GEOM_Displayer( study ).Display( main.in() ); + GEOM_Displayer().Display( main.in() ); main->UnRegister(); } else diff --git a/src/STEPPlugin/STEPPlugin_IECallBack.cxx b/src/STEPPlugin/STEPPlugin_IECallBack.cxx index 86f00981f..cae343405 100644 --- a/src/STEPPlugin/STEPPlugin_IECallBack.cxx +++ b/src/STEPPlugin/STEPPlugin_IECallBack.cxx @@ -46,12 +46,11 @@ STEPPlugin_IECallBack::~STEPPlugin_IECallBack() */ //============================================================================= bool -STEPPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +STEPPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() ); const STEPPlugin_IOperations::LengthUnit aUnit = STEPPlugin_IOperations::LengthUnit_Meter; aPluginOperations->ExportSTEP( theOriginal, theFileName, aUnit ); @@ -64,11 +63,10 @@ STEPPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -STEPPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +STEPPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() ); bool anIsIgnoreUnits = ( theFormatName == "STEP_SCALE" ) ? true : false; return aPluginOperations->ImportSTEP( theFileName, anIsIgnoreUnits, false ); } @@ -79,11 +77,10 @@ STEPPlugin_IECallBack::Import( int theDocId, */ //============================================================================= TCollection_AsciiString -STEPPlugin_IECallBack::ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theParameterName ) +STEPPlugin_IECallBack::ReadValue( const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theParameterName ) { - STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() ); return aPluginOperations->ReadValue( theFileName, theParameterName ); } diff --git a/src/STEPPlugin/STEPPlugin_IECallBack.hxx b/src/STEPPlugin/STEPPlugin_IECallBack.hxx index 3f961d8bc..71c55f456 100644 --- a/src/STEPPlugin/STEPPlugin_IECallBack.hxx +++ b/src/STEPPlugin/STEPPlugin_IECallBack.hxx @@ -36,17 +36,14 @@ public: STEPPlugin_IECallBack(); ~STEPPlugin_IECallBack(); - bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, + bool Export( const Handle(GEOM_Object) theOriginal, const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName ); - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); - TCollection_AsciiString ReadValue( int theDocId, - const TCollection_AsciiString& theFileName, + TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName, const TCollection_AsciiString& theParameterName ); }; diff --git a/src/STEPPlugin/STEPPlugin_IOperations.cxx b/src/STEPPlugin/STEPPlugin_IOperations.cxx index ec5943759..46a4594a1 100644 --- a/src/STEPPlugin/STEPPlugin_IOperations.cxx +++ b/src/STEPPlugin/STEPPlugin_IOperations.cxx @@ -38,8 +38,8 @@ * Constructor */ //============================================================================= -STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "STEPPlugin_IOperations::STEPPlugin_IOperations" ); } @@ -122,7 +122,7 @@ void STEPPlugin_IOperations::ExportSTEP if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( STEPPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); @@ -175,7 +175,7 @@ STEPPlugin_IOperations::ImportSTEP(const TCollection_AsciiString& theFileName, if( theFileName.IsEmpty() ) return NULL; //Add a new result object - Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT ); + Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT ); //Add an Import function Handle(GEOM_Function) aFunction = diff --git a/src/STEPPlugin/STEPPlugin_IOperations.hxx b/src/STEPPlugin/STEPPlugin_IOperations.hxx index 4a29e5a1e..a99c57d22 100644 --- a/src/STEPPlugin/STEPPlugin_IOperations.hxx +++ b/src/STEPPlugin/STEPPlugin_IOperations.hxx @@ -51,7 +51,7 @@ public: public: - STEPPlugin_IOperations( GEOM_Engine*, int ); + STEPPlugin_IOperations( GEOM_Engine* ); ~STEPPlugin_IOperations(); void ExportSTEP( const Handle(GEOM_Object), diff --git a/src/STEPPlugin/STEPPlugin_OperationsCreator.cxx b/src/STEPPlugin/STEPPlugin_OperationsCreator.cxx index 272a0313b..c81392c7e 100644 --- a/src/STEPPlugin/STEPPlugin_OperationsCreator.cxx +++ b/src/STEPPlugin/STEPPlugin_OperationsCreator.cxx @@ -35,6 +35,8 @@ // OCCT includes #include +STEPPlugin_IOperations* STEPPlugin_OperationsCreator::_operation; + STEPPlugin_OperationsCreator::STEPPlugin_OperationsCreator() { // Register drivers @@ -59,6 +61,12 @@ GEOM_IOperations_i* STEPPlugin_OperationsCreator::Create( PortableServer::POA_pt { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "STEPPlugin_OperationsCreator::Create" ); - STEPPlugin_IOperations* anOperation = new STEPPlugin_IOperations( theGenImpl ); - return new STEPPlugin_IOperations_i( thePOA, theEngine, anOperation ); + return new STEPPlugin_IOperations_i( thePOA, theEngine, get(theGenImpl) ); +} + +STEPPlugin_IOperations* STEPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) +{ + if( !_operation ) + _operation = new STEPPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/STEPPlugin/STEPPlugin_OperationsCreator.hxx b/src/STEPPlugin/STEPPlugin_OperationsCreator.hxx index f9f5d5ee2..2caf56dfc 100755 --- a/src/STEPPlugin/STEPPlugin_OperationsCreator.hxx +++ b/src/STEPPlugin/STEPPlugin_OperationsCreator.hxx @@ -43,7 +43,11 @@ public: GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ); +private: + static STEPPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); +private: + static STEPPlugin_IOperations* _operation; friend class STEPPlugin_IECallBack; }; diff --git a/src/STLPlugin/STLPlugin_GUI.cxx b/src/STLPlugin/STLPlugin_GUI.cxx index 6ca36ac81..52a87f59f 100644 --- a/src/STLPlugin/STLPlugin_GUI.cxx +++ b/src/STLPlugin/STLPlugin_GUI.cxx @@ -107,8 +107,6 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent ) { SalomeApp_Application* app = getGeometryGUI()->getApp(); if ( !app ) return false; - SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); - if ( !study ) return false; GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STLPluginEngine" ); STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op ); @@ -143,7 +141,7 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent ) entryList.append( so->GetID() ); transaction.commit(); - GEOM_Displayer( study ).Display( main.in() ); + GEOM_Displayer().Display( main.in() ); main->UnRegister(); } else diff --git a/src/STLPlugin/STLPlugin_IECallBack.cxx b/src/STLPlugin/STLPlugin_IECallBack.cxx index be4d0ce6d..e4f35377f 100755 --- a/src/STLPlugin/STLPlugin_IECallBack.cxx +++ b/src/STLPlugin/STLPlugin_IECallBack.cxx @@ -46,12 +46,11 @@ STLPlugin_IECallBack::~STLPlugin_IECallBack() */ //============================================================================= bool -STLPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +STLPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine() ); bool anIsASCII = ( theFormatName == "STL_Bin") ? false : true; const double aDeflection = 0.001; const bool anIsRelative = true; @@ -65,11 +64,10 @@ STLPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -STLPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +STLPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId ); + STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine() ); return aPluginOperations->ImportSTL( theFileName ); } diff --git a/src/STLPlugin/STLPlugin_IECallBack.hxx b/src/STLPlugin/STLPlugin_IECallBack.hxx index fb8979403..a2bf421c9 100644 --- a/src/STLPlugin/STLPlugin_IECallBack.hxx +++ b/src/STLPlugin/STLPlugin_IECallBack.hxx @@ -36,15 +36,13 @@ public: STLPlugin_IECallBack(); ~STLPlugin_IECallBack(); - virtual bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ); + virtual bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ); virtual - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); }; #endif diff --git a/src/STLPlugin/STLPlugin_IOperations.cxx b/src/STLPlugin/STLPlugin_IOperations.cxx index 0008bf779..f3d2928b5 100644 --- a/src/STLPlugin/STLPlugin_IOperations.cxx +++ b/src/STLPlugin/STLPlugin_IOperations.cxx @@ -38,8 +38,8 @@ * Constructor */ //============================================================================= -STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "STLPlugin_IOperations::STLPlugin_IOperations" ); } @@ -80,7 +80,7 @@ void STLPlugin_IOperations::ExportSTL( const Handle(GEOM_Object) theOrigina if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( STLPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); @@ -134,7 +134,7 @@ STLPlugin_IOperations::ImportSTL( const TCollection_AsciiString& theFileName ) if( theFileName.IsEmpty() ) return NULL; //Add a new result object - Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT ); + Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT ); //Add an Import function Handle(GEOM_Function) aFunction = diff --git a/src/STLPlugin/STLPlugin_IOperations.hxx b/src/STLPlugin/STLPlugin_IOperations.hxx index 776cc4aba..2ecca4b5d 100644 --- a/src/STLPlugin/STLPlugin_IOperations.hxx +++ b/src/STLPlugin/STLPlugin_IOperations.hxx @@ -30,7 +30,7 @@ class STLPLUGINENGINE_EXPORT STLPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - STLPlugin_IOperations( GEOM_Engine*, int ); + STLPlugin_IOperations( GEOM_Engine* ); ~STLPlugin_IOperations(); void ExportSTL( const Handle(GEOM_Object), diff --git a/src/STLPlugin/STLPlugin_OperationsCreator.cxx b/src/STLPlugin/STLPlugin_OperationsCreator.cxx index e7defaa0a..401dbff86 100644 --- a/src/STLPlugin/STLPlugin_OperationsCreator.cxx +++ b/src/STLPlugin/STLPlugin_OperationsCreator.cxx @@ -32,6 +32,8 @@ // OCCT includes #include +STLPlugin_IOperations* STLPlugin_OperationsCreator::_operation; + STLPlugin_OperationsCreator::STLPlugin_OperationsCreator() { // Register drivers @@ -56,6 +58,12 @@ GEOM_IOperations_i* STLPlugin_OperationsCreator::Create( PortableServer::POA_ptr { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "STLPlugin_OperationsCreator::Create" ); - STLPlugin_IOperations* anOperation = new STLPlugin_IOperations( theGenImpl ); - return new STLPlugin_IOperations_i( thePOA, theEngine, anOperation ); + return new STLPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); +} + +STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) +{ + if( !_operation ) + _operation = new STLPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/STLPlugin/STLPlugin_OperationsCreator.hxx b/src/STLPlugin/STLPlugin_OperationsCreator.hxx index 896bf75b4..1c2177c2e 100755 --- a/src/STLPlugin/STLPlugin_OperationsCreator.hxx +++ b/src/STLPlugin/STLPlugin_OperationsCreator.hxx @@ -44,6 +44,12 @@ public: GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ); +private: + static STLPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); + +private: + static STLPlugin_IOperations* _operation; + friend class STLPlugin_IECallBack; }; diff --git a/src/TransformationGUI/TransformationGUI.cxx b/src/TransformationGUI/TransformationGUI.cxx index 1cb0bc892..f1605786e 100644 --- a/src/TransformationGUI/TransformationGUI.cxx +++ b/src/TransformationGUI/TransformationGUI.cxx @@ -114,13 +114,11 @@ bool TransformationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) break; case GEOMOp::OpReimport: // RELOAD IMPORTED SHAPE { - SalomeApp_Study* anAppStudy = dynamic_cast(app->activeStudy()); - GEOM::GEOM_ITransformOperations_var anOp = - GeometryGUI::GetGeomGen()->GetITransformOperations(anAppStudy->id()); + GeometryGUI::GetGeomGen()->GetITransformOperations(); if (anOp->_is_nil()) return false; - GEOM_Displayer aDisp (anAppStudy); + GEOM_Displayer aDisp; SUIT_Desktop* desk = app->desktop(); QList wnds = desk->windows(); diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index 76459aa05..8cd153433 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -414,12 +414,11 @@ bool TransformationGUI_MirrorDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_MirrorDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_MirrorDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.h b/src/TransformationGUI/TransformationGUI_MirrorDlg.h index eb9cb4405..8147b3e85 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.h +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.h @@ -51,7 +51,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index d6cc0ab79..ecf1f3cd1 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -565,8 +565,7 @@ QList TransformationGUI_MultiRotationDlg::getSourceObjects() // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // we pass here the first operation argument (object) through the list of arguments @@ -575,7 +574,7 @@ void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; anArgs->length(1); anArgs[0] = myBase.copy(); - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_MultiTransformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h index 9e9a9ea68..bb0b0e156 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h @@ -97,7 +97,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index cd69f6a73..c867be1d7 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -728,8 +728,7 @@ QList TransformationGUI_MultiTranslationDlg::getSourceObjects( // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // we pass here the first operation argument (object) through the list of arguments @@ -738,7 +737,7 @@ void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_pt GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; anArgs->length(1); anArgs[0] = myBase.copy(); - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_MultiTransformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h index 43f618c93..94c95f7b2 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h @@ -52,7 +52,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx index d060a1f53..083428f9b 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx @@ -299,12 +299,11 @@ bool TransformationGUI_OffsetDlg::execute( ObjectList& objects ) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_OffsetDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject ) +void TransformationGUI_OffsetDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject ) { if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked() ); diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.h b/src/TransformationGUI/TransformationGUI_OffsetDlg.h index c2ec78c41..413ac4211 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.h +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.h @@ -50,7 +50,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx index f41760fc8..878c33dfc 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx @@ -578,12 +578,11 @@ bool TransformationGUI_PositionDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_PositionDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_PositionDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.h b/src/TransformationGUI/TransformationGUI_PositionDlg.h index 9457ab4a1..11257fdde 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.h +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.h @@ -50,7 +50,7 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual void addSubshapesToStudy(); virtual QList getSourceObjects(); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index 291726e16..d7cf7b6b2 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -549,8 +549,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // we pass here the first operation argument (object) through the list of arguments @@ -559,7 +558,7 @@ void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theS GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; anArgs->length(1); anArgs[0] = myCurrObject.copy(); - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.h b/src/TransformationGUI/TransformationGUI_RotationDlg.h index d5b1c4d17..c30cb9347 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.h @@ -51,7 +51,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index d37664a2b..5a8930bd7 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -500,12 +500,11 @@ bool TransformationGUI_ScaleDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(), /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.h b/src/TransformationGUI/TransformationGUI_ScaleDlg.h index 219950dd0..f1ca3567f 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.h +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.h @@ -56,7 +56,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 57cf49b4d..6057a591f 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -604,8 +604,7 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject) { if (mainFrame()->CheckBoxRestoreSS->isChecked()) { // we pass here the first operation argument (object) through the list of arguments @@ -614,7 +613,7 @@ void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr t GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; anArgs->length(1); anArgs[0] = myCurrObject.copy(); - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs, /*theFindMethod=*/GEOM::FSM_Transformed, /*theInheritFirstArg=*/true, mainFrame()->CheckBoxAddPrefix->isChecked()); diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.h b/src/TransformationGUI/TransformationGUI_TranslationDlg.h index 8aab1b6fd..fd2eb99a2 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.h @@ -51,7 +51,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); - virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); + virtual void restoreSubShapes( SALOMEDS::SObject_ptr ); virtual QList getSourceObjects(); private: diff --git a/src/VTKPlugin/VTKPlugin_GUI.cxx b/src/VTKPlugin/VTKPlugin_GUI.cxx index c3e357e64..48ccea52d 100644 --- a/src/VTKPlugin/VTKPlugin_GUI.cxx +++ b/src/VTKPlugin/VTKPlugin_GUI.cxx @@ -34,7 +34,6 @@ #include "GeometryGUI.h" #include "GEOM_Operation.h" #include "GEOMBase.h" -#include "GEOM_Displayer.h" #include "GEOM_GenericObjPtr.h" #include diff --git a/src/VTKPlugin/VTKPlugin_IECallBack.cxx b/src/VTKPlugin/VTKPlugin_IECallBack.cxx index 12e6c7f76..389e6adb7 100755 --- a/src/VTKPlugin/VTKPlugin_IECallBack.cxx +++ b/src/VTKPlugin/VTKPlugin_IECallBack.cxx @@ -45,12 +45,11 @@ VTKPlugin_IECallBack::~VTKPlugin_IECallBack() * Export */ //============================================================================= -bool VTKPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +bool VTKPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine(), theDocId ); + VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine() ); const double aDeflection = 0.001; aPluginOperations->ExportVTK( theOriginal, theFileName, aDeflection ); return true; diff --git a/src/VTKPlugin/VTKPlugin_IECallBack.hxx b/src/VTKPlugin/VTKPlugin_IECallBack.hxx index 71ba137e5..3140898e0 100644 --- a/src/VTKPlugin/VTKPlugin_IECallBack.hxx +++ b/src/VTKPlugin/VTKPlugin_IECallBack.hxx @@ -36,10 +36,9 @@ public: VTKPlugin_IECallBack(); ~VTKPlugin_IECallBack(); - bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ); + bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ); }; #endif diff --git a/src/VTKPlugin/VTKPlugin_IOperations.cxx b/src/VTKPlugin/VTKPlugin_IOperations.cxx index ab8f79fb2..78b565477 100644 --- a/src/VTKPlugin/VTKPlugin_IOperations.cxx +++ b/src/VTKPlugin/VTKPlugin_IOperations.cxx @@ -36,8 +36,8 @@ * Constructor */ //============================================================================= -VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "VTKPlugin_IOperations::VTKPlugin_IOperations" ); } @@ -72,7 +72,7 @@ void VTKPlugin_IOperations::ExportVTK( const Handle(GEOM_Object) theOrigina if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported //Add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT); //Add an Export function Handle(GEOM_Function) aFunction = result->AddFunction( VTKPlugin_ExportDriver::GetID(), EXPORT_SHAPE ); diff --git a/src/VTKPlugin/VTKPlugin_IOperations.hxx b/src/VTKPlugin/VTKPlugin_IOperations.hxx index a75d60833..d97fd1315 100644 --- a/src/VTKPlugin/VTKPlugin_IOperations.hxx +++ b/src/VTKPlugin/VTKPlugin_IOperations.hxx @@ -30,7 +30,7 @@ class VTKPLUGINENGINE_EXPORT VTKPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - VTKPlugin_IOperations( GEOM_Engine*, int ); + VTKPlugin_IOperations( GEOM_Engine* ); ~VTKPlugin_IOperations(); void ExportVTK( const Handle(GEOM_Object), diff --git a/src/VTKPlugin/VTKPlugin_OperationsCreator.cxx b/src/VTKPlugin/VTKPlugin_OperationsCreator.cxx index ffc854106..6ddef22df 100644 --- a/src/VTKPlugin/VTKPlugin_OperationsCreator.cxx +++ b/src/VTKPlugin/VTKPlugin_OperationsCreator.cxx @@ -31,6 +31,8 @@ // OCCT includes #include +VTKPlugin_IOperations* VTKPlugin_OperationsCreator::_operation; + VTKPlugin_OperationsCreator::VTKPlugin_OperationsCreator() { // Register drivers @@ -52,6 +54,12 @@ GEOM_IOperations_i* VTKPlugin_OperationsCreator::Create( PortableServer::POA_ptr { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "VTKPlugin_OperationsCreator::Create" ); - VTKPlugin_IOperations* anOperation = new VTKPlugin_IOperations( theGenImpl ); - return new VTKPlugin_IOperations_i( thePOA, theEngine, anOperation ); + return new VTKPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); +} + +VTKPlugin_IOperations* VTKPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) +{ + if( !_operation ) + _operation = new VTKPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/VTKPlugin/VTKPlugin_OperationsCreator.hxx b/src/VTKPlugin/VTKPlugin_OperationsCreator.hxx index feea41fd9..dfefb2954 100755 --- a/src/VTKPlugin/VTKPlugin_OperationsCreator.hxx +++ b/src/VTKPlugin/VTKPlugin_OperationsCreator.hxx @@ -43,6 +43,11 @@ public: GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ); +private: + static VTKPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); + +private: + static VTKPlugin_IOperations* _operation; friend class VTKPlugin_IECallBack; }; diff --git a/src/XAOPlugin/XAOPlugin_IECallBack.cxx b/src/XAOPlugin/XAOPlugin_IECallBack.cxx index 7992926b7..b69073baf 100644 --- a/src/XAOPlugin/XAOPlugin_IECallBack.cxx +++ b/src/XAOPlugin/XAOPlugin_IECallBack.cxx @@ -47,13 +47,12 @@ XAOPlugin_IECallBack::~XAOPlugin_IECallBack() */ //============================================================================= bool -XAOPlugin_IECallBack::Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +XAOPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId ); - GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations( theDocId ); + XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine() ); + GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations(); Handle(TColStd_HSequenceOfTransient) groups = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Groups ); Handle(TColStd_HSequenceOfTransient) fields = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Fields ); @@ -73,11 +72,10 @@ XAOPlugin_IECallBack::Export( int theDocId, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -XAOPlugin_IECallBack::Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +XAOPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId ); + XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine() ); Handle(TColStd_HSequenceOfTransient) result = new TColStd_HSequenceOfTransient(); Handle(TColStd_HSequenceOfTransient) subshapes = new TColStd_HSequenceOfTransient(); diff --git a/src/XAOPlugin/XAOPlugin_IECallBack.hxx b/src/XAOPlugin/XAOPlugin_IECallBack.hxx index d1f04cec5..98e16b717 100644 --- a/src/XAOPlugin/XAOPlugin_IECallBack.hxx +++ b/src/XAOPlugin/XAOPlugin_IECallBack.hxx @@ -36,15 +36,13 @@ public: XAOPlugin_IECallBack(); ~XAOPlugin_IECallBack(); - virtual bool Export( int theDocId, - const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ); + virtual bool Export( const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ); virtual - Handle(TColStd_HSequenceOfTransient) Import( int theDocId, - const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); + Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); }; #endif diff --git a/src/XAOPlugin/XAOPlugin_IOperations.cxx b/src/XAOPlugin/XAOPlugin_IOperations.cxx index d33a5deaf..64c1d8581 100644 --- a/src/XAOPlugin/XAOPlugin_IOperations.cxx +++ b/src/XAOPlugin/XAOPlugin_IOperations.cxx @@ -99,8 +99,8 @@ TopAbs_ShapeEnum getGroupDimension(XAO::Group* group) * Constructor */ //============================================================================= -XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine, int theDocID ) -: GEOMImpl_IBaseIEOperations( theEngine, theDocID ) +XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine ) +: GEOMImpl_IBaseIEOperations( theEngine ) { MESSAGE( "XAOPlugin_IOperations::XAOPlugin_IOperations" ); } @@ -322,7 +322,7 @@ bool XAOPlugin_IOperations::ExportXAO( Handle(GEOM_Object) shape, if (lastFunction.IsNull()) return false; // add a new result object - Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT); + Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_IMPORT); // add an Export function Handle(GEOM_Function) exportFunction = result->AddFunction(XAOPlugin_Driver::GetID(), EXPORT_SHAPE); @@ -408,7 +408,7 @@ void XAOPlugin_IOperations::importSubShapes( XAO::Geometry* xaoGeometry, anArray = new TColStd_HArray1OfInteger(1, 1); anArray->SetValue(1, iref); - subShape = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE); + subShape = GetEngine()->AddObject(GEOM_SUBSHAPE); Handle(GEOM_Function) aFunction = subShape->AddFunction(GEOM_Object::GetSubShapeID(), 1); if (aFunction.IsNull()) return; @@ -472,7 +472,7 @@ bool XAOPlugin_IOperations::ImportXAO( const char* fileName, } // create the shape - shape = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT); + shape = GetEngine()->AddObject(GEOM_IMPORT); Handle(GEOM_Function) function = shape->AddFunction(XAOPlugin_Driver::GetID(), IMPORT_SHAPE); if (function.IsNull()) return false; if (function->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false; diff --git a/src/XAOPlugin/XAOPlugin_IOperations.hxx b/src/XAOPlugin/XAOPlugin_IOperations.hxx index 65e42d42c..85b064484 100644 --- a/src/XAOPlugin/XAOPlugin_IOperations.hxx +++ b/src/XAOPlugin/XAOPlugin_IOperations.hxx @@ -40,7 +40,7 @@ namespace XAO { class XAOPLUGINENGINE_EXPORT XAOPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - XAOPlugin_IOperations( GEOM_Engine*, int ); + XAOPlugin_IOperations( GEOM_Engine* ); ~XAOPlugin_IOperations(); bool ExportXAO( Handle(GEOM_Object) shape, diff --git a/src/XAOPlugin/XAOPlugin_OperationsCreator.cxx b/src/XAOPlugin/XAOPlugin_OperationsCreator.cxx index e2876fd5e..4240ec953 100644 --- a/src/XAOPlugin/XAOPlugin_OperationsCreator.cxx +++ b/src/XAOPlugin/XAOPlugin_OperationsCreator.cxx @@ -31,6 +31,8 @@ // OCCT includes #include +XAOPlugin_IOperations* XAOPlugin_OperationsCreator::_operation; + XAOPlugin_OperationsCreator::XAOPlugin_OperationsCreator() { // Register drivers @@ -51,6 +53,12 @@ GEOM_IOperations_i* XAOPlugin_OperationsCreator::Create( PortableServer::POA_ptr { Unexpect aCatch( SALOME_SalomeException ); MESSAGE( "XAOPlugin_OperationsCreator::Create" ); - XAOPlugin_IOperations* anOperation = new XAOPlugin_IOperations( theGenImpl ); - return new XAOPlugin_IOperations_i( thePOA, theEngine, anOperation ); + return new XAOPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) ); +} + +XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl ) +{ + if( !_operation ) + _operation = new XAOPlugin_IOperations( theGenImpl ); + return _operation; } diff --git a/src/XAOPlugin/XAOPlugin_OperationsCreator.hxx b/src/XAOPlugin/XAOPlugin_OperationsCreator.hxx index 3811bc68a..26d645d83 100755 --- a/src/XAOPlugin/XAOPlugin_OperationsCreator.hxx +++ b/src/XAOPlugin/XAOPlugin_OperationsCreator.hxx @@ -43,6 +43,11 @@ public: GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl ); +private: + static XAOPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl); + +private: + static XAOPlugin_IOperations* _operation; friend class XAOPlugin_IECallBack; };