// function : GEOM_Gen_i()
// purpose : constructor to be called for servant creation.
//============================================================================
-GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName) :
+GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId* contId,
+ const char* instanceName,
+ const char* interfaceName) :
Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
{
_thisObj = this;
anAttr = aStudyBuilder->FindOrCreateAttribute(aFather, "AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
aName->SetValue("Geometry");
+ aName->Destroy();
anAttr = aStudyBuilder->FindOrCreateAttribute(aFather, "AttributePixMap");
- SALOMEDS::AttributePixMap::_narrow(anAttr)->SetPixMap("ICON_OBJBROWSER_Geometry");
- aStudyBuilder->DefineComponentInstance(aFather, GEOM_Gen::_this());
+ SALOMEDS::AttributePixMap_var aPixMap=SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixMap->SetPixMap("ICON_OBJBROWSER_Geometry");
+ aPixMap->Destroy();
+ aStudyBuilder->DefineComponentInstance(aFather, (GEOM::GEOM_Gen_var)GEOM_Gen::_this());
}
if (aFather->_is_nil()) return aResultSO;
}
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- //char *aGeomObjIOR = _orb->object_to_string(theObject);
- CORBA::String_var aGeomObjIOR = _orb->object_to_string(theObject);
- //anIOR->SetValue(CORBA::string_dup(aGeomObjIOR));
+ CORBA::String_var aGeomObjIOR = _orb->object_to_string(theObject);
anIOR->SetValue(aGeomObjIOR);
+ anIOR->Destroy();
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributePixMap");
SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
} else if ( aShape->GetType() == GEOM_MARKER ) {
aPixmap->SetPixMap( "ICON_OBJBROWSER_LCS" );
aShapeName = "LocalCS_";
+ } else if ( aShape->GetType() > ADVANCED_BASE ) {
+ char buf[20];
+ sprintf( buf, "%d", aShape->GetType() );
+ std::string advId = "ICON_OBJBROWSER_ADVANCED_"; advId += buf;
+ aPixmap->SetPixMap( advId.c_str() );
+ aShapeName = "Advanced_";
} else if ( aShape->GetShapeType() == GEOM::COMPOUND ) {
aPixmap->SetPixMap( "ICON_OBJBROWSER_COMPOUND" );
aShapeName = "Compound_";
aPixmap->SetPixMap( "ICON_OBJBROWSER_VERTEX" );
aShapeName = "Vertex_";
}
+ aPixmap->Destroy();
//if (strlen(theName) == 0) aShapeName += TCollection_AsciiString(aResultSO->Tag());
//else aShapeName = TCollection_AsciiString(CORBA::string_dup(theName));
Handle(GEOM_Object) aGShape = _impl->GetObject(aShape->GetStudyID(), entry);
TopoDS_Shape TopoSh = aGShape->GetValue();
// find label of main shape
- GEOM::GEOM_Object_var aMainShVar = aShape;
- GEOM::GEOM_Object_ptr aMainSh = aMainShVar._retn();
+ GEOM::GEOM_Object_var aMainSh = aShape;
while( !aMainSh->IsMainShape() ) {
aMainSh = aMainSh->GetMainShape();
}
}
//Set the study entry as a name of the published GEOM_Object
- aShape->SetStudyEntry(aResultSO->GetID());
+ CORBA::String_var anID =aResultSO->GetID();
+ aShape->SetStudyEntry(anID.in());
//Set a name of the added shape
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr);
aNameAttrib->SetValue(aShapeName.ToCString());
+ aNameAttrib->Destroy();
//Set NoteBook variables used in the object creation
TCollection_AsciiString aVars;
- SALOMEDS::ListOfListOfStrings_var aSections = theStudy->ParseVariables(aShape->GetParameters());
+ CORBA::String_var aString=aShape->GetParameters();
+ SALOMEDS::ListOfListOfStrings_var aSections = theStudy->ParseVariables(aString);
for(int i = 0, n = aSections->length(); i < n; i++) {
SALOMEDS::ListOfStrings aListOfVars = aSections[i];
for(int j = 0, m = aListOfVars.length(); j < m; j++) {
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString");
SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr);
aStringAttrib->SetValue(aVars.ToCString());
+ aStringAttrib->Destroy();
+
+ aFather->Destroy();
//Set a name of the GEOM object
aShape->SetName(theName);
GEOM::GEOM_Object_ptr GrObj =
GOp->CreateGroup( theMainShape, SeqS.Value(1).ShapeType() );
AddInStudy(theStudy, GrObj, GrName, theMainShape._retn());
+ CORBA::String_var GrEntry = GrObj->GetEntry();
+ Handle(GEOM_Object) HGrObj = _impl->GetObject(GrObj->GetStudyID(), GrEntry);
// add named objects
- Handle(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);
+ //anArray = new TColStd_HArray1OfInteger(1,1);
Standard_Integer anIndex = anIndices.FindIndex(aValue);
- anArray->SetValue(1, anIndex);
- anObj = GEOM_Engine::GetEngine()->AddObject(aMainShape->GetDocID(), GEOM_SUBSHAPE);
- if (anObj.IsNull()) continue;
- Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1);
- if (aFunction.IsNull()) continue;
- GEOM_ISubShape aSSI(aFunction);
- aSSI.SetMainShape(aMainShape->GetLastFunction());
- aSSI.SetIndices(anArray);
- aFunction->SetValue(aValue);
- GOp->UnionIDs(GrObj, anIndex);
- SALOMEDS::SObject_var aResultSO;
- TCollection_AsciiString anEntry;
- TDF_Tool::Entry(anObj->GetEntry(),anEntry);
- GEOM::GEOM_Object_var aGObj = GetObject(anObj->GetDocID(), anEntry.ToCString());
- AddInStudy(theStudy, aGObj._retn(), SeqN.Value(i).ToCString(), GrObj);
+ //anArray->SetValue(1, anIndex);
+ GOp->AddObject(GrObj,anIndex);
+ //anObj = GEOM_Engine::GetEngine()->AddObject(aMainShape->GetDocID(), GEOM_SUBSHAPE);
+ //if (anObj.IsNull()) continue;
+ //Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1);
+ //if (aFunction.IsNull()) continue;
+ //GEOM_ISubShape aSSI(aFunction);
+ //aSSI.SetMainShape(aMainShape->GetLastFunction());
+ //aSSI.SetIndices(anArray);
+ //aFunction->SetValue(aValue);
+ //GOp->UnionIDs(GrObj, anIndex);
+ //SALOMEDS::SObject_var aResultSO;
+ //TCollection_AsciiString anEntry;
+ //TDF_Tool::Entry(anObj->GetEntry(),anEntry);
+ //GEOM::GEOM_Object_var aGObj = GetObject(anObj->GetDocID(), anEntry.ToCString());
+ //AddInStudy(theStudy, aGObj._retn(), SeqN.Value(i).ToCString(), GrObj);
}
}
}
//============================================================================
void GEOM_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent)
{
- _impl->Close(theComponent->GetStudy()->StudyId());
+ SALOMEDS::Study_var aStudy= theComponent->GetStudy();
+ _impl->Close(aStudy->StudyId());
}
//============================================================================
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- GEOM::GEOM_Object_var anObject = GEOM::GEOM_Object::_narrow(_orb->string_to_object(anIOR->Value()));
+ CORBA::String_var aString=anIOR->Value();
+ anIOR->Destroy();
+ CORBA::Object_var anObj = _orb->string_to_object(aString);
+ GEOM::GEOM_Object_var anObject = GEOM::GEOM_Object::_narrow(anObj);
// If the object is null one it can't be copied: return false
if (anObject->_is_nil()) return false;
return true;
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var objStr = _orb->object_to_string(obj);
anIOR->SetValue(objStr.in());
+ anIOR->Destroy();
// Return the created in the Study SObject
return aNewSO._retn();
SALOMEDS::SObject_var aFatherSO = theStudy->FindObjectIOR(IOR.in());
if(aFatherSO->_is_nil()) return aResultSO._retn();
aResultSO = aStudyBuilder->NewObject(aFatherSO);
+ aFatherSO->Destroy();
//aStudyBuilder->Addreference(aResultSO, aResultSO);
}
if(aSO->_is_nil()) continue;
SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aResultSO);
aStudyBuilder->Addreference(aSubSO, aSO);
+ aSO->Destroy();
+ aSubSO->Destroy();
}
return aResultSO._retn();
GEOM::GEOM_Object_ptr theObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg)
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject))
// if (CORBA::is_nil(aSO))
// return aParts._retn();
- aParts = RestoreSubShapes(theStudy, theObject, aSO, theArgs, theFindMethod, theInheritFirstArg);
+ aParts = RestoreSubShapes(theStudy, theObject, aSO, theArgs,
+ theFindMethod, theInheritFirstArg, theAddPrefix);
+ if (!CORBA::is_nil(aSO)) aSO->Destroy();
return aParts._retn();
}
// To be used from GUI and from geompy.addToStudy
//============================================================================
GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
- const GEOM::ListOfGO& theArgs,
- GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg)
+ SALOMEDS::SObject_ptr theSObject,
+ const GEOM::ListOfGO& theArgs,
+ GEOM::find_shape_method theFindMethod,
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
if (CORBA::is_nil(theStudy) || CORBA::is_nil(theSObject))
if (CORBA::is_nil(anO))
return aParts._retn();
- aParts = RestoreSubShapes(theStudy, anO, theSObject, theArgs, theFindMethod, theInheritFirstArg);
+ aParts = RestoreSubShapes(theStudy, anO, theSObject, theArgs,
+ theFindMethod, theInheritFirstArg, theAddPrefix);
return aParts._retn();
}
// function : addToListOfGO
// purpose : static local function
//============================================================================
-static void addToListOfGO( const GEOM::GEOM_Object_ptr& theObject,
+static void addToListOfGO( GEOM::GEOM_Object_ptr theObject,
GEOM::ListOfGO& theList )
{
const int oldLen = theList.length();
theList.length(oldLen + 1);
- theList[ oldLen ] = theObject;
+ theList[ oldLen ] = GEOM::GEOM_Object::_duplicate( theObject );
}
//============================================================================
const int srcLen = theSrcList.length();
theTrgList.length(oldLen + srcLen);
for( int i = 0; i < srcLen; i++ )
- theTrgList[ oldLen + i ] = theSrcList[ i ];
+ theTrgList[ oldLen + i ] = GEOM::GEOM_Object::_duplicate( theSrcList[ i ] );
}
//============================================================================
// purpose : Private method. Works only if both theObject and theSObject
// are defined, and does not check, if they correspond to each other.
//============================================================================
-GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes (SALOMEDS::Study_ptr theStudy,
+GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
GEOM::GEOM_Object_ptr theObject,
SALOMEDS::SObject_ptr theSObject,
const GEOM::ListOfGO& theArgs,
GEOM::find_shape_method theFindMethod,
- CORBA::Boolean theInheritFirstArg)
+ CORBA::Boolean theInheritFirstArg,
+ CORBA::Boolean theAddPrefix)
{
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
//PTv, IMP 0020001, The salome object <theSObject>
aList = new GEOM::ListOfGO;
aList->length(aLength);
for (int i = 0; i < aLength; i++) {
- aList[i] = theArgs[i];
+ aList[i] = GEOM::GEOM_Object::_duplicate( theArgs[i] );
}
}
else {
// Do not publish argument's reflection,
// but only reconstruct its published sub-shapes
- GEOM::GEOM_Object_var anArgO = aList[0];
- CORBA::String_var anIOR = _orb->object_to_string(anArgO);
+ CORBA::String_var anIOR = _orb->object_to_string(aList[0]);
SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in());
- aParts = RestoreSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, theFindMethod);
+ aParts = RestoreSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, theFindMethod, theAddPrefix);
// set the color of the transformed shape to the color of initial shape
theObject->SetColor(aList[0]->GetColor());
+ anArgSO->Destroy();
}
else {
// Get interface, containing method, which we will use to reconstruct sub-shapes
if (!CORBA::is_nil(aSubO))
aGroupOp->UnionIDs(aSubO, anIDs);
}
- else {
+ else if (anIDs->length() > 0) {
// single sub-shape
aSubO = aShapesOp->GetSubShape(theObject, anIDs[0]);
}
// Publish the sub-shape
SALOMEDS::SObject_var aSubSO;
- if (!CORBA::is_nil(theSObject)) {
- TCollection_AsciiString aSubName ("from_");
+ if (!CORBA::is_nil(theSObject)) {
+ TCollection_AsciiString aSubName;
+ if (theAddPrefix) {
+ aSubName = "from_";
+ }
aSubName += anArgName;
aSubSO = aStudyBuilder->NewObject(theSObject);
aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
GEOM::ListOfGO_var aSubParts;
if (theFindMethod == GEOM::FSM_GetInPlaceByHistory)
// pass theObject, because only it has the history
- aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, theObject, theFindMethod);
+ aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ theObject, theFindMethod, theAddPrefix);
else
- aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, aSubO, theFindMethod);
+ aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ aSubO, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aParts );
}
else { // GetInPlace failed, try to build from published parts
if (!CORBA::is_nil(anArgSO)) {
SALOMEDS::SObject_var aSubSO;
- if (!CORBA::is_nil(theSObject))
+ if (!CORBA::is_nil(theSObject))
aSubSO = aStudyBuilder->NewObject(theSObject);
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
- RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, theObject, theFindMethod);
+ RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO,
+ theObject, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aParts );
}
if (!CORBA::is_nil(aSubO) && !CORBA::is_nil(aSubSO)) {
// Publish the sub-shape
- TCollection_AsciiString aSubName ("from_parts_of_");
+ TCollection_AsciiString aSubName;
+ if (theAddPrefix) {
+ aSubName = "from_parts_of_";
+ }
aSubName += anArgName;
aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString());
// Restore color
}
}
} // try to build from published parts
+ anArgSO->Destroy();
}
} // process arguments
}
- set<string> anObjEntryMap;
- GEOM::ListOfGO_var aResParts = new GEOM::ListOfGO;
- int nbRes = 0;
- int nb = aParts->length();
- aResParts->length(nb);
- if (nb > 0)
- {
+ set<string> anObjEntryMap;
+ GEOM::ListOfGO_var aResParts = new GEOM::ListOfGO;
+ int nbRes = 0;
+ int nb = aParts->length();
+ aResParts->length(nb);
+ if (nb > 0)
+ {
Handle(GEOM_Object) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry());
Handle(GEOM_Function) aFunction = aMainObj->GetLastFunction();
GEOM::TPythonDump pd (aFunction, true);
int i = 0, j = 0;
for ( ; i < nb; i++ )
{
- const GEOM::GEOM_Object_var& anObj = aParts[ i ];
+ GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_duplicate( aParts[ i ] );
if (CORBA::is_nil(anObj))
continue;
char* anEntry = anObj->GetEntry();
default:
pd << "FSM_GetInPlaceByHistory"; break;
}
- pd << ", " << theInheritFirstArg << ")";
+ pd << ", " << theInheritFirstArg << ", " << theAddPrefix << ")";
}
aResParts->length(nbRes);
return aResParts._retn();
SALOMEDS::SObject_ptr theOldSO,
SALOMEDS::SObject_ptr theNewSO,
GEOM::GEOM_Object_ptr theNewO,
- GEOM::find_shape_method theFindMethod)
+ GEOM::find_shape_method theFindMethod,
+ CORBA::Boolean theAddPrefix)
{
int i = 0;
GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
SALOMEDS::SObject_var aNewSubSO;
if (!CORBA::is_nil(theNewSO)) {
// Publish the sub-shape
- TCollection_AsciiString aSubName ("from_");
+ TCollection_AsciiString aSubName;
+ if (theAddPrefix) {
+ aSubName = "from_";
+ }
aSubName += anArgName;
aNewSubSO = aStudyBuilder->NewObject(theNewSO);
aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
GEOM::ListOfGO_var aSubParts;
if (theFindMethod == GEOM::FSM_GetInPlaceByHistory)
// pass the main shape as Object, because only it has the history
- aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, theNewO, theFindMethod);
+ aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ theNewO, theFindMethod, theAddPrefix);
else
- aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, aNewSubO, theFindMethod);
+ aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ aNewSubO, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aNewParts );
}
// Restore published sub-shapes of the argument
GEOM::ListOfGO_var aSubParts =
- RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, theNewO, theFindMethod);
+ RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO,
+ theNewO, theFindMethod, theAddPrefix);
// add to parts list
addToListOfGO( aSubParts, aNewParts );
// Publish the sub-shape
if (!CORBA::is_nil(aNewSubSO)) {
- TCollection_AsciiString aSubName = "from_parts_of_";
+ TCollection_AsciiString aSubName;
+ if (theAddPrefix) {
+ aSubName = "from_parts_of_";
+ }
aSubName += anArgName;
aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString());
// Restore color
GEOM_IBasicOperations_i* aServant =
new GEOM_IBasicOperations_i(_poa, engine, _impl->GetIBasicOperations(theStudyID));
+ PortableServer::ObjectId_var id = _poa->activate_object(aServant);
// activate the CORBA servant
GEOM::GEOM_IBasicOperations_var operations = aServant->_this();
return operations._retn();
GEOM_I3DPrimOperations_i* aServant =
new GEOM_I3DPrimOperations_i(_poa, engine, _impl->GetI3DPrimOperations(theStudyID));
+ PortableServer::ObjectId_var id = _poa->activate_object(aServant);
// activate the CORBA servant
GEOM::GEOM_I3DPrimOperations_var operations = aServant->_this();
return operations._retn();
}
+//============================================================================
+// function : GetIAdvancedOperations
+// purpose :
+//============================================================================
+GEOM::GEOM_IAdvancedOperations_ptr GEOM_Gen_i::GetIAdvancedOperations(CORBA::Long theStudyID)
+ throw ( SALOME::SALOME_Exception )
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ MESSAGE( "GEOM_Gen_i::GetIAdvancedOperations" );
+
+ GEOM::GEOM_Gen_ptr engine = _this();
+
+ GEOM_IAdvancedOperations_i* aServant =
+ new GEOM_IAdvancedOperations_i(_poa, engine, _impl->GetIAdvancedOperations(theStudyID));
+
+ // activate the CORBA servant
+ GEOM::GEOM_IAdvancedOperations_var operations = aServant->_this();
+ return operations._retn();
+}
+
//=============================================================================
/*!
* AddSubShape
void GEOM_Gen_i::RemoveObject(GEOM::GEOM_Object_ptr theObject)
{
CORBA::String_var anEntry = theObject->GetEntry();
- Handle(GEOM_Object) anObject = _impl->GetObject(theObject->GetStudyID(), anEntry);
+ Handle(GEOM_Object) anObject = _impl->GetObject(theObject->GetStudyID(), anEntry, false);
if (anObject.IsNull()) return;
_impl->RemoveObject(anObject);
return;
}
GEOM::GEOM_Gen_ptr engine = _this();
+ //transfer the reference to GEOM_Object_i
GEOM_Object_i* servant = new GEOM_Object_i (_poa, engine, handle_object);
+ PortableServer::ObjectId_var id = _poa->activate_object(servant);
obj = servant->_this();
CORBA::String_var objStr = _orb->object_to_string(obj);
if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR")) {
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var aVal = anIOR->Value();
+ anIOR->Destroy();
CORBA::Object_var anObject = aStudy->ConvertIORToObject(aVal);
aGeomObject = GEOM::GEOM_Object::_narrow(anObject);
}
+ if (!aSObj->_is_nil() )
+ aSObj->Destroy();
const char* aTypeInfo = "Object";
if ( !aGeomObject->_is_nil() ) {
//=====================================================================================
extern "C"
{
-GEOM_I_EXPORT
- PortableServer::ObjectId * GEOMEngine_factory(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char * interfaceName)
+ /*
+ GEOM_I_EXPORT
+ PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB*, PortableServer::POA*, PortableServer::ObjectId*, const char*, const char*);
+ */
+
+ GEOM_I_EXPORT
+ PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId* contId,
+ const char* instanceName,
+ const char* interfaceName)
{
- GEOM_Gen_i * myGEOM_Gen_i = new GEOM_Gen_i(orb, poa, contId, instanceName, interfaceName);
- // Don't understand the reason of this register ????
-// myGEOM_Gen_i->register_name("/myGEOM_Gen"); // NRI : 11/07/2002 : Add for Supervision example
- return myGEOM_Gen_i->getId();
+ GEOM_Gen_i* myGEOM_Gen_i = new GEOM_Gen_i(orb, poa, contId, instanceName, interfaceName);
+ return myGEOM_Gen_i->getId();
}
}