#include "MEDMEM_Family.hxx"
#include "MEDMEM_Group.hxx"
#include "MEDMEM_CellModel.hxx"
+
+#include "SenderFactory.hxx"
+#include "MultiCommException.hxx"
using namespace MEDMEM;
// Initialisation des variables statiques
* CORBA: Accessor for a specific coordinate
*/
//=============================================================================
-double MESH_i::getCoordinate(CORBA::Long Number, CORBA::Long Axis)
+CORBA::Double MESH_i::getCoordinate(CORBA::Long Number, CORBA::Long Axis)
throw (SALOME::SALOME_Exception)
{
if (_mesh==NULL)
return myseq._retn();
}
//=============================================================================
+/*!
+ * CORBA: 2nd Accessor for Coordinates
+ */
+//=============================================================================
+SALOME::SenderDouble_ptr MESH_i::getSenderForCoordinates(SALOME_MED::medModeSwitch typeSwitch)
+ throw (SALOME::SALOME_Exception)
+{
+ if (_mesh==NULL)
+ THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \
+ SALOME::INTERNAL_ERROR);
+ SALOME::SenderDouble_ptr ret;
+ try
+ {
+ int spaceDimension=_mesh->getSpaceDimension();
+ int nbNodes=_mesh->getNumberOfNodes();
+ const double * coordinates =_mesh->getCoordinates(convertIdlModeToMedMode(typeSwitch));
+ ret=SenderFactory::buildSender(*this,coordinates,nbNodes*spaceDimension);
+ }
+ catch (MEDEXCEPTION &ex)
+ {
+ MESSAGE("Unable to acces the coordinates");
+ THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
+ }
+ catch(MultiCommException &ex2)
+ THROW_SALOME_CORBA_EXCEPTION(ex2.what(),SALOME::INTERNAL_ERROR);
+ return ret;
+}
+//=============================================================================
/*!
* CORBA: Accessor for Coordinates Names
*/
}
return myseq._retn();
}
+//=============================================================================
+/*!
+ * CORBA: 2nd Accessor for connectivities
+ */
+//=============================================================================
+SALOME::SenderInt_ptr MESH_i::getSenderForConnectivity(SALOME_MED::medModeSwitch typeSwitch,
+ SALOME_MED::medConnectivity mode,
+ SALOME_MED::medEntityMesh entity,
+ SALOME_MED::medGeometryElement geomElement)
+throw (SALOME::SALOME_Exception)
+{
+ if (_mesh==NULL)
+ THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \
+ SALOME::INTERNAL_ERROR);
+ if (verifieParam(entity,geomElement)==false)
+ THROW_SALOME_CORBA_EXCEPTION("parameters don't match",\
+ SALOME::BAD_PARAM);
+ SALOME::SenderInt_ptr ret;
+ try
+ {
+ int nbelements=_mesh->getConnectivityLength(convertIdlModeToMedMode(typeSwitch),
+ convertIdlConnToMedConn(mode),
+ convertIdlEntToMedEnt(entity),
+ convertIdlEltToMedElt(geomElement));
+ const int * numbers=_mesh->getConnectivity(convertIdlModeToMedMode(typeSwitch),
+ convertIdlConnToMedConn(mode),
+ convertIdlEntToMedEnt(entity),
+ convertIdlEltToMedElt(geomElement));
+ ret=SenderFactory::buildSender(*this,numbers,nbelements);
+ }
+ catch (MEDEXCEPTION &ex)
+ {
+ MESSAGE("Unable to acces connectivities");
+ THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
+ }
+ catch(MultiCommException &ex2)
+ THROW_SALOME_CORBA_EXCEPTION(ex2.what(),SALOME::INTERNAL_ERROR);
+ return ret;
+}
+
+//=======================================================================
+//function : getSenderForPolygonsConnectivity
+//purpose :
+//=======================================================================
+
+SALOME::SenderInt_ptr MESH_i::getSenderForPolygonsConnectivity(SALOME_MED::medConnectivity mode,
+ SALOME_MED::medEntityMesh entity)
+ throw (SALOME::SALOME_Exception)
+{
+ if (_mesh==NULL)
+ THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \
+ SALOME::INTERNAL_ERROR);
+ if (verifieParam(entity,SALOME_MED::MED_POLYGON)==false)
+ THROW_SALOME_CORBA_EXCEPTION("parameters don't match",\
+ SALOME::BAD_PARAM);
+ SALOME::SenderInt_ptr ret;
+ try
+ {
+ int nbelements = _mesh->getPolygonsConnectivityLength(convertIdlConnToMedConn(mode),
+ convertIdlEntToMedEnt(entity));
+ const int * numbers=_mesh->getPolygonsConnectivity (convertIdlConnToMedConn(mode),
+ convertIdlEntToMedEnt(entity));
+ ret=SenderFactory::buildSender(*this,numbers,nbelements);
+ }
+ catch (MEDEXCEPTION &ex)
+ {
+ MESSAGE("Unable to acces connectivities");
+ THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
+ }
+ catch(MultiCommException &ex2)
+ THROW_SALOME_CORBA_EXCEPTION(ex2.what(),SALOME::INTERNAL_ERROR);
+ return ret;
+}
+
+//=======================================================================
+//function : getSenderForPolygonsConnectivityIndex
+//purpose :
+//=======================================================================
+
+SALOME::SenderInt_ptr MESH_i::getSenderForPolygonsConnectivityIndex(SALOME_MED::medConnectivity mode,
+ SALOME_MED::medEntityMesh entity)
+ throw (SALOME::SALOME_Exception)
+{
+ if (_mesh==NULL)
+ THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \
+ SALOME::INTERNAL_ERROR);
+ if (verifieParam(entity,SALOME_MED::MED_POLYGON)==false)
+ THROW_SALOME_CORBA_EXCEPTION("parameters don't match",\
+ SALOME::BAD_PARAM);
+ SALOME::SenderInt_ptr ret;
+ try
+ {
+ int nbelements = _mesh->getNumberOfPolygons() + 1;
+ const int * numbers=_mesh->getPolygonsConnectivityIndex (convertIdlConnToMedConn(mode),
+ convertIdlEntToMedEnt(entity));
+ ret=SenderFactory::buildSender(*this,numbers,nbelements);
+ }
+ catch (MEDEXCEPTION &ex)
+ {
+ MESSAGE("Unable to acces connectivities");
+ THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
+ }
+ catch(MultiCommException &ex2)
+ THROW_SALOME_CORBA_EXCEPTION(ex2.what(),SALOME::INTERNAL_ERROR);
+ return ret;
+}
+
+//=======================================================================
+//function : getSenderForPolyhedronConnectivity
+//purpose :
+//=======================================================================
+
+SALOME::SenderInt_ptr MESH_i::getSenderForPolyhedronConnectivity(SALOME_MED::medConnectivity mode)
+ throw (SALOME::SALOME_Exception)
+{
+ if (_mesh==NULL)
+ THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \
+ SALOME::INTERNAL_ERROR);
+ SALOME::SenderInt_ptr ret;
+ try
+ {
+ int nbelements = _mesh->getPolyhedronConnectivityLength(convertIdlConnToMedConn(mode));
+ const int * numbers=_mesh->getPolyhedronConnectivity( convertIdlConnToMedConn(mode) );
+ ret=SenderFactory::buildSender(*this,numbers,nbelements);
+ }
+ catch (MEDEXCEPTION &ex)
+ {
+ MESSAGE("Unable to acces connectivities");
+ THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
+ }
+ catch(MultiCommException &ex2)
+ THROW_SALOME_CORBA_EXCEPTION(ex2.what(),SALOME::INTERNAL_ERROR);
+ return ret;
+}
+
+//=======================================================================
+//function : getSenderForPolyhedronIndex
+//purpose :
+//=======================================================================
+
+SALOME::SenderInt_ptr MESH_i::getSenderForPolyhedronIndex(SALOME_MED::medConnectivity mode)
+ throw (SALOME::SALOME_Exception)
+{
+ if (_mesh==NULL)
+ THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \
+ SALOME::INTERNAL_ERROR);
+ SALOME::SenderInt_ptr ret;
+ try
+ {
+ int nbelements = _mesh->getNumberOfPolyhedron() + 1;
+ const int * numbers = _mesh->getPolyhedronIndex( convertIdlConnToMedConn( mode ) );
+ ret=SenderFactory::buildSender(*this,numbers,nbelements);
+ }
+ catch (MEDEXCEPTION &ex)
+ {
+ MESSAGE("Unable to acces connectivities");
+ THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
+ }
+ catch(MultiCommException &ex2)
+ THROW_SALOME_CORBA_EXCEPTION(ex2.what(),SALOME::INTERNAL_ERROR);
+ return ret;
+}
+
+//=======================================================================
+//function : getSenderForPolyhedronFacesIndex
+//purpose :
+//=======================================================================
+
+SALOME::SenderInt_ptr MESH_i::getSenderForPolyhedronFacesIndex()
+ throw (SALOME::SALOME_Exception)
+{
+ if (_mesh==NULL)
+ THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \
+ SALOME::INTERNAL_ERROR);
+ SALOME::SenderInt_ptr ret;
+ try
+ {
+ int nbelements = _mesh->getNumberOfPolyhedronFaces() + 1;
+ const int * numbers=_mesh->getPolyhedronFacesIndex();
+ ret=SenderFactory::buildSender(*this,numbers,nbelements);
+ }
+ catch (MEDEXCEPTION &ex)
+ {
+ MESSAGE("Unable to acces connectivities");
+ THROW_SALOME_CORBA_EXCEPTION(ex.what(), SALOME::INTERNAL_ERROR);
+ }
+ catch(MultiCommException &ex2)
+ THROW_SALOME_CORBA_EXCEPTION(ex2.what(),SALOME::INTERNAL_ERROR);
+ return ret;
+}
+
//=============================================================================
/*!
* CORBA: Accessor for connectivities
SALOME_MED::long_array_var myseq= new SALOME_MED::long_array;
try
{
- int nbelements;
- if ( mode == SALOME_MED::MED_DESCENDING)
- {
- nbelements =(_mesh->getNumberOfNodes())+1;
- }
- else
- {
- nbelements = _mesh->getNumberOfElements(MED_FACE,MED_ALL_ELEMENTS);
- }
+ int nbelements=_mesh->getReverseConnectivityLength(convertIdlConnToMedConn(mode));
SCRUTE(nbelements);
myseq->length(nbelements);
const int * numbers=_mesh->getReverseConnectivity(convertIdlConnToMedConn(mode));
SALOME_MED::long_array_var myseq= new SALOME_MED::long_array;
try
{
- int nbelements;
- if ( mode == SALOME_MED::MED_DESCENDING)
- {
- nbelements =_mesh->getNumberOfNodes();
- }
- else
- {
- int dim=_mesh->getMeshDimension();
- if ( dim == 3)
- nbelements = _mesh->getNumberOfElements(MED_FACE,MED_ALL_ELEMENTS);
- else
- if (dim == 2)
- nbelements = _mesh->getNumberOfElements(MED_EDGE,MED_ALL_ELEMENTS);
- else
- THROW_SALOME_CORBA_EXCEPTION("Pb ", \
- SALOME::INTERNAL_ERROR);
- }
-
+ int nbelements=_mesh->getReverseConnectivityIndexLength(convertIdlConnToMedConn(mode));
myseq->length(nbelements);
const int * numbers=_mesh->getReverseConnectivityIndex(convertIdlConnToMedConn(mode));
for (int i=0;i<nbelements;i++)
for (int i=0;i<nbfam;i++)
{
FAMILY_i * f1=new FAMILY_i(fam[i]);
- SALOME_MED::FAMILY_ptr f2 =
- f1->POA_SALOME_MED::FAMILY::_this();
- f1->_remove_ref();
- myseq[i] = f2;
+ myseq[i] = f1->POA_SALOME_MED::FAMILY::_this();
}
}
catch (MEDEXCEPTION &ex)
{
all->numberOfNodes = _mesh->getNumberOfNodes();
- int nbTypes=_mesh->getNumberOfTypes(convertIdlEntToMedEnt(entity));
- const medGeometryElement * elemts =_mesh->getTypes(
+ int nbTypes=_mesh->getNumberOfTypesWithPoly(convertIdlEntToMedEnt(entity));
+ const medGeometryElement * elemts =_mesh->getTypesWithPoly(
convertIdlEntToMedEnt(entity));
all->meshTypes.length(nbTypes);
all->numberOfElements.length(nbTypes);
+ all->entityDimension=_mesh->getConnectivityptr()->getEntityDimension();
for (int i=0; i<nbTypes; i++)
{
all->meshTypes[i]=convertMedEltToIdlElt(elemts[i]);
- all->numberOfElements[i]=_mesh->getNumberOfElements(
+ all->numberOfElements[i]=_mesh->getNumberOfElementsWithPoly(
convertIdlEntToMedEnt(entity),elemts[i]);
}
}
{
const FAMILY * fam = _mesh->getFamily(convertIdlEntToMedEnt(entity),i);
FAMILY_i * f1=new FAMILY_i(fam);
- SALOME_MED::FAMILY_ptr f2 = f1->POA_SALOME_MED::FAMILY::_this();
- f1->_remove_ref();
- return (SALOME_MED::FAMILY::_duplicate(f2));
+ return f1->POA_SALOME_MED::FAMILY::_this();
}
catch (MEDEXCEPTION &ex)
{
for (int i=0;i<nbFam;i++)
{
FAMILY_i * f1=new FAMILY_i(vNode[i]);
- SALOME_MED::FAMILY_ptr f2 = f1->POA_SALOME_MED::FAMILY::_this();
- f1->_remove_ref();
- all->famNode[i] = f2;
+ all->famNode[i] = f1->POA_SALOME_MED::FAMILY::_this();
}
nbFam = _mesh->getNumberOfFamilies(MED_EDGE);
for (int i=0;i<nbFam;i++)
{
FAMILY_i * f1=new FAMILY_i(vEdge[i]);
- SALOME_MED::FAMILY_ptr f2 = f1->POA_SALOME_MED::FAMILY::_this();
- f1->_remove_ref();
- all->famEdge[i] = f2;
+ all->famEdge[i] = f1->POA_SALOME_MED::FAMILY::_this();
}
nbFam = _mesh->getNumberOfFamilies(MED_FACE);
for (int i=0;i<nbFam;i++)
{
FAMILY_i * f1=new FAMILY_i(vFace[i]);
- SALOME_MED::FAMILY_ptr f2 = f1->POA_SALOME_MED::FAMILY::_this();
- f1->_remove_ref();
- all->famFace[i] = f2;
+ all->famFace[i] = f1->POA_SALOME_MED::FAMILY::_this();
}
nbFam = _mesh->getNumberOfFamilies(MED_CELL);
for (int i=0;i<nbFam;i++)
{
FAMILY_i * f1=new FAMILY_i(vCell[i]);
- SALOME_MED::FAMILY_ptr f2 = f1->POA_SALOME_MED::FAMILY::_this();
- f1->_remove_ref();
- all->famCell[i] = f2;
+ all->famCell[i] = f1->POA_SALOME_MED::FAMILY::_this();
}
int nbGroup = _mesh->getNumberOfGroups(MED_NODE);
for (int i=0;i<nbGroup;i++)
{
GROUP_i * f1=new GROUP_i(gNode[i]);
- SALOME_MED::GROUP_ptr f2 = f1->POA_SALOME_MED::GROUP::_this();
- f1->_remove_ref();
- all->groupNode[i] = f2;
+ all->groupNode[i] = f1->POA_SALOME_MED::GROUP::_this();
}
nbGroup = _mesh->getNumberOfGroups(MED_EDGE);
for (int i=0;i<nbGroup;i++)
{
GROUP_i * f1=new GROUP_i(gEdge[i]);
- SALOME_MED::GROUP_ptr f2 = f1->POA_SALOME_MED::GROUP::_this();
- f1->_remove_ref();
- all->groupEdge[i] = f2;
+ all->groupEdge[i] = f1->POA_SALOME_MED::GROUP::_this();
}
nbGroup = _mesh->getNumberOfGroups(MED_FACE);
all->groupFace.length(nbGroup);
for (int i=0;i<nbGroup;i++)
{
GROUP_i * f1=new GROUP_i(gFace[i]);
- SALOME_MED::GROUP_ptr f2 = f1->POA_SALOME_MED::GROUP::_this();
- f1->_remove_ref();
- all->groupFace[i] = f2;
+ all->groupFace[i] = f1->POA_SALOME_MED::GROUP::_this();
}
nbGroup = _mesh->getNumberOfGroups(MED_CELL);
for (int i=0;i<nbGroup;i++)
{
GROUP_i * f1=new GROUP_i(gCell[i]);
- SALOME_MED::GROUP_ptr f2 = f1->POA_SALOME_MED::GROUP::_this();
- f1->_remove_ref();
- all->groupCell[i] = f2;
+ all->groupCell[i] = f1->POA_SALOME_MED::GROUP::_this();
}
}
for (int i=0;i<nbgroups;i++)
{
GROUP_i * f1=new GROUP_i(groups[i]);
- SALOME_MED::GROUP_ptr f2 = f1->POA_SALOME_MED::GROUP::_this();
- f1->_remove_ref();
- myseq[i] = f2;
+ myseq[i] = f1->POA_SALOME_MED::GROUP::_this();
}
}
catch (MEDEXCEPTION &ex)
{
const GROUP * grou = _mesh->getGroup(convertIdlEntToMedEnt(entity),i);
GROUP_i * f1=new GROUP_i(grou);
- SALOME_MED::GROUP_ptr f2 = f1->POA_SALOME_MED::GROUP::_this();
- f1->_remove_ref();
- return (SALOME_MED::GROUP::_duplicate(f2));
+ return f1->POA_SALOME_MED::GROUP::_this();
}
catch (MEDEXCEPTION &ex)
{
{
SUPPORT * myNewSupport = _mesh->getBoundaryElements(convertIdlEntToMedEnt(entity));
SUPPORT_i * mySupportI = new SUPPORT_i(myNewSupport);
- SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportI->_this() ;
- return (SALOME_MED::SUPPORT::_duplicate(mySupportIOR));
+ return mySupportI->_this();
}
catch (MEDEXCEPTION &ex)
{
ASSERT(SUPPORT_i::supportMap.find(sup)!=SUPPORT_i::supportMap.end());
const SUPPORT * myCppSupport=SUPPORT_i::supportMap[sup];
::FIELD<double>*f=_mesh->getVolume( myCppSupport);
- FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(mySupport,f);
- POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i> * f1 =
- new POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i>(medf,true);
- SALOME_MED::FIELDDOUBLE_ptr f2 = f1->_this();
- f1->_remove_ref();
- return (SALOME_MED::FIELD::_duplicate(f2));
+ FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(f);
+ return medf->_this();
}
catch (MEDEXCEPTION &ex)
{
const SUPPORT * myCppSupport=SUPPORT_i::supportMap[sup];
SUPPORT * myNewSupport = _mesh->getSkin(myCppSupport);
SUPPORT_i * mySupportI = new SUPPORT_i(myNewSupport);
- SALOME_MED::SUPPORT_ptr mySupportIOR = mySupportI->_this() ;
- return (SALOME_MED::SUPPORT::_duplicate(mySupportIOR));
+ return mySupportI->_this() ;
}
catch (MEDEXCEPTION &ex)
{
ASSERT(SUPPORT_i::supportMap.find(sup)!=SUPPORT_i::supportMap.end());
const SUPPORT * myCppSupport=SUPPORT_i::supportMap[sup];
::FIELD<double>*f=_mesh->getArea( myCppSupport);
- FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(mySupport,f);
- POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i> * f1 =
- new POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i>(medf,true);
- SALOME_MED::FIELDDOUBLE_ptr f2 = f1->_this();
- f1->_remove_ref();
- return (SALOME_MED::FIELD::_duplicate(f2));
+ FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(f);
+ return medf->_this();
}
catch (MEDEXCEPTION &ex)
{
ASSERT(SUPPORT_i::supportMap.find(sup)!=SUPPORT_i::supportMap.end());
const SUPPORT * myCppSupport=SUPPORT_i::supportMap[sup];
::FIELD<double>*f=_mesh->getLength( myCppSupport);
- FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(mySupport,f);
- POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i> * f1 =
- new POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i>(medf,true);
- SALOME_MED::FIELDDOUBLE_ptr f2 = f1->_this();
- f1->_remove_ref();
- return (SALOME_MED::FIELD::_duplicate(f2));
+ FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(f);
+ return medf->_this();
}
catch (MEDEXCEPTION &ex)
{
ASSERT(SUPPORT_i::supportMap.find(sup)!=SUPPORT_i::supportMap.end());
const SUPPORT * myCppSupport=SUPPORT_i::supportMap[sup];
::FIELD<double>*f=_mesh->getNormal( myCppSupport);
- FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(mySupport,f);
- POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i> * f1 =
- new POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i>(medf,true);
- SALOME_MED::FIELDDOUBLE_ptr f2 = f1->_this();
- f1->_remove_ref();
- return (SALOME_MED::FIELD::_duplicate(f2));
+ FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(f);
+ return medf->_this();
}
catch (MEDEXCEPTION &ex)
{
ASSERT(SUPPORT_i::supportMap.find(sup)!=SUPPORT_i::supportMap.end());
const SUPPORT * myCppSupport=SUPPORT_i::supportMap[sup];
::FIELD<double>*f=_mesh->getBarycenter( myCppSupport);
- FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(mySupport,f);
- POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i> * f1 =
- new POA_SALOME_MED::FIELDDOUBLE_tie<FIELDDOUBLE_i>(medf,true);
- SALOME_MED::FIELDDOUBLE_ptr f2 = f1->_this();
- f1->_remove_ref();
- return (SALOME_MED::FIELD::_duplicate(f2));
+ FIELDDOUBLE_i * medf = new FIELDDOUBLE_i(f);
+ return medf->_this();
}
catch (MEDEXCEPTION &ex)
{
THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR);
// Create SObject labelled 'MESH' if it doesn't already exit
- SALOMEDS::SObject_var medmeshfather = myStudy->FindObject("MEDMESH");
+// SALOMEDS::SObject_var medmeshfather = myStudy->FindObject("MEDMESH");
+// if ( CORBA::is_nil(medmeshfather) )
+// {
+// MESSAGE("Add Object MEDMESH");
+// medmeshfather = myBuilder->NewObject(medfather);
+// //medmeshfather.Name = "MEDMESH" ;
+// anAttr = myBuilder->FindOrCreateAttribute(medmeshfather, "AttributeName");
+// aName = SALOMEDS::AttributeName::_narrow(anAttr);
+// aName->SetValue("MEDMESH");
+
+// } ;
+
+ SALOMEDS::SObject_var medmeshfather = myStudy->FindObjectByPath("/Med/MEDMESH");
if ( CORBA::is_nil(medmeshfather) )
- {
- MESSAGE("Add Object MEDMESH");
- medmeshfather = myBuilder->NewObject(medfather);
- //medmeshfather.Name = "MEDMESH" ;
- anAttr = myBuilder->FindOrCreateAttribute(medmeshfather, "AttributeName");
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue("MEDMESH");
+ {
+ MESSAGE("Add Object MEDMESH");
- } ;
+ myBuilder->AddDirectory("/Med/MEDMESH");
+ medmeshfather = myStudy->FindObjectByPath("/Med/MEDMESH");
+ } ;
MESSAGE("Add a mesh Object under MED/MEDMESH");
SALOMEDS::SObject_var newObj = myBuilder->NewObject(medmeshfather);
_meshId = newObj->GetID();
myBuilder->CommitCommand();
+ // register the Corba pointer: increase the referrence count
+ MESSAGE("Registering of the Corba Mesh pointer");
+ Register();
+
END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)");
}
//=============================================================================
_meshId = newObj->GetID();
myBuilder->CommitCommand();
+ // register the Corba pointer: increase the referrence count
+ MESSAGE("Registering of the Corba Mesh pointer");
+ Register();
+
END_OF("Mesh_i::addInStudy(SALOMEDS::Study_ptr myStudy)");
}
//=============================================================================
}
}
+//=============================================================================
+/*!
+ * CORBA : Test if this and other aggregate the same MESH using the MESH::operator==
+ */
+//=============================================================================
+CORBA::Boolean MESH_i::areEquals(SALOME_MED::MESH_ptr other)
+{
+ PortableServer::ServantBase *baseServ;
+ try {
+ baseServ=_default_POA()->reference_to_servant(other);
+ }
+ catch(...){
+ baseServ=0;
+ }
+ if(baseServ)
+ {
+ baseServ->_remove_ref();
+ MESH_i *otherServ=dynamic_cast<MESH_i *>(baseServ);
+ return *_mesh==*otherServ->_mesh;
+ }
+ return false;
+}