From: rnv Date: Tue, 26 Dec 2017 12:56:05 +0000 (+0300) Subject: Merge master branch into V9_dev. X-Git-Tag: V9_0_0~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=40d76807e945ceef6a730f4d0177e167d3ccb453;p=modules%2Fgeom.git Merge master branch into V9_dev. --- 40d76807e945ceef6a730f4d0177e167d3ccb453 diff --cc src/GEOM/GEOM_BaseDriver.cxx index 731acd999,8a7c72679..d7127bc0e --- a/src/GEOM/GEOM_BaseDriver.cxx +++ b/src/GEOM/GEOM_BaseDriver.cxx @@@ -33,8 -33,23 +33,8 @@@ #include #include - OCCT_IMPLEMENT_STANDARD_RTTIEXT(GEOM_BaseDriver,TFunction_Driver); + 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 --cc src/GEOM/GEOM_BaseObject.hxx index 4c9ed3cf8,464e0f6a0..f282d099e --- a/src/GEOM/GEOM_BaseObject.hxx +++ b/src/GEOM/GEOM_BaseObject.hxx @@@ -160,9 -163,10 +160,9 @@@ public TDF_Label _label; TCollection_AsciiString _ior; TCollection_AsciiString _parameters; - int _docID; public: - OCCT_DEFINE_STANDARD_RTTIEXT(GEOM_BaseObject,Standard_Transient) + DEFINE_STANDARD_RTTIEXT(GEOM_BaseObject,Standard_Transient) }; #endif diff --cc src/GEOM/GEOM_Engine.cxx index 1293fd8ed,dd4bc1012..d8ad0eb92 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@@ -246,20 -272,17 +250,16 @@@ 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 _OCAFApp->NewDocument("BinOcaf", aDoc); - #else - _OCAFApp->NewDocument("SALOME_GEOM", aDoc); - #endif aDoc->SetUndoLimit(_UndoLimit); - _mapIDDocument.Bind(theDocID, aDoc); - TDataStd_Integer::Set(aDoc->Main(), theDocID); + _document = aDoc; } return aDoc; } @@@ -467,10 -514,11 +466,10 @@@ bool GEOM_Engine::RemoveObject(Handle(G 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 + // we can't explicitly 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(); diff --cc src/GEOM/GEOM_Engine.hxx index b9bef5fbf,7353ccb50..21a213287 --- a/src/GEOM/GEOM_Engine.hxx +++ b/src/GEOM/GEOM_Engine.hxx @@@ -166,13 -169,18 +164,13 @@@ public const TCollection_AsciiString& anEntry, Resource_DataMapOfAsciiStringAsciiString& aNameToEntry); - protected: - 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: + 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; diff --cc src/GEOMGUI/GEOM_Displayer.cxx index 5dfc36699,c08cee809..dea39bbc5 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@@ -948,8 -943,8 +940,8 @@@ void GEOM_Displayer::updateShapePropert study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::Texture ), QString( GetTexture().c_str() ) ); study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::DisplayMode ), 3 ); - // Update propeties map + // Update properties map - propMap = getObjectProperties( study, entry, myViewFrame ); + propMap = getObjectProperties( entry, myViewFrame ); } } } @@@ -1759,43 -1751,50 +1748,44 @@@ SALOME_Prs* GEOM_Displayer::buildPresen // 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() ) - { + // 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 ) ); + CORBA::String_var name = GeomObject->GetName(); + theIO->setName( name ); + // finally set shape + setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) ); - } } } } diff --cc src/GEOMGUI/GeometryGUI.cxx index e233923f6,4a21919d8..d859307d5 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@@ -2806,9 -2815,10 +2805,7 @@@ void GeometryGUI::preferencesChanged( c param == QString("scalar_bar_height") || param == QString("scalar_bar_text_height") || param == QString("scalar_bar_nb_intervals")) { - GEOM_Displayer aDisplayer; - bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals"); - aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true ); - if( /*SalomeApp_Study* aStudy = */dynamic_cast( getApp()->activeStudy() ) ) - { - updateFieldColorScale(); - } ++ updateFieldColorScale(); } else if ( param == QString("dimensions_color") || param == QString("dimensions_line_width") || diff --cc src/GEOMImpl/GEOMImpl_ExportDriver.cxx index 5e089e578,8f574c85f..bb51dcf6a --- a/src/GEOMImpl/GEOMImpl_ExportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ExportDriver.cxx @@@ -85,14 -85,10 +85,10 @@@ Standard_Integer GEOMImpl_ExportDriver: 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 - log.SetTouched(Label()); - #else log->SetTouched(Label()); - #endif return 1; } diff --cc src/GEOMToolsGUI/GEOMToolsGUI.cxx index 647a1dbd8,bd79254a3..96d86599b --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@@ -466,8 -466,8 +466,8 @@@ void GEOMToolsGUI::OnEditDelete( } _PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder()); - GEOM_Displayer disp( appStudy ); + GEOM_Displayer disp; - disp.SetUpdateColorScale( false ); // IPAL54049 + bool toUpdateColorScale = disp.SetUpdateColorScale( false ); // IPAL54049 if ( isComponentSelected ) { // GEOM component is selected: delete all objects recursively diff --cc src/GEOM_I/GEOM_BaseObject_i.cc index 3575672b4,5dce2cc26..e6d2bb837 --- a/src/GEOM_I/GEOM_BaseObject_i.cc +++ b/src/GEOM_I/GEOM_BaseObject_i.cc @@@ -170,10 -181,10 +170,10 @@@ GEOM::ListOfGBO* GEOM_BaseObject_i::Get TCollection_AsciiString anEntry; for (int i = 1; i<=aLength; i++) { - HANDLE_NAMESPACE(GEOM_BaseObject) anObj = HANDLE_NAMESPACE(GEOM_BaseObject)::DownCast(aSeq->Value(i)); + Handle(::GEOM_BaseObject) anObj = Handle(::GEOM_BaseObject)::DownCast(aSeq->Value(i)); if (anObj.IsNull()) continue; TDF_Tool::Entry(anObj->GetEntry(), anEntry); - GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetDocID(), (char*) anEntry.ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject((char*) anEntry.ToCString()); aList[i-1] = obj; } @@@ -200,9 -211,10 +200,9 @@@ GEOM::ListOfGBO* GEOM_BaseObject_i::Get TCollection_AsciiString anEntry; for (int i = 1; i<=aLength; i++) { - HANDLE_NAMESPACE(GEOM_BaseObject) anObj = HANDLE_NAMESPACE(GEOM_BaseObject)::DownCast(aSeq->Value(i)); + Handle(::GEOM_BaseObject) anObj = Handle(::GEOM_BaseObject)::DownCast(aSeq->Value(i)); if (anObj.IsNull()) continue; - GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetDocID(), - anObj->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetEntryString().ToCString()); aList[i-1] = GEOM::GEOM_BaseObject::_duplicate( obj ); } diff --cc src/GEOM_I/GEOM_Field_i.cc index bd127842c,48a7858c3..0d1aa810d --- a/src/GEOM_I/GEOM_Field_i.cc +++ b/src/GEOM_I/GEOM_Field_i.cc @@@ -66,10 -66,11 +66,10 @@@ GEOM_Field_i::~GEOM_Field_i( GEOM::GEOM_Object_ptr GEOM_Field_i::GetShape() { GEOM::GEOM_Object_var shapeVar; - HANDLE_NAMESPACE(GEOM_Object) shape = _impl->GetShape(); + Handle(::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(); @@@ -134,10 -135,11 +134,10 @@@ GEOM::string_array* GEOM_Field_i::GetCo GEOM::GEOM_FieldStep_ptr GEOM_Field_i::AddStep(::CORBA::Long stepID, ::CORBA::Long stamp) { GEOM::GEOM_FieldStep_var stepVar; - HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->AddStep( stepID, stamp ); + Handle(::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(); @@@ -196,10 -198,11 +196,10 @@@ GEOM::ListOfLong* GEOM_Field_i::GetStep GEOM::GEOM_FieldStep_ptr GEOM_Field_i::GetStep(CORBA::Long stepID) { GEOM::GEOM_FieldStep_var stepVar; - HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->GetStep(stepID); + Handle(::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(); @@@ -285,10 -288,11 +285,10 @@@ void GEOM_FieldStep_i::SetStamp(::CORBA GEOM::GEOM_Field_ptr GEOM_FieldStep_i::GetField() { GEOM::GEOM_Field_var fieldVar; - HANDLE_NAMESPACE(GEOM_Field) field = _impl->GetField(); + Handle(::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 --cc src/GEOM_I/GEOM_Gen_i.cc index 5c99e5876,34365e199..756ebd362 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@@ -177,8 -176,10 +177,8 @@@ char* GEOM_Gen_i::LocalPersistentIDToIO CORBA::Boolean isMultiFile, CORBA::Boolean isASCII) { - HANDLE_NAMESPACE(GEOM_BaseObject) anObject = - SALOMEDS::Study_var aStudy = theSObject->GetStudy(); - + Handle(::GEOM_BaseObject) anObject = - _impl->GetObject(aStudy->StudyId(), aLocalPersistentID); + _impl->GetObject(aLocalPersistentID); if ( !anObject.IsNull() ) { TCollection_AsciiString anEntry; @@@ -261,10 -262,10 +261,10 @@@ SALOMEDS::SObject_ptr GEOM_Gen_i::Publi // BEGIN: try to find existed name for current shape if ( !aShape->_is_nil() && mytype != GEOM_GROUP) { - // recieve current TopoDS shape + // receive current TopoDS shape CORBA::String_var entry = aShape->GetEntry(); - HANDLE_NAMESPACE(GEOM_Object) aGShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast + Handle(::GEOM_Object) aGShape = Handle(::GEOM_Object)::DownCast - ( _impl->GetObject( aShape->GetStudyID(), entry )); + ( _impl->GetObject( entry )); TopoDS_Shape TopoSh = aGShape->GetValue(); // find label of main shape GEOM::GEOM_Object_var aMainSh = aShape; @@@ -272,7 -273,7 +272,7 @@@ aMainSh = aMainSh->GetMainShape(); } entry = aMainSh->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anObj = _impl->GetObject( entry ); - Handle(::GEOM_BaseObject) anObj = _impl->GetObject( aMainSh->GetStudyID(), entry ); ++ Handle(::GEOM_BaseObject) anObj = _impl->GetObject( entry ); TDF_Label aMainLbl = anObj->GetFunction(1)->GetNamingEntry(); // check all named shapes using iterator @@@ -449,9 -452,10 +451,9 @@@ //============================================================================ // function : CreateAndPublishGroup - // purpose : auxilary for PublishNamedShapesInStudy + // purpose : auxiliary for PublishNamedShapesInStudy //============================================================================ -void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_var theMainShape, +void GEOM_Gen_i::CreateAndPublishGroup(GEOM::GEOM_Object_var theMainShape, const TopTools_IndexedMapOfShape& anIndices, const TopTools_SequenceOfShape& SeqS, const TColStd_SequenceOfAsciiString& SeqN, @@@ -459,26 -463,26 +461,26 @@@ GEOM::ListOfGO_var aResList) { CORBA::String_var entry = theMainShape->GetEntry(); - //HANDLE_NAMESPACE(GEOM_Object) aMainShape = _impl->GetObject(entry); - //Handle(::GEOM_Object) aMainShape = _impl->GetObject(theMainShape->GetStudyID(), entry); ++ //Handle(::GEOM_Object) aMainShape = _impl->GetObject(entry); Handle(TColStd_HArray1OfInteger) anArray; if(SeqS.Length()>0) { // create a group - GEOM::GEOM_IGroupOperations_var GOp = GetIGroupOperations(theStudy->StudyId()); + GEOM::GEOM_IGroupOperations_var GOp = GetIGroupOperations(); GEOM::GEOM_Object_wrap GrObj = GOp->CreateGroup( theMainShape, SeqS(1).ShapeType() ); - AddInStudy(theStudy, GrObj, GrName, theMainShape._retn()); + AddInStudy(GrObj, GrName, theMainShape._retn()); //CORBA::String_var GrEntry = GrObj->GetEntry(); - //HANDLE_NAMESPACE(GEOM_Object) HGrObj = _impl->GetObject(GrEntry); - //Handle(::GEOM_Object) HGrObj = _impl->GetObject(GrObj->GetStudyID(), GrEntry); ++ //Handle(::GEOM_Object) HGrObj = _impl->GetObject(GrEntry); // add named objects - //HANDLE_NAMESPACE(GEOM_Object) anObj; + //Handle(::GEOM_Object) anObj; for(int i=1; i<=SeqS.Length(); i++) { TopoDS_Shape aValue = SeqS.Value(i); //anArray = new TColStd_HArray1OfInteger(1,1); 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); + //Handle(::GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1); //if (aFunction.IsNull()) continue; //GEOM_ISubShape aSSI(aFunction); //aSSI.SetMainShape(aMainShape->GetLastFunction()); @@@ -511,8 -516,8 +513,8 @@@ GEOM::ListOfGO* GEOM_Gen_i: if(theMainShape->_is_nil()) return aResList._retn(); CORBA::String_var entry = theMainShape->GetEntry(); - HANDLE_NAMESPACE(GEOM_Object) aMainShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast + Handle(::GEOM_Object) aMainShape = Handle(::GEOM_Object)::DownCast - ( _impl->GetObject( theMainShape->GetStudyID(), entry )); + ( _impl->GetObject( entry )); if (aMainShape.IsNull()) return aResList._retn(); TopoDS_Shape MainSh = aMainShape->GetValue(); @@@ -590,19 -595,15 +592,15 @@@ SALOMEDS::TMPFile* GEOM_Gen_i::Save(SAL } // Create a list to store names of created files - SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames; - aSeq->length(1); + SALOMEDS_Tool::ListOfFiles aSeq; + aSeq.reserve(1); // Prepare a file name to open TCollection_AsciiString aNameWithExt(""); -- if (isMultiFile) - aNameWithExt = TCollection_AsciiString( (char*)(SALOMEDS_Tool::GetNameFromPath( - Kernel_Utils::encode(getStudyServant()->URL())).c_str())); - #if OCC_VERSION_MAJOR > 6 - aNameWithExt = TCollection_AsciiString((char*)(SALOMEDS_Tool::GetNameFromPath - (theComponent->GetStudy()->URL())).c_str()); ++ if (isMultiFile) ++ aNameWithExt = TCollection_AsciiString((char*)(SALOMEDS_Tool::GetNameFromPath( ++ Kernel_Utils::encode(getStudyServant()->URL())).c_str())); aNameWithExt += TCollection_AsciiString("_GEOM.cbf"); - #else - aNameWithExt += TCollection_AsciiString("_GEOM.sgd"); - #endif - aSeq[0] = CORBA::string_dup(aNameWithExt.ToCString()); + aSeq.push_back(CORBA::string_dup(aNameWithExt.ToCString())); // Build a full file name of temporary file TCollection_AsciiString aFullName = TCollection_AsciiString((char*)aTmpDir.c_str()) + aNameWithExt; // Save GEOM component in this file @@@ -662,12 -663,11 +660,11 @@@ CORBA::Boolean GEOM_Gen_i::Load(SALOMED // Prepare a file name to open TCollection_AsciiString aNameWithExt(""); - SALOMEDS::Study_var study = theComponent->GetStudy(); + SALOMEDS::Study_var study = getStudyServant(); - #if OCC_VERSION_MAJOR > 6 // Get the file name. int i; - int aLength = aSeq->length(); + int aLength = aSeq.size(); const char *aGeomSgd = "_GEOM.sgd"; const char *aGeomcbf = "_GEOM.cbf"; @@@ -822,8 -815,8 +811,8 @@@ SALOMEDS::SObject_ptr GEOM_Gen_i::Paste //Create a new GEOM_Object - HANDLE_NAMESPACE(GEOM_Object) anObj = _impl->AddObject(theObjectID); - HANDLE_NAMESPACE(GEOM_Function) aFunction = anObj->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF); - Handle(::GEOM_Object) anObj = _impl->AddObject(aNewSO->GetStudy()->StudyId(), theObjectID); ++ Handle(::GEOM_Object) anObj = _impl->AddObject(theObjectID); + Handle(::GEOM_Function) aFunction = anObj->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF); aFunction->SetValue(aTopology); TCollection_AsciiString anEntry; @@@ -1139,16 -1134,16 +1128,16 @@@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubS GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anArgO, theObject); if (!CORBA::is_nil(anArgOTrsf)) { CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); - HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); - Handle(::GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry); ++ Handle(::GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); + Handle(::GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); anArgOTrsfFun->SetDescription(""); aSubO = aShapesOp->GetInPlace(theObject, anArgOTrsf); } /* - HANDLE_NAMESPACE(GEOM_Function) anOFun = theObject->GetLastFunction(); + Handle(::GEOM_Function) anOFun = theObject->GetLastFunction(); if (!anOFun.IsNull()) { CORBA::String_var entryArg = anArgO->GetEntry(); - HANDLE_NAMESPACE(GEOM_Object) anArgOImpl = _impl->GetObject(entryArg); - Handle(::GEOM_Object) anArgOImpl = _impl->GetObject(anArgO->GetStudyID(), entryArg); ++ Handle(::GEOM_Object) anArgOImpl = _impl->GetObject(entryArg); if (!anArgOImpl.IsNull()) { TopoDS_Shape anArgOShape = anArgOImpl->GetValue(); TopoDS_Shape aMultiArgShape; @@@ -1335,8 -1329,8 +1324,8 @@@ aResParts->length(nb); if (nb > 0) { - HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetEntry()); - HANDLE_NAMESPACE(GEOM_Function) aFunction = aMainObj->GetLastFunction(); - Handle(::GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry()); ++ Handle(::GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetEntry()); + Handle(::GEOM_Function) aFunction = aMainObj->GetLastFunction(); GEOM::TPythonDump pd (aFunction, true); pd <<"["; int i = 0, j = 0; @@@ -1351,8 -1345,8 +1340,8 @@@ anObjEntryMap.insert(anEntry); aResParts[nbRes++] = anObj; // clear python dump of object - HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anEntry); - HANDLE_NAMESPACE(GEOM_Function) anObjFun = aGeomObj->GetLastFunction(); - Handle(::GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anEntry); ++ Handle(::GEOM_BaseObject) aGeomObj = _impl->GetObject(anEntry); + Handle(::GEOM_Function) anObjFun = aGeomObj->GetLastFunction(); if ( !anObjFun.IsNull() ) anObjFun->SetDescription( "" ); if ( j > 0 ) @@@ -1369,7 -1363,7 +1358,7 @@@ GEOM::GEOM_Object_var anObj = anOutArgs[ i ]; if (CORBA::is_nil(anObj)) continue; - HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetEntry()); - Handle(::GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anObj->GetEntry()); ++ Handle(::GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetEntry()); if ( j > 0 ) pd << ", "; pd << aGeomObj; @@@ -1461,8 -1455,8 +1450,8 @@@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubS GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anOldSubO, theNewO); if (!CORBA::is_nil(anArgOTrsf)) { CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); - HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); - Handle(::GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry); ++ Handle(::GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); + Handle(::GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); anArgOTrsfFun->SetDescription(""); aNewSubO = aShapesOp->GetInPlace(theNewO, anArgOTrsf); } @@@ -1737,8 -1731,8 +1726,8 @@@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGive GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anArgO, theObject); if (!CORBA::is_nil(anArgOTrsf)) { CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); - HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); - Handle(::GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry); ++ Handle(::GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); + Handle(::GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); anArgOTrsfFun->SetDescription(""); aSubO = aShapesOp->GetInPlace(theObject, anArgOTrsf); } @@@ -1881,8 -1875,8 +1870,8 @@@ aResParts->length(nb); if (nb > 0) { - HANDLE_NAMESPACE(GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetEntry()); - HANDLE_NAMESPACE(GEOM_Function) aFunction = aMainObj->GetLastFunction(); - Handle(::GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry()); ++ Handle(::GEOM_BaseObject) aMainObj = _impl->GetObject(theObject->GetEntry()); + Handle(::GEOM_Function) aFunction = aMainObj->GetLastFunction(); GEOM::TPythonDump pd (aFunction, true); pd <<"["; int i = 0, j = 0; @@@ -1897,8 -1891,8 +1886,8 @@@ anObjEntryMap.insert(anEntry); aResParts[nbRes++] = anObj; // clear python dump of object - HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anEntry); - HANDLE_NAMESPACE(GEOM_Function) anObjFun = aGeomObj->GetLastFunction(); - Handle(::GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anEntry); ++ Handle(::GEOM_BaseObject) aGeomObj = _impl->GetObject(anEntry); + Handle(::GEOM_Function) anObjFun = aGeomObj->GetLastFunction(); if ( !anObjFun.IsNull() ) anObjFun->SetDescription( "" ); if ( j > 0 ) @@@ -1913,7 -1907,7 +1902,7 @@@ GEOM::GEOM_Object_var anObj = theArgs[ i ]; if (CORBA::is_nil(anObj)) continue; - HANDLE_NAMESPACE(GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetEntry()); - Handle(::GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anObj->GetEntry()); ++ Handle(::GEOM_BaseObject) aGeomObj = _impl->GetObject(anObj->GetEntry()); if ( j > 0 ) pd << ", "; pd << aGeomObj; @@@ -2013,8 -2007,8 +2002,8 @@@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGive GEOM::GEOM_Object_var anArgOTrsf = aTrsfOpSv->TransformLikeOtherCopy(anOldSubO, theNewO); if (!CORBA::is_nil(anArgOTrsf)) { CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); - HANDLE_NAMESPACE(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); - Handle(::GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry); ++ Handle(::GEOM_BaseObject) anArgOTrsfImpl = _impl->GetObject(anArgOTrsfEntry); + Handle(::GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction(); anArgOTrsfFun->SetDescription(""); aNewSubO = aShapesOp->GetInPlace(theNewO, anArgOTrsf); } @@@ -2564,8 -2545,8 +2553,8 @@@ GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSu if (CORBA::is_nil(theMainShape) || theIndices.length() < 1) return GEOM::GEOM_Object::_nil(); CORBA::String_var entry = theMainShape->GetEntry(); - HANDLE_NAMESPACE(GEOM_Object) aMainShape = HANDLE_NAMESPACE(GEOM_Object)::DownCast + Handle(::GEOM_Object) aMainShape = Handle(::GEOM_Object)::DownCast - ( _impl->GetObject( theMainShape->GetStudyID(), entry )); + ( _impl->GetObject( entry )); if (aMainShape.IsNull()) return GEOM::GEOM_Object::_nil(); Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1, theIndices.length()); @@@ -2587,7 -2568,7 +2576,7 @@@ void GEOM_Gen_i::RemoveObject(GEOM::GEOM_BaseObject_ptr theObject) { CORBA::String_var anEntry = theObject->GetEntry(); - HANDLE_NAMESPACE(GEOM_BaseObject) anObject = _impl->GetObject(anEntry, false); - Handle(::GEOM_BaseObject) anObject = _impl->GetObject(theObject->GetStudyID(), anEntry, false); ++ Handle(::GEOM_BaseObject) anObject = _impl->GetObject(anEntry, false); if (!anObject.IsNull()) _impl->RemoveObject(anObject); } @@@ -2619,10 -2600,10 +2608,10 @@@ GEOM::GEOM_Object_ptr GEOM_Gen_i::GetIO // function : GetObject() // purpose : //================================================================================= -GEOM::GEOM_BaseObject_ptr GEOM_Gen_i::GetObject (CORBA::Long theStudyID, const char* theEntry) +GEOM::GEOM_BaseObject_ptr GEOM_Gen_i::GetObject (const char* theEntry) { GEOM::GEOM_BaseObject_var obj; - HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject((char*)theEntry); - Handle(::GEOM_BaseObject) handle_object = _impl->GetObject(theStudyID, (char*)theEntry); ++ Handle(::GEOM_BaseObject) handle_object = _impl->GetObject((char*)theEntry); if (handle_object.IsNull()) return obj._retn(); TCollection_AsciiString stringIOR = handle_object->GetIOR(); @@@ -2972,10 -2956,10 +2961,10 @@@ SALOMEDS::TMPFile* GEOM_Gen_i::GetDepen GEOMUtils::TreeModel tree; std::string entry; - for ( int i = 0; i < theObjectEntries.length(); i++ ) { + for ( CORBA::ULong i = 0; i < theObjectEntries.length(); i++ ) { // process objects one-by-one entry = theObjectEntries[i].in(); - GEOM::GEOM_BaseObject_var anObj = GetObject( theStudy->StudyId(), entry.c_str() ); + GEOM::GEOM_BaseObject_var anObj = GetObject(entry.c_str() ); if ( anObj->_is_nil() ) continue; std::map< std::string, std::set > passedEntries; @@@ -3060,9 -3044,9 +3049,9 @@@ void GEOM_Gen_i::getDownwardDependency std::map< std::string, std::set > &passedEntries, int level ) { std::string aGboEntry = gbo->GetEntry(); - Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(gbo->GetStudyID()); + Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(); Handle(TDataStd_TreeNode) aNode, aRoot; - HANDLE_NAMESPACE(GEOM_Function) aFunction; + Handle(::GEOM_Function) aFunction; if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) { // go through the whole OCAF tree TDataStd_ChildNodeIterator Itr( aRoot ); @@@ -3132,9 -3117,9 +3121,9 @@@ void GEOM_Gen_i::GetEntriesToReduceStud aSelected.insert( CORBA::string_dup( theSelectedEntries[i] ) ); } - Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(theStudy->StudyId()); + Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(); Handle(TDataStd_TreeNode) aNode, aRoot; - HANDLE_NAMESPACE(GEOM_Function) aFunction; + Handle(::GEOM_Function) aFunction; if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) { // go through the whole OCAF tree TDF_Label aLabel; @@@ -3180,7 -3165,7 +3169,7 @@@ // because they could not be modified anyhow. std::set aToBeInSelected; for ( it = aSelected.begin(); it != aSelected.end(); ++it ) { - HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject((*it).c_str(), false); - Handle(::GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), (*it).c_str(), false); ++ Handle(::GEOM_BaseObject) handle_object = _impl->GetObject((*it).c_str(), false); if ( handle_object.IsNull() ) continue; @@@ -3277,7 -3263,7 +3266,7 @@@ void GEOM_Gen_i::includeSubObjects(cons std::set& anOthers) { std::set::iterator foundIt; - HANDLE_NAMESPACE(GEOM_BaseObject) handle_object = _impl->GetObject(aSelectedEntry.c_str(), false); - Handle(::GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), aSelectedEntry.c_str(), false); ++ Handle(::GEOM_BaseObject) handle_object = _impl->GetObject(aSelectedEntry.c_str(), false); if ( handle_object.IsNull() ) return; diff --cc src/GEOM_I/GEOM_Gen_i.hh index 7e2aec814,778d57197..c65e9500c --- a/src/GEOM_I/GEOM_Gen_i.hh +++ b/src/GEOM_I/GEOM_Gen_i.hh @@@ -68,9 -68,10 +68,9 @@@ //===================================================================== class GEOM_I_EXPORT GEOM_GenericOperationsCreator { - public: + public: // Create operations virtual GEOM_IOperations_i* Create (PortableServer::POA_ptr thePOA, - int theStudyId, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_Gen* theGenImpl) = 0; // return the name of IDL module diff --cc src/GEOM_I/GEOM_IOperations_i.cc index b71199220,47aadccca..511f230e6 --- a/src/GEOM_I/GEOM_IOperations_i.cc +++ b/src/GEOM_I/GEOM_IOperations_i.cc @@@ -140,13 -150,13 +140,13 @@@ GEOM_IOperations_i::GetBaseObject(Handl * GetObjectImpl */ //============================================================================= - HANDLE_NAMESPACE(GEOM_BaseObject) + Handle(::GEOM_BaseObject) GEOM_IOperations_i::GetBaseObjectImpl(GEOM::GEOM_BaseObject_ptr theObject) { - HANDLE_NAMESPACE(GEOM_BaseObject) anImpl; + Handle(::GEOM_BaseObject) anImpl; if (!CORBA::is_nil(theObject)) { CORBA::String_var anEntry = theObject->GetEntry(); - anImpl = GetImpl()->GetEngine()->GetObject( theObject->GetStudyID(), anEntry ); + anImpl = GetImpl()->GetEngine()->GetObject( anEntry ); } return anImpl; } diff --cc src/GEOM_I/GEOM_IOperations_i.hh index 15c0bd269,61acf9656..71b349378 --- a/src/GEOM_I/GEOM_IOperations_i.hh +++ b/src/GEOM_I/GEOM_IOperations_i.hh @@@ -45,10 -45,12 +45,10 @@@ class GEOM_I_EXPORT GEOM_IOperations_i virtual char* GetErrorCode(); - virtual GEOM::GEOM_BaseObject_ptr GetBaseObject(HANDLE_NAMESPACE(GEOM_BaseObject) theObject); - virtual HANDLE_NAMESPACE(GEOM_BaseObject) GetBaseObjectImpl(GEOM::GEOM_BaseObject_ptr theObject); - virtual GEOM::GEOM_Object_ptr GetObject(HANDLE_NAMESPACE(GEOM_Object) theObject); - virtual HANDLE_NAMESPACE(GEOM_Object) GetObjectImpl(GEOM::GEOM_Object_ptr theObject); - virtual CORBA::Long GetStudyID(); - + virtual GEOM::GEOM_BaseObject_ptr GetBaseObject(Handle(::GEOM_BaseObject) theObject); + virtual Handle(::GEOM_BaseObject) GetBaseObjectImpl(GEOM::GEOM_BaseObject_ptr theObject); + virtual GEOM::GEOM_Object_ptr GetObject(Handle(::GEOM_Object) theObject); + virtual Handle(::GEOM_Object) GetObjectImpl(GEOM::GEOM_Object_ptr theObject); virtual void StartOperation(); diff --cc src/GEOM_I/GEOM_Object_i.cc index cf7e37b3b,165613dc6..63000e35b --- a/src/GEOM_I/GEOM_Object_i.cc +++ b/src/GEOM_I/GEOM_Object_i.cc @@@ -177,8 -177,8 +177,8 @@@ char* GEOM_Object_i::GetSubShapeName(CO for (; anIt.More(); anIt.Next()) { TCollection_AsciiString anEntry = anIt.Value(); - HANDLE_NAMESPACE(GEOM_BaseObject) anObj = + Handle(::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(); @@@ -413,8 -413,8 +413,8 @@@ bool GEOM_Object_i::IsSame(GEOM::GEOM_B GEOM::GEOM_Object_var shapePtr = GEOM::GEOM_Object::_narrow( other ); if ( !CORBA::is_nil( shapePtr ) ) { CORBA::String_var entry = shapePtr->GetEntry(); - HANDLE_NAMESPACE(GEOM_Object) otherObject = HANDLE_NAMESPACE(GEOM_Object)::DownCast + Handle(::GEOM_Object) otherObject = Handle(::GEOM_Object)::DownCast - ( GEOM_Engine::GetEngine()->GetObject( shapePtr->GetStudyID(), entry, false )); + ( GEOM_Engine::GetEngine()->GetObject( entry, false )); if ( !otherObject.IsNull() ) { TopoDS_Shape thisShape = _impl->GetValue(); TopoDS_Shape otherShape = otherObject->GetValue(); diff --cc src/GEOM_PY/sketcher.py index 572252f36,2e4c98292..6dd29d0b7 --- a/src/GEOM_PY/sketcher.py +++ b/src/GEOM_PY/sketcher.py @@@ -48,10 -48,10 +48,10 @@@ Example: # Put it in the study from salome.geom import geomBuilder - geompy = geomBuilder.New(salome.myStudy) + geompy = geomBuilder.New() geompy.addToStudy( wire, 'mysketch' ) - Additionnal examples can be found as unit tests in the source code. + Additional examples can be found as unit tests in the source code. """ geompyEnable = True diff --cc src/GEOM_SWIG/GEOM_TestOthers.py index a05fc395c,afad24292..3bec23f46 --- a/src/GEOM_SWIG/GEOM_TestOthers.py +++ b/src/GEOM_SWIG/GEOM_TestOthers.py @@@ -816,9 -816,9 +816,9 @@@ def TestOtherOperations (geompy, math) for afaces in faces_list: ifa = 1 for aface in afaces: - ssname = "Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)" + ssname = "Reflection of face " + repr(ifa) + " of box " + repr(ibb) + " (by history)" if ibb == 6 and (ifa == 2 or ifa == 4): - # use IDL interface directly to avoid error message appearence in Python console + # use IDL interface directly to avoid error message appearance in Python console refl_box_face = geompy.ShapesOp.GetInPlaceByHistory(part, aface) if refl_box_face is not None: geompy.addToStudyInFather(part, refl_box_face, ssname) diff --cc src/GEOM_SWIG/gsketcher.py index 5424a96ef,b9f8a5b3e..33d1a16bc --- a/src/GEOM_SWIG/gsketcher.py +++ b/src/GEOM_SWIG/gsketcher.py @@@ -48,9 -48,9 +48,9 @@@ # geompy.addToStudy( Sketch_1, 'Sketch_1' ) # # # update object browser -# salome.sg.updateObjBrowser(True) +# salome.sg.updateObjBrowser() # @endcode - # @n Additionnal examples can be found as unit tests in the source code. + # @n Additional examples can be found as unit tests in the source code. # @} """