Update to match the new implementation of SMDS

This commit is contained in:
jrt 2003-09-04 10:41:22 +00:00
parent fb91f8b907
commit dd138f193f
8 changed files with 1479 additions and 1573 deletions

View File

@ -571,7 +571,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
int meshId = myMesh->GetId();
SMESH_Mesh_i* meshServant = myStudyContext->mapMesh_i[meshId];
::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
Handle(SMESHDS_Mesh) mySMESHDSMesh = myLocMesh.GetMeshDS();
SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS();
SCRUTE(mySMESHDSMesh->NbNodes());
if (mySMESHDSMesh->NbNodes()>0) {//checks if the mesh is not empty
@ -1136,7 +1136,7 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
int meshId = myNewMesh->GetId();
SMESH_Mesh_i* meshServant = myStudyContext->mapMesh_i[meshId];
::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
Handle(SMESHDS_Mesh) mySMESHDSMesh = myLocMesh.GetMeshDS();
SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS();
DriverMED_R_SMESHDS_Mesh* myReader = new DriverMED_R_SMESHDS_Mesh;

File diff suppressed because it is too large Load Diff

View File

@ -37,147 +37,131 @@
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_MeshFacesIterator.hxx"
#include "SMDS_MeshEdgesIterator.hxx"
#include "SMDS_MeshNodesIterator.hxx"
#include "SMDS_MeshVolumesIterator.hxx"
#define MED_NBR_GEOMETRIE_MAILLE 15
#define MED_NBR_TYPE 5
class SMESH_Mesh_i;
class SMESH_MEDMesh_i:
public POA_SALOME_MED::MESH,
public PortableServer::RefCountServantBase
public POA_SALOME_MED::MESH, public PortableServer::RefCountServantBase
{
public :
public: private: protected:
// C++ object containing values
::SMESH_Mesh_i * _mesh_i;
SMESHDS_Mesh *_meshDS;
private :
string _meshId;
bool _compte;
bool _creeFamily;
int _indexElts;
int _indexEnts;
int _famIdent;
protected:
// C++ object containing values
::SMESH_Mesh_i* _mesh_i;
Handle (SMESHDS_Mesh) _meshDS;
map < SALOME_MED::medGeometryElement, int >_mapIndToSeqElts;
Engines::long_array_var _seq_elemId[MED_NBR_GEOMETRIE_MAILLE];
string _meshId;
bool _compte;
bool _creeFamily;
int _indexElts;
int _indexEnts;
int _famIdent;
map < SALOME_MED::medEntityMesh, int >_mapNbTypes;
map < SALOME_MED::medEntityMesh, int >_mapIndToVectTypes;
vector < SALOME_MED::medGeometryElement >
_TypesId[MED_NBR_GEOMETRIE_MAILLE];
map <SALOME_MED::medGeometryElement,int> _mapIndToSeqElts;
Engines::long_array_var _seq_elemId[MED_NBR_GEOMETRIE_MAILLE];
vector < SALOME_MED::FAMILY_ptr > _families;
public:
map <SALOME_MED::medEntityMesh,int> _mapNbTypes;
map <SALOME_MED::medEntityMesh,int> _mapIndToVectTypes;
vector<SALOME_MED::medGeometryElement> _TypesId[MED_NBR_GEOMETRIE_MAILLE];
// Constructors and associated internal methods
SMESH_MEDMesh_i();
SMESH_MEDMesh_i(SMESH_Mesh_i * m);
~SMESH_MEDMesh_i();
vector<SALOME_MED::FAMILY_ptr> _families;
public:
// IDL Methods
char *getName() throw(SALOME::SALOME_Exception);
CORBA::Long getSpaceDimension() throw(SALOME::SALOME_Exception);
CORBA::Long getMeshDimension() throw(SALOME::SALOME_Exception);
// Constructors and associated internal methods
SMESH_MEDMesh_i();
SMESH_MEDMesh_i(SMESH_Mesh_i* m);
~SMESH_MEDMesh_i();
char *getCoordinateSystem() throw(SALOME::SALOME_Exception);
Engines::double_array * getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
throw(SALOME::SALOME_Exception);
Engines::string_array * getCoordinatesNames()
throw(SALOME::SALOME_Exception);
Engines::string_array * getCoordinatesUnits()
throw(SALOME::SALOME_Exception);
CORBA::Long getNumberOfNodes() throw(SALOME::SALOME_Exception);
// IDL Methods
char * getName() throw (SALOME::SALOME_Exception);
CORBA::Long getSpaceDimension() throw (SALOME::SALOME_Exception);
CORBA::Long getMeshDimension() throw (SALOME::SALOME_Exception);
CORBA::Long getNumberOfTypes(SALOME_MED::medEntityMesh entity)
throw(SALOME::SALOME_Exception);
SALOME_MED::medGeometryElement_array *
getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME::
SALOME_Exception);
char * getCoordinateSystem()
throw (SALOME::SALOME_Exception);
Engines::double_array* getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
throw (SALOME::SALOME_Exception);
Engines::string_array* getCoordinatesNames()
throw (SALOME::SALOME_Exception);
Engines::string_array* getCoordinatesUnits()
throw (SALOME::SALOME_Exception);
CORBA::Long getNumberOfNodes()
throw (SALOME::SALOME_Exception);
CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity,
SALOME_MED::medGeometryElement geomElement)
throw(SALOME::SALOME_Exception);
Engines::long_array * getConnectivity(SALOME_MED::medModeSwitch typeSwitch,
SALOME_MED::medConnectivity mode,
SALOME_MED::medEntityMesh entity,
SALOME_MED::medGeometryElement geomElement)
throw(SALOME::SALOME_Exception);
Engines::long_array * getConnectivityIndex(SALOME_MED::medConnectivity mode,
SALOME_MED::medEntityMesh entity) throw(SALOME::SALOME_Exception);
CORBA::Long getNumberOfTypes (SALOME_MED::medEntityMesh entity)
throw (SALOME::SALOME_Exception);
SALOME_MED::medGeometryElement_array* getTypes(SALOME_MED::medEntityMesh entity)
throw (SALOME::SALOME_Exception);
CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode,
SALOME_MED::medEntityMesh entity,
SALOME_MED::medGeometryElement type,
const Engines::long_array & connectivity)
throw(SALOME::SALOME_Exception);
CORBA::Long getNumberOfElements (SALOME_MED::medEntityMesh entity,
SALOME_MED::medGeometryElement geomElement)
throw (SALOME::SALOME_Exception);
Engines::long_array* getConnectivity (SALOME_MED::medModeSwitch typeSwitch,
SALOME_MED::medConnectivity mode,
SALOME_MED::medEntityMesh entity,
SALOME_MED::medGeometryElement geomElement)
throw (SALOME::SALOME_Exception);
Engines::long_array* getConnectivityIndex(SALOME_MED::medConnectivity mode,
SALOME_MED::medEntityMesh entity)
throw (SALOME::SALOME_Exception);
Engines::long_array *
getReverseConnectivity(SALOME_MED::medConnectivity mode) throw(SALOME::
SALOME_Exception);
Engines::long_array *
getReverseConnectivityIndex(SALOME_MED::
medConnectivity mode) throw(SALOME::SALOME_Exception);
CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode,
SALOME_MED::medEntityMesh entity,
SALOME_MED::medGeometryElement type,
const Engines::long_array & connectivity)
throw (SALOME::SALOME_Exception);
// Family and Group
CORBA::Long getNumberOfFamilies(SALOME_MED::medEntityMesh entity)
throw(SALOME::SALOME_Exception);
CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity)
throw(SALOME::SALOME_Exception);
SALOME_MED::Family_array * getFamilies(SALOME_MED::medEntityMesh entity)
throw(SALOME::SALOME_Exception);
SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity,
CORBA::Long i) throw(SALOME::SALOME_Exception);
SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity)
throw(SALOME::SALOME_Exception);
SALOME_MED::GROUP_ptr getGroup(SALOME_MED::medEntityMesh entity,
CORBA::Long i) throw(SALOME::SALOME_Exception);
//
SALOME_MED::FIELD_ptr getVolume(SALOME_MED::SUPPORT_ptr mySupport)
throw(SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getArea(SALOME_MED::SUPPORT_ptr mySupport)
throw(SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getLength(SALOME_MED::SUPPORT_ptr mySupport)
throw(SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getNormal(SALOME_MED::SUPPORT_ptr mySupport)
throw(SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getBarycenter(SALOME_MED::SUPPORT_ptr mySupport)
throw(SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getNeighbourhood(SALOME_MED::SUPPORT_ptr mySupport)
throw(SALOME::SALOME_Exception);
Engines::long_array* getReverseConnectivity(SALOME_MED::medConnectivity mode)
// Others
void addInStudy(SALOMEDS::Study_ptr myStudy,
SALOME_MED::MESH_ptr myIor) throw(SALOME::SALOME_Exception);
CORBA::Long addDriver(SALOME_MED::medDriverTypes driverType,
const char *fileName, const char *meshName)
throw(SALOME::SALOME_Exception);
void rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception);
void read(CORBA::Long i) throw(SALOME::SALOME_Exception);
void write(CORBA::Long i, const char *driverMeshName)
throw(SALOME::SALOME_Exception);
throw (SALOME::SALOME_Exception);
Engines::long_array* getReverseConnectivityIndex(SALOME_MED::medConnectivity mode)
throw (SALOME::SALOME_Exception);
// Cuisine interne
CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception);
// Family and Group
CORBA::Long getNumberOfFamilies (SALOME_MED::medEntityMesh entity)
throw (SALOME::SALOME_Exception);
CORBA::Long getNumberOfGroups (SALOME_MED::medEntityMesh entity)
throw (SALOME::SALOME_Exception);
SALOME_MED::Family_array* getFamilies (SALOME_MED::medEntityMesh entity)
throw (SALOME::SALOME_Exception);
SALOME_MED::FAMILY_ptr getFamily (SALOME_MED::medEntityMesh entity,
CORBA::Long i)
throw (SALOME::SALOME_Exception);
SALOME_MED::Group_array* getGroups (SALOME_MED::medEntityMesh entity)
throw (SALOME::SALOME_Exception);
SALOME_MED::GROUP_ptr getGroup (SALOME_MED::medEntityMesh entity,
CORBA::Long i)
throw (SALOME::SALOME_Exception);
//
SALOME_MED::FIELD_ptr getVolume (SALOME_MED::SUPPORT_ptr mySupport)
throw (SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getArea (SALOME_MED::SUPPORT_ptr mySupport)
throw (SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getLength (SALOME_MED::SUPPORT_ptr mySupport)
throw (SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getNormal (SALOME_MED::SUPPORT_ptr mySupport)
throw (SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getBarycenter (SALOME_MED::SUPPORT_ptr mySupport)
throw (SALOME::SALOME_Exception);
SALOME_MED::FIELD_ptr getNeighbourhood (SALOME_MED::SUPPORT_ptr mySupport)
throw (SALOME::SALOME_Exception);
// Others
void addInStudy (SALOMEDS::Study_ptr myStudy,
SALOME_MED::MESH_ptr myIor)
throw (SALOME::SALOME_Exception);
CORBA::Long addDriver (SALOME_MED::medDriverTypes driverType,
const char* fileName, const char* meshName)
throw (SALOME::SALOME_Exception);
void rmDriver (CORBA::Long i)
throw (SALOME::SALOME_Exception);
void read (CORBA::Long i)
throw (SALOME::SALOME_Exception);
void write (CORBA::Long i, const char* driverMeshName)
throw (SALOME::SALOME_Exception);
// Cuisine interne
CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception);
//
void calculeNbElts() throw (SALOME::SALOME_Exception);
void createFamilies() throw (SALOME::SALOME_Exception);
//
void calculeNbElts() throw(SALOME::SALOME_Exception);
void createFamilies() throw(SALOME::SALOME_Exception);
};
#endif /* _MED_MESH_I_HXX_ */

View File

@ -31,7 +31,6 @@ using namespace std;
#include <TopoDS_Iterator.hxx>
#include "SMESHDS_Mesh.hxx"
#include "SMDS_MapIteratorOfExtendedMap.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_Mesh_i.hxx"
@ -44,8 +43,8 @@ using namespace std;
//=============================================================================
SMESH_MEDSupport_i::SMESH_MEDSupport_i()
{
BEGIN_OF("Default Constructor SMESH_MEDSupport_i");
END_OF("Default Constructor SMESH_MEDSupport_i");
BEGIN_OF("Default Constructor SMESH_MEDSupport_i");
END_OF("Default Constructor SMESH_MEDSupport_i");
}
//=============================================================================
@ -53,70 +52,68 @@ SMESH_MEDSupport_i::SMESH_MEDSupport_i()
* Constructor
*/
//=============================================================================
SMESH_MEDSupport_i::SMESH_MEDSupport_i(SMESH_subMesh_i* sm,
string name,
string description,
SALOME_MED::medEntityMesh entity) :
_subMesh_i(sm),
_name(name),
_description(description),
_entity(entity),
_seqNumber(false),
_seqLength(0)
SMESH_MEDSupport_i::SMESH_MEDSupport_i(SMESH_subMesh_i * sm, string name,
string description, SALOME_MED::medEntityMesh entity)
:_subMesh_i(sm), _name(name), _description(description), _entity(entity),
_seqNumber(false), _seqLength(0)
{
BEGIN_OF("Constructor SMESH_MEDSupport_i");
BEGIN_OF("Constructor SMESH_MEDSupport_i");
_meshDS = _subMesh_i->_mesh_i->GetImpl().GetMeshDS();
_meshDS = _subMesh_i->_mesh_i->GetImpl().GetMeshDS();
int subMeshId = _subMesh_i->GetId();
int subMeshId = _subMesh_i->GetId();
MESSAGE ( " subMeshId " << subMeshId )
if (_subMesh_i->_mesh_i->_mapSubMesh.find(subMeshId) != _subMesh_i->_mesh_i->_mapSubMesh.end()) {
::SMESH_subMesh* subMesh = _subMesh_i->_mesh_i->_mapSubMesh[subMeshId];
MESSAGE(" subMeshId " << subMeshId)
_subMeshDS = subMesh->GetSubMeshDS();
}
if (_subMesh_i->_mesh_i->_mapSubMesh.find(subMeshId) !=
_subMesh_i->_mesh_i->_mapSubMesh.end())
{
::SMESH_subMesh * subMesh = _subMesh_i->_mesh_i->_mapSubMesh[subMeshId];
_subMeshDS = subMesh->GetSubMeshDS();
}
if ( _entity == SALOME_MED::MED_NODE)
{
_numberOfGeometricType = 1 ;
_geometricType = new SALOME_MED::medGeometryElement[1] ;
_geometricType[0] = SALOME_MED::MED_NONE ;
}
else
{
MESSAGE("Pas implemente dans cette version");
THROW_SALOME_CORBA_EXCEPTION("Seules les familles de noeuds sont implementees ", \
SALOME::BAD_PARAM);
}
if (_entity == SALOME_MED::MED_NODE)
{
_numberOfGeometricType = 1;
_geometricType = new SALOME_MED::medGeometryElement[1];
_geometricType[0] = SALOME_MED::MED_NONE;
}
else
{
MESSAGE("Pas implemente dans cette version");
THROW_SALOME_CORBA_EXCEPTION
("Seules les familles de noeuds sont implementees ",
SALOME::BAD_PARAM);
}
END_OF("Constructor SMESH_MEDSupport_i");
END_OF("Constructor SMESH_MEDSupport_i");
}
//=============================================================================
/*!
* Constructor
*/
//=============================================================================
SMESH_MEDSupport_i::SMESH_MEDSupport_i(const SMESH_MEDSupport_i &s) :
_subMesh_i(s._subMesh_i),
_name(s._name),
_description(s._description),
_entity(s._entity),
_seqNumber(false),
_seqLength(0)
SMESH_MEDSupport_i::
SMESH_MEDSupport_i(const SMESH_MEDSupport_i & s):_subMesh_i(s._subMesh_i),
_name(s._name), _description(s._description), _entity(s._entity),
_seqNumber(false), _seqLength(0)
{
BEGIN_OF("Constructor SMESH_MEDSupport_i");
BEGIN_OF("Constructor SMESH_MEDSupport_i");
_meshDS = _subMesh_i->_mesh_i->GetImpl().GetMeshDS();
_meshDS = _subMesh_i->_mesh_i->GetImpl().GetMeshDS();
int subMeshId = _subMesh_i->GetId();
if (_subMesh_i->_mesh_i->_mapSubMesh.find(subMeshId) != _subMesh_i->_mesh_i->_mapSubMesh.end()) {
::SMESH_subMesh* subMesh = _subMesh_i->_mesh_i->_mapSubMesh[subMeshId];
_subMeshDS = subMesh->GetSubMeshDS();
}
int subMeshId = _subMesh_i->GetId();
if (_subMesh_i->_mesh_i->_mapSubMesh.find(subMeshId) !=
_subMesh_i->_mesh_i->_mapSubMesh.end())
{
::SMESH_subMesh * subMesh = _subMesh_i->_mesh_i->_mapSubMesh[subMeshId];
_subMeshDS = subMesh->GetSubMeshDS();
}
END_OF("Constructor SMESH_MEDSupport_i");
END_OF("Constructor SMESH_MEDSupport_i");
}
//=============================================================================
/*!
* Destructor
@ -126,21 +123,20 @@ SMESH_MEDSupport_i::SMESH_MEDSupport_i(const SMESH_MEDSupport_i &s) :
SMESH_MEDSupport_i::~SMESH_MEDSupport_i()
{
}
//=============================================================================
/*!
* CORBA: Accessor for Corba Index
*/
//=============================================================================
CORBA::Long SMESH_MEDSupport_i::getCorbaIndex()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_MEDSupport_i::getCorbaIndex()throw(SALOME::SALOME_Exception)
{
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
MESSAGE("Not implemented for SMESH_i");
THROW_SALOME_CORBA_EXCEPTION("Not Implemented ", \
SALOME::BAD_PARAM);
if (_subMeshDS == NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
MESSAGE("Not implemented for SMESH_i");
THROW_SALOME_CORBA_EXCEPTION("Not Implemented ", SALOME::BAD_PARAM);
}
@ -150,13 +146,12 @@ CORBA::Long SMESH_MEDSupport_i::getCorbaIndex()
*/
//=============================================================================
char * SMESH_MEDSupport_i::getName()
throw (SALOME::SALOME_Exception)
char *SMESH_MEDSupport_i::getName() throw(SALOME::SALOME_Exception)
{
if (_subMeshDS.IsNull())
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
return CORBA::string_dup(_name.c_str());
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
return CORBA::string_dup(_name.c_str());
}
@ -166,13 +161,12 @@ char * SMESH_MEDSupport_i::getName()
*/
//=============================================================================
char* SMESH_MEDSupport_i::getDescription()
throw (SALOME::SALOME_Exception)
char *SMESH_MEDSupport_i::getDescription() throw(SALOME::SALOME_Exception)
{
if (_subMeshDS.IsNull())
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
return CORBA::string_dup(_description.c_str());
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
return CORBA::string_dup(_description.c_str());
}
//=============================================================================
@ -181,14 +175,14 @@ char* SMESH_MEDSupport_i::getDescription()
*/
//=============================================================================
SALOME_MED::MESH_ptr SMESH_MEDSupport_i::getMesh()
throw (SALOME::SALOME_Exception)
SALOME_MED::MESH_ptr SMESH_MEDSupport_i::getMesh()throw(SALOME::
SALOME_Exception)
{
if (_subMeshDS.IsNull())
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
return _subMesh_i->_mesh_i->GetMEDMesh();
return _subMesh_i->_mesh_i->GetMEDMesh();
}
//=============================================================================
@ -197,48 +191,37 @@ SALOME_MED::MESH_ptr SMESH_MEDSupport_i::getMesh()
*/
//=============================================================================
CORBA::Boolean SMESH_MEDSupport_i::isOnAllElements()
throw (SALOME::SALOME_Exception)
CORBA::Boolean SMESH_MEDSupport_i::isOnAllElements()throw(SALOME::
SALOME_Exception)
{
if (_subMeshDS.IsNull())
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
if (_seqNumber == false)
{
if (_entity != SALOME_MED::MED_NONE)
{
int i = 0;
const SMDS_MapOfMeshElement& myNodesMap = _subMeshDS->GetNodes();
for (SMDS_MapIteratorOfExtendedMap it(myNodesMap); it.More(); it.Next())
{
const Handle(SMDS_MeshElement)& elem = myNodesMap.FindID(it.Key()->GetID());
const Handle(SMDS_MeshNode)& node = _meshDS->GetNode(1,elem);
i ++;
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
if (_seqNumber == false)
{
if (_entity != SALOME_MED::MED_NONE)
{
_seqLength = _subMeshDS->NbNodes();
_seqNumber = true;
}
else
{
MESSAGE("Only Node Families are implemented ");
THROW_SALOME_CORBA_EXCEPTION("Not implemented Yet ",
SALOME::BAD_PARAM);
}
}
_seqLength=i;
_seqNumber=true;
}
else
{
MESSAGE("Only Node Families are implemented ");
THROW_SALOME_CORBA_EXCEPTION("Not implemented Yet ", \
SALOME::BAD_PARAM);
}
}
try
{
if (_seqLength == _meshDS->NbNodes())
_isOnAllElements=true;
else
_isOnAllElements=false;
}
catch(...)
{
MESSAGE("unable to acces related Mesh");
THROW_SALOME_CORBA_EXCEPTION("No associated Mesh", \
SALOME::INTERNAL_ERROR);
};
return _isOnAllElements;
try
{
_isOnAllElements = (_seqLength == _meshDS->NbNodes());
}
catch(...)
{
MESSAGE("unable to acces related Mesh");
THROW_SALOME_CORBA_EXCEPTION("No associated Mesh",
SALOME::INTERNAL_ERROR);
};
return _isOnAllElements;
}
//=============================================================================
@ -247,13 +230,13 @@ CORBA::Boolean SMESH_MEDSupport_i::isOnAllElements()
*/
//=============================================================================
SALOME_MED::medEntityMesh SMESH_MEDSupport_i::getEntity()
throw (SALOME::SALOME_Exception)
SALOME_MED::medEntityMesh SMESH_MEDSupport_i::getEntity()throw(SALOME::
SALOME_Exception)
{
if (_subMeshDS.IsNull())
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
return _entity;
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
return _entity;
}
//=============================================================================
@ -262,29 +245,30 @@ SALOME_MED::medEntityMesh SMESH_MEDSupport_i::getEntity()
*/
//=============================================================================
SALOME_MED::medGeometryElement_array * SMESH_MEDSupport_i::getTypes()
throw (SALOME::SALOME_Exception)
SALOME_MED::medGeometryElement_array *
SMESH_MEDSupport_i::getTypes()throw(SALOME::SALOME_Exception)
{
if (_subMeshDS.IsNull())
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
SALOME_MED::medGeometryElement_array_var myseq = new SALOME_MED::medGeometryElement_array;
try
{
int mySeqLength = _numberOfGeometricType;
myseq->length(mySeqLength);
for (int i=0;i<mySeqLength;i++)
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
SALOME_MED::medGeometryElement_array_var myseq =
new SALOME_MED::medGeometryElement_array;
try
{
myseq[i]=_geometricType[i];
int mySeqLength = _numberOfGeometricType;
myseq->length(mySeqLength);
for (int i = 0; i < mySeqLength; i++)
{
myseq[i] = _geometricType[i];
}
}
}
catch(...)
{
MESSAGE("Exception lors de la recherche des differents types");
THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support Types", \
SALOME::INTERNAL_ERROR);
}
return myseq._retn();
catch(...)
{
MESSAGE("Exception lors de la recherche des differents types");
THROW_SALOME_CORBA_EXCEPTION("Unable to acces Support Types",
SALOME::INTERNAL_ERROR);
}
return myseq._retn();
}
//=============================================================================
@ -293,13 +277,13 @@ SALOME_MED::medGeometryElement_array * SMESH_MEDSupport_i::getTypes()
* existing in the support
*/
//=============================================================================
CORBA::Long SMESH_MEDSupport_i::getNumberOfElements(SALOME_MED::medGeometryElement geomElement)
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_MEDSupport_i::getNumberOfElements(SALOME_MED::
medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
{
if (_subMeshDS.IsNull())
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
return _numberOfGeometricType;
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
return _numberOfGeometricType;
}
@ -309,39 +293,38 @@ CORBA::Long SMESH_MEDSupport_i::getNumberOfElements(SALOME_MED::medGeometryEleme
*/
//=============================================================================
Engines::long_array * SMESH_MEDSupport_i::getNumber(SALOME_MED::medGeometryElement geomElement)
throw (SALOME::SALOME_Exception)
Engines::long_array * SMESH_MEDSupport_i::getNumber(
SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
{
if (_subMeshDS.IsNull())
THROW_SALOME_CORBA_EXCEPTION("No associated Support", \
SALOME::INTERNAL_ERROR);
if (_subMeshDS==NULL)
THROW_SALOME_CORBA_EXCEPTION("No associated Support",
SALOME::INTERNAL_ERROR);
// A changer s'il ne s agit plus seulement de famille de noeuds
if (geomElement != SALOME_MED::MED_NONE)
THROW_SALOME_CORBA_EXCEPTION("Not implemented", SALOME::BAD_PARAM);
// A changer s'il ne s agit plus seulement de famille de noeuds
if (geomElement != SALOME_MED::MED_NONE)
THROW_SALOME_CORBA_EXCEPTION("Not implemented", \
SALOME::BAD_PARAM);
Engines::long_array_var myseq = new Engines::long_array;
Engines::long_array_var myseq= new Engines::long_array;
int i = 0;
myseq->length(_subMeshDS->NbNodes());
const set<const SMDS_MeshNode*> & myNodesMap = _subMeshDS->GetNodes();
set<const SMDS_MeshNode*>::const_iterator it=myNodesMap.begin();
int i =0;
const SMDS_MapOfMeshElement& myNodesMap = _subMeshDS->GetNodes();
for (SMDS_MapIteratorOfExtendedMap it(myNodesMap); it.More(); it.Next())
{
const Handle(SMDS_MeshElement)& elem = myNodesMap.FindID(it.Key()->GetID());
const Handle(SMDS_MeshNode)& node = _meshDS->GetNode(1,elem);
myseq->length(i+1);
myseq[i]=node->GetID();
SCRUTE(node->GetID());
SCRUTE(myseq[i]);
i++;
};
for (; it!=myNodesMap.end(); it++)
{
myseq[i] = (*it)->GetID();
SCRUTE((*it)->GetID());
SCRUTE(myseq[i]);
i++;
};
SCRUTE(myseq->length());
MESSAGE("yyyyy");
return myseq._retn();
SCRUTE(myseq->length());
MESSAGE("End of SMESH_MEDSupport_i::getNumber");
return myseq._retn();
}
//=============================================================================
/*!
* CORBA: Global Nodes Index (optionnaly designed by the user)
@ -349,13 +332,12 @@ MESSAGE("yyyyy");
*/
//=============================================================================
Engines::long_array * SMESH_MEDSupport_i::getNumberIndex()
throw (SALOME::SALOME_Exception)
Engines::long_array *
SMESH_MEDSupport_i::getNumberIndex()throw(SALOME::SALOME_Exception)
{
MESSAGE("Not implemented for SMESH_i");
THROW_SALOME_CORBA_EXCEPTION("Not Implemented", \
SALOME::BAD_PARAM);
return 0;
MESSAGE("Not implemented for SMESH_i");
THROW_SALOME_CORBA_EXCEPTION("Not Implemented", SALOME::BAD_PARAM);
return 0;
}
//=============================================================================
@ -364,10 +346,9 @@ Engines::long_array * SMESH_MEDSupport_i::getNumberIndex()
*/
//=============================================================================
CORBA::Long SMESH_MEDSupport_i::getNumberOfGaussPoints(SALOME_MED::medGeometryElement geomElement)
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_MEDSupport_i::getNumberOfGaussPoints(SALOME_MED::
medGeometryElement geomElement) throw(SALOME::SALOME_Exception)
{
MESSAGE("Not implemented for SMESH_i");
return 0;
MESSAGE("Not implemented for SMESH_i");
return 0;
}

View File

@ -1,28 +1,28 @@
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// You should have received a copy of the GNU Lesser General Public
// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : SMESH_MEDSupport_i.hxx
// Module : SMESH
// File : SMESH_MEDSupport_i.hxx
// Module : SMESH
#ifndef _MED_SMESH_MEDSUPPORT_I_HXX_
#define _MED_SMESH_MEDSUPPORT_I_HXX_
@ -41,61 +41,51 @@
class SMESH_subMesh_i;
class SMESH_MEDSupport_i:
public POA_SALOME_MED::SUPPORT,
public PortableServer::RefCountServantBase
public POA_SALOME_MED::SUPPORT, public PortableServer::RefCountServantBase
{
public:
protected :
SMESH_MEDSupport_i();
~SMESH_MEDSupport_i();
// Constructors and associated internal methods
SMESH_MEDSupport_i(SMESH_subMesh_i * sm,
string name, string description, SALOME_MED::medEntityMesh entity);
SMESH_MEDSupport_i(const SMESH_MEDSupport_i & s);
// IDL Methods
char *getName() throw(SALOME::SALOME_Exception);
char *getDescription() throw(SALOME::SALOME_Exception);
SALOME_MED::MESH_ptr getMesh() throw(SALOME::SALOME_Exception);
CORBA::Boolean isOnAllElements() throw(SALOME::SALOME_Exception);
SALOME_MED::medEntityMesh getEntity() throw(SALOME::SALOME_Exception);
CORBA::Long getNumberOfElements(SALOME_MED::medGeometryElement geomElement)
throw(SALOME::SALOME_Exception);
Engines::long_array * getNumber(SALOME_MED::medGeometryElement geomElement)
throw(SALOME::SALOME_Exception);
Engines::long_array * getNumberIndex() throw(SALOME::SALOME_Exception);
CORBA::Long getNumberOfGaussPoints(SALOME_MED::
medGeometryElement geomElement) throw(SALOME::SALOME_Exception);
SALOME_MED::medGeometryElement_array *
getTypes() throw(SALOME::SALOME_Exception);
CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception);
void createSeq() throw(SALOME::SALOME_Exception);
public :
public: //public field
const SMESHDS_SubMesh * _subMeshDS;
::SMESH_subMesh_i * _subMesh_i;
Handle_SMESHDS_SubMesh _subMeshDS;
::SMESH_subMesh_i* _subMesh_i;
Handle_SMESHDS_Mesh _meshDS;
string _name;
string _description;
bool _isOnAllElements;
bool _seqNumber;
int _seqLength;
SALOME_MED::medEntityMesh _entity;
SALOME_MED::medGeometryElement * _geometricType;
int _numberOfGeometricType;
public:
// Constructors and associated internal methods
SMESH_MEDSupport_i(SMESH_subMesh_i* sm,
string name,
string description,
SALOME_MED::medEntityMesh entity);
SMESH_MEDSupport_i(const SMESH_MEDSupport_i & s);
// IDL Methods
char * getName() throw (SALOME::SALOME_Exception);
char * getDescription() throw (SALOME::SALOME_Exception);
SALOME_MED::MESH_ptr getMesh() throw (SALOME::SALOME_Exception);
CORBA::Boolean isOnAllElements() throw (SALOME::SALOME_Exception);
SALOME_MED::medEntityMesh getEntity() throw (SALOME::SALOME_Exception);
CORBA::Long getNumberOfElements(SALOME_MED::medGeometryElement geomElement)
throw (SALOME::SALOME_Exception);
Engines::long_array* getNumber(SALOME_MED::medGeometryElement geomElement)
throw (SALOME::SALOME_Exception);
Engines::long_array* getNumberIndex()
throw (SALOME::SALOME_Exception);
CORBA::Long getNumberOfGaussPoints(SALOME_MED::medGeometryElement geomElement)
throw (SALOME::SALOME_Exception);
SALOME_MED::medGeometryElement_array* getTypes()
throw (SALOME::SALOME_Exception);
CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception);
void createSeq() throw (SALOME::SALOME_Exception);
SMESHDS_Mesh * _meshDS;
string _name;
string _description;
bool _isOnAllElements;
bool _seqNumber;
int _seqLength;
SALOME_MED::medEntityMesh _entity;
SALOME_MED::medGeometryElement * _geometricType;
int _numberOfGeometricType;
protected:
SMESH_MEDSupport_i();
~SMESH_MEDSupport_i();
};
#endif /* _MED_MEDSUPPORT_I_HXX_ */

View File

@ -29,9 +29,6 @@
using namespace std;
#include "SMESH_MeshEditor_i.hxx"
#include "SMDS_MeshEdgesIterator.hxx"
#include "SMDS_MeshFacesIterator.hxx"
#include "SMDS_MeshVolumesIterator.hxx"
#include "SMDS_MeshEdge.hxx"
#include "SMDS_MeshFace.hxx"
#include "SMDS_MeshVolume.hxx"
@ -41,16 +38,15 @@ using namespace std;
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
//=============================================================================
/*!
*
*/
//=============================================================================
SMESH_MeshEditor_i::SMESH_MeshEditor_i(const Handle(SMESHDS_Mesh)& theMesh) {
_myMeshDS = theMesh;
SMESH_MeshEditor_i::SMESH_MeshEditor_i(SMESHDS_Mesh* theMesh)
{
_myMeshDS = theMesh;
};
//=============================================================================
@ -59,13 +55,16 @@ SMESH_MeshEditor_i::SMESH_MeshEditor_i(const Handle(SMESHDS_Mesh)& theMesh) {
*/
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array& IDsOfElements) {
for (int i = 0 ; i< IDsOfElements.length(); i++) {
CORBA::Long index = IDsOfElements[i];
_myMeshDS->RemoveElement(index);
MESSAGE ( "Element "<< index << " was removed" )
}
return true;
CORBA::Boolean SMESH_MeshEditor_i::RemoveElements(const SMESH::
long_array & IDsOfElements)
{
for (int i = 0; i < IDsOfElements.length(); i++)
{
CORBA::Long index = IDsOfElements[i];
_myMeshDS->RemoveElement(index);
MESSAGE("Element " << index << " was removed")
}
return true;
};
//=============================================================================
@ -74,66 +73,23 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array& IDsOf
*/
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array& IDsOfNodes) {
// Here we try to collect all 1D, 2D and 3D elements which contain at least one
// of <IDsOfNodes> in order to remove such elements.
// This seems correct since e.g a triangle without 1 vertex looks nonsense.
TColStd_MapOfInteger elemsToRemove;
for (int i = 0 ; i< IDsOfNodes.length(); i++) {
CORBA::Long ID = IDsOfNodes[i];
SMDS_MeshEdgesIterator edgeIt(_myMeshDS);
for (; edgeIt.More(); edgeIt.Next()) {
Handle(SMDS_MeshEdge) anEdge = Handle(SMDS_MeshEdge)::DownCast(edgeIt.Value());
for (Standard_Integer i = 0; i < anEdge->NbNodes(); i++) {
if (anEdge->GetConnection(i) == ID) {
Standard_Integer elemID = anEdge->GetID();
if (!elemsToRemove.Contains(elemID)) elemsToRemove.Add(elemID);
CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::
long_array & IDsOfNodes)
{
// It's nodes' turn to die
for (int i = 0; i < IDsOfNodes.length(); i++)
{
const SMDS_MeshNode * node=_myMeshDS->FindNode(IDsOfNodes[i]);
if(node==NULL)
{
MESSAGE("SMESH_MeshEditor_i::RemoveNodes: Node "<<IDsOfNodes[i]
<<" not found");
continue;
}
_myMeshDS->RemoveNode(IDsOfNodes[i]);
MESSAGE("Node " << index << " was removed")
}
}
}
SMDS_MeshFacesIterator faceIt(_myMeshDS);
for (; faceIt.More(); faceIt.Next()) {
Handle(SMDS_MeshFace) aFace = Handle(SMDS_MeshFace)::DownCast(faceIt.Value());
for (Standard_Integer i = 0; i < aFace->NbNodes(); i++) {
if (aFace->GetConnection(i) == ID) {
Standard_Integer elemID = aFace->GetID();
if (!elemsToRemove.Contains(elemID)) elemsToRemove.Add(elemID);
}
}
}
SMDS_MeshVolumesIterator volIt(_myMeshDS);
for (; volIt.More(); volIt.Next()) {
Handle(SMDS_MeshVolume) aVol = Handle(SMDS_MeshVolume)::DownCast(volIt.Value());
for (Standard_Integer i = 0; i < aVol->NbNodes(); i++) {
if (aVol->GetConnection(i) == ID) {
Standard_Integer elemID = aVol->GetID();
if (!elemsToRemove.Contains(elemID)) elemsToRemove.Add(elemID);
}
}
}
}
// Now remove them!
TColStd_MapIteratorOfMapOfInteger it(elemsToRemove);
for (; it.More(); it.Next()) {
Standard_Integer elemID = it.Key();
_myMeshDS->RemoveElement(elemID);
MESSAGE("RemoveNodes(): element removed: " << elemID)
}
// It's nodes' turn to die
for (int i = 0 ; i< IDsOfNodes.length(); i++) {
CORBA::Long index = IDsOfNodes[i];
_myMeshDS->RemoveNode(index);
MESSAGE ( "Node "<< index << " was removed" )
}
return true;
return true;
};
//=============================================================================
@ -142,14 +98,16 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array& IDsOfNod
*/
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::AddEdge(const SMESH::long_array& IDsOfNodes) {
int NbNodes = IDsOfNodes.length();
if ( NbNodes == 2 ) {
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
int idTri = _myMeshDS->AddEdge(index1,index2);
}
return true;
CORBA::Boolean SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes)
{
int NbNodes = IDsOfNodes.length();
if (NbNodes == 2)
{
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
_myMeshDS->AddEdge(index1, index2);
}
return true;
}
//=============================================================================
@ -159,12 +117,11 @@ CORBA::Boolean SMESH_MeshEditor_i::AddEdge(const SMESH::long_array& IDsOfNodes)
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::AddNode(CORBA::Double x,
CORBA::Double y,
CORBA::Double z) {
MESSAGE( " AddNode " << x << " , " << y << " , " << z )
int idNode = _myMeshDS->AddNode(x,y,z);
MESSAGE( " idNode " << idNode )
return true;
CORBA::Double y, CORBA::Double z)
{
MESSAGE(" AddNode " << x << " , " << y << " , " << z)
int idNode = _myMeshDS->AddNode(x, y, z)->GetID();
MESSAGE(" idNode " << idNode) return true;
}
//=============================================================================
@ -173,21 +130,25 @@ CORBA::Boolean SMESH_MeshEditor_i::AddNode(CORBA::Double x,
*/
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::AddFace(const SMESH::long_array& IDsOfNodes) {
int NbNodes = IDsOfNodes.length();
if ( NbNodes == 3 ) {
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
int idTri = _myMeshDS->AddFace(index1,index2,index3);
} else if ( NbNodes == 4 ) {
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
int idTri = _myMeshDS->AddFace(index1,index2,index3,index4);
}
return true;
CORBA::Boolean SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes)
{
int NbNodes = IDsOfNodes.length();
if (NbNodes == 3)
{
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
_myMeshDS->AddFace(index1, index2, index3);
}
else if (NbNodes == 4)
{
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
_myMeshDS->AddFace(index1, index2, index3, index4);
}
return true;
};
//=============================================================================
@ -196,39 +157,49 @@ CORBA::Boolean SMESH_MeshEditor_i::AddFace(const SMESH::long_array& IDsOfNodes)
*/
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::AddVolume(const SMESH::long_array& IDsOfNodes) {
int NbNodes = IDsOfNodes.length();
if ( NbNodes == 4 ) {
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
int idTetra = _myMeshDS->AddVolume(index1,index2,index3,index4);
} else if ( NbNodes == 5 ) {
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
CORBA::Long index5 = IDsOfNodes[4];
int idPyramid = _myMeshDS->AddVolume(index1,index2,index3,index4,index5);
} else if ( NbNodes == 6 ) {
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
CORBA::Long index5 = IDsOfNodes[4];
CORBA::Long index6 = IDsOfNodes[5];
int idPrism = _myMeshDS->AddVolume(index1,index2,index3,index4,index5,index6);
} else if ( NbNodes == 8 ) {
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
CORBA::Long index5 = IDsOfNodes[4];
CORBA::Long index6 = IDsOfNodes[5];
CORBA::Long index7 = IDsOfNodes[6];
CORBA::Long index8 = IDsOfNodes[7];
int idHexa = _myMeshDS->AddVolume(index1,index2,index3,index4,index5,index6,index7,index8);
}
return true;
CORBA::Boolean SMESH_MeshEditor_i::AddVolume(const SMESH::
long_array & IDsOfNodes)
{
int NbNodes = IDsOfNodes.length();
if (NbNodes == 4)
{
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
_myMeshDS->AddVolume(index1, index2, index3, index4);
}
else if (NbNodes == 5)
{
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
CORBA::Long index5 = IDsOfNodes[4];
_myMeshDS->AddVolume(index1, index2, index3, index4, index5);
}
else if (NbNodes == 6)
{
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
CORBA::Long index5 = IDsOfNodes[4];
CORBA::Long index6 = IDsOfNodes[5];
_myMeshDS->AddVolume(index1, index2, index3, index4, index5, index6);
}
else if (NbNodes == 8)
{
CORBA::Long index1 = IDsOfNodes[0];
CORBA::Long index2 = IDsOfNodes[1];
CORBA::Long index3 = IDsOfNodes[2];
CORBA::Long index4 = IDsOfNodes[3];
CORBA::Long index5 = IDsOfNodes[4];
CORBA::Long index6 = IDsOfNodes[5];
CORBA::Long index7 = IDsOfNodes[6];
CORBA::Long index8 = IDsOfNodes[7];
_myMeshDS->AddVolume(index1, index2, index3, index4, index5, index6,
index7, index8);
}
return true;
};

View File

@ -34,30 +34,27 @@
#include "SMESHDS_Mesh.hxx"
class SMESH_MeshEditor_i:
public POA_SMESH::SMESH_MeshEditor
class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
{
public:
SMESH_MeshEditor_i(const Handle(SMESHDS_Mesh)& theMesh);
public:
SMESH_MeshEditor_i(SMESHDS_Mesh * theMesh);
virtual ~SMESH_MeshEditor_i() {};
virtual ~ SMESH_MeshEditor_i()
{
};
// --- CORBA
CORBA::Boolean RemoveElements(const SMESH::long_array& IDsOfElements);
CORBA::Boolean RemoveNodes(const SMESH::long_array& IDsOfNodes);
// --- CORBA
CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
CORBA::Boolean AddNode(CORBA::Double x,
CORBA::Double y,
CORBA::Double z);
CORBA::Boolean AddEdge(const SMESH::long_array& IDsOfNodes);
CORBA::Boolean AddFace(const SMESH::long_array& IDsOfNodes);
CORBA::Boolean AddVolume(const SMESH::long_array& IDsOfNodes);
CORBA::Boolean AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
CORBA::Boolean AddEdge(const SMESH::long_array & IDsOfNodes);
CORBA::Boolean AddFace(const SMESH::long_array & IDsOfNodes);
CORBA::Boolean AddVolume(const SMESH::long_array & IDsOfNodes);
private:
SMESH::SMESH_subMesh_var _myMesh;
Handle (SMESHDS_Mesh) _myMeshDS;
private:
SMESH::SMESH_subMesh_var _myMesh;
SMESHDS_Mesh *_myMeshDS;
};
#endif

View File

@ -26,7 +26,6 @@
// Module : SMESH
// $Header$
using namespace std;
using namespace std;
#include "SMESH_Mesh_i.hxx"
#include "SMESH_subMesh_i.hxx"
@ -40,22 +39,12 @@ using namespace std;
#include "OpUtil.hxx"
#include "TCollection_AsciiString.hxx"
// #include "SMESHDS_ListOfAsciiString.hxx"
// #include "SMESHDS_ListIteratorOfListOfAsciiString.hxx"
#include "TColStd_ListOfInteger.hxx"
#include "TColStd_ListOfReal.hxx"
#include "TColStd_ListIteratorOfListOfInteger.hxx"
#include "TColStd_ListIteratorOfListOfReal.hxx"
#include "SMESHDS_Command.hxx"
#include "SMESHDS_CommandType.hxx"
#include "SMESHDS_ListOfCommand.hxx"
#include "SMESHDS_ListIteratorOfListOfCommand.hxx"
#include "Handle_SMESHDS_Command.hxx"
#include "SMESH_MeshEditor_i.hxx"
#include <string>
#include <iostream>
//#include <sstream>
//**** SMESHDS en champ
@ -67,8 +56,8 @@ using namespace std;
SMESH_Mesh_i::SMESH_Mesh_i()
{
MESSAGE("SMESH_Mesh_i: default constructor, not for use");
ASSERT(0);
MESSAGE("SMESH_Mesh_i: default constructor, not for use");
ASSERT(0);
};
//=============================================================================
@ -77,16 +66,14 @@ SMESH_Mesh_i::SMESH_Mesh_i()
*/
//=============================================================================
SMESH_Mesh_i::SMESH_Mesh_i(SMESH_Gen_i* gen_i,
GEOM::GEOM_Gen_ptr geomEngine,
CORBA::Long studyId,
int localId)
SMESH_Mesh_i::SMESH_Mesh_i(SMESH_Gen_i * gen_i,
GEOM::GEOM_Gen_ptr geomEngine, CORBA::Long studyId, int localId)
{
MESSAGE("SMESH_Mesh_i");
_gen_i = gen_i;
_id = localId;
_geom = GEOM::GEOM_Gen::_narrow(geomEngine);
_studyId = studyId;
MESSAGE("SMESH_Mesh_i");
_gen_i = gen_i;
_id = localId;
_geom = GEOM::GEOM_Gen::_narrow(geomEngine);
_studyId = studyId;
}
//=============================================================================
@ -97,11 +84,10 @@ SMESH_Mesh_i::SMESH_Mesh_i(SMESH_Gen_i* gen_i,
SMESH_Mesh_i::~SMESH_Mesh_i()
{
MESSAGE("~SMESH_Mesh_i");
// ****
MESSAGE("~SMESH_Mesh_i");
// ****
};
//=============================================================================
/*!
*
@ -109,35 +95,33 @@ SMESH_Mesh_i::~SMESH_Mesh_i()
//=============================================================================
CORBA::Boolean SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
SMESH::SMESH_Hypothesis_ptr anHyp)
throw (SALOME::SALOME_Exception)
SMESH::SMESH_Hypothesis_ptr anHyp) throw(SALOME::SALOME_Exception)
{
MESSAGE("AddHypothesis");
// **** proposer liste de subShape (selection multiple)
MESSAGE("AddHypothesis");
// **** proposer liste de subShape (selection multiple)
GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
if (CORBA::is_nil(mySubShape))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", \
SALOME::BAD_PARAM);
GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
if (CORBA::is_nil(mySubShape))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
SALOME::BAD_PARAM);
SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
if (CORBA::is_nil(myHyp))
THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference", \
SALOME::BAD_PARAM);
bool ret = false;
try
{
TopoDS_Shape myLocSubShape=
_gen_i->_ShapeReader->GetShape(_geom,mySubShape);
int hypId = myHyp->GetId();
ret = _impl->AddHypothesis(myLocSubShape, hypId);
}
catch (SALOME_Exception& S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
SALOME::BAD_PARAM);
}
return ret;
SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
if (CORBA::is_nil(myHyp))
THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",
SALOME::BAD_PARAM);
bool ret = false;
try
{
TopoDS_Shape myLocSubShape =
_gen_i->_ShapeReader->GetShape(_geom, mySubShape);
int hypId = myHyp->GetId();
ret = _impl->AddHypothesis(myLocSubShape, hypId);
}
catch(SALOME_Exception & S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
return ret;
};
//=============================================================================
@ -147,37 +131,35 @@ CORBA::Boolean SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
//=============================================================================
CORBA::Boolean
SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
SMESH::SMESH_Hypothesis_ptr anHyp)
throw (SALOME::SALOME_Exception)
SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
SMESH::SMESH_Hypothesis_ptr anHyp) throw(SALOME::SALOME_Exception)
{
MESSAGE("RemoveHypothesis");
// **** proposer liste de subShape (selection multiple)
MESSAGE("RemoveHypothesis");
// **** proposer liste de subShape (selection multiple)
GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
if (CORBA::is_nil(mySubShape))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", \
SALOME::BAD_PARAM);
GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
if (CORBA::is_nil(mySubShape))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
SALOME::BAD_PARAM);
SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
if (CORBA::is_nil(myHyp))
THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference", \
SALOME::BAD_PARAM);
SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp);
if (CORBA::is_nil(myHyp))
THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",
SALOME::BAD_PARAM);
bool ret = false;
try
{
TopoDS_Shape myLocSubShape=
_gen_i->_ShapeReader->GetShape(_geom,mySubShape);
int hypId = myHyp->GetId();
ret = _impl->RemoveHypothesis(myLocSubShape, hypId);
}
catch (SALOME_Exception& S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
SALOME::BAD_PARAM);
}
return ret;
bool ret = false;
try
{
TopoDS_Shape myLocSubShape =
_gen_i->_ShapeReader->GetShape(_geom, mySubShape);
int hypId = myHyp->GetId();
ret = _impl->RemoveHypothesis(myLocSubShape, hypId);
}
catch(SALOME_Exception & S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
return ret;
};
//=============================================================================
@ -186,12 +168,12 @@ SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
*/
//=============================================================================
SMESH::ListOfHypothesis*
SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
throw (SALOME::SALOME_Exception)
SMESH::ListOfHypothesis *
SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
throw(SALOME::SALOME_Exception)
{
MESSAGE("GetHypothesisList");
// ****
MESSAGE("GetHypothesisList");
// ****
};
//=============================================================================
@ -199,54 +181,53 @@ SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
*
*/
//=============================================================================
SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetElementsOnShape(GEOM::GEOM_Shape_ptr aSubShape)
throw (SALOME::SALOME_Exception)
SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetElementsOnShape(GEOM::
GEOM_Shape_ptr aSubShape) throw(SALOME::SALOME_Exception)
{
MESSAGE("SMESH_Mesh_i::GetElementsOnShape");
GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
if (CORBA::is_nil(mySubShape))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", \
SALOME::BAD_PARAM);
MESSAGE("SMESH_Mesh_i::GetElementsOnShape");
GEOM::GEOM_Shape_var mySubShape = GEOM::GEOM_Shape::_narrow(aSubShape);
if (CORBA::is_nil(mySubShape))
THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
SALOME::BAD_PARAM);
int subMeshId = 0;
try
{
SMESH_subMesh_i* subMeshServant;
TopoDS_Shape myLocSubShape
= _gen_i->_ShapeReader->GetShape(_geom,mySubShape);
//Get or Create the SMESH_subMesh object implementation
::SMESH_subMesh * mySubMesh
= _impl->GetSubMesh(myLocSubShape);
subMeshId = mySubMesh->GetId();
// create a new subMesh object servant if there is none for the shape
if (_mapSubMesh.find(subMeshId) != _mapSubMesh.end())
int subMeshId = 0;
try
{
ASSERT(_mapSubMesh_i.find(subMeshId) != _mapSubMesh_i.end());
subMeshServant = _mapSubMesh_i[subMeshId];
}
else
{
// create and activate the CORBA servant of Mesh
subMeshServant = new SMESH_subMesh_i(_gen_i, this, subMeshId);
SMESH::SMESH_subMesh_var subMesh
= SMESH::SMESH_subMesh::_narrow(subMeshServant->_this());
_mapSubMesh[subMeshId] = mySubMesh;
_mapSubMesh_i[subMeshId] = subMeshServant;
_mapSubMeshIor[subMeshId]
= SMESH::SMESH_subMesh::_duplicate(subMesh);
}
}
catch (SALOME_Exception& S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
SMESH_subMesh_i *subMeshServant;
TopoDS_Shape myLocSubShape
= _gen_i->_ShapeReader->GetShape(_geom, mySubShape);
ASSERT(_mapSubMeshIor.find(subMeshId) != _mapSubMeshIor.end());
return SMESH::SMESH_subMesh::_duplicate(_mapSubMeshIor[subMeshId]);
//Get or Create the SMESH_subMesh object implementation
::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape);
subMeshId = mySubMesh->GetId();
// create a new subMesh object servant if there is none for the shape
if (_mapSubMesh.find(subMeshId) != _mapSubMesh.end())
{
ASSERT(_mapSubMesh_i.find(subMeshId) != _mapSubMesh_i.end());
subMeshServant = _mapSubMesh_i[subMeshId];
}
else
{
// create and activate the CORBA servant of Mesh
subMeshServant = new SMESH_subMesh_i(_gen_i, this, subMeshId);
SMESH::SMESH_subMesh_var subMesh
= SMESH::SMESH_subMesh::_narrow(subMeshServant->_this());
_mapSubMesh[subMeshId] = mySubMesh;
_mapSubMesh_i[subMeshId] = subMeshServant;
_mapSubMeshIor[subMeshId]
= SMESH::SMESH_subMesh::_duplicate(subMesh);
}
}
catch(SALOME_Exception & S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
ASSERT(_mapSubMeshIor.find(subMeshId) != _mapSubMeshIor.end());
return SMESH::SMESH_subMesh::_duplicate(_mapSubMeshIor[subMeshId]);
}
//=============================================================================
@ -255,62 +236,63 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetElementsOnShape(GEOM::GEOM_Shape_ptr a
*/
//=============================================================================
SMESH::log_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
throw (SALOME::SALOME_Exception)
SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
throw(SALOME::SALOME_Exception)
{
MESSAGE("SMESH_Mesh_i::GetLog");
MESSAGE("SMESH_Mesh_i::GetLog");
SMESH::log_array_var aLog;
try
{
const SMESHDS_ListOfCommand& logDS =_impl->GetLog();
aLog = new SMESH::log_array;
int indexLog = 0;
int lg = logDS.Extent();
SCRUTE(lg);
aLog->length(lg);
SMESHDS_ListIteratorOfListOfCommand its(logDS);
while(its.More())
{
Handle(SMESHDS_Command) com = its.Value();
int comType = com->GetType();
//SCRUTE(comType);
int lgcom = com->GetNumber();
//SCRUTE(lgcom);
const TColStd_ListOfInteger& intList = com->GetIndexes();
int inum = intList.Extent();
//SCRUTE(inum);
TColStd_ListIteratorOfListOfInteger ii(intList);
const TColStd_ListOfReal& coordList = com->GetCoords();
int rnum = coordList.Extent();
//SCRUTE(rnum);
TColStd_ListIteratorOfListOfReal ir(coordList);
aLog[indexLog].commandType = comType;
aLog[indexLog].number = lgcom;
aLog[indexLog].coords.length(rnum);
aLog[indexLog].indexes.length(inum);
for (int i=0; i<rnum; i++)
{
aLog[indexLog].coords[i] = ir.Value();
//MESSAGE(" "<<i<<" "<<ir.Value());
ir.Next();
}
for (int i=0; i<inum; i++)
{
aLog[indexLog].indexes[i] = ii.Value();
//MESSAGE(" "<<i<<" "<<ii.Value());
ii.Next();
}
indexLog++;
its.Next();
}
if (clearAfterGet) _impl->ClearLog();
}
catch (SALOME_Exception& S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
return aLog._retn();
SMESH::log_array_var aLog;
try
{
list < SMESHDS_Command * >logDS = _impl->GetLog();
aLog = new SMESH::log_array;
int indexLog = 0;
int lg = logDS.size();
SCRUTE(lg);
aLog->length(lg);
list < SMESHDS_Command * >::iterator its = logDS.begin();
while (its != logDS.end())
{
SMESHDS_Command *com = *its;
int comType = com->GetType();
//SCRUTE(comType);
int lgcom = com->GetNumber();
//SCRUTE(lgcom);
const list < int >&intList = com->GetIndexes();
int inum = intList.size();
//SCRUTE(inum);
list < int >::const_iterator ii = intList.begin();
const list < double >&coordList = com->GetCoords();
int rnum = coordList.size();
//SCRUTE(rnum);
list < double >::const_iterator ir = coordList.begin();
aLog[indexLog].commandType = comType;
aLog[indexLog].number = lgcom;
aLog[indexLog].coords.length(rnum);
aLog[indexLog].indexes.length(inum);
for (int i = 0; i < rnum; i++)
{
aLog[indexLog].coords[i] = *ir;
//MESSAGE(" "<<i<<" "<<ir.Value());
ir++;
}
for (int i = 0; i < inum; i++)
{
aLog[indexLog].indexes[i] = *ii;
//MESSAGE(" "<<i<<" "<<ii.Value());
ii++;
}
indexLog++;
its++;
}
if (clearAfterGet)
_impl->ClearLog();
}
catch(SALOME_Exception & S_ex)
{
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
return aLog._retn();
}
// SMESH::string_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
@ -330,97 +312,97 @@ SMESH::log_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
// SMESHDS_ListIteratorOfListOfCommand its(logDS);
// while(its.More())
// {
// Handle(SMESHDS_Command) com = its.Value();
// int comType = com->GetType();
// SCRUTE(comType);
// int lgcom = com->GetNumber();
// SCRUTE(lgcom);
// logSize += lgcom;
// aLog->length(logSize);
// SCRUTE(logSize);
// const TColStd_ListOfInteger& intList = com->GetIndexes();
// TColStd_ListIteratorOfListOfInteger ii(intList);
// const TColStd_ListOfReal& coordList = com->GetCoords();
// TColStd_ListIteratorOfListOfReal ir(coordList);
// for (int icom = 1; icom <= lgcom; icom++)
// {
// ostringstream S;
// switch (comType)
// {
// case SMESHDS_AddNode:
// S << "AddNode " << ii.Value(); ii.Next();
// S << " " << ir.Value(); ir.Next();
// S << " " << ir.Value(); ir.Next();
// S << " " << ir.Value(); ir.Next();
// break;
// case SMESHDS_AddEdge:
// S << "AddEdge " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddTriangle:
// S << "AddFace " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddQuadrangle:
// S << "AddFace " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddTetrahedron:
// S << "AddVolume " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddPyramid:
// S << "AddVolume " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddPrism:
// S << "AddVolume " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddHexahedron:
// S << "AddVolume " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_RemoveNode:
// S << "RemoveNode " << ii.Value(); ii.Next();
// break;
// case SMESHDS_RemoveElement:
// S << "RemoveElement " << ii.Value(); ii.Next();
// break;
// default:
// ASSERT(0);
// break;
// }
// string ch = S.str();
// SCRUTE(ch);
// aLog[indexLog++] = CORBA::string_dup(ch.c_str());
// }
// its.Next();
// Handle(SMESHDS_Command) com = its.Value();
// int comType = com->GetType();
// SCRUTE(comType);
// int lgcom = com->GetNumber();
// SCRUTE(lgcom);
// logSize += lgcom;
// aLog->length(logSize);
// SCRUTE(logSize);
// const TColStd_ListOfInteger& intList = com->GetIndexes();
// TColStd_ListIteratorOfListOfInteger ii(intList);
// const TColStd_ListOfReal& coordList = com->GetCoords();
// TColStd_ListIteratorOfListOfReal ir(coordList);
// for (int icom = 1; icom <= lgcom; icom++)
// {
// ostringstream S;
// switch (comType)
// {
// case SMESHDS_AddNode:
// S << "AddNode " << ii.Value(); ii.Next();
// S << " " << ir.Value(); ir.Next();
// S << " " << ir.Value(); ir.Next();
// S << " " << ir.Value(); ir.Next();
// break;
// case SMESHDS_AddEdge:
// S << "AddEdge " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddTriangle:
// S << "AddFace " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddQuadrangle:
// S << "AddFace " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddTetrahedron:
// S << "AddVolume " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddPyramid:
// S << "AddVolume " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddPrism:
// S << "AddVolume " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_AddHexahedron:
// S << "AddVolume " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// S << " " << ii.Value(); ii.Next();
// break;
// case SMESHDS_RemoveNode:
// S << "RemoveNode " << ii.Value(); ii.Next();
// break;
// case SMESHDS_RemoveElement:
// S << "RemoveElement " << ii.Value(); ii.Next();
// break;
// default:
// ASSERT(0);
// break;
// }
// string ch = S.str();
// SCRUTE(ch);
// aLog[indexLog++] = CORBA::string_dup(ch.c_str());
// }
// its.Next();
// }
// if (clearAfterGet) _impl->ClearLog();
// }
@ -437,11 +419,10 @@ SMESH::log_array* SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet)
*/
//=============================================================================
void SMESH_Mesh_i::ClearLog()
throw (SALOME::SALOME_Exception)
void SMESH_Mesh_i::ClearLog() throw(SALOME::SALOME_Exception)
{
MESSAGE("SMESH_Mesh_i::ClearLog");
// ****
MESSAGE("SMESH_Mesh_i::ClearLog");
// ****
}
//=============================================================================
@ -450,11 +431,10 @@ void SMESH_Mesh_i::ClearLog()
*/
//=============================================================================
CORBA::Long SMESH_Mesh_i::GetId()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_Mesh_i::GetId()throw(SALOME::SALOME_Exception)
{
MESSAGE("SMESH_Mesh_i::GetId");
return _id;
MESSAGE("SMESH_Mesh_i::GetId");
return _id;
}
//=============================================================================
@ -463,21 +443,9 @@ CORBA::Long SMESH_Mesh_i::GetId()
*/
//=============================================================================
CORBA::Long SMESH_Mesh_i::GetStudyId()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_Mesh_i::GetStudyId()throw(SALOME::SALOME_Exception)
{
return _studyId;
}
//=============================================================================
/*!
*
*/
//=============================================================================
void SMESH_Mesh_i::SetImpl(::SMESH_Mesh* impl)
{
MESSAGE("SMESH_Mesh_i::SetImpl");
_impl = impl;
return _studyId;
}
//=============================================================================
@ -486,10 +454,22 @@ void SMESH_Mesh_i::SetImpl(::SMESH_Mesh* impl)
*/
//=============================================================================
::SMESH_Mesh& SMESH_Mesh_i::GetImpl()
void SMESH_Mesh_i::SetImpl(::SMESH_Mesh * impl)
{
MESSAGE("SMESH_Mesh_i::GetImpl()");
return *_impl;
MESSAGE("SMESH_Mesh_i::SetImpl");
_impl = impl;
}
//=============================================================================
/*!
*
*/
//=============================================================================
::SMESH_Mesh & SMESH_Mesh_i::GetImpl()
{
MESSAGE("SMESH_Mesh_i::GetImpl()");
return *_impl;
}
//=============================================================================
@ -500,8 +480,8 @@ void SMESH_Mesh_i::SetImpl(::SMESH_Mesh* impl)
GEOM::GEOM_Gen_ptr SMESH_Mesh_i::GetGeomEngine()
{
MESSAGE("SMESH_Mesh_i::GetGeomEngine");
return GEOM::GEOM_Gen::_duplicate(_geom);
MESSAGE("SMESH_Mesh_i::GetGeomEngine");
return GEOM::GEOM_Gen::_duplicate(_geom);
}
//=============================================================================
@ -512,9 +492,9 @@ GEOM::GEOM_Gen_ptr SMESH_Mesh_i::GetGeomEngine()
void SMESH_Mesh_i::SetIor(SMESH::SMESH_Mesh_ptr myIor)
{
MESSAGE("SMESH_Mesh_i::SetIor");
_myIor = SMESH::SMESH_Mesh::_duplicate(myIor);
ASSERT(! CORBA::is_nil(_myIor));
MESSAGE("SMESH_Mesh_i::SetIor");
_myIor = SMESH::SMESH_Mesh::_duplicate(myIor);
ASSERT(!CORBA::is_nil(_myIor));
}
//=============================================================================
@ -525,10 +505,11 @@ void SMESH_Mesh_i::SetIor(SMESH::SMESH_Mesh_ptr myIor)
SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetIor()
{
MESSAGE("SMESH_Mesh_i::GetIor");
ASSERT(! CORBA::is_nil(_myIor));
return SMESH::SMESH_Mesh::_duplicate(_myIor);
MESSAGE("SMESH_Mesh_i::GetIor");
ASSERT(!CORBA::is_nil(_myIor));
return SMESH::SMESH_Mesh::_duplicate(_myIor);
}
//=============================================================================
/*!
*
@ -537,9 +518,10 @@ SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetIor()
SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
{
SMESH_MeshEditor_i* aMeshEditor = new SMESH_MeshEditor_i(_impl->GetMeshDS());
SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
return aMesh._retn();
SMESH_MeshEditor_i *aMeshEditor =
new SMESH_MeshEditor_i(_impl->GetMeshDS());
SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
return aMesh._retn();
}
//=============================================================================
@ -548,35 +530,17 @@ SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
*/
//=============================================================================
void SMESH_Mesh_i::ExportMED( const char* file )
throw (SALOME::SALOME_Exception)
void SMESH_Mesh_i::ExportMED(const char *file) throw(SALOME::SALOME_Exception)
{
_impl->ExportMED( file );
_impl->ExportMED(file);
}
void SMESH_Mesh_i::ExportDAT( const char* file )
throw (SALOME::SALOME_Exception)
void SMESH_Mesh_i::ExportDAT(const char *file) throw(SALOME::SALOME_Exception)
{
_impl->ExportDAT( file );
_impl->ExportDAT(file);
}
void SMESH_Mesh_i::ExportUNV( const char* file )
throw (SALOME::SALOME_Exception)
void SMESH_Mesh_i::ExportUNV(const char *file) throw(SALOME::SALOME_Exception)
{
_impl->ExportUNV( file );
}
//=============================================================================
/*!
*
*/
//=============================================================================
SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()
throw (SALOME::SALOME_Exception)
{
SMESH_MEDMesh_i* aMedMesh = new SMESH_MEDMesh_i( this );
SALOME_MED::MESH_var aMesh = aMedMesh->_this();
return aMesh._retn();
_impl->ExportUNV(file);
}
//=============================================================================
@ -584,10 +548,12 @@ SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()
*
*/
//=============================================================================
CORBA::Long SMESH_Mesh_i::NbNodes()
throw (SALOME::SALOME_Exception)
SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()throw(SALOME::SALOME_Exception)
{
return _impl->NbNodes();
SMESH_MEDMesh_i *aMedMesh = new SMESH_MEDMesh_i(this);
SALOME_MED::MESH_var aMesh = aMedMesh->_this();
return aMesh._retn();
}
//=============================================================================
@ -595,10 +561,9 @@ CORBA::Long SMESH_Mesh_i::NbNodes()
*
*/
//=============================================================================
CORBA::Long SMESH_Mesh_i::NbEdges()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception)
{
return _impl->NbEdges();
return _impl->NbNodes();
}
//=============================================================================
@ -606,20 +571,9 @@ CORBA::Long SMESH_Mesh_i::NbEdges()
*
*/
//=============================================================================
CORBA::Long SMESH_Mesh_i::NbFaces()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_Mesh_i::NbEdges()throw(SALOME::SALOME_Exception)
{
return _impl->NbFaces();
}
CORBA::Long SMESH_Mesh_i::NbTriangles()
throw (SALOME::SALOME_Exception)
{
return _impl->NbTriangles();
}
CORBA::Long SMESH_Mesh_i::NbQuadrangles()
throw (SALOME::SALOME_Exception)
{
return _impl->NbQuadrangles();
return _impl->NbEdges();
}
//=============================================================================
@ -627,20 +581,19 @@ CORBA::Long SMESH_Mesh_i::NbQuadrangles()
*
*/
//=============================================================================
CORBA::Long SMESH_Mesh_i::NbVolumes()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_Mesh_i::NbFaces()throw(SALOME::SALOME_Exception)
{
return _impl->NbVolumes();
return _impl->NbFaces();
}
CORBA::Long SMESH_Mesh_i::NbTetras()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_Mesh_i::NbTriangles()throw(SALOME::SALOME_Exception)
{
return _impl->NbTetras();
return _impl->NbTriangles();
}
CORBA::Long SMESH_Mesh_i::NbHexas()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_Mesh_i::NbQuadrangles()throw(SALOME::SALOME_Exception)
{
return _impl->NbHexas();
return _impl->NbQuadrangles();
}
//=============================================================================
@ -648,8 +601,27 @@ CORBA::Long SMESH_Mesh_i::NbHexas()
*
*/
//=============================================================================
CORBA::Long SMESH_Mesh_i::NbSubMesh()
throw (SALOME::SALOME_Exception)
CORBA::Long SMESH_Mesh_i::NbVolumes()throw(SALOME::SALOME_Exception)
{
return _impl->NbSubMesh();
return _impl->NbVolumes();
}
CORBA::Long SMESH_Mesh_i::NbTetras()throw(SALOME::SALOME_Exception)
{
return _impl->NbTetras();
}
CORBA::Long SMESH_Mesh_i::NbHexas()throw(SALOME::SALOME_Exception)
{
return _impl->NbHexas();
}
//=============================================================================
/*!
*
*/
//=============================================================================
CORBA::Long SMESH_Mesh_i::NbSubMesh()throw(SALOME::SALOME_Exception)
{
return _impl->NbSubMesh();
}