// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : SMESH_MEDMesh_i.cxx
// Module : SMESH
-using namespace std;
#include "SMESH_MEDMesh_i.hxx"
#include "SMESH_Mesh_i.hxx"
# include "Utils_ORB_INIT.hxx"
# include "Utils_SINGLETON.hxx"
+# include "Utils_ExceptHandlers.hxx"
+
extern "C"
{
#include <stdio.h>
}
+using namespace std;
+
//=============================================================================
/*!
* Default constructor
myseq->length(nbNodes * spaceDimension);
int i = 0;
- SMDS_Iterator<const SMDS_MeshNode *> * itNodes=_meshDS->nodesIterator();
+ SMDS_NodeIteratorPtr itNodes=_meshDS->nodesIterator();
while(itNodes->more())
{
const SMDS_MeshNode* node = itNodes->next();
}
i++;
}
- delete itNodes;
}
catch(...)
{
* ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
* ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
* CORBA::ORB_var &orb = init(0,0);
- * string iorStr = orb->object_to_string(myIor);
- * //myBuilder->AddAttribute(newObj,SALOMEDS::IOR,iorStr.c_str());
+ * CORBA::String_var iorStr = orb->object_to_string(myIor);
+ * //myBuilder->AddAttribute(newObj,SALOMEDS::IOR,iorStr.in());
* SALOMEDS::AttributeIOR_var aIOR = SALOMEDS::AttributeIOR::_narrow(
* myBuilder->FindOrCreateAttribute(newObj, "AttributeIOR"));
* aIOR->SetValue(iorStr.c_str());
int trouveSeg3 = 0;
SALOME_MED::medGeometryElement medElement;
- SMDS_Iterator<const SMDS_MeshEdge*> * itEdges=_meshDS->edgesIterator();
+ SMDS_EdgeIteratorPtr itEdges=_meshDS->edgesIterator();
while(itEdges->more())
{
const SMDS_MeshEdge* elem = itEdges->next();
int longueur = _seq_elemId[index]->length();
_seq_elemId[index]->length(longueur + nb_of_nodes);
- SMDS_Iterator<const SMDS_MeshNode*> * itn=_meshDS->nodesIterator();
+ SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
for(int k=0; itn->more(); k++)
_seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
- delete itn;
}
- delete itEdges;
_mapNbTypes[SALOME_MED::MED_EDGE] = trouveSeg2 + trouveSeg3;
_mapIndToSeqElts[SALOME_MED::MED_QUAD4] = _indexElts++;
_mapIndToVectTypes[SALOME_MED::MED_FACE] = _indexEnts++;
- SMDS_Iterator<const SMDS_MeshFace*> * itFaces=_meshDS->facesIterator();
+ SMDS_FaceIteratorPtr itFaces=_meshDS->facesIterator();
while(itFaces->more())
{
const SMDS_MeshFace * elem = itFaces->next();
int longueur = _seq_elemId[index]->length();
_seq_elemId[index]->length(longueur + nb_of_nodes);
- SMDS_Iterator<const SMDS_MeshNode*> * itn=_meshDS->nodesIterator();
+ SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
for(int k=0; itn->more(); k++)
_seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
- delete itn;
} //itFaces
- delete itFaces;
_mapNbTypes[SALOME_MED::MED_FACE] =
trouveTria3 + trouveTria6 + trouveQuad4;
int trouveHexa8 = 0;
- SMDS_Iterator<const SMDS_MeshVolume*> * itVolumes=_meshDS->volumesIterator();
+ SMDS_VolumeIteratorPtr itVolumes=_meshDS->volumesIterator();
while(itVolumes->more())
{
const SMDS_MeshVolume * elem = itVolumes->next();
int nb_of_nodes = elem->NbNodes();
medElement = SALOME_MED::MED_HEXA8;
- ASSERT(nb_of_nodes = 8);
+ ASSERT(nb_of_nodes == 8);
if (trouveHexa8 == 0)
{
int longueur = _seq_elemId[index]->length();
_seq_elemId[index]->length(longueur + nb_of_nodes);
- SMDS_Iterator<const SMDS_MeshNode*> * itn=_meshDS->nodesIterator();
+ SMDS_NodeIteratorPtr itn=_meshDS->nodesIterator();
for(int k=0; itn->more(); k++)
_seq_elemId[index][longueur + k] = itn->next()->GetID()+1;
- delete itn;
}
- delete itVolumes;
_mapNbTypes[SALOME_MED::MED_CELL] = trouveHexa8;
_mapNbTypes[SALOME_MED::MED_ALL_ENTITIES]
//=============================================================================
void SMESH_MEDMesh_i::createFamilies() throw(SALOME::SALOME_Exception)
{
+ Unexpect aCatch(SALOME_SalomeException);
string famDes = ("Je ne sais pas");
string famName0 = "Famille_";
string famName;
if (_creeFamily == false)
{
_creeFamily = true;
- SMESH_subMesh_i *subMeshServant;
+ //SMESH_subMesh_i *subMeshServant;
map < int, SMESH_subMesh_i * >::iterator it;
for (it = _mesh_i->_mapSubMesh_i.begin();
SMESH_MEDFamily_i *famservant =
new SMESH_MEDFamily_i(famIdent, submesh_i,
famName, famDes, SALOME_MED::MED_NODE);
- SALOME_MED::FAMILY_ptr famille =
- SALOME_MED::FAMILY::_narrow(famservant->
- POA_SALOME_MED::FAMILY::_this());
+#ifdef WNT
+ SALOME_MED::FAMILY_ptr famille = SALOME_MED::FAMILY::_nil();
+ POA_SALOME_MED::FAMILY* servantbase = dynamic_cast<POA_SALOME_MED::FAMILY*>(famservant);
+ if ( servantbase )
+ famille = SALOME_MED::FAMILY::_narrow( servantbase->_this() );
+#else
+ SALOME_MED::FAMILY_ptr famille =
+ SALOME_MED::FAMILY::_narrow( famservant->POA_SALOME_MED::FAMILY::_this() );
+#endif
_families.push_back(famille);
}
}