From f03c1085ac43b0c7c3df58a6feb1d2b1b4b2fb3f Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Wed, 22 May 2019 14:27:07 +0200 Subject: [PATCH] multistudy removal part 1 --- src/HYDROData/HYDROData_Application.cxx | 32 +++--------- src/HYDROData/HYDROData_Application.h | 10 ++-- src/HYDROData/HYDROData_CalculationCase.cxx | 15 +++--- src/HYDROData/HYDROData_CalculationCase.h | 7 +-- src/HYDROData/HYDROData_Document.cxx | 42 +++------------ src/HYDROData/HYDROData_Document.h | 10 ++-- src/HYDROData/HYDROData_GeomTool.cxx | 51 +++++++++---------- src/HYDROData/HYDROData_GeomTool.h | 18 ++----- src/HYDROData/HYDROData_LandCoverMap.cxx | 4 +- src/HYDROData/HYDROData_Obstacle.cxx | 14 +---- src/HYDROGUI/HYDROGUI_DataModel.cxx | 8 +-- src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx | 3 +- src/HYDROGUI/HYDROGUI_ExportFileOp.cxx | 2 +- .../HYDROGUI_ImportLandCoverMapOp.cxx | 4 +- src/HYDROGUI/HYDROGUI_Module.cxx | 7 ++- src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx | 2 +- src/HYDROGUI/HYDROGUI_ObjComboBox.cxx | 2 +- src/HYDROGUI/HYDROGUI_Operation.cxx | 2 +- src/HYDROGUI/HYDROGUI_Operations.cxx | 2 +- src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx | 3 +- .../HYDROGUI_StricklerTypeComboBox.cxx | 2 +- src/HYDROGUI/HYDROGUI_Tool2.cxx | 12 ++--- src/HYDROPy/HYDROData_CalculationCase.sip | 6 +-- src/HYDROPy/HYDROData_Document.sip | 9 ++-- src/HYDRO_tests/test_Dependencies.cxx | 4 +- src/HYDRO_tests/test_HYDROData_Bathymetry.cxx | 4 +- .../test_HYDROData_BoundaryPolygons.cxx | 8 +-- src/HYDRO_tests/test_HYDROData_CalcCase.cxx | 8 +-- src/HYDRO_tests/test_HYDROData_Channel.cxx | 2 +- src/HYDRO_tests/test_HYDROData_DTM.cxx | 22 ++++---- src/HYDRO_tests/test_HYDROData_Document.cxx | 14 ++--- src/HYDRO_tests/test_HYDROData_Entity.cxx | 8 +-- src/HYDRO_tests/test_HYDROData_Image.cxx | 10 ++-- src/HYDRO_tests/test_HYDROData_Iterator.cxx | 4 +- .../test_HYDROData_LandCoverMap.cxx | 50 +++++++++--------- .../test_HYDROData_OperationsFactory.cxx | 4 +- src/HYDRO_tests/test_HYDROData_PolylineXY.cxx | 24 ++++----- src/HYDRO_tests/test_HYDROData_Profile.cxx | 6 +-- src/HYDRO_tests/test_HYDROData_Stream.cxx | 12 ++--- .../test_HYDROData_StricklerTable.cxx | 16 +++--- .../test_HYDROGUI_BathymetryPrs.cxx | 14 ++--- .../test_HYDROGUI_LandCoverMapDlg.cxx | 2 +- src/HYDRO_tests/test_HYDROGUI_ListModel.cxx | 2 +- 43 files changed, 197 insertions(+), 284 deletions(-) diff --git a/src/HYDROData/HYDROData_Application.cxx b/src/HYDROData/HYDROData_Application.cxx index 04a0e18b..9fd0d2ed 100644 --- a/src/HYDROData/HYDROData_Application.cxx +++ b/src/HYDROData/HYDROData_Application.cxx @@ -20,6 +20,8 @@ #include +#define _STUDYID_ 1 + IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Application,TDocStd_Application) static HYDROData_Application* TheApplication = new HYDROData_Application; @@ -37,30 +39,10 @@ HYDROData_Application* HYDROData_Application::GetApplication() //function : GetDocument //purpose : //======================================================================= -bool HYDROData_Application::GetDocumentId(const Handle(HYDROData_Document)& theDocument, - int& theDocId) const -{ - DataMapOfStudyIDDocument::Iterator aMapit( myDocuments ); - for ( ; aMapit.More(); aMapit.Next() ) - { - if ( aMapit.Value() != theDocument ) - continue; - - theDocId = aMapit.Key(); - return true; - } - - return false; -} - -//======================================================================= -//function : GetDocument -//purpose : -//======================================================================= -Handle(HYDROData_Document) HYDROData_Application::GetDocument(int theStudyID) const +Handle(HYDROData_Document) HYDROData_Application::GetDocument() const { - if (myDocuments.IsBound(theStudyID)) { - return myDocuments.Find(theStudyID); + if (myDocuments.IsBound(_STUDYID_)) { + return myDocuments.Find(_STUDYID_); } // document not found => create the new one return Handle(HYDROData_Document)(); @@ -81,9 +63,9 @@ HYDROData_Application::HYDROData_Application () //function : addDocument //purpose : //======================================================================= -void HYDROData_Application::AddDocument(int theStudyID, const Handle(HYDROData_Document)& theDocument) +void HYDROData_Application::AddDocument(const Handle(HYDROData_Document)& theDocument) { - myDocuments.Bind(theStudyID, theDocument); + myDocuments.Bind(_STUDYID_, theDocument); } //======================================================================= diff --git a/src/HYDROData/HYDROData_Application.h b/src/HYDROData/HYDROData_Application.h index 37eb02c2..4b289e3d 100644 --- a/src/HYDROData/HYDROData_Application.h +++ b/src/HYDROData/HYDROData_Application.h @@ -55,15 +55,11 @@ public: // Redefined OCAF methods DEFINE_STANDARD_RTTIEXT(HYDROData_Application, TDocStd_Application) private: - //! Returns document by its study ID, if document doesn't exists return null - Handle(HYDROData_Document) GetDocument(int theStudyID) const; - - //! Get study id by document instance, if document doesn't exists return false - bool GetDocumentId(const Handle(HYDROData_Document)& theDocument, - int& theDocId) const; + //! Returns document, if document doesn't exists return null + Handle(HYDROData_Document) GetDocument() const; //! Appends document to the application - void AddDocument(int theStudyID, const Handle(HYDROData_Document)& theDocument); + void AddDocument(const Handle(HYDROData_Document)& theDocument); //! Removes document from the application void RemoveDocument( const Handle(HYDROData_Document)& theDocument ); diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 8dcedb1e..5b291318 100755 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -1292,24 +1292,22 @@ Handle(HYDROData_SplitShapesGroup) HYDROData_CalculationCase::addNewSplitGroup( return aNewGroup; } -QString HYDROData_CalculationCase::Export( int theStudyId ) const +QString HYDROData_CalculationCase::Export() const { #ifdef LIGHT_MODE return ""; #else GEOM::GEOM_Gen_var aGEOMEngine = HYDROData_GeomTool::GetGeomGen(); - SALOMEDS::Study_var aDSStudy = HYDROData_GeomTool::GetStudyByID( theStudyId ); QString aGeomObjEntry, anErrorMsg; QString statMess; - bool isOK = Export( aGEOMEngine, aDSStudy, aGeomObjEntry, anErrorMsg, statMess ); + bool isOK = Export( aGEOMEngine, aGeomObjEntry, anErrorMsg, statMess ); return isOK ? aGeomObjEntry : QString(); #endif } #ifndef LIGHT_MODE bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, QString& theGeomObjEntry, QString& theErrorMsg, QString& statMess) const @@ -1374,7 +1372,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, } else if ( isAllNotSubmersible ) { theErrorMsg = QString("there are no submersible regions."); } else { - aRes = Export( theGeomEngine, theStudy, aShToNames, aSeqOfGroupsDefs, theGeomObjEntry );; + aRes = Export( theGeomEngine, aShToNames, aSeqOfGroupsDefs, theGeomObjEntry );; } if( aRes && !GetLandCoverMap().IsNull() && !GetStricklerTable().IsNull() ) @@ -1388,7 +1386,6 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, } bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, const NCollection_IndexedDataMap& aShToName, const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs, QString& theGeomObjEntry ) const @@ -1461,7 +1458,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var #endif // Publish the sewed shape QString aName = EXPORT_NAME; GEOM::GEOM_Object_ptr aMainShape = - HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( theGeomEngine, theStudy, aSewedShape, aFacesToNameModif, aName, theGeomObjEntry ); + HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( theGeomEngine, aSewedShape, aFacesToNameModif, aName, theGeomObjEntry ); if ( aMainShape->_is_nil() ) return false; @@ -1528,7 +1525,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var if ( !aGroupsData.IsEmpty() ) { GEOM::GEOM_IGroupOperations_var aGroupOp = - theGeomEngine->GetIGroupOperations( theStudy->StudyId() ); + theGeomEngine->GetIGroupOperations(); NCollection_DataMap< TCollection_AsciiString, NCollection_Sequence >::Iterator aMapIt( aGroupsData ); for ( ; aMapIt.More(); aMapIt.Next() ) @@ -1550,7 +1547,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var if ( aGroupOp->IsDone() ) { SALOMEDS::SObject_var aGroupSO = - theGeomEngine->AddInStudy( theStudy, aGeomGroup, aGroupName.ToCString(), aMainShape ); + theGeomEngine->AddInStudy( aGeomGroup, aGroupName.ToCString(), aMainShape ); } } } diff --git a/src/HYDROData/HYDROData_CalculationCase.h b/src/HYDROData/HYDROData_CalculationCase.h index 953be5ce..998f3f36 100644 --- a/src/HYDROData/HYDROData_CalculationCase.h +++ b/src/HYDROData/HYDROData_CalculationCase.h @@ -287,22 +287,19 @@ public: /** * Exports the calculation case data (shell and groups) to GEOM module. - * \param theStudyId the id of the study where the GEOM module should be used for export * \return the entry of the GEOM object (empty string in the case of error) */ - HYDRODATA_EXPORT virtual QString Export( int theStudyId ) const; + HYDRODATA_EXPORT virtual QString Export() const; /** * Exports the calculation case data (shell and groups) to GEOM module. * \param theGeomEngine GEOM module engine - * \param theStudy SALOMEDS study, is used for publishing of GEOM objects * \param theGeomObjEntry the published GEOM object entry * \param theErrorMsg the error message * \return true in case of success */ #ifndef LIGHT_MODE HYDRODATA_EXPORT virtual bool Export( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, QString& theGeomObjEntry, QString& theErrorMsg, QString& statMess) const; @@ -440,14 +437,12 @@ private: /** * Exports the given faces as shell and the given groups to GEOM module. * \param theGeomEngine GEOM module engine - * \param theStudy SALOMEDS study, is used for publishing of GEOM objects * \param theFaces the list of faces to make shell * \param theSplitGroups the list of groups * \return true in case of success */ #ifndef LIGHT_MODE bool Export( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, const NCollection_IndexedDataMap& aFacesToName, const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs, QString& theGeomObjEntry ) const; diff --git a/src/HYDROData/HYDROData_Document.cxx b/src/HYDROData/HYDROData_Document.cxx index c892dcd8..3a5cd32f 100644 --- a/src/HYDROData/HYDROData_Document.cxx +++ b/src/HYDROData/HYDROData_Document.cxx @@ -58,13 +58,13 @@ using namespace std; typedef QMap MapOfOrdered; typedef QMap MapOfUnordered; -Handle(HYDROData_Document) HYDROData_Document::Document(const int theStudyID) +Handle(HYDROData_Document) HYDROData_Document::Document() { Handle(HYDROData_Document) aResult = - HYDROData_Application::GetApplication()->GetDocument(theStudyID); + HYDROData_Application::GetApplication()->GetDocument(); if (aResult.IsNull()) { aResult = new HYDROData_Document(); - HYDROData_Application::GetApplication()->AddDocument(theStudyID, aResult); + HYDROData_Application::GetApplication()->AddDocument(aResult); } return aResult; } @@ -89,35 +89,19 @@ Handle(HYDROData_Document) HYDROData_Document::Document( return aResDoc; HYDROData_Application* anApp = HYDROData_Application::GetApplication(); - - DataMapOfStudyIDDocument::Iterator aMapIt( anApp->myDocuments ); - for ( ; aMapIt.More(); aMapIt.Next() ) - { - Handle(HYDROData_Document) anAppDoc = aMapIt.Value(); - if ( anAppDoc.IsNull() || anAppDoc->myDoc != anObjDoc ) - continue; - - aResDoc = anAppDoc; - break; - } + aResDoc = anApp->GetDocument(); return aResDoc; } -bool HYDROData_Document::HasDocument(const int theStudyID) +bool HYDROData_Document::HasDocument() { Handle(HYDROData_Document) aResult = - HYDROData_Application::GetApplication()->GetDocument(theStudyID); + HYDROData_Application::GetApplication()->GetDocument(); return !aResult.IsNull(); } -bool HYDROData_Document::DocumentId(const Handle(HYDROData_Document)& theDocument, - int& theDocId ) -{ - return HYDROData_Application::GetApplication()->GetDocumentId(theDocument, theDocId); -} - -Data_DocError HYDROData_Document::Load(const char* theFileName, const int theStudyID) +Data_DocError HYDROData_Document::Load(const char* theFileName) { Handle(TDocStd_Document) aResult; TCollection_ExtendedString aPath ((const Standard_CString)theFileName); @@ -130,7 +114,7 @@ Data_DocError HYDROData_Document::Load(const char* theFileName, const int theStu {} if (!aResult.IsNull()) { aResult->SetUndoLimit(UNDO_LIMIT); - HYDROData_Application::GetApplication()->AddDocument(theStudyID, new HYDROData_Document(aResult)); + HYDROData_Application::GetApplication()->AddDocument(new HYDROData_Document(aResult)); } // recognize error Data_DocError anError; @@ -353,12 +337,6 @@ QString HYDROData_Document::GetDocPyName() const { QString aDocName = PYTHON_DOC_NAME; - /* - int aDocId = 1; - if ( DocumentId( this, aDocId ) ) - aDocName += "_" + QString::number( aDocId ); - */ - return aDocName; } @@ -371,10 +349,6 @@ QStringList HYDROData_Document::DumpToPython( const QString& thePyScriptPath, // Append document in to the map of treated objects to prevent names overlaping theTreatedObjects.insert( aDocName, this ); - int aDocId = 1; - if ( !DocumentId( this, aDocId ) ) - aDocId = 1; - QStringList aResScript; aResScript << QString( "from HYDROPy import *" ); diff --git a/src/HYDROData/HYDROData_Document.h b/src/HYDROData/HYDROData_Document.h index 6d474b69..1eaf6408 100644 --- a/src/HYDROData/HYDROData_Document.h +++ b/src/HYDROData/HYDROData_Document.h @@ -62,7 +62,7 @@ public: DEFINE_STANDARD_RTTIEXT(HYDROData_Document, MMgt_TShared); //! Returns the existing document or creates new if it is not exist - HYDRODATA_EXPORT static Handle(HYDROData_Document) Document(const int theStudyID); + HYDRODATA_EXPORT static Handle(HYDROData_Document) Document(); //! Returns the document by object HYDRODATA_EXPORT static Handle(HYDROData_Document) Document( @@ -71,19 +71,15 @@ public: public: //! Returns true if data model contains document for this study - HYDRODATA_EXPORT static bool HasDocument(const int theStudyID); + HYDRODATA_EXPORT static bool HasDocument(); - //! Get study id by document instance, if document doesn't exists return false - HYDRODATA_EXPORT static bool DocumentId( const Handle(HYDROData_Document)& theDocument, - int& theDocId ); public: //! Loads the OCAF document from the file. //! \param theFileName full name of the file to load - //! \param theStudyID identifier of the SALOME study to associate with loaded file //! \returns error status (OK in case of success) - HYDRODATA_EXPORT static Data_DocError Load(const char* theFileName, const int theStudyID); + HYDRODATA_EXPORT static Data_DocError Load(const char* theFileName); //! Saves the OCAF document to the file. //! \param theFileName full name of the file to store diff --git a/src/HYDROData/HYDROData_GeomTool.cxx b/src/HYDROData/HYDROData_GeomTool.cxx index a152909c..23c7b9a8 100644 --- a/src/HYDROData/HYDROData_GeomTool.cxx +++ b/src/HYDROData/HYDROData_GeomTool.cxx @@ -47,9 +47,9 @@ static int _argc = 0; static CORBA::ORB_var _ORB = CORBA::ORB_init( _argc, 0, "omniORB4"/*CORBA::ORB_ID*/ ); static SALOME_NamingService _NS( _ORB ); static SALOME_LifeCycleCORBA _LCC( &_NS ); +static SALOMEDS::Study_var _STUDY = SALOMEDS::Study::_nil(); - -TopoDS_Shape HYDROData_GeomTool::GetShapeFromIOR( const int theStudyId, const QString& theIOR ) +TopoDS_Shape HYDROData_GeomTool::GetShapeFromIOR( const QString& theIOR ) { // Note that GEOMBase::GetShape() cause crash in batch mode @@ -77,19 +77,21 @@ GEOM::GEOM_Gen_var HYDROData_GeomTool::GetGeomGen() return aGEOMEngine._retn(); } -SALOMEDS::Study_var HYDROData_GeomTool::GetStudyByID( const int theStudyId ) +SALOMEDS::Study_var HYDROData_GeomTool::GetStudy() { - CORBA::Object_var aSMObject = _NS.Resolve("/myStudyManager"); - SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject); - SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID( theStudyId ); - - return aDSStudy._retn(); + if (_STUDY->_is_nil()) + { + CORBA::Object_var aStudyObject = _NS.Resolve("/Study"); + _STUDY = SALOMEDS::Study::_narrow(aStudyObject); + } + return _STUDY._retn(); } -QString HYDROData_GeomTool::GetFreeName( SALOMEDS::Study_ptr theStudy, const QString& theBaseName ) +QString HYDROData_GeomTool::GetFreeName( const QString& theBaseName ) { QString aName = theBaseName; + SALOMEDS::Study_var theStudy = GetStudy(); if ( !theStudy->_is_nil() ) { // collect all object names of GEOM component QSet anUsedNames; @@ -125,15 +127,15 @@ QString HYDROData_GeomTool::GetFreeName( SALOMEDS::Study_ptr theStudy, const QSt return aName; } -GEOM::GEOM_Object_ptr HYDROData_GeomTool::publishShapeInGEOM( - GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy, +GEOM::GEOM_Object_ptr HYDROData_GeomTool::publishShapeInGEOM( + GEOM::GEOM_Gen_var theGeomEngine, const TopoDS_Shape& theShape, const QString& theName, QString& theGeomObjEntry ) { theGeomObjEntry = ""; GEOM::GEOM_Object_var aGeomObj; - if ( theGeomEngine->_is_nil() || theStudy->_is_nil() || + if ( theGeomEngine->_is_nil() || theShape.IsNull() ) { return aGeomObj._retn(); } @@ -151,26 +153,25 @@ GEOM::GEOM_Object_ptr HYDROData_GeomTool::publishShapeInGEOM( SALOMEDS::TMPFile_var aSeqFile = new SALOMEDS::TMPFile( aSize, aSize, anOctetBuf, 1 ); // Restore shape from the stream and get the GEOM object - GEOM::GEOM_IInsertOperations_var anInsOp = theGeomEngine->GetIInsertOperations( theStudy->StudyId() ); + GEOM::GEOM_IInsertOperations_var anInsOp = theGeomEngine->GetIInsertOperations(); aGeomObj = anInsOp->RestoreShape( aSeqFile ); // Publish the GEOM object - theGeomObjEntry = publishGEOMObject( theGeomEngine, theStudy, aGeomObj, theName ); + theGeomObjEntry = publishGEOMObject( theGeomEngine, aGeomObj, theName ); return aGeomObj._retn(); } GEOM::GEOM_Object_ptr HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, const TopoDS_Shape& theShape, const NCollection_IndexedDataMap& aFacesToNameModif, const QString& theName, QString& theGeomObjEntry) { - GEOM::GEOM_Object_ptr aGeomObj = HYDROData_GeomTool::publishShapeInGEOM( theGeomEngine, theStudy, theShape, theName, theGeomObjEntry ); + GEOM::GEOM_Object_ptr aGeomObj = HYDROData_GeomTool::publishShapeInGEOM( theGeomEngine, theShape, theName, theGeomObjEntry ); - GEOM::GEOM_IShapesOperations_var anExpOp = theGeomEngine->GetIShapesOperations( theStudy->StudyId() ); + GEOM::GEOM_IShapesOperations_var anExpOp = theGeomEngine->GetIShapesOperations(); GEOM::ListOfGO* aFc = anExpOp->MakeExplode(aGeomObj, TopAbs_FACE, false); TopTools_MapOfShape mapShape; @@ -201,7 +202,7 @@ GEOM::GEOM_Object_ptr HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( GEOM::GE std::string name = Names[i].toStdString(); GEOM::GEOM_Object_ptr anObj = aFc->operator[](i); //GEOMBase::PublishSubObject( anObj, name.c_str() ); - theGeomEngine->AddInStudy( theStudy, anObj, name.c_str(), aGeomObj ); + theGeomEngine->AddInStudy( anObj, name.c_str(), aGeomObj ); } return aGeomObj; @@ -209,7 +210,6 @@ GEOM::GEOM_Object_ptr HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( GEOM::GE GEOM::GEOM_Object_ptr HYDROData_GeomTool::createFaceInGEOM( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, const int theWidth, const int theHeight, const QString& theName, @@ -218,12 +218,12 @@ GEOM::GEOM_Object_ptr HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( GEOM::GE theFaceEntry = ""; GEOM::GEOM_Object_var aGeomObj; - if ( theGeomEngine->_is_nil() || theStudy->_is_nil() ) { + if ( theGeomEngine->_is_nil() ) { return aGeomObj._retn(); } - GEOM::GEOM_IBasicOperations_var aBasicOperations = theGeomEngine->GetIBasicOperations( theStudy->StudyId() ); - GEOM::GEOM_IBlocksOperations_var aBlocksOperations = theGeomEngine->GetIBlocksOperations( theStudy->StudyId() ); + GEOM::GEOM_IBasicOperations_var aBasicOperations = theGeomEngine->GetIBasicOperations(); + GEOM::GEOM_IBlocksOperations_var aBlocksOperations = theGeomEngine->GetIBlocksOperations(); GEOM::GEOM_Object_var P1 = aBasicOperations->MakePointXYZ( -0.5 * theWidth, -0.5 * theHeight, 0 ); GEOM::GEOM_Object_var P2 = aBasicOperations->MakePointXYZ( 0.5 * theWidth, -0.5 * theHeight, 0 ); @@ -233,23 +233,22 @@ GEOM::GEOM_Object_ptr HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( GEOM::GE GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices( P1, P2 ,P3, P4 ); // Publish the face - theFaceEntry = publishGEOMObject( theGeomEngine, theStudy, aFace, theName ); + theFaceEntry = publishGEOMObject( theGeomEngine, aFace, theName ); return aFace._retn(); } QString HYDROData_GeomTool::publishGEOMObject( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, GEOM::GEOM_Object_ptr theGeomObj, const QString& theName ) { QString anEntry; if ( !theGeomObj->_is_nil() ) { - QString aName = HYDROData_GeomTool::GetFreeName( theStudy, theName ); + QString aName = HYDROData_GeomTool::GetFreeName( theName ); SALOMEDS::SObject_var aResultSO = - theGeomEngine->PublishInStudy( theStudy, SALOMEDS::SObject::_nil(), + theGeomEngine->PublishInStudy( SALOMEDS::SObject::_nil(), theGeomObj, qPrintable( aName ) ); if ( !aResultSO->_is_nil() ) { anEntry = aResultSO->GetID(); diff --git a/src/HYDROData/HYDROData_GeomTool.h b/src/HYDROData/HYDROData_GeomTool.h index 17d48314..419c49c6 100644 --- a/src/HYDROData/HYDROData_GeomTool.h +++ b/src/HYDROData/HYDROData_GeomTool.h @@ -44,10 +44,9 @@ public: /** * \brief Get shape by the specified IOR. * \param theIOR the GEOM object IOR - * \param theStudyId the study ID * \return the shape */ - static TopoDS_Shape GetShapeFromIOR( const int theStudyId, const QString& theIOR ); + static TopoDS_Shape GetShapeFromIOR( const QString& theIOR ); /** * \brief Get GEOM engine. @@ -56,31 +55,27 @@ public: static GEOM::GEOM_Gen_var GetGeomGen(); /** - * \brief Get shape by the specified study ID. - * \param theStudyId the study ID + * \brief Get Study. * \return the study */ - static SALOMEDS::Study_var GetStudyByID( const int theStudyId ); + static SALOMEDS::Study_var GetStudy(); /** * \brief Get free name for GEOM object. - * \param theStudy the study * \param theBaseName the base name * \return the default name */ - static QString GetFreeName( SALOMEDS::Study_ptr theStudy, const QString& theBaseName ); + static QString GetFreeName( const QString& theBaseName ); /** * Publish the given shape in GEOM as a GEOM object. * \param theGeomEngine GEOM module engine - * \param theStudy SALOMEDS study, used for publishing of the shape * \param theShape the shape to publish as a GEOM object * \param theName the name of the published object * \param theGeomObjEntry the entry of the published object * \return the published GEOM object */ static GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, const TopoDS_Shape& theShape, const QString& theName, QString& theGeomObjEntry ); @@ -88,7 +83,6 @@ public: /** * Create and publish face in GEOM as a GEOM object. * \param theGeomEngine GEOM module engine - * \param theStudy SALOMEDS study, used for publishing of the face * \param theWidth the face width * \param theHeight the face height * \param theName the name of the published face @@ -96,7 +90,6 @@ public: * \return the published GEOM object */ static GEOM::GEOM_Object_ptr createFaceInGEOM( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, const int theWidth, const int theHeight, const QString& theName, @@ -105,18 +98,15 @@ public: /** * Publish the given GEOM object in the study. * \param theGeomEngine GEOM module engine - * \param theStudy SALOMEDS study, used for publishing of the object * \param theGeomObj the GEOM object * \param theName the object name * \return the entry of the published object (empty string in case of fail) */ static QString publishGEOMObject( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, GEOM::GEOM_Object_ptr theGeomObj, const QString& theName ); static GEOM::GEOM_Object_ptr ExplodeShapeInGEOMandPublish( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, const TopoDS_Shape& theShape, const NCollection_IndexedDataMap& aShToNameModif, const QString& theName, diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index f069df13..fcb89b42 100755 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -1191,7 +1191,7 @@ bool HYDROData_LandCoverMap::ImportSHP( const QString& theSHPFileName, QStringList aPolyList; TopTools_SequenceOfShape aFaces; //int aSHapeType = -1; - int Stat = anImporter.ImportPolygons(HYDROData_Document::Document(1), theSHPFileName, aPolyList, aFaces); + int Stat = anImporter.ImportPolygons(HYDROData_Document::Document(), theSHPFileName, aPolyList, aFaces); // if (Stat != 1) return false; @@ -1232,7 +1232,7 @@ bool HYDROData_LandCoverMap::ExportSHP( const QString& theSHPFileName, bool bUse { HYDROData_ShapeFile anExporter; QStringList aList; - anExporter.Export(HYDROData_Document::Document(1), theSHPFileName, this, aList, bUseDiscr, theDefl ); + anExporter.Export(HYDROData_Document::Document(), theSHPFileName, this, aList, bUseDiscr, theDefl ); if (aList.empty()) return true; else diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index c3586ef5..eeb847bb 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -235,13 +235,8 @@ bool HYDROData_Obstacle::ImportFromGeomIOR( const TCollection_AsciiString& theIO return aRes; } - int aDocId = -1; - if ( !HYDROData_Document::DocumentId( HYDROData_Document::Document( myLab ), aDocId ) || aDocId < 0 ) { - return aRes; - } - // TopoDS_Shape aShape = GEOMBase::GetShapeFromIOR( theIOR.ToCString() ); - TopoDS_Shape aShape = HYDROData_GeomTool::GetShapeFromIOR( aDocId, theIOR.ToCString() ); + TopoDS_Shape aShape = HYDROData_GeomTool::GetShapeFromIOR( theIOR.ToCString() ); if ( !aShape.IsNull() ) { SetShape3D( aShape ); @@ -277,13 +272,8 @@ TCollection_AsciiString HYDROData_Obstacle::GetGeomObjectName() const { TCollection_AsciiString aRes; - int aDocId = -1; - if ( !HYDROData_Document::DocumentId( HYDROData_Document::Document( myLab ), aDocId ) || aDocId < 0 ) { - return aRes; - } - #ifndef LIGHT_MODE - SALOMEDS::Study_var aDSStudy = HYDROData_GeomTool::GetStudyByID( aDocId ); + SALOMEDS::Study_var aDSStudy = HYDROData_GeomTool::GetStudy(); if ( !aDSStudy->_is_nil() ) { TCollection_AsciiString anEntry = GetGeomObjectEntry(); diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index bfb64ec4..e9e8bc45 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -118,7 +118,7 @@ bool HYDROGUI_DataModel::open( const QString& theURL, try { - res = HYDROData_Document::Load( (char*)aDataFullPath.toLatin1().constData(), aStudyId ); + res = HYDROData_Document::Load( (char*)aDataFullPath.toLatin1().constData() ); } catch(...) { @@ -225,7 +225,7 @@ bool HYDROGUI_DataModel::dumpPython( const QString& theURL, int aStudyId = theStudy->id(); LightApp_Study* aStudy = ::qobject_cast( theStudy ); - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( aStudyId ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document(); if ( aDocument.IsNull() || !aStudy ) return false; @@ -265,7 +265,7 @@ void HYDROGUI_DataModel::update( const int theStudyId ) // create a new root object CAM_DataObject* aNewRootObj = new CAM_DataObject(); - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theStudyId ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document(); if( aDocument.IsNull() ) return; @@ -817,7 +817,7 @@ QString HYDROGUI_DataModel::partitionName( const ObjectKind theObjectKind ) Handle(HYDROData_Document) HYDROGUI_DataModel::getDocument() const { int aStudyId = module()->application()->activeStudy()->id(); - return HYDROData_Document::Document( aStudyId ); + return HYDROData_Document::Document(); } LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent, diff --git a/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx b/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx index 77978ee5..b024f3b5 100644 --- a/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx @@ -87,10 +87,9 @@ bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags, myStatMess.clear(); QString anErrorMsg; if ( aStudy ) { - SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy->studyDS() ); GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen(); QString anEntry; - if ( aCalculation->Export( aGeomEngine, aDSStudy, anEntry, theErrorMsg, myStatMess ) ) { + if ( aCalculation->Export( aGeomEngine, anEntry, theErrorMsg, myStatMess ) ) { theUpdateFlags = UF_ObjBrowser; isOk = true; } diff --git a/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx b/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx index 956fb7f3..0d9027d2 100644 --- a/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx @@ -107,7 +107,7 @@ void HYDROGUI_ExportFileOp::startOperation() { QStringList aNonExpList; HYDROData_ShapeFile anExporter; - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); if (!aPolyXYSeq.IsEmpty() || !aPoly3DSeq.IsEmpty()) //Export polylines anExporter.Export(aDoc, aFileName, aPolyXYSeq, aPoly3DSeq, aNonExpList); diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx index 7b8fedb0..351bf92b 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx @@ -263,7 +263,7 @@ bool HYDROGUI_ImportLandCoverMapOp::processApply( int& theUpdateFlags, if ( !aPanel->getFileName().isEmpty() ) anObjName = aPanel->getObjectName(); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); //check if name of LCM is already exists QSet aNameList; @@ -409,7 +409,7 @@ void HYDROGUI_ImportLandCoverMapOp::onNext( const int theIndex ) //Collect all strickler_types QSet aSTSet; - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) DefStricklerTableObj; if ( aDoc ) { diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index aeacb30b..40cc9237 100755 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -250,7 +250,7 @@ bool HYDROGUI_Module::activateModule( SUIT_Study* theStudy ) SalomeApp_Study* aStudy = dynamic_cast( getApp()->activeStudy() ); if ( aStudy ) { - SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy->studyDS() ); + SALOMEDS::Study_var aDSStudy = GeometryGUI::getStudyServant(); GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen(); if ( !aGeomEngine->_is_nil() && !aGeomEngine->_is_nil() ) { SALOMEDS::StudyBuilder_var aStudyBuilder = aDSStudy->NewBuilder(); @@ -969,7 +969,7 @@ void HYDROGUI_Module::preferencesChanged( const QString& theSection, const QStri if ( theSection == "preferences" && thePref == "default_strickler_coefficient" ) { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); if ( resMgr && !aDoc.IsNull() ) aDoc->SetDefaultStricklerCoefficient( resMgr->doubleValue( theSection, thePref, 0 ) ); } @@ -1932,8 +1932,7 @@ void HYDROGUI_Module::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEvent* if ( aDesktop && aDesktop->statusBar() ) { gp_Pnt aWPnt( X, Y, Z ); - int aStudyId = application()->activeStudy()->id(); - HYDROData_Document::Document( aStudyId )->Transform( aWPnt, false ); + HYDROData_Document::Document()->Transform( aWPnt, false ); double WX = aWPnt.X(), WY = aWPnt.Y(); QString aXStr = HYDROGUI_Tool::GetCoordinateString( X, true ); diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx index de674e8b..2bb54eda 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx @@ -194,7 +194,7 @@ void HYDROGUI_OCCDisplayer::Display( const HYDROData_SequenceOfObjects& theObjs, return; // Get the document - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( module()->getStudyId() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); if ( !aDoc ) return; diff --git a/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx b/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx index 8d2ef26e..5ac43302 100644 --- a/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx +++ b/src/HYDROGUI/HYDROGUI_ObjComboBox.cxx @@ -119,7 +119,7 @@ SUIT_SelectionMgr* HYDROGUI_ObjComboBox::selectionMgr() const QStringList HYDROGUI_ObjComboBox::objectNames( HYDROData_SequenceOfObjects& theObjects ) const { QStringList aNames; - for ( HYDROData_Iterator it( HYDROData_Document::Document( module()->getStudyId() ), objectType() ); it.More(); it.Next() ) + for ( HYDROData_Iterator it( HYDROData_Document::Document(), objectType() ); it.More(); it.Next() ) { if ( !objectFilter() || objectFilter()->isOk( it.Current() ) ) { diff --git a/src/HYDROGUI/HYDROGUI_Operation.cxx b/src/HYDROGUI/HYDROGUI_Operation.cxx index 80365156..aeb8e452 100644 --- a/src/HYDROGUI/HYDROGUI_Operation.cxx +++ b/src/HYDROGUI/HYDROGUI_Operation.cxx @@ -395,7 +395,7 @@ void HYDROGUI_Operation::commitDocOperation() Handle(HYDROData_Document) HYDROGUI_Operation::doc() const { - return HYDROData_Document::Document( myModule->getStudyId() ); + return HYDROData_Document::Document(); } void HYDROGUI_Operation::onApplyAndClose() diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index f4cec87b..c828568a 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -458,7 +458,7 @@ void HYDROGUI_Module::updateUndoRedoControls() void HYDROGUI_Module::enableLCMActions() { - HYDROData_Iterator anIt( HYDROData_Document::Document( getStudyId() ), KIND_LAND_COVER_MAP ); + HYDROData_Iterator anIt( HYDROData_Document::Document(), KIND_LAND_COVER_MAP ); bool anEnableTools = anIt.More(); QtxListAction* anAction; diff --git a/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx b/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx index 20220731..9af735e4 100644 --- a/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx +++ b/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx @@ -127,12 +127,11 @@ void HYDROGUI_RecognizeContoursOp::startOperation() // Export the selected image to GEOM module if ( aStudy && aViewMgr ) { - SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy->studyDS() ); GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen(); QString aGeomPictureEntry; - HYDROData_GeomTool::createFaceInGEOM( aGeomEngine, aDSStudy, aQImage.width(), aQImage.height(), + HYDROData_GeomTool::createFaceInGEOM( aGeomEngine, aQImage.width(), aQImage.height(), anImageName, aGeomPictureEntry ); if ( !aGeomPictureEntry.isEmpty() ) { diff --git a/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx b/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx index 321a72cd..3b0a2f4d 100644 --- a/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx +++ b/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx @@ -46,7 +46,7 @@ HYDROGUI_StricklerTypeComboBox::HYDROGUI_StricklerTypeComboBox( HYDROGUI_Module* if ( myModule ) { // Construct a list of unique names of all Strickler types defined within the data model - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myModule->getStudyId() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); if ( aDoc ) { QStringList aStricklerTypes; diff --git a/src/HYDROGUI/HYDROGUI_Tool2.cxx b/src/HYDROGUI/HYDROGUI_Tool2.cxx index a7b684ff..ad41ec63 100644 --- a/src/HYDROGUI/HYDROGUI_Tool2.cxx +++ b/src/HYDROGUI/HYDROGUI_Tool2.cxx @@ -141,7 +141,7 @@ bool HYDROGUI_Tool::IsObjectHasPresentation( const Handle(HYDROData_Entity)& the void HYDROGUI_Tool::GetPrsSubObjects( HYDROGUI_Module* theModule, HYDROData_SequenceOfObjects& theSeq ) { - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document(); if( !aDocument.IsNull() ) { HYDROData_Iterator anIterator( aDocument ); @@ -230,7 +230,7 @@ Handle(HYDROData_Entity) HYDROGUI_Tool::GetSelectedObject( HYDROGUI_Module* theM HYDROData_SequenceOfObjects HYDROGUI_Tool::GetGeometryObjects( HYDROGUI_Module* theModule ) { - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document(); HYDROData_SequenceOfObjects aResSeq; @@ -389,7 +389,7 @@ Handle(HYDROData_Entity) HYDROGUI_Tool::FindObjectByName( HYDROGUI_Module* theMo { Handle(HYDROData_Entity) aResObj; - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document(); if ( !aDocument.IsNull() ) aResObj = aDocument->FindObjectByName( theName, theObjectKind ); @@ -402,7 +402,7 @@ HYDROData_SequenceOfObjects HYDROGUI_Tool::FindObjectsByNames( HYDROGUI_Module* { HYDROData_SequenceOfObjects aResSeq; - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document(); if ( !aDocument.IsNull() ) aResSeq = aDocument->FindObjectsByNames( theNames, theObjectKind ); @@ -414,7 +414,7 @@ QString HYDROGUI_Tool::GenerateObjectName( HYDROGUI_Module* theModule, const QStringList& theUsedNames, const bool theIsTryToUsePurePrefix) { - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document(); return HYDROData_Tool::GenerateObjectName( aDocument, thePrefix, theUsedNames, theIsTryToUsePurePrefix ); } @@ -509,7 +509,7 @@ void HYDROGUI_Tool::setOCCActionShown( HYDROGUI_Module* theModule, QColor HYDROGUI_Tool::GenerateFillingColor( HYDROGUI_Module* theModule, const QStringList& theZoneNames ) { - Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( theModule->getStudyId() ); + Handle(HYDROData_Document) aDocument = HYDROData_Document::Document(); return GenerateFillingColor( aDocument, theZoneNames ); } diff --git a/src/HYDROPy/HYDROData_CalculationCase.sip b/src/HYDROPy/HYDROData_CalculationCase.sip index dac4e0d4..10532be6 100644 --- a/src/HYDROPy/HYDROData_CalculationCase.sip +++ b/src/HYDROPy/HYDROData_CalculationCase.sip @@ -378,13 +378,11 @@ public: /** * Exports the calculation case data (shell and groups) to GEOM module. * \param theGeomEngine GEOM module engine - * \param theStudy SALOMEDS study, is used for publishing of GEOM objects * \return true in case of success */ -//TODO: virtual bool Export( GEOM::GEOM_Gen_var theGeomEngine, -// SALOMEDS::Study_ptr theStudy ); +//TODO: virtual bool Export( GEOM::GEOM_Gen_var theGeomEngine ); - QString Export( int theStudyId ) const; + QString Export( ) const; public: // Public methods to work with Calculation services diff --git a/src/HYDROPy/HYDROData_Document.sip b/src/HYDROPy/HYDROData_Document.sip index 49febca4..6c0a75aa 100644 --- a/src/HYDROPy/HYDROData_Document.sip +++ b/src/HYDROPy/HYDROData_Document.sip @@ -205,13 +205,13 @@ class HYDROData_Document public: //! Returns the existing document or creates new if it is not exist - static HYDROData_Document Document( const int theStudyID ) [opencascade::handle (const int)] ; + static HYDROData_Document Document() [opencascade::handle ()] ; %MethodCode Handle(HYDROData_Document) aDocument; Py_BEGIN_ALLOW_THREADS - aDocument = HYDROData_Document::Document( a0 ); + aDocument = HYDROData_Document::Document(); Py_END_ALLOW_THREADS if ( !aDocument.IsNull() ) @@ -220,13 +220,12 @@ public: %End //! Returns true if data model contains document for this study - static bool HasDocument( const int theStudyID ); + static bool HasDocument(); //! Loads the OCAF document from the file. //! \param theFileName full name of the file to load - //! \param theStudyID identifier of the SALOME study to associate with loaded file //! \returns error status (OK in case of success) - static Data_DocError Load( const char* theFileName, const int theStudyID ); + static Data_DocError Load( const char* theFileName); //! Saves the OCAF document to the file. //! \param theFileName full name of the file to store diff --git a/src/HYDRO_tests/test_Dependencies.cxx b/src/HYDRO_tests/test_Dependencies.cxx index 7bbc96bb..b97d7543 100644 --- a/src/HYDRO_tests/test_Dependencies.cxx +++ b/src/HYDRO_tests/test_Dependencies.cxx @@ -30,7 +30,7 @@ void test_Dependencies::test_dependencies_broad_cast() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( aDoc->CreateObject( KIND_BATHYMETRY ) ); @@ -101,7 +101,7 @@ void test_Dependencies::test_dependencies_broad_cast() void test_Dependencies::test_calc_case_ref_objects() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_ImmersibleZone) aZone = Handle(HYDROData_ImmersibleZone)::DownCast( aDoc->CreateObject( KIND_IMMERSIBLE_ZONE ) ); diff --git a/src/HYDRO_tests/test_HYDROData_Bathymetry.cxx b/src/HYDRO_tests/test_HYDROData_Bathymetry.cxx index 5de3256b..a243d1ae 100644 --- a/src/HYDRO_tests/test_HYDROData_Bathymetry.cxx +++ b/src/HYDRO_tests/test_HYDROData_Bathymetry.cxx @@ -117,7 +117,7 @@ bool test_HYDROData_Bathymetry::createTestFile( const QString& theFileName ) void test_HYDROData_Bathymetry::testFileImport() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Bathymetry) aBathymetry = Handle(HYDROData_Bathymetry)::DownCast( aDoc->CreateObject( KIND_BATHYMETRY ) ); @@ -161,7 +161,7 @@ void test_HYDROData_Bathymetry::testFileImport() void test_HYDROData_Bathymetry::testCopy() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Bathymetry) aBathymetry1 = Handle(HYDROData_Bathymetry)::DownCast( aDoc->CreateObject( KIND_BATHYMETRY ) ); diff --git a/src/HYDRO_tests/test_HYDROData_BoundaryPolygons.cxx b/src/HYDRO_tests/test_HYDROData_BoundaryPolygons.cxx index 1877e1a3..541f54ba 100644 --- a/src/HYDRO_tests/test_HYDROData_BoundaryPolygons.cxx +++ b/src/HYDRO_tests/test_HYDROData_BoundaryPolygons.cxx @@ -34,9 +34,9 @@ void test_HYDROData_BoundaryPolygons::test_bp_1() { TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/test_boundary_polygon_calc_case_1.cbf"; - CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString(), 1 ) ); + CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString() ) ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); //Calc case already contains already contains 4 boundary poltgons (3 cut, 1 include) //Update it to recalculate the shape groups Handle(HYDROData_CalculationCase) aCase = @@ -109,8 +109,8 @@ void test_HYDROData_BoundaryPolygons::test_bp_2() { TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/test_boundary_polygon_calc_case_2.cbf"; - CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString(), 1 ) ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString() ) ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); //add boundary polygons to case_1 Handle(HYDROData_CalculationCase) aCase = Handle(HYDROData_CalculationCase)::DownCast( aDoc->FindObjectByName( "Case_1" ) ); diff --git a/src/HYDRO_tests/test_HYDROData_CalcCase.cxx b/src/HYDRO_tests/test_HYDROData_CalcCase.cxx index 91141a7c..e383b41d 100644 --- a/src/HYDRO_tests/test_HYDROData_CalcCase.cxx +++ b/src/HYDRO_tests/test_HYDROData_CalcCase.cxx @@ -135,9 +135,9 @@ void test_HYDROData_CalcCase::test_complete_1() { TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/study_cc_1.cbf"; - CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString(), 1 ) ); + CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString() ) ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_CalculationCase) aCase = Handle(HYDROData_CalculationCase)::DownCast( aDoc->FindObjectByName( "Case_1" ) ); @@ -222,9 +222,9 @@ void test_HYDROData_CalcCase::test_complete_2() { TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/study_cc_2.cbf"; - CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString(), 1 ) ); + CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString() ) ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_CalculationCase) aCase = Handle(HYDROData_CalculationCase)::DownCast( aDoc->FindObjectByName( "Case_1" ) ); diff --git a/src/HYDRO_tests/test_HYDROData_Channel.cxx b/src/HYDRO_tests/test_HYDROData_Channel.cxx index c80b0da3..be1cced8 100644 --- a/src/HYDRO_tests/test_HYDROData_Channel.cxx +++ b/src/HYDRO_tests/test_HYDROData_Channel.cxx @@ -37,7 +37,7 @@ TopoDS_Edge Spline( const QList& theXYList, bool isClosed = false ); void test_HYDROData_Channel::test_channel_prs_refs_751() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) Polyline_2 = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); diff --git a/src/HYDRO_tests/test_HYDROData_DTM.cxx b/src/HYDRO_tests/test_HYDROData_DTM.cxx index 48a47069..6fc2fb9f 100644 --- a/src/HYDRO_tests/test_HYDROData_DTM.cxx +++ b/src/HYDRO_tests/test_HYDROData_DTM.cxx @@ -160,7 +160,7 @@ void test_HYDROData_DTM::setUp() void test_HYDROData_DTM::test_creation() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_DTM) DTM = Handle(HYDROData_DTM)::DownCast( aDoc->CreateObject( KIND_DTM ) ); @@ -172,7 +172,7 @@ void test_HYDROData_DTM::test_creation() void test_HYDROData_DTM::test_hydraulic_axis() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Profile) aProfile1 = Handle(HYDROData_Profile)::DownCast( aDoc->CreateObject( KIND_PROFILE ) ); @@ -225,7 +225,7 @@ void test_HYDROData_DTM::test_hydraulic_axis() void test_HYDROData_DTM::test_profile_conversion_to_2d() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Profile) aProfile1 = Handle(HYDROData_Profile)::DownCast( aDoc->CreateObject( KIND_PROFILE ) ); @@ -296,7 +296,7 @@ void test_HYDROData_DTM::test_profile_conversion_to_2d() void test_HYDROData_DTM::test_profile_properties() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( aDoc->CreateObject( KIND_PROFILE ) ); @@ -332,7 +332,7 @@ void test_HYDROData_DTM::test_profile_properties() void test_HYDROData_DTM::test_profile_discretization_polyline() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( aDoc->CreateObject( KIND_PROFILE ) ); @@ -371,7 +371,7 @@ void test_HYDROData_DTM::test_profile_discretization_polyline() void test_HYDROData_DTM::test_profile_discretization_spline() { -Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); +Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( aDoc->CreateObject( KIND_PROFILE ) ); @@ -479,7 +479,7 @@ void test_HYDROData_DTM::test_curves_interpolation() void test_HYDROData_DTM::test_curve_to_3d() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Profile) aProfile1 = Handle(HYDROData_Profile)::DownCast( aDoc->CreateObject( KIND_PROFILE ) ); @@ -523,7 +523,7 @@ void test_HYDROData_DTM::test_curve_to_3d() void test_HYDROData_DTM::test_presentation() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_DTM) DTM = Handle(HYDROData_DTM)::DownCast( aDoc->CreateObject( KIND_DTM ) ); @@ -578,7 +578,7 @@ void test_HYDROData_DTM::test_presentation() void test_HYDROData_DTM::test_garonne() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/Profiles.xyz"; @@ -634,9 +634,9 @@ void test_HYDROData_DTM::test_classifier_1() { TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/pb_1066.cbf"; - CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString(), 1 ) ); + CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString() ) ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_CalculationCase) aCase = Handle(HYDROData_CalculationCase)::DownCast( aDoc->FindObjectByName( "Case_1" ) ); diff --git a/src/HYDRO_tests/test_HYDROData_Document.cxx b/src/HYDRO_tests/test_HYDROData_Document.cxx index 9469ec38..d1079f2d 100644 --- a/src/HYDRO_tests/test_HYDROData_Document.cxx +++ b/src/HYDRO_tests/test_HYDROData_Document.cxx @@ -26,7 +26,7 @@ void test_HYDROData_Document::testSaveOpen() // temporarly created file name (in the current directory) const char* aTestFile = "TestDoc.cbf"; // save - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); CPPUNIT_ASSERT(!aDoc.IsNull()); // keep some saved information to check after retreive aDoc->NewID(); @@ -34,13 +34,13 @@ void test_HYDROData_Document::testSaveOpen() Data_DocError aStatus = aDoc->Save(aTestFile); CPPUNIT_ASSERT(aStatus == DocError_OK); aDoc->Close(); - CPPUNIT_ASSERT(!HYDROData_Document::HasDocument(1)); + CPPUNIT_ASSERT(!HYDROData_Document::HasDocument()); // open - aStatus = HYDROData_Document::Load(aTestFile, 2); + aStatus = HYDROData_Document::Load(aTestFile); CPPUNIT_ASSERT(aStatus == DocError_OK); - CPPUNIT_ASSERT(HYDROData_Document::HasDocument(2)); - aDoc = HYDROData_Document::Document(2); + CPPUNIT_ASSERT(HYDROData_Document::HasDocument()); + aDoc = HYDROData_Document::Document(); CPPUNIT_ASSERT(!aDoc.IsNull()); // check that retreived correctly CPPUNIT_ASSERT(aDoc->NewID() == anID + 1); @@ -54,7 +54,7 @@ void test_HYDROData_Document::testSaveOpen() void test_HYDROData_Document::testOperations() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); CPPUNIT_ASSERT(!aDoc.IsNull()); CPPUNIT_ASSERT(!aDoc->IsOperation()); CPPUNIT_ASSERT(!aDoc->IsModified()); @@ -80,7 +80,7 @@ void test_HYDROData_Document::testOperations() void test_HYDROData_Document::testUndoRedo() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); CPPUNIT_ASSERT(!aDoc.IsNull()); CPPUNIT_ASSERT(!aDoc->CanUndo()); CPPUNIT_ASSERT(!aDoc->CanRedo()); diff --git a/src/HYDRO_tests/test_HYDROData_Entity.cxx b/src/HYDRO_tests/test_HYDROData_Entity.cxx index ca377c32..285d9972 100644 --- a/src/HYDRO_tests/test_HYDROData_Entity.cxx +++ b/src/HYDRO_tests/test_HYDROData_Entity.cxx @@ -25,7 +25,7 @@ void test_HYDROData_Entity::testName() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object static const QString aName("test_name"); @@ -37,7 +37,7 @@ void test_HYDROData_Entity::testName() void test_HYDROData_Entity::testRemove() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object CPPUNIT_ASSERT(!anObj->IsRemoved()); @@ -49,7 +49,7 @@ void test_HYDROData_Entity::testRemove() void test_HYDROData_Entity::testCopy() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object static const QString aName("test_name"); @@ -67,7 +67,7 @@ void test_HYDROData_Entity::testCopy() void test_HYDROData_Entity::testPythonNameChoice() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object diff --git a/src/HYDRO_tests/test_HYDROData_Image.cxx b/src/HYDRO_tests/test_HYDROData_Image.cxx index 9e2014ae..bcea756c 100644 --- a/src/HYDRO_tests/test_HYDROData_Image.cxx +++ b/src/HYDRO_tests/test_HYDROData_Image.cxx @@ -39,7 +39,7 @@ static QImage TestImage() { void test_HYDROData_Image::testQImage() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Image) anImage = Handle(HYDROData_Image)::DownCast(aDoc->CreateObject(KIND_IMAGE)); @@ -61,7 +61,7 @@ void test_HYDROData_Image::testQImage() void test_HYDROData_Image::testTrsf() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Image) anImage = Handle(HYDROData_Image)::DownCast(aDoc->CreateObject(KIND_IMAGE)); @@ -86,7 +86,7 @@ void test_HYDROData_Image::testTrsf() void test_HYDROData_Image::testReferences() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Image) anImage1 = Handle(HYDROData_Image)::DownCast(aDoc->CreateObject(KIND_IMAGE)); @@ -137,7 +137,7 @@ void test_HYDROData_Image::testReferences() void test_HYDROData_Image::testCopy() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Image) anImage1 = Handle(HYDROData_Image)::DownCast(aDoc->CreateObject(KIND_IMAGE)); @@ -193,7 +193,7 @@ void test_HYDROData_Image::test_loadECW() QString refECWPath = REF_DATA_PATH + "/01-2009-0865-6525-LA93.ecw"; QString refPNGPath = REF_DATA_PATH + "/01-2009-0865-6525-LA93.png"; // - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Image) ecwHImage = Handle(HYDROData_Image)::DownCast(aDoc->CreateObject(KIND_IMAGE)); // CPPUNIT_ASSERT (ecwHImage->LoadImageECW(refECWPath)); diff --git a/src/HYDRO_tests/test_HYDROData_Iterator.cxx b/src/HYDRO_tests/test_HYDROData_Iterator.cxx index 7381a4e7..4efa7cfd 100644 --- a/src/HYDRO_tests/test_HYDROData_Iterator.cxx +++ b/src/HYDRO_tests/test_HYDROData_Iterator.cxx @@ -27,7 +27,7 @@ void test_HYDROData_Iterator::testOneKind() { static const QString aName1("test_name1"); static const QString aName2("test_name2"); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // image object anObj->SetName(aName1); @@ -55,7 +55,7 @@ void test_HYDROData_Iterator::testAllKinds() { static const QString aName1("test_name1"); static const QString aName2("test_name2"); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // image object anObj->SetName(aName1); diff --git a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index b1eb3e1a..1423827b 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -54,7 +54,7 @@ extern QString TMP_DIR; void test_HYDROData_LandCoverMap::test_add_2_objects() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -100,7 +100,7 @@ void test_HYDROData_LandCoverMap::test_add_2_objects() void test_HYDROData_LandCoverMap::test_split() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -135,7 +135,7 @@ void test_HYDROData_LandCoverMap::test_split() void test_HYDROData_LandCoverMap::test_incomplete_split() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -167,7 +167,7 @@ void test_HYDROData_LandCoverMap::test_incomplete_split() void test_HYDROData_LandCoverMap::test_merge() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -212,7 +212,7 @@ void test_HYDROData_LandCoverMap::test_merge() void test_HYDROData_LandCoverMap::test_merge_refs_691() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) Polyline_4 = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -272,7 +272,7 @@ void test_HYDROData_LandCoverMap::test_merge_refs_691() void test_HYDROData_LandCoverMap::test_remove() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -534,7 +534,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_circles() void test_HYDROData_LandCoverMap::test_import_dbf() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -572,7 +572,7 @@ void test_HYDROData_LandCoverMap::test_import_dbf() #include void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -624,7 +624,7 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types() void test_HYDROData_LandCoverMap::test_land_cover_prs_by_coeff() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -660,7 +660,7 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_coeff() void test_HYDROData_LandCoverMap::test_dump_python() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -702,7 +702,7 @@ void test_HYDROData_LandCoverMap::test_dump_python() void test_HYDROData_LandCoverMap::test_transparent_prs() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -742,7 +742,7 @@ void test_HYDROData_LandCoverMap::test_transparent_prs() void test_HYDROData_LandCoverMap::test_add_triangles() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) Polyline_1 = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -813,7 +813,7 @@ void test_HYDROData_LandCoverMap::test_add_triangles() void test_HYDROData_LandCoverMap::test_assign_to_calc_case() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -830,7 +830,7 @@ void test_HYDROData_LandCoverMap::test_shp_import_cyp() { //TestViewer::eraseAll(true); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); QString aFileName = REF_DATA_PATH + "/cyprus_natural.shp"; HYDROData_ShapeFile anImporter; QStringList PolygonList; @@ -861,7 +861,7 @@ void test_HYDROData_LandCoverMap::test_shp_import_cyp() void test_HYDROData_LandCoverMap::test_shp_import_clc_dec() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); QString aFileName = REF_DATA_PATH + "/CLC_decoupe.shp"; HYDROData_ShapeFile anImporter; QStringList PolygonList; @@ -892,7 +892,7 @@ void test_HYDROData_LandCoverMap::test_shp_import_clc_dec() void test_HYDROData_LandCoverMap::test_shp_import_nld_areas() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); QString aFileName = REF_DATA_PATH + "/NLD_water_areas_dcw.shp"; HYDROData_ShapeFile anImporter; QStringList PolygonList; @@ -929,7 +929,7 @@ void test_HYDROData_LandCoverMap::test_shp_loop_back() { //DEBTRACE("aFFileName: " << aFFileName.toStdString()); //DEBTRACE("aSFileName: " << aSFileName.toStdString()); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); HYDROData_ShapeFile anImporter; QStringList PolygonList; TopTools_SequenceOfShape PolygonFaces; @@ -962,7 +962,7 @@ void test_HYDROData_LandCoverMap::test_shp_loop_back() aDoc->Close(); } { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); HYDROData_ShapeFile anImporter; QStringList PolygonList; TopTools_SequenceOfShape PolygonFaces; @@ -991,7 +991,7 @@ void test_HYDROData_LandCoverMap::test_shp_loop_back() void test_HYDROData_LandCoverMap::test_add_2_section_poly() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) Polyline_12 = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -1021,7 +1021,7 @@ void test_HYDROData_LandCoverMap::test_add_2_section_poly() void test_HYDROData_LandCoverMap::test_split_2() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) Polyline_1 = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -1094,7 +1094,7 @@ void test_HYDROData_LandCoverMap::test_split_2() void test_HYDROData_LandCoverMap::test_export_telemac() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -1135,7 +1135,7 @@ void test_HYDROData_LandCoverMap::test_export_telemac() void test_HYDROData_LandCoverMap::test_copy() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_LandCoverMap) aMap = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) ); @@ -1177,7 +1177,7 @@ void test_HYDROData_LandCoverMap::test_copy() void test_HYDROData_LandCoverMap::test_shp_clc_classification_perf() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); QString aFileName = REF_DATA_PATH + "/CLC_decoupe.shp"; HYDROData_ShapeFile anImporter; QStringList PolygonList; @@ -1244,7 +1244,7 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_perf() void test_HYDROData_LandCoverMap::test_shp_clc_classification_check() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); QString aFileName = REF_DATA_PATH + "/CLC_decoupe.shp"; HYDROData_ShapeFile anImporter; QStringList PolygonList; @@ -1307,7 +1307,7 @@ void test_HYDROData_LandCoverMap::test_shp_clc_classification_check() void test_HYDROData_LandCoverMap::test_lcm_classification() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); diff --git a/src/HYDRO_tests/test_HYDROData_OperationsFactory.cxx b/src/HYDRO_tests/test_HYDROData_OperationsFactory.cxx index f9c08ec5..b01dc7b9 100644 --- a/src/HYDRO_tests/test_HYDROData_OperationsFactory.cxx +++ b/src/HYDRO_tests/test_HYDROData_OperationsFactory.cxx @@ -31,7 +31,7 @@ void test_HYDROData_OperationsFactory::testCreate() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); HYDROData_OperationsFactory* aFactory = HYDROData_OperationsFactory::Factory(); CPPUNIT_ASSERT(aFactory); @@ -56,7 +56,7 @@ static QImage TestImage() { void test_HYDROData_OperationsFactory::testCrop() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); HYDROData_OperationsFactory* aFactory = HYDROData_OperationsFactory::Factory(); // prepare the original image and crop-path diff --git a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx index 91409768..2fed851c 100644 --- a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx +++ b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx @@ -54,7 +54,7 @@ extern QString REF_DATA_PATH; void test_HYDROData_PolylineXY::test_polyline() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY)); @@ -84,7 +84,7 @@ void test_HYDROData_PolylineXY::test_polyline() void test_HYDROData_PolylineXY::test_copy() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline1 = Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY)); @@ -102,7 +102,7 @@ void test_HYDROData_PolylineXY::test_copy() void test_HYDROData_PolylineXY::test_split_refs_624() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -135,7 +135,7 @@ void test_HYDROData_PolylineXY::test_split_refs_624() void test_HYDROData_PolylineXY::test_extraction_immersible_zone() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -169,7 +169,7 @@ void test_HYDROData_PolylineXY::test_extraction_immersible_zone() void test_HYDROData_PolylineXY::test_extraction_channel_refs_611() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline2d = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -226,7 +226,7 @@ void test_HYDROData_PolylineXY::test_extraction_channel_refs_611() void test_HYDROData_PolylineXY::test_presentation() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline2d = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -299,7 +299,7 @@ void test_HYDROData_PolylineXY::test_presentation() void test_HYDROData_PolylineXY::test_split_refs_627() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -370,7 +370,7 @@ void test_HYDROData_PolylineXY::test_split_refs_627() void test_HYDROData_PolylineXY::test_custom_polylines() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline1 = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -426,7 +426,7 @@ void test_HYDROData_PolylineXY::test_custom_polylines() void test_HYDROData_PolylineXY::test_merge_refs_630() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline1 = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -476,7 +476,7 @@ void test_HYDROData_PolylineXY::test_merge_refs_630() void test_HYDROData_PolylineXY::test_split_straight_refs_634() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_PolylineXY) aPolyline1 = Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); @@ -548,7 +548,7 @@ void test_HYDROData_PolylineXY::test_split_straight_refs_634() void test_HYDROData_PolylineXY::test_import_from_xyz() { NCollection_Sequence ents; - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/profiles1.xyz"; @@ -578,7 +578,7 @@ void test_HYDROData_PolylineXY::test_import_from_xyz() void test_HYDROData_PolylineXY::test_import_from_sx() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/polylines_sx.sx"; diff --git a/src/HYDRO_tests/test_HYDROData_Profile.cxx b/src/HYDRO_tests/test_HYDROData_Profile.cxx index d649b6dc..d4ebe985 100644 --- a/src/HYDRO_tests/test_HYDROData_Profile.cxx +++ b/src/HYDRO_tests/test_HYDROData_Profile.cxx @@ -80,7 +80,7 @@ bool test_HYDROData_Profile::createTestFile( const QString& theFileName, void test_HYDROData_Profile::testFileImport() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); QString aParamFileName = TMP_DIR + QDir::separator() + "parametric.pa"; QString aGeorefFileName = TMP_DIR + QDir::separator() + "georef.pa"; @@ -139,7 +139,7 @@ void test_HYDROData_Profile::testFileImport() void test_HYDROData_Profile::testCopy() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Profile) aProfile1 = Handle(HYDROData_Profile)::DownCast( aDoc->CreateObject( KIND_PROFILE ) ); @@ -187,7 +187,7 @@ void test_HYDROData_Profile::testProjection() { std::string aPath = ( REF_DATA_PATH+"/profiles1.xyz" ).toStdString(); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); TCollection_AsciiString aFileName( aPath.c_str() ); NCollection_Sequence aBadProfilesList; diff --git a/src/HYDRO_tests/test_HYDROData_Stream.cxx b/src/HYDRO_tests/test_HYDROData_Stream.cxx index 6d63658f..a6dfe1ce 100644 --- a/src/HYDRO_tests/test_HYDROData_Stream.cxx +++ b/src/HYDRO_tests/test_HYDROData_Stream.cxx @@ -77,7 +77,7 @@ void test_HYDROData_Stream::test_alt_object() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Stream) aStream = Handle(HYDROData_Stream)::DownCast( aDoc->CreateObject( KIND_STREAM ) ); @@ -99,7 +99,7 @@ void test_HYDROData_Stream::test_params_sync() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Stream) aStream = Handle(HYDROData_Stream)::DownCast( aDoc->CreateObject( KIND_STREAM ) ); @@ -153,7 +153,7 @@ void test_HYDROData_Stream::test_dump() TestViewer::eraseAll( true, true ); // Case 1. Without hydraulic axis - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_Stream) aStream1 = Handle(HYDROData_Stream)::DownCast( aDoc->CreateObject( KIND_STREAM ) ); @@ -243,7 +243,7 @@ void test_HYDROData_Stream::test_presentation() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/Profiles.xyz"; @@ -293,9 +293,9 @@ void test_HYDROData_Stream::test_lism_1() TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/study_lism_1.cbf"; - CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString(), 1 ) ); + CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString() ) ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); HYDROData_SequenceOfObjects profiles; HYDROData_Iterator it( aDoc, KIND_PROFILE ); diff --git a/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx b/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx index bfc54037..659d4901 100644 --- a/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx +++ b/src/HYDRO_tests/test_HYDROData_StricklerTable.cxx @@ -33,7 +33,7 @@ extern QString TMP_DIR; void test_HYDROData_StricklerTable::test_import() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -59,7 +59,7 @@ void test_HYDROData_StricklerTable::test_import() void test_HYDROData_StricklerTable::test_import_export_equivalence() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -90,7 +90,7 @@ void test_HYDROData_StricklerTable::test_import_export_equivalence() void test_HYDROData_StricklerTable::test_type_by_attr() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -106,7 +106,7 @@ void test_HYDROData_StricklerTable::test_type_by_attr() void test_HYDROData_StricklerTable::test_unique_attr_name() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable1 = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -134,7 +134,7 @@ void test_HYDROData_StricklerTable::test_unique_attr_name() void test_HYDROData_StricklerTable::test_colors_sync() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable1 = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -158,7 +158,7 @@ void test_HYDROData_StricklerTable::test_colors_sync() void test_HYDROData_StricklerTable::test_duplication_refs_613() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable1 = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -204,7 +204,7 @@ void test_HYDROData_StricklerTable::test_duplication_refs_613() void test_HYDROData_StricklerTable::test_dump_python() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); @@ -222,7 +222,7 @@ void test_HYDROData_StricklerTable::test_dump_python() void test_HYDROData_StricklerTable::test_add_row_in_gui_refs_717() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( aDoc->CreateObject( KIND_STRICKLER_TABLE ) ); diff --git a/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx b/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx index 4eec4f63..a2509289 100644 --- a/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx @@ -63,7 +63,7 @@ void test_HYDROGUI_BathymetryPrs::updateColors() void test_HYDROGUI_BathymetryPrs::test_presentation() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); importTestBath( aDoc ); TestViewer::showColorScale( false ); @@ -95,7 +95,7 @@ void select( int x1, int y1, int x2, int y2 ) void test_HYDROGUI_BathymetryPrs::test_selection() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); importTestBath( aDoc ); TestViewer::showColorScale( false ); @@ -126,7 +126,7 @@ void test_HYDROGUI_BathymetryPrs::test_selection() void test_HYDROGUI_BathymetryPrs::test_rescale_by_selection() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); importTestBath( aDoc ); TestViewer::showColorScale( false ); @@ -185,7 +185,7 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_by_selection() void test_HYDROGUI_BathymetryPrs::test_rescale_by_visible() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); importTestBath( aDoc ); TestViewer::showColorScale( false ); @@ -232,7 +232,7 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_by_visible() void test_HYDROGUI_BathymetryPrs::test_text_presentation() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); importTestBath( aDoc ); TestViewer::showColorScale( false ); @@ -283,7 +283,7 @@ void test_HYDROGUI_BathymetryPrs::test_text_presentation() void test_HYDROGUI_BathymetryPrs::test_rescale_default() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); importTestBath( aDoc ); TestViewer::showColorScale( false ); @@ -340,7 +340,7 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_default() void test_HYDROGUI_BathymetryPrs::test_fit_on_selected() { TestViewer::eraseAll( true, true ); - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); importTestBath( aDoc ); TestViewer::showColorScale( false ); diff --git a/src/HYDRO_tests/test_HYDROGUI_LandCoverMapDlg.cxx b/src/HYDRO_tests/test_HYDROGUI_LandCoverMapDlg.cxx index a9ac1dc0..9836f3e6 100644 --- a/src/HYDRO_tests/test_HYDROGUI_LandCoverMapDlg.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_LandCoverMapDlg.cxx @@ -35,7 +35,7 @@ bool isOK( const HYDROGUI_LandCoverArgsFilter& theFilter, void test_HYDROGUI_LandCoverMapDlg::test_objects_filtering_refs_707() { - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(); HYDROGUI_LandCoverArgsFilter f( AddLandCoverId ); diff --git a/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx b/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx index 2290ed7e..dc1bdc22 100644 --- a/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx @@ -24,7 +24,7 @@ Handle(HYDROData_Document) GetDocument() { - return HYDROData_Document::Document( 0 ); + return HYDROData_Document::Document(); } HYDROGUI_ListModel::Object2VisibleList CreateTestObjects( int theObjCount ) -- 2.39.2