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;
// 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;
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
//============================================================================
// 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,
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());
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();
}
// 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
// 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";
//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;
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;
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;
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 )
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;
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);
}
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);
}
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;
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 )
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;
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);
}
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());
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);
}
// 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();
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<std::string> > passedEntries;
std::map< std::string, std::set<std::string> > &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 );
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;
// because they could not be modified anyhow.
std::set<std::string> 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;
std::set<std::string>& anOthers)
{
std::set<std::string>::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;