Version: 6.3.1
Data Structures | Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Private Attributes | Static Private Attributes

SMESH_Mesh_i Class Reference

#include <SMESH_Mesh_i.hxx>

Inheritance diagram for SMESH_Mesh_i:
Inheritance graph
[legend]

Data Structures

struct  TGeomGroupData

Public Member Functions

 SMESH_Mesh_i (PortableServer::POA_ptr thePOA, SMESH_Gen_i *myGen_i, CORBA::Long studyId)
 Constructor.
virtual ~SMESH_Mesh_i ()
 Destructor.
void SetShape (GEOM::GEOM_Object_ptr theShapeObject) throw (SALOME::SALOME_Exception)
 SetShape.
CORBA::Boolean HasShapeToMesh () throw (SALOME::SALOME_Exception)
 return true if mesh has a shape to build a shape on
GEOM::GEOM_Object_ptr GetShapeToMesh () throw (SALOME::SALOME_Exception)
void Clear () throw (SALOME::SALOME_Exception)
 Remove all nodes and elements.
void ClearSubMesh (CORBA::Long ShapeID) throw (SALOME::SALOME_Exception)
 Remove all nodes and elements for indicated shape.
SMESH::Hypothesis_Status AddHypothesis (GEOM::GEOM_Object_ptr aSubShapeObject, SMESH::SMESH_Hypothesis_ptr anHyp) throw (SALOME::SALOME_Exception)
 AddHypothesis.
SMESH::Hypothesis_Status RemoveHypothesis (GEOM::GEOM_Object_ptr aSubShapeObject, SMESH::SMESH_Hypothesis_ptr anHyp) throw (SALOME::SALOME_Exception)
SMESH::ListOfHypothesisGetHypothesisList (GEOM::GEOM_Object_ptr aSubShapeObject) throw (SALOME::SALOME_Exception)
SMESH::SMESH_subMesh_ptr GetSubMesh (GEOM::GEOM_Object_ptr aSubShapeObject, const char *theName) throw (SALOME::SALOME_Exception)
void RemoveSubMesh (SMESH::SMESH_subMesh_ptr theSubMesh) throw (SALOME::SALOME_Exception)
SMESH::SMESH_Group_ptr CreateGroup (SMESH::ElementType theElemType, const char *theName) throw (SALOME::SALOME_Exception)
SMESH::SMESH_GroupOnGeom_ptr CreateGroupFromGEOM (SMESH::ElementType theElemType, const char *theName, GEOM::GEOM_Object_ptr theGeomObj) throw (SALOME::SALOME_Exception)
void RemoveGroup (SMESH::SMESH_GroupBase_ptr theGroup) throw (SALOME::SALOME_Exception)
void RemoveGroupWithContents (SMESH::SMESH_GroupBase_ptr theGroup) throw (SALOME::SALOME_Exception)
 RemoveGroupWithContents Remove group with its contents.
SMESH::ListOfGroupsGetGroups () throw (SALOME::SALOME_Exception)
 Get the list of groups existing in the mesh.
CORBA::Long NbGroups () throw (SALOME::SALOME_Exception)
 Get number of groups existing in the mesh.
SMESH::SMESH_Group_ptr UnionGroups (SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char *theName) throw (SALOME::SALOME_Exception)
 UnionGroups New group is created.
SMESH::SMESH_Group_ptr UnionListOfGroups (const SMESH::ListOfGroups &theGroups, const char *theName) throw (SALOME::SALOME_Exception)
 Union list of groups.
SMESH::SMESH_Group_ptr IntersectGroups (SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char *theName) throw (SALOME::SALOME_Exception)
 IntersectGroups New group is created.
SMESH::SMESH_Group_ptr IntersectListOfGroups (const SMESH::ListOfGroups &theGroups, const char *theName) throw (SALOME::SALOME_Exception)
 Intersect list of groups.
SMESH::SMESH_Group_ptr CutGroups (SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char *theName) throw (SALOME::SALOME_Exception)
 CutGroups New group is created.
SMESH::SMESH_Group_ptr CutListOfGroups (const SMESH::ListOfGroups &theMainGroups, const SMESH::ListOfGroups &theToolGroups, const char *theName) throw (SALOME::SALOME_Exception)
 Cut lists of groups.
SMESH::SMESH_Group_ptr CreateDimGroup (const SMESH::ListOfGroups &theGroups, SMESH::ElementType theElemType, const char *theName) throw (SALOME::SALOME_Exception)
 Create groups of entities from existing groups of superior dimensions System 1) extract all nodes from each group, 2) combine all elements of specified dimension laying on these nodes.
SMESH::SMESH_Group_ptr ConvertToStandalone (SMESH::SMESH_GroupOnGeom_ptr theGeomGroup)
 Create standalone group instead if group on geometry.
SMESH::log_arrayGetLog (CORBA::Boolean clearAfterGet) throw (SALOME::SALOME_Exception)
SMESH::SMESH_MeshEditor_ptr GetMeshEditor ()
 Return mesh editor.
SMESH::SMESH_MeshEditor_ptr GetMeshEditPreviewer ()
 Return mesh edition previewer.
CORBA::Boolean HasModificationsToDiscard () throw (SALOME::SALOME_Exception)
 Return true if the mesh has been edited since a last total re-compute and those modifications may prevent successful partial re-compute.
void ClearLog () throw (SALOME::SALOME_Exception)
CORBA::Long GetId () throw (SALOME::SALOME_Exception)
CORBA::Long GetStudyId () throw (SALOME::SALOME_Exception)
void SetImpl (::SMESH_Mesh *impl)
::SMESH_MeshGetImpl ()
SMESH_Gen_iGetGen ()
int ImportUNVFile (const char *theFileName) throw (SALOME::SALOME_Exception)
 ImportUNVFile.
int ImportSTLFile (const char *theFileName) throw (SALOME::SALOME_Exception)
 ImportSTLFile.
SMESH::DriverMED_ReadStatus ImportMEDFile (const char *theFileName, const char *theMeshName) throw (SALOME::SALOME_Exception)
 consult DriverMED_R_SMESHDS_Mesh.ReadStatus for returned value
void SetAutoColor (CORBA::Boolean theAutoColor) throw (SALOME::SALOME_Exception)
 Auto color.
CORBA::Boolean GetAutoColor () throw (SALOME::SALOME_Exception)
CORBA::Boolean HasDuplicatedGroupNamesMED ()
 Check group names for duplications.
char * GetVersionString (SMESH::MED_VERSION version, CORBA::Short nbDigits)
 Return string representation of a MED file version comprising nbDigits.
void ExportToMEDX (const char *file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion, CORBA::Boolean overwrite) throw (SALOME::SALOME_Exception)
void ExportToMED (const char *file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion) throw (SALOME::SALOME_Exception)
void ExportMED (const char *file, CORBA::Boolean auto_groups) throw (SALOME::SALOME_Exception)
void ExportDAT (const char *file) throw (SALOME::SALOME_Exception)
void ExportUNV (const char *file) throw (SALOME::SALOME_Exception)
void ExportSTL (const char *file, bool isascii) throw (SALOME::SALOME_Exception)
SALOME_MED::MESH_ptr GetMEDMesh () throw (SALOME::SALOME_Exception)
CORBA::Long NbNodes () throw (SALOME::SALOME_Exception)
CORBA::Long NbElements () throw (SALOME::SALOME_Exception)
CORBA::Long Nb0DElements () throw (SALOME::SALOME_Exception)
CORBA::Long NbEdges () throw (SALOME::SALOME_Exception)
CORBA::Long NbEdgesOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbFaces () throw (SALOME::SALOME_Exception)
CORBA::Long NbFacesOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbTriangles () throw (SALOME::SALOME_Exception)
CORBA::Long NbTrianglesOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbQuadrangles () throw (SALOME::SALOME_Exception)
CORBA::Long NbQuadranglesOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbPolygons () throw (SALOME::SALOME_Exception)
CORBA::Long NbVolumes () throw (SALOME::SALOME_Exception)
CORBA::Long NbVolumesOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbTetras () throw (SALOME::SALOME_Exception)
CORBA::Long NbTetrasOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbHexas () throw (SALOME::SALOME_Exception)
CORBA::Long NbHexasOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbPyramids () throw (SALOME::SALOME_Exception)
CORBA::Long NbPyramidsOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbPrisms () throw (SALOME::SALOME_Exception)
CORBA::Long NbPrismsOfOrder (SMESH::ElementOrder order) throw (SALOME::SALOME_Exception)
CORBA::Long NbPolyhedrons () throw (SALOME::SALOME_Exception)
CORBA::Long NbSubMesh () throw (SALOME::SALOME_Exception)
SMESH::long_arrayGetElementsId () throw (SALOME::SALOME_Exception)
SMESH::long_arrayGetElementsByType (SMESH::ElementType theElemType) throw (SALOME::SALOME_Exception)
SMESH::long_arrayGetNodesId () throw (SALOME::SALOME_Exception)
SMESH::ElementType GetElementType (CORBA::Long id, bool iselem) throw (SALOME::SALOME_Exception)
SMESH::EntityType GetElementGeomType (CORBA::Long id) throw (SALOME::SALOME_Exception)
SMESH::long_arrayGetSubMeshElementsId (CORBA::Long ShapeID) throw (SALOME::SALOME_Exception)
 Returns ID of elements for given submesh.
SMESH::long_arrayGetSubMeshNodesId (CORBA::Long ShapeID, CORBA::Boolean all) throw (SALOME::SALOME_Exception)
 Returns ID of nodes for given submesh If param all==true - returns all nodes, else - returns only nodes on shapes.
SMESH::ElementType GetSubMeshElementType (CORBA::Long ShapeID) throw (SALOME::SALOME_Exception)
 Returns type of elements for given submesh.
char * Dump ()
SMESH_Hypothesis::Hypothesis_Status addHypothesis (GEOM::GEOM_Object_ptr aSubShapeObject, SMESH::SMESH_Hypothesis_ptr anHyp)
SMESH_Hypothesis::Hypothesis_Status removeHypothesis (GEOM::GEOM_Object_ptr aSubShapeObject, SMESH::SMESH_Hypothesis_ptr anHyp)
SMESH::SMESH_subMesh_ptr createSubMesh (GEOM::GEOM_Object_ptr theSubShapeObject)
void removeSubMesh (SMESH::SMESH_subMesh_ptr theSubMesh, GEOM::GEOM_Object_ptr theSubShapeObject)
SMESH::SMESH_GroupBase_ptr createGroup (SMESH::ElementType theElemType, const char *theName, const TopoDS_Shape &theShape=TopoDS_Shape())
void removeGroup (const int theId)
 SMESH_Mesh_i.removeGroup.
SMESH::SMESH_subMesh_ptr getSubMesh (int shapeID)
const std::map< int,
SMESH::SMESH_GroupBase_ptr > & 
getGroups ()
void CheckGeomGroupModif ()
 Update hypotheses assigned to geom groups if the latter change.
CORBA::LongLong GetMeshPtr ()
void CreateGroupServants ()
 Assure that all groups are published.
SMESH::ListOfGroupsGetGroups (const std::list< int > &groupIDs) const
 Return groups cantained in _mapGroups by their IDs.
SMESH::double_arrayGetNodeXYZ (CORBA::Long id)
 Get XYZ coordinates of node as list of double If there is not node for given ID - returns empty list.
SMESH::long_arrayGetNodeInverseElements (CORBA::Long id)
 For given node returns list of IDs of inverse elements If there is not node for given ID - returns empty list.
SMESH::NodePositionGetNodePosition (CORBA::Long NodeID)
 Return position of a node on shape.
CORBA::Long GetShapeID (CORBA::Long id)
 If given element is node returns IDs of shape from position If there is not node for given ID - returns -1.
CORBA::Long GetShapeIDForElem (CORBA::Long id)
 For given element returns ID of result shape after ::FindShape() from SMESH_MeshEditor If there is not element for given ID - returns -1.
CORBA::Long GetElemNbNodes (CORBA::Long id)
 Returns number of nodes for given element If there is not element for given ID - returns -1.
SMESH::long_arrayGetElemNodes (CORBA::Long id)
 Returns IDs of nodes of given element.
CORBA::Long GetElemNode (CORBA::Long id, CORBA::Long index)
 Returns ID of node by given index for given element If there is not element for given ID - returns -1 If there is not node for given index - returns -2.
CORBA::Boolean IsMediumNode (CORBA::Long ide, CORBA::Long idn)
 Returns true if given node is medium node in given quadratic element.
CORBA::Boolean IsMediumNodeOfAnyElem (CORBA::Long idn, SMESH::ElementType theElemType)
 Returns true if given node is medium node in one of quadratic elements.
CORBA::Long ElemNbEdges (CORBA::Long id)
 Returns number of edges for given element.
CORBA::Long ElemNbFaces (CORBA::Long id)
 Returns number of faces for given element.
SMESH::long_arrayGetElemFaceNodes (CORBA::Long elemId, CORBA::Short faceIndex)
 Returns nodes of given face (counted from zero) for given element.
CORBA::Long FindElementByNodes (const SMESH::long_array &nodes)
 Returns an element based on all given nodes.
CORBA::Boolean IsPoly (CORBA::Long id)
 Returns true if given element is polygon.
CORBA::Boolean IsQuadratic (CORBA::Long id)
 Returns true if given element is quadratic.
SMESH::double_arrayBaryCenter (CORBA::Long id)
 Returns bary center for given element.
virtual SALOME_MED::MedFileInfo * GetMEDFileInfo ()
 Returns information about imported MED file.
void SetParameters (const char *theParameters)
 Sets list of notebook variables used for Mesh operations separated by ":" symbol.
char * GetParameters ()
 Returns list of notebook variables used for Mesh operations separated by ":" symbol.
SMESH::string_arrayGetLastParameters ()
 Returns list of notebook variables used for last Mesh operation.
virtual
SMESH::submesh_array_array
GetMeshOrder ()
 Return submesh objects list in meshing order.
virtual ::CORBA::Boolean SetMeshOrder (const SMESH::submesh_array_array &theSubMeshArray)
 Set submesh object order.
virtual SMESH::long_arrayGetIDs ()
virtual SMESH::long_arrayGetMeshInfo ()
 Returns statistic of mesh elements Result array of number enityties Inherited from SMESH_IDSource.
virtual
SMESH::array_of_ElementType
GetTypes ()
 Returns types of elements it contains.
virtual SMESH::SMESH_Mesh_ptr GetMesh ()
 Returns self.

Static Public Member Functions

static SMESH::Hypothesis_Status ConvertHypothesisStatus (SMESH_Hypothesis::Hypothesis_Status theStatus)
static void PrepareForWriting (const char *file, bool overwrite=true)
static void CollectMeshInfo (const SMDS_ElemIteratorPtr theItr, SMESH::long_array &theInfo)
 Collect statistic of mesh elements given by iterator.

Data Fields

std::map< int, SMESH_subMesh_i * > _mapSubMesh_i
std::map< int,::SMESH_subMesh * > _mapSubMesh

Private Member Functions

 SMESH_Mesh_i ()
 SMESH_Mesh_i (const SMESH_Mesh_i &)
void checkGroupNames ()
 Check and correct names of mesh groups.
void convertMeshOrder (const TListOfListOfInt &theIdsOrder, SMESH::submesh_array_array &theSubMeshOrder, const bool theIsDump)
 Convert submesh ids into submesh interfaces.
void addGeomGroupData (GEOM::GEOM_Object_ptr theGeomObj, CORBA::Object_ptr theSmeshObj)
 Remember GEOM group data.
void removeGeomGroupData (CORBA::Object_ptr theSmeshObj)
 Remove GEOM group data relating to removed smesh object.
TopoDS_Shape newGroupShape (TGeomGroupData &groupData)
 Return new group contents if it has been changed and update group data.

Private Attributes

::SMESH_Mesh_impl
SMESH_Gen_i_gen_i
int _id
int _studyId
std::map< int,
SMESH::SMESH_subMesh_ptr > 
_mapSubMeshIor
std::map< int,
SMESH::SMESH_GroupBase_ptr > 
_mapGroups
std::map< int,
SMESH::SMESH_Hypothesis_ptr > 
_mapHypo
SALOME_MED::MedFileInfo_var myFileInfo
std::list< TGeomGroupData_geomGroupData

Static Private Attributes

static int myIdGenerator = 0

Detailed Description

Definition at line 51 of file SMESH_Mesh_i.hxx.


Constructor & Destructor Documentation

SMESH_Mesh_i.SMESH_Mesh_i ( ) [private]
SMESH_Mesh_i.SMESH_Mesh_i ( const SMESH_Mesh_i ) [private]
SMESH_Mesh_i::SMESH_Mesh_i ( PortableServer::POA_ptr  thePOA,
SMESH_Gen_i myGen_i,
CORBA::Long  studyId 
)

Constructor.

Definition at line 101 of file SMESH_Mesh_i.cxx.

References _gen_i, _id, _impl, _studyId, MESSAGE, and myIdGenerator.

: SALOME::GenericObj_i( thePOA )
{
  MESSAGE("SMESH_Mesh_i");
  _impl = NULL;
  _gen_i = gen_i;
  _id = myIdGenerator++;
  _studyId = studyId;
}
SMESH_Mesh_i::~SMESH_Mesh_i ( ) [virtual]

Destructor.

Definition at line 119 of file SMESH_Mesh_i.cxx.

References _impl, _mapGroups, _mapHypo, _mapSubMeshIor, SMESH_controls.aGroup, SMESH_Gen_i.GetServant(), MESSAGE, and SMESH_GroupBase_i.myMeshServant.

{
  MESSAGE("~SMESH_Mesh_i");

#ifdef WITHGENERICOBJ
  // destroy groups
  map<int, SMESH::SMESH_GroupBase_ptr>::iterator itGr;
  for (itGr = _mapGroups.begin(); itGr != _mapGroups.end(); itGr++) {
    if ( CORBA::is_nil( itGr->second ))
      continue;
    SMESH_GroupBase_i* aGroup = dynamic_cast<SMESH_GroupBase_i*>(SMESH_Gen_i::GetServant(itGr->second).in());
    if (aGroup) {
      // this method is called from destructor of group (PAL6331)
      //_impl->RemoveGroup( aGroup->GetLocalID() );
      aGroup->myMeshServant = 0;
      aGroup->UnRegister();
    }
  }
  _mapGroups.clear();

  // destroy submeshes
  map<int, SMESH::SMESH_subMesh_ptr>::iterator itSM;
  for ( itSM = _mapSubMeshIor.begin(); itSM != _mapSubMeshIor.end(); itSM++ ) {
    if ( CORBA::is_nil( itSM->second ))
      continue;
    SMESH_subMesh_i* aSubMesh = dynamic_cast<SMESH_subMesh_i*>(SMESH_Gen_i::GetServant(itSM->second).in());
    if (aSubMesh) {
      aSubMesh->UnRegister();
    }
  }
  _mapSubMeshIor.clear();

  // destroy hypotheses
  map<int, SMESH::SMESH_Hypothesis_ptr>::iterator itH;
  for ( itH = _mapHypo.begin(); itH != _mapHypo.end(); itH++ ) {
    if ( CORBA::is_nil( itH->second ))
      continue;
    SMESH_Hypothesis_i* aHypo = dynamic_cast<SMESH_Hypothesis_i*>(SMESH_Gen_i::GetServant(itH->second).in());
    if (aHypo) {
      aHypo->UnRegister();
    }
  }
  _mapHypo.clear();
#endif

  delete _impl;
}

Member Function Documentation

void SMESH_Mesh_i::addGeomGroupData ( GEOM::GEOM_Object_ptr  theGeomObj,
CORBA::Object_ptr  theSmeshObj 
) [private]

Remember GEOM group data.

Definition at line 1561 of file SMESH_Mesh_i.cxx.

References _gen_i, _geomGroupData, SMESH_Mesh_i.TGeomGroupData._groupEntry, SMESH_Mesh_i.TGeomGroupData._indices, SMESH_Mesh_i.TGeomGroupData._smeshObject, SMESH_Gen_i.GetCurrentStudy(), SMESH_Gen_i.GetCurrentStudyID(), SMESH_Gen_i.GetGeomEngine(), SMESH_test.ids, and SMESH_Gen_i.ObjectToSObject().

Referenced by createGroup(), and createSubMesh().

{
  if ( CORBA::is_nil( theGeomObj ) || theGeomObj->GetType() != GEOM_GROUP )
    return;
  // group SO
  SALOMEDS::Study_var   study  = _gen_i->GetCurrentStudy();
  SALOMEDS::SObject_var groupSO = _gen_i->ObjectToSObject( study, theGeomObj );
  if ( groupSO->_is_nil() )
    return;
  // group indices
  GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
  GEOM::GEOM_IGroupOperations_var groupOp =
    geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
  GEOM::ListOfLong_var ids = groupOp->GetObjects( theGeomObj );

  // store data
  _geomGroupData.push_back( TGeomGroupData() );
  TGeomGroupData & groupData = _geomGroupData.back();
  // entry
  CORBA::String_var entry = groupSO->GetID();
  groupData._groupEntry = entry.in();
  // indices
  for ( int i = 0; i < ids->length(); ++i )
    groupData._indices.insert( ids[i] );
  // SMESH object
  groupData._smeshObject = theSmeshObj;
}
SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh_i::addHypothesis ( GEOM::GEOM_Object_ptr  aSubShapeObject,
SMESH::SMESH_Hypothesis_ptr  anHyp 
)

Definition at line 480 of file SMESH_Mesh_i.cxx.

References _gen_i, _impl, _mapHypo, _mapSubMesh_i, createSubMesh(), SMESH_Gen_i.GeomObjectToShape(), HasShapeToMesh(), SMESH.HYP_OK, SMESH_Hypothesis.IsStatusFatal(), MESSAGE, and ex30_tepal.status.

Referenced by SMESH_Gen_i.Load().

{
  if(MYDEBUG) MESSAGE("addHypothesis");

  if (CORBA::is_nil(aSubShapeObject) && HasShapeToMesh())
    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_Hypothesis::Hypothesis_Status status = SMESH_Hypothesis::HYP_OK;
  try
  {
    TopoDS_Shape myLocSubShape;
    //use PseudoShape in case if mesh has no shape
    if(HasShapeToMesh())
      myLocSubShape = _gen_i->GeomObjectToShape( aSubShapeObject);
    else              
      myLocSubShape = _impl->GetShapeToMesh();
    
    int hypId = myHyp->GetId();
    status = _impl->AddHypothesis(myLocSubShape, hypId);
    if ( !SMESH_Hypothesis::IsStatusFatal(status) ) {
      _mapHypo[hypId] = SMESH::SMESH_Hypothesis::_duplicate( myHyp );
#ifdef WITHGENERICOBJ
      _mapHypo[hypId]->Register();
#endif
      // assure there is a corresponding submesh
      if ( !_impl->IsMainShape( myLocSubShape )) {
        int shapeId = _impl->GetMeshDS()->ShapeToIndex( myLocSubShape );
        if ( _mapSubMesh_i.find( shapeId ) == _mapSubMesh_i.end() )
          createSubMesh( aSubShapeObject );
      }
    }
  }
  catch(SALOME_Exception & S_ex)
  {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
  return status;
}
SMESH::Hypothesis_Status SMESH_Mesh_i::AddHypothesis ( GEOM::GEOM_Object_ptr  aSubShapeObject,
SMESH::SMESH_Hypothesis_ptr  anHyp 
) throw (SALOME::SALOME_Exception)

AddHypothesis.

calls internal addHypothesis() and then adds a reference to <anHyp> under the SObject actually having a reference to <aSubShape>. NB: For this method to work, it is necessary to add a reference to sub-shape first.

Definition at line 448 of file SMESH_Mesh_i.cxx.

References SMESH_Hypothesis.IsStatusFatal(), MESSAGE, and ex30_tepal.status.

{
  Unexpect aCatch(SALOME_SalomeException);
  SMESH_Hypothesis::Hypothesis_Status status = addHypothesis( aSubShapeObject, anHyp );

  if ( !SMESH_Hypothesis::IsStatusFatal(status) )
    _gen_i->AddHypothesisToShape(_gen_i->GetCurrentStudy(), _this(),
                                 aSubShapeObject, anHyp );

  if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status );

  // Update Python script
  if(_impl->HasShapeToMesh()) {
    TPythonDump() << "status = " << _this() << ".AddHypothesis( "
                  << aSubShapeObject << ", " << anHyp << " )";
  }
  else {
    TPythonDump() << "status = " << _this() << ".AddHypothesis( "<< anHyp << " )";
  }
  
  return ConvertHypothesisStatus(status);
}
SMESH::double_array * SMESH_Mesh_i::BaryCenter ( CORBA::Long  id)

Returns bary center for given element.

Definition at line 3414 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindElement(), SMDS_VolumeTool.GetBaryCenter(), SMDS_MeshElement.GetType(), SMESH_AdvancedEditor.nbn, SMDS_MeshElement.nodesIterator(), SMDS_VolumeTool.Set(), SMDSAbs_Volume, SMDS_MeshNode.X(), ex13_hole1partial.x, SMDS_MeshNode.Y(), ex13_hole1partial.y, and SMDS_MeshNode.Z().

{
  SMESH::double_array_var aResult = new SMESH::double_array();
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL )
    return aResult._retn();

  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
  if(!elem)
    return aResult._retn();

  if(elem->GetType()==SMDSAbs_Volume) {
    SMDS_VolumeTool aTool;
    if(aTool.Set(elem)) {
      aResult->length(3);
      if (!aTool.GetBaryCenter( aResult[0], aResult[1], aResult[2]) )
        aResult->length(0);
    }
  }
  else {
    SMDS_ElemIteratorPtr anIt = elem->nodesIterator();
    int nbn = 0;
    double x=0., y=0., z=0.;
    for(; anIt->more(); ) {
      nbn++;
      const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(anIt->next());
      x += aNode->X();
      y += aNode->Y();
      z += aNode->Z();
    }
    if(nbn>0) {
      // add coordinates
      aResult->length(3);
      aResult[0] = x/nbn;
      aResult[1] = y/nbn;
      aResult[2] = z/nbn;
    }
  }

  return aResult._retn();
}
void SMESH_Mesh_i::CheckGeomGroupModif ( )

Update hypotheses assigned to geom groups if the latter change.

Update objects depending on changed geom groups.

NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"

NPAL16168: geometrical group edition from a submesh don't modifiy mesh computation issue 0020210: Update of a smesh group after modification of the associated geom group

Definition at line 1680 of file SMESH_Mesh_i.cxx.

References _gen_i, _geomGroupData, _impl, _mapGroups, _mapSubMesh, _mapSubMesh_i, _mapSubMeshIor, SMESH_GroupBase_i.changeLocalId(), SMESH_box.geom, SMESH_Gen_i.GetCurrentStudy(), SMESHDS_Mesh.GetGroups(), SMESHDS_Mesh.GetHypothesis(), SMESH_GroupBase_i.GetLocalID(), SMESHDS_GroupOnGeom.GetShape(), ex21_lamp.group, SMESHDS_Mesh.IndexToShape(), SMESHDS_Mesh.MaxShapeIndex(), PAL_MESH_041_mesh.mesh, ex21_lamp.name, NbElements(), NbNodes(), newGroupShape(), SMESH_Gen_i.ObjectToSObject(), RemoveGroup(), RemoveSubMesh(), SMESH_Gen_i.SetPixMap(), SMESHDS_GroupOnGeom.SetShape(), SMESHDS_Mesh.ShapeToIndex(), SMESHDS_Mesh.ShapeToMesh(), and SMESH_test4.submesh.

Referenced by Clear(), SMESH_Gen_i.Compute(), SMESH_Gen_i.Evaluate(), and SMESH_Gen_i.Precompute().

{
  if ( !_impl->HasShapeToMesh() ) return;

  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
  if ( study->_is_nil() ) return;

  CORBA::Long nbEntities = NbNodes() + NbElements();

  // Check if group contents changed

  typedef map< string, TopoDS_Shape > TEntry2Geom;
  TEntry2Geom newGroupContents;

  list<TGeomGroupData>::iterator
    data = _geomGroupData.begin(), dataEnd = _geomGroupData.end();
  for ( ; data != dataEnd; ++data )
  {
    pair< TEntry2Geom::iterator, bool > it_new =
      newGroupContents.insert( make_pair( data->_groupEntry, TopoDS_Shape() ));
    bool processedGroup    = !it_new.second;
    TopoDS_Shape& newShape = it_new.first->second;
    if ( !processedGroup )
      newShape = newGroupShape( *data );
    if ( newShape.IsNull() )
      continue; // no changes

    if ( processedGroup ) { // update group indices
      list<TGeomGroupData>::iterator data2 = data;
      for ( --data2; data2->_groupEntry != data->_groupEntry; --data2) {}
      data->_indices = data2->_indices;
    }

    // Update SMESH objects according to new GEOM group contents

    SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow( data->_smeshObject );
    if ( !submesh->_is_nil() ) // -------------- Sub mesh ---------------------
    {
      int oldID = submesh->GetId();
      if ( _mapSubMeshIor.find( oldID ) == _mapSubMeshIor.end() )
        continue;
      TopoDS_Shape oldShape = _mapSubMesh[oldID]->GetSubShape();

      // update hypotheses
      list <const SMESHDS_Hypothesis * > hyps = _impl->GetHypothesisList(oldShape);
      list <const SMESHDS_Hypothesis * >::iterator hypIt;
      for ( hypIt = hyps.begin(); hypIt != hyps.end(); ++hypIt )
      {
        _impl->RemoveHypothesis( oldShape, (*hypIt)->GetID());
        _impl->AddHypothesis   ( newShape, (*hypIt)->GetID());
      }
      // care of submeshes
      SMESH_subMesh* newSubmesh = _impl->GetSubMesh( newShape );
      int newID = newSubmesh->GetId();
      if ( newID != oldID ) {
        _mapSubMesh   [ newID ] = newSubmesh;
        _mapSubMesh_i [ newID ] = _mapSubMesh_i [ oldID ];
        _mapSubMeshIor[ newID ] = _mapSubMeshIor[ oldID ];
        _mapSubMesh.   erase(oldID);
        _mapSubMesh_i. erase(oldID);
        _mapSubMeshIor.erase(oldID);
        _mapSubMesh_i [ newID ]->changeLocalId( newID );
      }
      continue;
    }

    SMESH::SMESH_GroupOnGeom_var smeshGroup =
      SMESH::SMESH_GroupOnGeom::_narrow( data->_smeshObject );
    if ( !smeshGroup->_is_nil() ) // ------------ GROUP -----------------------
    {
      SMESH_GroupOnGeom_i* group_i = SMESH::DownCast<SMESH_GroupOnGeom_i*>( smeshGroup );
      if ( group_i ) {
        ::SMESH_Group* group = _impl->GetGroup( group_i->GetLocalID() );
        SMESHDS_GroupOnGeom* ds = static_cast<SMESHDS_GroupOnGeom*>( group->GetGroupDS() );
        ds->SetShape( newShape );
      }
      continue;
    }

    SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( data->_smeshObject );
    if ( !mesh->_is_nil() ) // -------------- MESH ----------------------------
    {
      // Remove groups and submeshes basing on removed sub-shapes

      TopTools_MapOfShape newShapeMap;
      TopoDS_Iterator shapeIt( newShape );
      for ( ; shapeIt.More(); shapeIt.Next() )
        newShapeMap.Add( shapeIt.Value() );

      SMESHDS_Mesh* meshDS = _impl->GetMeshDS();
      for ( shapeIt.Initialize( meshDS->ShapeToMesh() ); shapeIt.More(); shapeIt.Next() )
      {
        if ( newShapeMap.Contains( shapeIt.Value() ))
          continue;
        TopTools_IndexedMapOfShape oldShapeMap;
        TopExp::MapShapes( shapeIt.Value(), oldShapeMap );
        for ( int i = 1; i <= oldShapeMap.Extent(); ++i )
        {
          const TopoDS_Shape& oldShape = oldShapeMap(i);
          int oldInd = meshDS->ShapeToIndex( oldShape );
          // -- submeshes --
          map<int, SMESH::SMESH_subMesh_ptr>::iterator i_smIor = _mapSubMeshIor.find( oldInd );
          if ( i_smIor != _mapSubMeshIor.end() ) {
            RemoveSubMesh( i_smIor->second ); // one submesh per shape index
          }
          // --- groups ---
          map<int, SMESH::SMESH_GroupBase_ptr>::iterator i_grp = _mapGroups.begin();
          for ( ; i_grp != _mapGroups.end(); ++i_grp )
          {
            // check if a group bases on oldInd shape
            SMESHDS_GroupOnGeom* grpOnGeom = 0;
            if ( ::SMESH_Group* g = _impl->GetGroup( i_grp->first ))
              grpOnGeom = dynamic_cast<SMESHDS_GroupOnGeom*>( g->GetGroupDS() );
            if ( grpOnGeom && oldShape.IsSame( grpOnGeom->GetShape() ))
            { // remove
              RemoveGroup( i_grp->second ); // several groups can base on same shape
              i_grp = _mapGroups.begin(); // _mapGroups changed - restart iteration
            }
          }
        }
      }
      // Reassign hypotheses and update groups after setting the new shape to mesh

      // collect anassigned hypotheses
      typedef list< pair< TIndexedShape, list<const SMESHDS_Hypothesis*> > > TShapeHypList;
      list <const SMESHDS_Hypothesis * >::const_iterator hypIt;
      TShapeHypList assignedHyps;
      for ( int i = 1; i <= meshDS->MaxShapeIndex(); ++i )
      {
        const TopoDS_Shape& oldShape = meshDS->IndexToShape(i);
        list<const SMESHDS_Hypothesis*> hyps = meshDS->GetHypothesis( oldShape );// copy
        if ( !hyps.empty() ) {
          assignedHyps.push_back( make_pair( TIndexedShape(i,oldShape), hyps ));
          for ( hypIt = hyps.begin(); hypIt != hyps.end(); ++hypIt )
            _impl->RemoveHypothesis( oldShape, (*hypIt)->GetID());
        }
      }
      // collect shapes supporting groups
      typedef list < pair< TIndexedShape, SMDSAbs_ElementType > > TShapeTypeList;
      TShapeTypeList groupData;
      const set<SMESHDS_GroupBase*>& groups = meshDS->GetGroups();
      set<SMESHDS_GroupBase*>::const_iterator grIt = groups.begin();
      for ( ; grIt != groups.end(); ++grIt )
      {
        if ( SMESHDS_GroupOnGeom* gog = dynamic_cast<SMESHDS_GroupOnGeom*>( *grIt ))
          groupData.push_back
            ( make_pair( TIndexedShape( gog->GetID(),gog->GetShape()), gog->GetType()));
      }
      // set new shape to mesh -> DS of submeshes and geom groups is deleted
      _impl->ShapeToMesh( newShape );
      
      // reassign hypotheses
      TShapeHypList::iterator indS_hyps = assignedHyps.begin();
      for ( ; indS_hyps != assignedHyps.end(); ++indS_hyps )
      {
        TIndexedShape&                   geom = indS_hyps->first;
        list<const SMESHDS_Hypothesis*>& hyps = indS_hyps->second;
        int oldID = geom._index;
        int newID = meshDS->ShapeToIndex( geom._shape );
        if ( !newID )
          continue;
        if ( oldID == 1 ) { // main shape
          newID = 1;
          geom._shape = newShape;
        }
        for ( hypIt = hyps.begin(); hypIt != hyps.end(); ++hypIt )
          _impl->AddHypothesis( geom._shape, (*hypIt)->GetID());
        // care of submeshes
        SMESH_subMesh* newSubmesh = _impl->GetSubMesh( geom._shape );
        if ( newID != oldID ) {
          _mapSubMesh   [ newID ] = newSubmesh;
          _mapSubMesh_i [ newID ] = _mapSubMesh_i [ oldID ];
          _mapSubMeshIor[ newID ] = _mapSubMeshIor[ oldID ];
          _mapSubMesh.   erase(oldID);
          _mapSubMesh_i. erase(oldID);
          _mapSubMeshIor.erase(oldID);
          _mapSubMesh_i [ newID ]->changeLocalId( newID );
        }
      }
      // recreate groups
      TShapeTypeList::iterator geomType = groupData.begin();
      for ( ; geomType != groupData.end(); ++geomType )
      {
        const TIndexedShape& geom = geomType->first;
        int oldID = geom._index;
        if ( _mapGroups.find( oldID ) == _mapGroups.end() )
          continue;
        // get group name
        SALOMEDS::SObject_var groupSO = _gen_i->ObjectToSObject( study,_mapGroups[oldID] );
        CORBA::String_var     name    = groupSO->GetName();
        // update
        SMESH_GroupBase_i* group_i    = SMESH::DownCast<SMESH_GroupBase_i*>(_mapGroups[oldID] );
        int newID;
        if ( group_i && _impl->AddGroup( geomType->second, name.in(), newID, geom._shape ))
          group_i->changeLocalId( newID );
      }

      break; // everything has been updated

    } // update mesh
  } // loop on group data

  // Update icons

  CORBA::Long newNbEntities = NbNodes() + NbElements();
  list< SALOMEDS::SObject_var > soToUpdateIcons;
  if ( newNbEntities != nbEntities )
  {
    // Add all SObjects with icons
    soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, _this() )); // mesh

    for (map<int, SMESH::SMESH_subMesh_ptr>::iterator i_sm = _mapSubMeshIor.begin();
         i_sm != _mapSubMeshIor.end(); ++i_sm ) // submeshes
      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, i_sm->second ));

    for ( map<int, SMESH::SMESH_GroupBase_ptr>::iterator i_gr = _mapGroups.begin();
          i_gr != _mapGroups.end(); ++i_gr ) // groups
      soToUpdateIcons.push_back( _gen_i->ObjectToSObject( study, i_gr->second ));
  }

  list< SALOMEDS::SObject_var >::iterator so = soToUpdateIcons.begin();
  for ( ; so != soToUpdateIcons.end(); ++so )
    _gen_i->SetPixMap( *so, "ICON_SMESH_TREE_MESH_WARN" );
}
void SMESH_Mesh_i::checkGroupNames ( ) [private]

Check and correct names of mesh groups.

Definition at line 3568 of file SMESH_Mesh_i.cxx.

References _gen_i, SMESH_Gen_i.GetCurrentStudy(), GetGroups(), NbGroups(), and SMESH_Gen_i.ObjectToSObject().

{
  int nbGrp = NbGroups();
  if ( !nbGrp )
    return;

  SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
  if ( aStudy->_is_nil() )
    return; // nothing to do
  
  SMESH::ListOfGroups* grpList = 0;
  // avoid dump of "GetGroups"
  {
    // store python dump into a local variable inside local scope
    SMESH::TPythonDump pDump; // do not delete this line of code
    grpList = GetGroups();
  }

  for ( int gIndx = 0; gIndx < nbGrp; gIndx++ ) {
    SMESH::SMESH_GroupBase_ptr aGrp = (*grpList)[ gIndx ];
    if ( !aGrp )
      continue;
    SALOMEDS::SObject_var aGrpSO = _gen_i->ObjectToSObject( aStudy, aGrp );
    if ( aGrpSO->_is_nil() )
      continue;
    // correct name of the mesh group if necessary
    const char* guiName = aGrpSO->GetName();
    if ( strcmp(guiName, aGrp->GetName()) )
      aGrp->SetName( guiName );
  }
}
void SMESH_Mesh_i::Clear ( ) throw (SALOME::SALOME_Exception)

Remove all nodes and elements.

Definition at line 238 of file SMESH_Mesh_i.cxx.

References _impl, and CheckGeomGroupModif().

{
  Unexpect aCatch(SALOME_SalomeException);
  try {
    _impl->Clear();
    CheckGeomGroupModif(); // issue 20145
  }
  catch(SALOME_Exception & S_ex) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
  TPythonDump() <<  _this() << ".Clear()";
}
void SMESH_Mesh_i::ClearLog ( ) throw (SALOME::SALOME_Exception)

Definition at line 2208 of file SMESH_Mesh_i.cxx.

References _impl, and MESSAGE.

{
  if(MYDEBUG) MESSAGE("SMESH_Mesh_i::ClearLog");
  _impl->ClearLog();
}
void SMESH_Mesh_i::ClearSubMesh ( CORBA::Long  ShapeID) throw (SALOME::SALOME_Exception)

Remove all nodes and elements for indicated shape.

Definition at line 257 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  try {
    _impl->ClearSubMesh( ShapeID );
  }
  catch(SALOME_Exception & S_ex) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
}
void SMESH_Mesh_i::CollectMeshInfo ( const SMDS_ElemIteratorPtr  theItr,
SMESH::long_array theInfo 
) [static]

Collect statistic of mesh elements given by iterator.

Definition at line 3706 of file SMESH_Mesh_i.cxx.

Referenced by SMESH_subMesh_i.GetMeshInfo(), and SMESH_GroupBase_i.GetMeshInfo().

{
  if (!theItr) return;
  while (theItr->more())
    theInfo[ theItr->next()->GetEntityType() ]++;
}
SMESH::Hypothesis_Status SMESH_Mesh_i::ConvertHypothesisStatus ( SMESH_Hypothesis::Hypothesis_Status  theStatus) [static]
void SMESH_Mesh_i::convertMeshOrder ( const TListOfListOfInt theIdsOrder,
SMESH::submesh_array_array theSubMeshOrder,
const bool  theIsDump 
) [private]

Convert submesh ids into submesh interfaces.

Definition at line 4102 of file SMESH_Mesh_i.cxx.

Referenced by GetMeshOrder().

{
  int nbSet = theIdsOrder.size();
  TPythonDump aPythonDump; // prevent dump of called methods
  if ( theIsDump )
    aPythonDump << "[ ";
  theResOrder.length(nbSet);
  TListOfListOfInt::const_iterator it = theIdsOrder.begin();
  int listIndx = 0;
  for( ; it != theIdsOrder.end(); it++ ) {
    // translate submesh identificators into submesh objects
    //  takeing into account real number of concurrent lists
    const TListOfInt& aSubOrder = (*it);
    if (!aSubOrder.size())
      continue;
    if ( theIsDump )
      aPythonDump << "[ ";
    // convert shape indeces into interfaces
    SMESH::submesh_array_var aResSubSet = new SMESH::submesh_array();
    aResSubSet->length(aSubOrder.size());
    TListOfInt::const_iterator subIt = aSubOrder.begin();
    for( int j = 0; subIt != aSubOrder.end(); subIt++ ) {
      if ( _mapSubMeshIor.find(*subIt) == _mapSubMeshIor.end() )
        continue;
      SMESH::SMESH_subMesh_var subMesh =
        SMESH::SMESH_subMesh::_duplicate( _mapSubMeshIor[*subIt] );
      if ( theIsDump ) {
        if ( j > 0 )
          aPythonDump << ", ";
        aPythonDump << subMesh;
      }
      aResSubSet[ j++ ] = subMesh;
    }
    if ( theIsDump )
      aPythonDump << " ]";
    theResOrder[ listIndx++ ] = aResSubSet;
  }
  // correct number of lists
  theResOrder.length( listIndx );

  if ( theIsDump ) {
    // finilise python dump
    aPythonDump << " ]";
    aPythonDump << " = " << _this() << ".GetMeshOrder()";
  }
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone ( SMESH::SMESH_GroupOnGeom_ptr  theGeomGroup)

Create standalone group instead if group on geometry.

Definition at line 1911 of file SMESH_Mesh_i.cxx.

References _gen_i, _impl, _mapGroups, SMESH_controls.aGroup, SMESH_Gen_i.GetCurrentStudy(), SMESH_GroupBase_i.GetLocalID(), SMESH_Gen_i.GetORB(), SMESH_Gen_i.GetPOA(), SMESH_Gen_i.GetServant(), SMESH_Gen_i.ObjectToSObject(), SMESH_Gen_i.RegisterObject(), and removeGeomGroupData().

{
  SMESH::SMESH_Group_var aGroup;
  if ( theGroup->_is_nil() )
    return aGroup._retn();

  Unexpect aCatch(SALOME_SalomeException);

  SMESH_GroupBase_i* aGroupToRem =
    dynamic_cast<SMESH_GroupBase_i*>( SMESH_Gen_i::GetServant( theGroup ).in() );
  if ( !aGroupToRem )
    return aGroup._retn();

  int anId = aGroupToRem->GetLocalID();
  if ( !_impl->ConvertToStandalone( anId ) )
    return aGroup._retn();
  removeGeomGroupData( theGroup );

  SMESH_GroupBase_i* aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, anId );

  // remove old instance of group from own map
  _mapGroups.erase( anId );

  SALOMEDS::StudyBuilder_var builder;
  SALOMEDS::SObject_var aGroupSO;
  SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
  if ( !aStudy->_is_nil() )  {
    builder = aStudy->NewBuilder();
    aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup );
    if ( !aGroupSO->_is_nil() ) {

    // remove reference to geometry
    SALOMEDS::ChildIterator_var chItr = aStudy->NewChildIterator(aGroupSO);
    for ( ; chItr->More(); chItr->Next() )
      // Remove group's child SObject
      builder->RemoveObject( chItr->Value() );

      // Update Python script
      TPythonDump() << aGroupSO << " = " << _this() << ".ConvertToStandalone( "
                    << aGroupSO << " )";
    }
  }

  // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i
  SMESH_Gen_i::GetPOA()->activate_object( aGroupImpl );
  aGroupImpl->Register();
  // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i

  // remember new group in own map
  aGroup = SMESH::SMESH_Group::_narrow( aGroupImpl->_this() );
  _mapGroups[anId] = SMESH::SMESH_GroupBase::_duplicate( aGroup );

  // register CORBA object for persistence
  /*int nextId =*/ _gen_i->RegisterObject( aGroup );

  builder->SetIOR( aGroupSO, _gen_i->GetORB()->object_to_string( aGroup ) );

  return aGroup._retn();
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateDimGroup ( const SMESH::ListOfGroups theGroups,
SMESH::ElementType  theElemType,
const char *  theName 
) throw (SALOME::SALOME_Exception)

Create groups of entities from existing groups of superior dimensions System 1) extract all nodes from each group, 2) combine all elements of specified dimension laying on these nodes.

Parameters:
theGroupslist of source groups
theElemTypedimension of elements
theNamename of new group
Returns:
pointer on new group

Definition at line 1401 of file SMESH_Mesh_i.cxx.

References SMESH.ALL, SMESH_BelongToGeom.anElemType, SMDS_MeshElement.elementsIterator(), SMDS_Mesh.FindElement(), SMDS_Mesh.FindNode(), SMDS_MeshElement.GetID(), SMDS_MeshElement.GetType(), SMESH.NODE, and SMDS_MeshElement.nodesIterator().

{
  SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS();

  if ( !theName || !aMeshDS )
    return SMESH::SMESH_Group::_nil();

  SMDSAbs_ElementType anElemType = (SMDSAbs_ElementType)theElemType;

  try
  {
    // Create map of nodes from all groups 

    set< int > aNodeMap;
    
    for ( int g = 0, n = theGroups.length(); g < n; g++ )
    {
      SMESH::SMESH_GroupBase_var aGrp = theGroups[ g ];
      if ( CORBA::is_nil( aGrp ) )
        continue;

      SMESH::ElementType aType = aGrp->GetType();
      if ( aType == SMESH::ALL )
        continue;
      else if ( aType == SMESH::NODE )
      {
        SMESH::long_array_var aCurrIds = aGrp->GetListOfID();
        for ( int i = 0, n = aCurrIds->length(); i < n; i++ )
        {
          int aCurrId = aCurrIds[ i ];
          const SMDS_MeshNode* aNode = aMeshDS->FindNode( aCurrId );
          if ( aNode )
            aNodeMap.insert( aNode->GetID() );
        }
      }
      else 
      {
        SMESH::long_array_var aCurrIds = aGrp->GetListOfID();
        for ( int i = 0, n = aCurrIds->length(); i < n; i++ )
        {
          int aCurrId = aCurrIds[ i ];
          const SMDS_MeshElement* anElem = aMeshDS->FindElement( aCurrId );
          if ( !anElem )
            continue;
          SMDS_ElemIteratorPtr aNodeIter = anElem->nodesIterator();
          while( aNodeIter->more() )
          {
            const SMDS_MeshNode* aNode = 
              dynamic_cast<const SMDS_MeshNode*>( aNodeIter->next() );
            if ( aNode )
              aNodeMap.insert( aNode->GetID() );
          }
        }
      }
    }

    // Get result identifiers 

    vector< int > aResultIds;
    if ( theElemType == SMESH::NODE )
    {
      //NCollection_Map< int >::Iterator aNodeIter( aNodeMap );
      set<int>::iterator iter = aNodeMap.begin();
      for ( ; iter != aNodeMap.end(); iter++ )
        aResultIds.push_back( *iter);
    }
    else
    {
      // Create list of elements of given dimension constructed on the nodes
      vector< int > anElemList;
      //NCollection_Map< int >::Iterator aNodeIter( aNodeMap );
      //for ( ; aNodeIter.More(); aNodeIter.Next() )
      set<int>::iterator iter = aNodeMap.begin();
      for ( ; iter != aNodeMap.end(); iter++ )
      {
        const SMDS_MeshElement* aNode = 
          dynamic_cast<const SMDS_MeshElement*>( aMeshDS->FindNode( *iter ) );
        if ( !aNode )
          continue;

         SMDS_ElemIteratorPtr anElemIter = aNode->elementsIterator( anElemType );
        while( anElemIter->more() )
        {
          const SMDS_MeshElement* anElem = 
            dynamic_cast<const SMDS_MeshElement*>( anElemIter->next() );
          if ( anElem && anElem->GetType() == anElemType )
            anElemList.push_back( anElem->GetID() );
        }
      }

      // check whether all nodes of elements are present in nodes map
      //NCollection_Map< int >::Iterator anIter( anElemList );
      //for ( ; anIter.More(); anIter.Next() )
      for (int i=0; i< anElemList.size(); i++)
      {
        const SMDS_MeshElement* anElem = aMeshDS->FindElement( anElemList[i] );
        if ( !anElem )
          continue;

        bool isOk = true;
        SMDS_ElemIteratorPtr aNodeIter = anElem->nodesIterator();
        while( aNodeIter->more() )
        {
          const SMDS_MeshNode* aNode = 
            dynamic_cast<const SMDS_MeshNode*>( aNodeIter->next() );
          if ( !aNode || !aNodeMap.count( aNode->GetID() ) )
          {
            isOk = false;
            break;
          }
        } 
        if ( isOk )
          aResultIds.push_back( anElem->GetID() );
      }
    }

    // Create group

    SMESH::SMESH_Group_var aResGrp = CreateGroup( theElemType, theName );
    if ( aResGrp->_is_nil() )
      return SMESH::SMESH_Group::_nil();
    
    // Create array of identifiers
    SMESH::long_array_var aResIds = new SMESH::long_array;
    aResIds->length( aResultIds.size() );
    
    //NCollection_Map< int >::Iterator aResIter( aResultIds );
    //for ( int i = 0; aResIter.More(); aResIter.Next(), i++ )
    for (int i=0; i< aResultIds.size(); i++)
      aResIds[ i ] = aResultIds[i];
    aResGrp->Add( aResIds );

    // Remove strings corresponding to group creation
    SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
    _gen_i->RemoveLastFromPythonScript( aStudy->StudyId() );
    _gen_i->RemoveLastFromPythonScript( aStudy->StudyId() );

    // Update Python script
    
    TPythonDump() << aResGrp << " = " << _this() << ".CreateDimGroup( "
                  << &theGroups << ", " << theElemType << ", '" << theName << "' )";

    return aResGrp._retn();
  }
  catch( ... )
  {
    return SMESH::SMESH_Group::_nil();
  }
}
SMESH::SMESH_GroupBase_ptr SMESH_Mesh_i::createGroup ( SMESH::ElementType  theElemType,
const char *  theName,
const TopoDS_Shape &  theShape = TopoDS_Shape() 
)

Definition at line 2072 of file SMESH_Mesh_i.cxx.

References _gen_i, _impl, _mapGroups, addGeomGroupData(), SMESH_controls.aGroup, SMESH_box.geom, SMESH_Gen_i.GetPOA(), MESSAGE, SMESH_Gen_i.RegisterObject(), and SMESH_Gen_i.ShapeToGeomObject().

Referenced by SMESH_Gen_i.Load().

{
  std::string newName;
  if ( !theName || strlen( theName ) == 0 )
  {
    std::set< std::string > presentNames;
    std::map<int, SMESH::SMESH_GroupBase_ptr>::const_iterator i_gr = _mapGroups.begin();
    for ( ; i_gr != _mapGroups.end(); ++i_gr )
      presentNames.insert( i_gr->second->GetName() );
    do {
      newName = "noname_Group_" + SMESH_Comment( presentNames.size() + 1 );
    } while ( !presentNames.insert( newName ).second );
    theName = newName.c_str();
  }
  int anId;
  SMESH::SMESH_GroupBase_var aGroup;
  if ( _impl->AddGroup( (SMDSAbs_ElementType)theElemType, theName, anId, theShape )) {
    SMESH_GroupBase_i* aGroupImpl;
    if ( !theShape.IsNull() )
      aGroupImpl = new SMESH_GroupOnGeom_i( SMESH_Gen_i::GetPOA(), this, anId );
    else
      aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, anId );

    // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i
    SMESH_Gen_i::GetPOA()->activate_object( aGroupImpl );
    aGroupImpl->Register();
    // PAL7962: san -- To ensure correct mapping of servant and correct reference counting in GenericObj_i

    aGroup = SMESH::SMESH_GroupBase::_narrow( aGroupImpl->_this() );
    _mapGroups[anId] = SMESH::SMESH_GroupBase::_duplicate( aGroup );

    // register CORBA object for persistence
    int nextId = _gen_i->RegisterObject( aGroup );
    if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId);

    // to track changes of GEOM groups
    if ( !theShape.IsNull() ) {
      GEOM::GEOM_Object_var geom = _gen_i->ShapeToGeomObject( theShape );
      addGeomGroupData( geom, aGroup );
    }
  }
  return aGroup._retn();
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup ( SMESH::ElementType  theElemType,
const char *  theName 
) throw (SALOME::SALOME_Exception)

Definition at line 754 of file SMESH_Mesh_i.cxx.

References ElementTypeString().

Referenced by SMESH_Gen_i.ConcatenateCommon(), and SMESH_MeshEditor_i.MakeBoundaryElements().

{
  Unexpect aCatch(SALOME_SalomeException);
  SMESH::SMESH_Group_var aNewGroup =
    SMESH::SMESH_Group::_narrow( createGroup( theElemType, theName ));

  if ( _gen_i->CanPublishInStudy( aNewGroup ) ) {
    SALOMEDS::SObject_var aSO =
      _gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(),
                           aNewGroup, GEOM::GEOM_Object::_nil(), theName);
    if ( !aSO->_is_nil()) {
      // Update Python script
      TPythonDump() << aSO << " = " << _this() << ".CreateGroup( "
                    << ElementTypeString(theElemType) << ", '" << theName << "' )";
    }
  }
  return aNewGroup._retn();
}
SMESH::SMESH_GroupOnGeom_ptr SMESH_Mesh_i::CreateGroupFromGEOM ( SMESH::ElementType  theElemType,
const char *  theName,
GEOM::GEOM_Object_ptr  theGeomObj 
) throw (SALOME::SALOME_Exception)

Definition at line 781 of file SMESH_Mesh_i.cxx.

References SMESH_fixation.aShape, and ElementTypeString().

{
  Unexpect aCatch(SALOME_SalomeException);
  SMESH::SMESH_GroupOnGeom_var aNewGroup;

  TopoDS_Shape aShape = _gen_i->GeomObjectToShape( theGeomObj );
  if ( !aShape.IsNull() )
  {
    aNewGroup = SMESH::SMESH_GroupOnGeom::_narrow
      ( createGroup( theElemType, theName, aShape ));

    if ( _gen_i->CanPublishInStudy( aNewGroup ) ) {
      SALOMEDS::SObject_var aSO =
        _gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(),
                             aNewGroup, theGeomObj, theName);
      if ( !aSO->_is_nil()) {
        // Update Python script
        TPythonDump() << aSO << " = " << _this() << ".CreateGroupFromGEOM("
                      << ElementTypeString(theElemType) << ", '" << theName << "', "
                      << theGeomObj << " )";
      }
    }
  }

  return aNewGroup._retn();
}
void SMESH_Mesh_i::CreateGroupServants ( )

Assure that all groups are published.

Create and publish group servants if any groups were imported or created anyhow.

Definition at line 3463 of file SMESH_Mesh_i.cxx.

References _gen_i, _impl, _mapGroups, SMESH_Gen_i.GetCurrentStudy(), SMESH_Gen_i.GetPOA(), ex21_lamp.group, MESSAGE, SMESH_Gen_i.PublishGroup(), SMESH_Gen_i.RegisterObject(), SMESH_fixation.shape, and SMESH_Gen_i.ShapeToGeomObject().

Referenced by SMESH_Gen_i.Compute(), SMESH_MeshEditor_i.MirrorMakeMesh(), SMESH_MeshEditor_i.MirrorObjectMakeMesh(), SMESH_MeshEditor_i.RotateMakeMesh(), SMESH_MeshEditor_i.RotateObjectMakeMesh(), SMESH_MeshEditor_i.ScaleMakeMesh(), SMESH_MeshEditor_i.TranslateMakeMesh(), and SMESH_MeshEditor_i.TranslateObjectMakeMesh().

{
  SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();

  set<int> addedIDs;
  ::SMESH_Mesh::GroupIteratorPtr groupIt = _impl->GetGroups();
  while ( groupIt->more() )
  {
    ::SMESH_Group* group = groupIt->next();
    int            anId = group->GetGroupDS()->GetID();

    map<int, SMESH::SMESH_GroupBase_ptr>::iterator it = _mapGroups.find(anId);
    if ( it != _mapGroups.end() && !CORBA::is_nil( it->second ))
      continue;
    addedIDs.insert( anId );

    SMESH_GroupBase_i* aGroupImpl;
    TopoDS_Shape       shape;
    if ( SMESHDS_GroupOnGeom* groupOnGeom =
         dynamic_cast<SMESHDS_GroupOnGeom*>( group->GetGroupDS() ))
    {
      aGroupImpl = new SMESH_GroupOnGeom_i( SMESH_Gen_i::GetPOA(), this, anId );
      shape      = groupOnGeom->GetShape();
    }
    else {
      aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, anId );
    }

    // To ensure correct mapping of servant and correct reference counting in GenericObj_i
    SMESH_Gen_i::GetPOA()->activate_object( aGroupImpl );
    aGroupImpl->Register();

    SMESH::SMESH_GroupBase_var groupVar =
      SMESH::SMESH_GroupBase::_narrow( aGroupImpl->_this() );
    _mapGroups[anId] = SMESH::SMESH_GroupBase::_duplicate( groupVar );

    // register CORBA object for persistence
    int nextId = _gen_i->RegisterObject( groupVar );
    if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId);

    // publishing the groups in the study
    if ( !aStudy->_is_nil() ) {
      GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape );
      _gen_i->PublishGroup( aStudy, _this(), groupVar, shapeVar, groupVar->GetName());
    }
  }
  if ( !addedIDs.empty() )
  {
    // python dump
    set<int>::iterator id = addedIDs.begin();
    for ( ; id != addedIDs.end(); ++id )
    {
      map<int, SMESH::SMESH_GroupBase_ptr>::iterator it = _mapGroups.find(*id);
      int i = std::distance( _mapGroups.begin(), it );
      TPythonDump() << it->second << " = " << _this() << ".GetGroups()[ "<< i << " ]";
    }
  }
}
SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::createSubMesh ( GEOM::GEOM_Object_ptr  theSubShapeObject)

Definition at line 1977 of file SMESH_Mesh_i.cxx.

References _gen_i, _impl, _mapSubMesh, _mapSubMesh_i, _mapSubMeshIor, addGeomGroupData(), SMESH_Gen_i.GeomObjectToShape(), MESSAGE, and SMESH_Gen_i.RegisterObject().

Referenced by addHypothesis(), and SMESH_Gen_i.Load().

{
  if(MYDEBUG) MESSAGE( "createSubMesh" );
  TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(theSubShapeObject);

  ::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape);
  int subMeshId = _impl->GetMeshDS()->ShapeToIndex( myLocSubShape );
  SMESH_subMesh_i *subMeshServant = new SMESH_subMesh_i(myPOA, _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);

  // register CORBA object for persistence
  int nextId = _gen_i->RegisterObject( subMesh );
  if(MYDEBUG) MESSAGE( "Add submesh to map with id = "<< nextId);

  // to track changes of GEOM groups
  addGeomGroupData( theSubShapeObject, subMesh );

  return subMesh._retn();
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutGroups ( SMESH::SMESH_GroupBase_ptr  theGroup1,
SMESH::SMESH_GroupBase_ptr  theGroup2,
const char *  theName 
) throw (SALOME::SALOME_Exception)

CutGroups New group is created.

All mesh elements that are present in main group but do not present in tool group are added to the new one

Definition at line 1228 of file SMESH_Mesh_i.cxx.

References SMESH_test.i1, SMESH_test.i2, SMESH_AdvancedEditor.n1, and SMESH_AdvancedEditor.n2.

{
  if ( theGroup1->_is_nil() || theGroup2->_is_nil() ||
       theGroup1->GetType() != theGroup2->GetType() )
    return SMESH::SMESH_Group::_nil();

  // Perform Cutting
  SMESH::SMESH_Group_var aResGrp = CreateGroup( theGroup1->GetType(), theName );
  if ( aResGrp->_is_nil() )
    return aResGrp;

  SMESH::long_array_var anIds1 = theGroup1->GetListOfID();
  SMESH::long_array_var anIds2 = theGroup2->GetListOfID();

  TColStd_MapOfInteger aMap2;

  for ( int i2 = 0, n2 = anIds2->length(); i2 < n2; i2++ )
    aMap2.Add( anIds2[ i2 ] );

  TColStd_SequenceOfInteger aSeq;
  for ( int i1 = 0, n1 = anIds1->length(); i1 < n1; i1++ )
    if ( !aMap2.Contains( anIds1[ i1 ] ) )
      aSeq.Append( anIds1[ i1 ] );

  SMESH::long_array_var aResIds = new SMESH::long_array;
  aResIds->length( aSeq.Length() );

  for ( int resI = 0, resN = aSeq.Length(); resI < resN; resI++ )
    aResIds[ resI ] = aSeq( resI + 1 );

  aResGrp->Add( aResIds );

  // Clear python lines, created by CreateGroup() and Add()
  SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
  _gen_i->RemoveLastFromPythonScript(aStudy->StudyId());
  _gen_i->RemoveLastFromPythonScript(aStudy->StudyId());

  // Update Python script
  TPythonDump() << aResGrp << " = " << _this() << ".CutGroups( "
                << theGroup1 << ", " << theGroup2 << ", '"
                << theName << "' )";

  return aResGrp._retn();
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutListOfGroups ( const SMESH::ListOfGroups theMainGroups,
const SMESH::ListOfGroups theToolGroups,
const char *  theName 
) throw (SALOME::SALOME_Exception)

Cut lists of groups.

New group is created. All mesh elements that are present in main groups but do not present in tool groups are added to the new one

Parameters:
theMainGroupslist of main groups
theToolGroupslist of tool groups
theNamename of group to be created
Returns:
pointer on the group

Definition at line 1286 of file SMESH_Mesh_i.cxx.

References SMESH.ALL, and SMESH_BelongToGeom.anIds.

{
  if ( !theName )
    return SMESH::SMESH_Group::_nil();

  try
  {
    set< int > aToolIds;
    SMESH::ElementType aType = SMESH::ALL;
    int g, n;
    // iterate through tool groups
    for ( g = 0, n = theToolGroups.length(); g < n; g++ )
    {
      SMESH::SMESH_GroupBase_var aGrp = theToolGroups[ g ];
      if ( CORBA::is_nil( aGrp ) )
        continue;

      // check type
      SMESH::ElementType aCurrType = aGrp->GetType();
      if ( aType == SMESH::ALL )
        aType = aCurrType;
      else 
      {
        if ( aType != aCurrType )
          return SMESH::SMESH_Group::_nil();
      }

      // unite tool ids
      SMESH::long_array_var aCurrIds = aGrp->GetListOfID();
      for ( int i = 0, n = aCurrIds->length(); i < n; i++ )
      {
        int aCurrId = aCurrIds[ i ];
        aToolIds.insert( aCurrId );
      }
    }

    vector< int > anIds; // result

    // Iterate through main group 
    for ( g = 0, n = theMainGroups.length(); g < n; g++ )
    {
      SMESH::SMESH_GroupBase_var aGrp = theMainGroups[ g ];
      if ( CORBA::is_nil( aGrp ) )
        continue;

      // check type
      SMESH::ElementType aCurrType = aGrp->GetType();
      if ( aType == SMESH::ALL )
        aType = aCurrType;
      else 
      {
        if ( aType != aCurrType )
          return SMESH::SMESH_Group::_nil();
      }

      // unite tool ids
      SMESH::long_array_var aCurrIds = aGrp->GetListOfID();
      for ( int i = 0, n = aCurrIds->length(); i < n; i++ )
      {
        int aCurrId = aCurrIds[ i ];
        if ( !aToolIds.count( aCurrId ) )
          anIds.push_back( aCurrId );
      }
    }

    // Create group
    SMESH::SMESH_Group_var aResGrp = CreateGroup( aType, theName );
    if ( aResGrp->_is_nil() )
      return SMESH::SMESH_Group::_nil();
    
    // Create array of identifiers
    SMESH::long_array_var aResIds = new SMESH::long_array;
    aResIds->length( anIds.size() );
    
    for (int i=0; i<anIds.size(); i++ )
    {
      aResIds[ i ] = anIds[i];
    }
    aResGrp->Add( aResIds );

    // Clear python lines, created by CreateGroup() and Add()
    SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
    _gen_i->RemoveLastFromPythonScript( aStudy->StudyId() );
    _gen_i->RemoveLastFromPythonScript( aStudy->StudyId() );

    // Update Python script

    TPythonDump() << aResGrp << " = " << _this() << ".CutListOfGroups( "
                  << &theMainGroups << ", " << &theToolGroups << ", '"
                  << theName << "' )";
    
    return aResGrp._retn();
  }
  catch( ... )
  {
    return SMESH::SMESH_Group::_nil();
  }
}
char * SMESH_Mesh_i::Dump ( )

Definition at line 2753 of file SMESH_Mesh_i.cxx.

References _impl.

{
  ostringstream os;
  _impl->Dump( os );
  return CORBA::string_dup( os.str().c_str() );
}
CORBA::Long SMESH_Mesh_i::ElemNbEdges ( CORBA::Long  id)

Returns number of edges for given element.

Definition at line 3299 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindElement(), and SMDS_MeshElement.NbEdges().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL ) return -1;
  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
  if(!elem) return -1;
  return elem->NbEdges();
}
CORBA::Long SMESH_Mesh_i::ElemNbFaces ( CORBA::Long  id)

Returns number of faces for given element.

Definition at line 3315 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindElement(), and SMDS_MeshElement.NbFaces().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL ) return -1;
  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
  if(!elem) return -1;
  return elem->NbFaces();
}
void SMESH_Mesh_i::ExportDAT ( const char *  file) throw (SALOME::SALOME_Exception)

Definition at line 2501 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);

  // Update Python script
  // check names of groups
  checkGroupNames();
  TPythonDump() << _this() << ".ExportDAT( r'" << file << "' )";

  // Perform Export
  PrepareForWriting(file);
  _impl->ExportDAT(file);
}
void SMESH_Mesh_i::ExportMED ( const char *  file,
CORBA::Boolean  auto_groups 
) throw (SALOME::SALOME_Exception)

Definition at line 2494 of file SMESH_Mesh_i.cxx.

References SMESH.MED_V2_2.

{
  ExportToMEDX(file,auto_groups,SMESH::MED_V2_2,true);
}
void SMESH_Mesh_i::ExportSTL ( const char *  file,
bool  isascii 
) throw (SALOME::SALOME_Exception)

Definition at line 2531 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);

  // Update Python script
  // check names of groups
  checkGroupNames();
  TPythonDump() << _this() << ".ExportSTL( r'" << file << "', " << isascii << " )";

  // Perform Export
  PrepareForWriting(file);
  _impl->ExportSTL(file, isascii);
}
void SMESH_Mesh_i::ExportToMED ( const char *  file,
CORBA::Boolean  auto_groups,
SMESH::MED_VERSION  theVersion 
) throw (SALOME::SALOME_Exception)

Definition at line 2486 of file SMESH_Mesh_i.cxx.

{
  ExportToMEDX(file,auto_groups,theVersion,true);
}
void SMESH_Mesh_i::ExportToMEDX ( const char *  file,
CORBA::Boolean  auto_groups,
SMESH::MED_VERSION  theVersion,
CORBA::Boolean  overwrite 
) throw (SALOME::SALOME_Exception)

Definition at line 2439 of file SMESH_Mesh_i.cxx.

References SMESH_test5.aFileName.

{
  Unexpect aCatch(SALOME_SalomeException);

  // Perform Export
  PrepareForWriting(file, overwrite);
  const char* aMeshName = "Mesh";
  SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
  if ( !aStudy->_is_nil() ) {
    SALOMEDS::SObject_var aMeshSO = _gen_i->ObjectToSObject( aStudy, _this() );
    if ( !aMeshSO->_is_nil() ) {
      aMeshName = aMeshSO->GetName();
      // asv : 27.10.04 : fix of 6903: check for StudyLocked before adding attributes
      if ( !aStudy->GetProperties()->IsLocked() )
        {
        SALOMEDS::GenericAttribute_var anAttr;
        SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
        SALOMEDS::AttributeExternalFileDef_var aFileName;
        anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeExternalFileDef");
        aFileName = SALOMEDS::AttributeExternalFileDef::_narrow(anAttr);
        ASSERT(!aFileName->_is_nil());
        aFileName->SetValue(file);
        SALOMEDS::AttributeFileType_var aFileType;
        anAttr=aStudyBuilder->FindOrCreateAttribute(aMeshSO, "AttributeFileType");
        aFileType = SALOMEDS::AttributeFileType::_narrow(anAttr);
        ASSERT(!aFileType->_is_nil());
        aFileType->SetValue("FICHIERMED");
        }
    }
  }
  // Update Python script
  // set name of mesh before export
  TPythonDump() << _gen_i << ".SetName(" << _this() << ", '" << aMeshName << "')";
  
  // check names of groups
  checkGroupNames();

  TPythonDump() << _this() << ".ExportToMEDX( r'"
                << file << "', " << auto_groups << ", " << theVersion << ", " << overwrite << " )";

  _impl->ExportMED( file, aMeshName, auto_groups, theVersion );
}
void SMESH_Mesh_i::ExportUNV ( const char *  file) throw (SALOME::SALOME_Exception)

Definition at line 2516 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);

  // Update Python script
  // check names of groups
  checkGroupNames();
  TPythonDump() << _this() << ".ExportUNV( r'" << file << "' )";

  // Perform Export
  PrepareForWriting(file);
  _impl->ExportUNV(file);
}
CORBA::Long SMESH_Mesh_i::FindElementByNodes ( const SMESH::long_array nodes)

Returns an element based on all given nodes.

Definition at line 3355 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_MeshElement.GetID(), PAL_MESH_041_mesh.mesh, ORDER_QUADRATIC, and SMDSAbs_All.

{
  CORBA::Long elemID(0);
  if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() )
  {
    vector< const SMDS_MeshNode * > nn( nodes.length() );
    for ( int i = 0; i < nodes.length(); ++i )
      if ( !( nn[i] = mesh->FindNode( nodes[i] )))
        return elemID;

    const SMDS_MeshElement* elem = mesh->FindElement( nn );
    if ( !elem && ( _impl->NbEdges( ORDER_QUADRATIC ) ||
                    _impl->NbFaces( ORDER_QUADRATIC ) ||
                    _impl->NbVolumes( ORDER_QUADRATIC )))
      elem = mesh->FindElement( nn, SMDSAbs_All, /*noMedium=*/true );

    if ( elem ) elemID = CORBA::Long( elem->GetID() );
  }
  return elemID;
}
CORBA::Boolean SMESH_Mesh_i::GetAutoColor ( ) throw (SALOME::SALOME_Exception)

Definition at line 2378 of file SMESH_Mesh_i.cxx.

References _impl.

Referenced by SMESH_Gen_i.Save().

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->GetAutoColor();
}
SMESH::EntityType SMESH_Mesh_i::GetElementGeomType ( CORBA::Long  id) throw (SALOME::SALOME_Exception)

Definition at line 2894 of file SMESH_Mesh_i.cxx.

References SMDS_MeshElement.GetEntityType().

{
  const SMDS_MeshElement* e = _impl->GetMeshDS()->FindElement(id);
  if ( !e )
    THROW_SALOME_CORBA_EXCEPTION( "invalid element id", SALOME::BAD_PARAM );

  return ( SMESH::EntityType ) e->GetEntityType();
}
SMESH::long_array * SMESH_Mesh_i::GetElementsByType ( SMESH::ElementType  theElemType) throw (SALOME::SALOME_Exception)

Definition at line 2815 of file SMESH_Mesh_i.cxx.

References SMESH.ALL, SMDS_Mesh.elementsIterator(), SMDS_MeshElement.GetID(), SMDS_MeshElement.GetType(), MESSAGE, and SMESH.NODE.

{
  Unexpect aCatch(SALOME_SalomeException);
  MESSAGE("SMESH_subMesh_i::GetElementsByType");
  SMESH::long_array_var aResult = new SMESH::long_array();
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();

  if ( aSMESHDS_Mesh == NULL )
    return aResult._retn();

  long nbElements = NbElements();

  // No sense in returning ids of elements along with ids of nodes:
  // when theElemType == SMESH::ALL, return node ids only if
  // there are no elements
  if ( theElemType == SMESH::NODE || (theElemType == SMESH::ALL && nbElements == 0) )
    return GetNodesId();

  aResult->length( nbElements );

  int i = 0;

  SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator();
  while ( i < nbElements && anIt->more() ) {
    const SMDS_MeshElement* anElem = anIt->next();
    if ( theElemType == SMESH::ALL || anElem->GetType() == (SMDSAbs_ElementType)theElemType )
      aResult[i++] = anElem->GetID();
  }

  aResult->length( i );

  return aResult._retn();
}
SMESH::long_array * SMESH_Mesh_i::GetElementsId ( ) throw (SALOME::SALOME_Exception)

Definition at line 2788 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.elementsIterator(), MESSAGE, and NbElements().

Referenced by GetIDs().

{
  Unexpect aCatch(SALOME_SalomeException);
  MESSAGE("SMESH_Mesh_i::GetElementsId");
  SMESH::long_array_var aResult = new SMESH::long_array();
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();

  if ( aSMESHDS_Mesh == NULL )
    return aResult._retn();

  long nbElements = NbElements();
  aResult->length( nbElements );
  SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator();
  for ( int i = 0, n = nbElements; i < n && anIt->more(); i++ )
    aResult[i] = anIt->next()->GetID();

  return aResult._retn();
}
SMESH::ElementType SMESH_Mesh_i::GetElementType ( CORBA::Long  id,
bool  iselem 
) throw (SALOME::SALOME_Exception)

Definition at line 2882 of file SMESH_Mesh_i.cxx.

{
  return ( SMESH::ElementType )_impl->GetElementType( id, iselem );
}
SMESH::long_array * SMESH_Mesh_i::GetElemFaceNodes ( CORBA::Long  elemId,
CORBA::Short  faceIndex 
)

Returns nodes of given face (counted from zero) for given element.

Definition at line 3329 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_VolumeTool.GetFaceNodes(), SMDS_VolumeTool.NbFaceNodes(), and SMDS_VolumeTool.NbFaces().

{
  SMESH::long_array_var aResult = new SMESH::long_array();
  if ( SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS() )
  {
    if ( const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(elemId) )
    {
      SMDS_VolumeTool vtool( elem );
      if ( faceIndex < vtool.NbFaces() )
      {
        aResult->length( vtool.NbFaceNodes( faceIndex ));
        const SMDS_MeshNode** nn = vtool.GetFaceNodes( faceIndex );
        for ( int i = 0; i < aResult->length(); ++i )
          aResult[ i ] = nn[ i ]->GetID();
      }
    }
  }
  return aResult._retn();
}
CORBA::Long SMESH_Mesh_i::GetElemNbNodes ( CORBA::Long  id)

Returns number of nodes for given element If there is not element for given ID - returns -1.

Definition at line 3192 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindElement(), and SMDS_MeshElement.NbNodes().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL ) return -1;
  // try to find element
  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
  if(!elem) return -1;
  return elem->NbNodes();
}
CORBA::Long SMESH_Mesh_i::GetElemNode ( CORBA::Long  id,
CORBA::Long  index 
)

Returns ID of node by given index for given element If there is not element for given ID - returns -1 If there is not node for given index - returns -2.

Definition at line 3211 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindElement(), SMDS_MeshElement.GetID(), SMDS_MeshElement.GetNode(), and SMDS_MeshElement.NbNodes().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL ) return -1;
  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
  if(!elem) return -1;
  if( index>=elem->NbNodes() || index<0 ) return -1;
  return elem->GetNode(index)->GetID();
}
SMESH::long_array * SMESH_Mesh_i::GetElemNodes ( CORBA::Long  id)

Returns IDs of nodes of given element.

Definition at line 3227 of file SMESH_Mesh_i.cxx.

References _impl.

{
  SMESH::long_array_var aResult = new SMESH::long_array();
  if ( SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS() )
  {
    if ( const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id) )
    {
      aResult->length( elem->NbNodes() );
      for ( int i = 0; i < elem->NbNodes(); ++i )
        aResult[ i ] = elem->GetNode( i )->GetID();
    }
  }
  return aResult._retn();
}
SMESH_Gen_i* SMESH_Mesh_i.GetGen ( )

Definition at line 178 of file SMESH_Mesh_i.hxx.

Referenced by SMESH_GroupOnGeom_i.GetShape(), and SMESH_GroupBase_i.SetName().

{ return _gen_i; }
const std::map<int, SMESH::SMESH_GroupBase_ptr>& SMESH_Mesh_i.getGroups ( )

Definition at line 365 of file SMESH_Mesh_i.hxx.

Referenced by SMESH_Gen_i.PublishMesh().

{ return _mapGroups; }
SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups ( const std::list< int > &  groupIDs) const

Return groups cantained in _mapGroups by their IDs.

Definition at line 3528 of file SMESH_Mesh_i.cxx.

References _mapGroups, and SMESH_test.ids.

{
  int nbGroups = groupIDs.size();
  SMESH::ListOfGroups_var aList = new SMESH::ListOfGroups();
  aList->length( nbGroups );

  list<int>::const_iterator ids = groupIDs.begin();
  for ( nbGroups = 0; ids != groupIDs.end(); ++ids )
  {
    map<int, SMESH::SMESH_GroupBase_ptr>::const_iterator it = _mapGroups.find( *ids );
    if ( it != _mapGroups.end() && !CORBA::is_nil( it->second ))
      aList[nbGroups++] = SMESH::SMESH_GroupBase::_duplicate( it->second );
  }
  aList->length( nbGroups );
  return aList._retn();
}
SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups ( ) throw (SALOME::SALOME_Exception)

Get the list of groups existing in the mesh.

Return values:
SMESH.ListOfGroups* - list of groups

Definition at line 886 of file SMESH_Mesh_i.cxx.

References _mapGroups, and MESSAGE.

Referenced by checkGroupNames(), SMESH_Gen_i.ConcatenateCommon(), SMESH_Gen_i.CreateMeshesFromUNV(), SMESH_MeshEditor_i.MirrorMakeMesh(), SMESH_MeshEditor_i.MirrorObjectMakeMesh(), SMESH_MeshEditor_i.RotateMakeMesh(), SMESH_MeshEditor_i.RotateObjectMakeMesh(), SMESH_MeshEditor_i.ScaleMakeMesh(), SMESH_MeshEditor_i.TranslateMakeMesh(), and SMESH_MeshEditor_i.TranslateObjectMakeMesh().

{
  Unexpect aCatch(SALOME_SalomeException);
  if (MYDEBUG) MESSAGE("GetGroups");

  SMESH::ListOfGroups_var aList = new SMESH::ListOfGroups();

  // Python Dump
  TPythonDump aPythonDump;
  if ( !_mapGroups.empty() ) // (IMP13463) avoid "SyntaxError: can't assign to []"
    aPythonDump << "[ ";

  try {
    aList->length( _mapGroups.size() );
    int i = 0;
    map<int, SMESH::SMESH_GroupBase_ptr>::iterator it = _mapGroups.begin();
    for ( ; it != _mapGroups.end(); it++ ) {
      if ( CORBA::is_nil( it->second )) continue;
      aList[i++] = SMESH::SMESH_GroupBase::_duplicate( it->second );
      // Python Dump
      if (i > 1) aPythonDump << ", ";
      aPythonDump << it->second;
    }
    aList->length( i );
  }
  catch(SALOME_Exception & S_ex) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }

  // Update Python script
  if ( !_mapGroups.empty() ) // (IMP13463) avoid "SyntaxError: can't assign to []"
    aPythonDump << " ] = " << _this() << ".GetGroups()";

  return aList._retn();
}
SMESH::ListOfHypothesis * SMESH_Mesh_i::GetHypothesisList ( GEOM::GEOM_Object_ptr  aSubShapeObject) throw (SALOME::SALOME_Exception)

Definition at line 606 of file SMESH_Mesh_i.cxx.

References SMESHDS_Hypothesis.GetID(), and MESSAGE.

Referenced by removeSubMesh().

{
  Unexpect aCatch(SALOME_SalomeException);
  if (MYDEBUG) MESSAGE("GetHypothesisList");
  if (_impl->HasShapeToMesh() && CORBA::is_nil(aSubShapeObject))
    THROW_SALOME_CORBA_EXCEPTION("bad subShape reference", SALOME::BAD_PARAM);

  SMESH::ListOfHypothesis_var aList = new SMESH::ListOfHypothesis();

  try {
    TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(aSubShapeObject);
    if ( myLocSubShape.IsNull() && !_impl->HasShapeToMesh() )
      myLocSubShape = _impl->GetShapeToMesh();
    const list<const SMESHDS_Hypothesis*>& aLocalList = _impl->GetHypothesisList( myLocSubShape );
    int i = 0, n = aLocalList.size();
    aList->length( n );

    for ( list<const SMESHDS_Hypothesis*>::const_iterator anIt = aLocalList.begin(); i < n && anIt != aLocalList.end(); anIt++ ) {
      SMESHDS_Hypothesis* aHyp = (SMESHDS_Hypothesis*)(*anIt);
      if ( _mapHypo.find( aHyp->GetID() ) != _mapHypo.end() )
        aList[i++] = SMESH::SMESH_Hypothesis::_narrow( _mapHypo[aHyp->GetID()] );
    }

    aList->length( i );
  }
  catch(SALOME_Exception & S_ex) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }

  return aList._retn();
}
CORBA::Long SMESH_Mesh_i::GetId ( ) throw (SALOME::SALOME_Exception)

Definition at line 2220 of file SMESH_Mesh_i.cxx.

References _id, and MESSAGE.

{
  if(MYDEBUG) MESSAGE("SMESH_Mesh_i::GetId");
  return _id;
}
SMESH::long_array * SMESH_Mesh_i::GetIDs ( ) [virtual]

Definition at line 2765 of file SMESH_Mesh_i.cxx.

References GetElementsId().

{
//   SMESH::long_array_var aResult = new SMESH::long_array();
//   SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
//   int aMinId = aSMESHDS_Mesh->MinElementID();
//   int aMaxId =  aSMESHDS_Mesh->MaxElementID();

//   aResult->length(aMaxId - aMinId + 1);

//   for (int i = 0, id = aMinId; id <= aMaxId; id++  )
//     aResult[i++] = id;

//   return aResult._retn();
  // PAL12398
  return GetElementsId();
}
SMESH_Mesh & SMESH_Mesh_i::GetImpl ( )

Definition at line 2270 of file SMESH_Mesh_i.cxx.

References _impl, and MESSAGE.

Referenced by SMESH_Gen_i.AddHypothesisToShape(), SMESH_Gen_i.CancelCompute(), SMESH_Gen_i.Compute(), SMESH_Gen_i.ConcatenateCommon(), SMESH_Gen_i.CopyMesh(), SMESH_Gen_i.CreateMeshesFromMED(), SMESH_Gen_i.CreateMeshesFromSTL(), SMESH_Gen_i.CreateMeshesFromUNV(), SMESH_Gen_i.Evaluate(), SMESH_MeshEditor_i.extrusionAlongPath(), SMESH_Gen_i.FindGeometryByMeshElement(), SMESH_Gen_i.GetAlgoState(), SMESH_Gen_i.GetHypothesisParameterValues(), SMESH_Pattern_i.getMesh(), getMesh(), GetMeshOrder(), SMESH_Gen_i.GetMeshOrSubmeshByShape(), SMESH_GroupBase_i.GetSmeshGroup(), SMESH_Gen_i.IsReadyToCompute(), SMESH_MeshEditor_i.LinearAnglesVariation(), SMESH_Gen_i.Load(), StdMeshers_ProjectionSource2D_i.LoadFrom(), StdMeshers_ProjectionSource1D_i.LoadFrom(), SMESH_MeshEditor_i.MakeBoundaryElements(), MeshPtr2SMDSMesh(), SMESH_MeshEditor_i.MirrorMakeMesh(), SMESH_MeshEditor_i.MirrorObjectMakeMesh(), SMESH_Gen_i.Precompute(), SMESH_MeshEditor_i.RotateMakeMesh(), SMESH_MeshEditor_i.RotateObjectMakeMesh(), SMESH_Gen_i.Save(), SMESH_MeshEditor_i.ScaleMakeMesh(), SetMeshOrder(), StdMeshers_ProjectionSource3D_i.SetSourceMesh(), StdMeshers_ProjectionSource2D_i.SetSourceMesh(), StdMeshers_ProjectionSource1D_i.SetSourceMesh(), SMESH_MEDSupport_i.SMESH_MEDSupport_i(), SMESH_MeshEditor_i.SMESH_MeshEditor_i(), SMESH_MeshEditor_i.TranslateMakeMesh(), and SMESH_MeshEditor_i.TranslateObjectMakeMesh().

{
  if(MYDEBUG) MESSAGE("SMESH_Mesh_i::GetImpl()");
  return *_impl;
}
SMESH::string_array * SMESH_Mesh_i::GetLastParameters ( )

Returns list of notebook variables used for last Mesh operation.

Definition at line 3627 of file SMESH_Mesh_i.cxx.

References SMESH_Gen_i.GetCurrentStudy(), GetParameters(), and SMESH_Gen_i.GetSMESHGen().

{
  SMESH::string_array_var aResult = new SMESH::string_array();
  SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
  if(gen) {
    char *aParameters = GetParameters();
    SALOMEDS::Study_ptr aStudy = gen->GetCurrentStudy();
    if(!aStudy->_is_nil()) {
      SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters); 
      if(aSections->length() > 0) {
        SALOMEDS::ListOfStrings aVars = aSections[aSections->length()-1];
        aResult->length(aVars.length());
        for(int i = 0;i < aVars.length();i++)
          aResult[i] = CORBA::string_dup( aVars[i]);
      }
    }
  }
  return aResult._retn();
}
SMESH::log_array * SMESH_Mesh_i::GetLog ( CORBA::Boolean  clearAfterGet) throw (SALOME::SALOME_Exception)

Definition at line 2147 of file SMESH_Mesh_i.cxx.

References SMESH_test.comType, SMESHDS_Command.GetCoords(), SMESHDS_Command.GetIndexes(), SMESHDS_Command.GetNumber(), SMESHDS_Command.GetType(), SMESH_test.ii, SMESH_test.ir, and MESSAGE.

{
  if(MYDEBUG) MESSAGE("SMESH_Mesh_i::GetLog");

  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();
}
SALOME_MED::MedFileInfo * SMESH_Mesh_i::GetMEDFileInfo ( ) [virtual]

Returns information about imported MED file.

Return information about imported file.

Definition at line 3551 of file SMESH_Mesh_i.cxx.

References myFileInfo, and SMESH_AdvancedEditor.res.

{
  SALOME_MED::MedFileInfo_var res( myFileInfo );
  if ( !res.operator->() ) {
    res = new SALOME_MED::MedFileInfo;
    res->fileName = "";
    res->fileSize = res->major = res->minor = res->release = -1;
  }
  return res._retn();
}
SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh ( ) throw (SALOME::SALOME_Exception)

Definition at line 2552 of file SMESH_Mesh_i.cxx.

Referenced by SMESH_MEDSupport_i.getMesh().

{
  Unexpect aCatch(SALOME_SalomeException);
  SMESH_MEDMesh_i *aMedMesh = new SMESH_MEDMesh_i(this);
  SALOME_MED::MESH_var aMesh = aMedMesh->_this();
  return aMesh._retn();
}
SMESH::SMESH_Mesh_ptr SMESH_Mesh_i::GetMesh ( ) [virtual]

Returns self.

Definition at line 3676 of file SMESH_Mesh_i.cxx.

{
  return SMESH::SMESH_Mesh::_duplicate( _this() );
}
SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor ( )

Return mesh editor.

Definition at line 2282 of file SMESH_Mesh_i.cxx.

Referenced by RemoveGroupWithContents().

{
  // Create MeshEditor
  SMESH_MeshEditor_i *aMeshEditor = new SMESH_MeshEditor_i( this, false );
  SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();

  // Update Python script
  TPythonDump() << aMeshEditor << " = " << _this() << ".GetMeshEditor()";

  return aMesh._retn();
}
SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditPreviewer ( )

Return mesh edition previewer.

Definition at line 2300 of file SMESH_Mesh_i.cxx.

{
  SMESH_MeshEditor_i *aMeshEditor = new SMESH_MeshEditor_i( this, true );
  SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
  return aMesh._retn();
}
SMESH::long_array * SMESH_Mesh_i::GetMeshInfo ( ) [virtual]

Returns statistic of mesh elements Result array of number enityties Inherited from SMESH_IDSource.

Returns statistic of mesh elements.

Definition at line 3686 of file SMESH_Mesh_i.cxx.

References _impl, SMESH.Entity_Last, SMESH.Entity_Node, SMDS_Mesh.GetMeshInfo(), and SMDS_MeshInfo.NbEntities().

{
  SMESH::long_array_var aRes = new SMESH::long_array();
  aRes->length(SMESH::Entity_Last);
  for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
    aRes[i] = 0;
  SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS();
  if (!aMeshDS)
    return aRes._retn();
  const SMDS_MeshInfo& aMeshInfo = aMeshDS->GetMeshInfo();
  for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
    aRes[i] = aMeshInfo.NbEntities((SMDSAbs_EntityType)i);
  return aRes._retn();
}
SMESH::submesh_array_array * SMESH_Mesh_i::GetMeshOrder ( ) [virtual]

Return submesh objects list in meshing order.

Definition at line 3928 of file SMESH_Mesh_i.cxx.

References _impl, _mapSubMesh, SMESH_DimHyp._subMesh, addDimHypInstance(), convertMeshOrder(), findConcurrents(), GetImpl(), SMESH_demo_hexa2_upd.hyp, PAL_MESH_041_mesh.mesh, SMESHDS_Hypothesis.PARAM_ALGO, removeDimHyps(), shapeTypeByDim(), and unionLists().

{
  SMESH::submesh_array_array_var aResult = new SMESH::submesh_array_array();

  SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS();
  if ( !aMeshDS )
    return aResult._retn();
  
  ::SMESH_Mesh& mesh = GetImpl();
  TListOfListOfInt anOrder = mesh.GetMeshOrder(); // is there already defined order?
  if ( !anOrder.size() ) {

    // collect submeshes detecting concurrent algorithms and hypothesises
    TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
    
    map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
    for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) {
      ::SMESH_subMesh* sm = (*i_sm).second;
      // shape of submesh
      const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
      
      // list of assigned hypothesises
      const list <const SMESHDS_Hypothesis*>& hypList = mesh.GetHypothesisList(aSubMeshShape);
      // Find out dimensions where the submesh can be concurrent.
      // We define the dimensions by algo of each of hypotheses in hypList
      list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
      for( ; hypIt != hypList.end(); hypIt++ ) {
        SMESH_Algo* anAlgo = 0;
        const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
        if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
          // hyp it-self is algo
          anAlgo = (SMESH_Algo*)dynamic_cast<const SMESH_Algo*>(hyp);
        else {
          // try to find algorithm with help of subshapes
          TopExp_Explorer anExp( aSubMeshShape, shapeTypeByDim(hyp->GetDim()) );
          for ( ; !anAlgo && anExp.More(); anExp.Next() )
            anAlgo = mesh.GetGen()->GetAlgo( mesh, anExp.Current() );
        }
        if (!anAlgo)
          continue; // no assigned algorithm to current submesh

        int dim = anAlgo->GetDim(); // top concurrent dimension (see comment to SMESH_DimHyp)
        // the submesh can concurrent at <dim> (or lower dims if !anAlgo->NeedDescretBoundary())

        // create instance of dimension-hypothesis for found concurrent dimension(s) and algorithm
        for ( int j = anAlgo->NeedDescretBoundary() ? dim : 1, jn = dim; j <= jn; j++ )
          addDimHypInstance( j, aSubMeshShape, anAlgo, sm, hypList, dimHypListArr );
      }
    } // end iterations on submesh
    
    // iterate on created dimension-hypotheses and check for concurrents
    for ( int i = 0; i < 4; i++ ) {
      const list<SMESH_DimHyp*>& listOfDimHyp = dimHypListArr[i];
      // check for concurrents in own and other dimensions (step-by-step)
      TDimHypList::const_iterator dhIt = listOfDimHyp.begin();
      for ( ; dhIt != listOfDimHyp.end(); dhIt++ ) {
        const SMESH_DimHyp* dimHyp = *dhIt;
        TListOfInt listOfConcurr;
        // looking for concurrents and collect into own list
        for ( int j = i; j < 4; j++ )
          findConcurrents( dimHyp, dimHypListArr[j], listOfConcurr );
        // check if any concurrents found
        if ( listOfConcurr.size() > 0 ) {
          // add own submesh to list of concurrent
          listOfConcurr.push_front( dimHyp->_subMesh->GetId() );
          anOrder.push_back( listOfConcurr );
        }
      }
    }
    
    removeDimHyps(dimHypListArr);
    
    // now, minimise the number of concurrent groups
    // Here we assume that lists of submhes can has same submesh
    // in case of multi-dimension algorithms, as result
    //  list with common submesh have to be union into one list
    int listIndx = 0;
    TListOfListOfInt::iterator listIt = anOrder.begin();
    for(; listIt != anOrder.end(); listIt++, listIndx++ )
      unionLists( *listIt,  anOrder, listIndx + 1 );
  }
  // convert submesh ids into interface instances
  //  and dump command into python
  convertMeshOrder( anOrder, aResult, true );

  return aResult._retn();
}
CORBA::LongLong SMESH_Mesh_i::GetMeshPtr ( )

Definition at line 3009 of file SMESH_Mesh_i.cxx.

References _impl, and MESSAGE.

{
  CORBA::LongLong pointeur = CORBA::LongLong(_impl);
  if ( MYDEBUG )
    MESSAGE("CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() "<<pointeur);
  return pointeur;
}
SMESH::long_array * SMESH_Mesh_i::GetNodeInverseElements ( CORBA::Long  id)

For given node returns list of IDs of inverse elements If there is not node for given ID - returns empty list.

Definition at line 3053 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindNode(), SMDS_MeshElement.GetID(), and SMDS_MeshNode.GetInverseElementIterator().

{
  SMESH::long_array_var aResult = new SMESH::long_array();
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL )
    return aResult._retn();

  // find node
  const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(id);
  if(!aNode)
    return aResult._retn();

  // find inverse elements
  SMDS_ElemIteratorPtr eIt = aNode->GetInverseElementIterator();
  TColStd_SequenceOfInteger IDs;
  while(eIt->more()) {
    const SMDS_MeshElement* elem = eIt->next();
    IDs.Append(elem->GetID());
  }
  if(IDs.Length()>0) {
    aResult->length(IDs.Length());
    int i = 1;
    for(; i<=IDs.Length(); i++) {
      aResult[i-1] = IDs.Value(i);
    }
  }
  return aResult._retn();
}
SMESH::NodePosition * SMESH_Mesh_i::GetNodePosition ( CORBA::Long  NodeID)

Return position of a node on shape.

Definition at line 3088 of file SMESH_Mesh_i.cxx.

References _impl, EDGE, FACE, SMDS_Mesh.FindNode(), SMESH.if(), PAL_MESH_041_mesh.mesh, SMESH.NodePosition.params, SMESH.NodePosition.shapeID, SMESH.NodePosition.shapeType, SMDS_TOP_3DSPACE, SMDS_TOP_EDGE, SMDS_TOP_FACE, and SMDS_TOP_VERTEX.

{
  SMESH::NodePosition* aNodePosition = new SMESH::NodePosition();
  aNodePosition->shapeID = 0;
  aNodePosition->shapeType = GEOM::SHAPE;

  SMESHDS_Mesh* mesh = _impl->GetMeshDS();
  if ( !mesh ) return aNodePosition;

  if ( const SMDS_MeshNode* aNode = mesh->FindNode(NodeID) )
  {
    if ( SMDS_PositionPtr pos = aNode->GetPosition() )
    {
      aNodePosition->shapeID = aNode->getshapeId();
      switch ( pos->GetTypeOfPosition() ) {
      case SMDS_TOP_EDGE:
        aNodePosition->shapeType = GEOM::EDGE;
        aNodePosition->params.length(1);
        aNodePosition->params[0] =
          static_cast<SMDS_EdgePosition*>( pos )->GetUParameter();
        break;
      case SMDS_TOP_FACE:
        aNodePosition->shapeType = GEOM::FACE;
        aNodePosition->params.length(2);
        aNodePosition->params[0] =
          static_cast<SMDS_FacePosition*>( pos )->GetUParameter();
        aNodePosition->params[1] =
          static_cast<SMDS_FacePosition*>( pos )->GetVParameter();
        break;
      case SMDS_TOP_VERTEX:
        aNodePosition->shapeType = GEOM::VERTEX;
        break;
      case SMDS_TOP_3DSPACE:
        if ( TopExp_Explorer(_impl->GetShapeToMesh(), TopAbs_SOLID).More() )
          aNodePosition->shapeType = GEOM::SOLID;
        else if ( TopExp_Explorer(_impl->GetShapeToMesh(), TopAbs_SHELL).More() )
          aNodePosition->shapeType = GEOM::SHELL;
        break;
      default:;
      }
    }
  }
  return aNodePosition;
}
SMESH::long_array * SMESH_Mesh_i::GetNodesId ( ) throw (SALOME::SALOME_Exception)

Definition at line 2856 of file SMESH_Mesh_i.cxx.

References _impl, MESSAGE, NbNodes(), and SMDS_Mesh.nodesIterator().

{
  Unexpect aCatch(SALOME_SalomeException);
  MESSAGE("SMESH_subMesh_i::GetNodesId");
  SMESH::long_array_var aResult = new SMESH::long_array();
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();

  if ( aSMESHDS_Mesh == NULL )
    return aResult._retn();

  long nbNodes = NbNodes();
  aResult->length( nbNodes );
  SMDS_NodeIteratorPtr anIt = aSMESHDS_Mesh->nodesIterator(/*idInceasingOrder=*/true);
  for ( int i = 0, n = nbNodes; i < n && anIt->more(); i++ )
    aResult[i] = anIt->next()->GetID();

  return aResult._retn();
}
SMESH::double_array * SMESH_Mesh_i::GetNodeXYZ ( CORBA::Long  id)

Get XYZ coordinates of node as list of double If there is not node for given ID - returns empty list.

Definition at line 3025 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindNode(), SMDS_MeshNode.X(), SMDS_MeshNode.Y(), and SMDS_MeshNode.Z().

{
  SMESH::double_array_var aResult = new SMESH::double_array();
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL )
    return aResult._retn();

  // find node
  const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(id);
  if(!aNode)
    return aResult._retn();

  // add coordinates
  aResult->length(3);
  aResult[0] = aNode->X();
  aResult[1] = aNode->Y();
  aResult[2] = aNode->Z();
  return aResult._retn();
}
char * SMESH_Mesh_i::GetParameters ( )

Returns list of notebook variables used for Mesh operations separated by ":" symbol.

Definition at line 3616 of file SMESH_Mesh_i.cxx.

References SMESH_Gen_i.GetParameters(), and SMESH_Gen_i.GetSMESHGen().

Referenced by GetLastParameters().

{
  SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
  return CORBA::string_dup(gen->GetParameters(SMESH::SMESH_Mesh::_narrow(_this())));
}
CORBA::Long SMESH_Mesh_i::GetShapeID ( CORBA::Long  id)

If given element is node returns IDs of shape from position If there is not node for given ID - returns -1.

Definition at line 3140 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindNode(), and SMDS_MeshElement.getshapeId().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL )
    return -1;

  // try to find node
  const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(id);
  if(aNode) {
    return aNode->getshapeId();
  }

  return -1;
}
CORBA::Long SMESH_Mesh_i::GetShapeIDForElem ( CORBA::Long  id)

For given element returns ID of result shape after ::FindShape() from SMESH_MeshEditor If there is not element for given ID - returns -1.

Definition at line 3164 of file SMESH_Mesh_i.cxx.

References _impl, and SMDS_Mesh.FindElement().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL )
    return -1;

  // try to find element
  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
  if(!elem)
    return -1;

  //SMESH::SMESH_MeshEditor_var aMeshEditor = SMESH_Mesh_i::GetMeshEditor();
  ::SMESH_MeshEditor aMeshEditor(_impl);
  int index = aMeshEditor.FindShape( elem );
  if(index>0)
    return index;

  return -1;
}
GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh ( ) throw (SALOME::SALOME_Exception)

Definition at line 216 of file SMESH_Mesh_i.cxx.

References _gen_i, _impl, and SMESH_Gen_i.ShapeToGeomObject().

Referenced by SMESH_Gen_i.Load().

{
  Unexpect aCatch(SALOME_SalomeException);
  GEOM::GEOM_Object_var aShapeObj;
  try {
    TopoDS_Shape S = _impl->GetMeshDS()->ShapeToMesh();
    if ( !S.IsNull() )
      aShapeObj = _gen_i->ShapeToGeomObject( S );
  }
  catch(SALOME_Exception & S_ex) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
  return aShapeObj._retn();
}
CORBA::Long SMESH_Mesh_i::GetStudyId ( ) throw (SALOME::SALOME_Exception)

Definition at line 2232 of file SMESH_Mesh_i.cxx.

References _studyId.

{
  return _studyId;
}
SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh ( GEOM::GEOM_Object_ptr  aSubShapeObject,
const char *  theName 
) throw (SALOME::SALOME_Exception)

Definition at line 644 of file SMESH_Mesh_i.cxx.

References MESSAGE.

{
  Unexpect aCatch(SALOME_SalomeException);
  MESSAGE("SMESH_Mesh_i::GetSubMesh");
  if (CORBA::is_nil(aSubShapeObject))
    THROW_SALOME_CORBA_EXCEPTION("bad subShape reference",
                                 SALOME::BAD_PARAM);

  SMESH::SMESH_subMesh_var subMesh;
  SMESH::SMESH_Mesh_var    aMesh = SMESH::SMESH_Mesh::_narrow(_this());
  try {
    TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(aSubShapeObject);

    //Get or Create the SMESH_subMesh object implementation

    int subMeshId = _impl->GetMeshDS()->ShapeToIndex( myLocSubShape );

    if ( !subMeshId && ! _impl->GetMeshDS()->IsGroupOfSubShapes( myLocSubShape ))
    {
      TopoDS_Iterator it( myLocSubShape );
      if ( it.More() )
        THROW_SALOME_CORBA_EXCEPTION("not sub-shape of the main shape", SALOME::BAD_PARAM);
    }
    subMesh = getSubMesh( subMeshId );

    // create a new subMesh object servant if there is none for the shape
    if ( subMesh->_is_nil() )
      subMesh = createSubMesh( aSubShapeObject );
    if ( _gen_i->CanPublishInStudy( subMesh )) {
      SALOMEDS::SObject_var aSO =
        _gen_i->PublishSubMesh(_gen_i->GetCurrentStudy(), aMesh,
                               subMesh, aSubShapeObject, theName );
      if ( !aSO->_is_nil()) {
        // Update Python script
        TPythonDump() << aSO << " = " << _this() << ".GetSubMesh( "
                      << aSubShapeObject << ", '" << theName << "' )";
      }
    }
  }
  catch(SALOME_Exception & S_ex) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
  return subMesh._retn();
}
SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::getSubMesh ( int  shapeID)

Definition at line 2007 of file SMESH_Mesh_i.cxx.

References _mapSubMeshIor.

Referenced by SMESH_Gen_i.AddHypothesisToShape(), and SMESH_Gen_i.GetMeshOrSubmeshByShape().

{
  map<int, SMESH::SMESH_subMesh_ptr>::iterator it = _mapSubMeshIor.find( shapeID );
  if ( it == _mapSubMeshIor.end() )
    return SMESH::SMESH_subMesh::_nil();

  return SMESH::SMESH_subMesh::_duplicate( (*it).second );
}
SMESH::long_array * SMESH_Mesh_i::GetSubMeshElementsId ( CORBA::Long  ShapeID) throw (SALOME::SALOME_Exception)

Returns ID of elements for given submesh.

Definition at line 2909 of file SMESH_Mesh_i.cxx.

References SMESHDS_SubMesh.GetElements(), and SMESHDS_SubMesh.NbElements().

{
  SMESH::long_array_var aResult = new SMESH::long_array();

  SMESH_subMesh* SM = _impl->GetSubMeshContaining(ShapeID);
  if(!SM) return aResult._retn();

  SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS();
  if(!SDSM) return aResult._retn();

  aResult->length(SDSM->NbElements());

  SMDS_ElemIteratorPtr eIt = SDSM->GetElements();
  int i = 0;
  while ( eIt->more() ) {
    aResult[i++] = eIt->next()->GetID();
  }

  return aResult._retn();
}
SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType ( CORBA::Long  ShapeID) throw (SALOME::SALOME_Exception)

Returns type of elements for given submesh.

Definition at line 2985 of file SMESH_Mesh_i.cxx.

References SMESH.ALL, SMESHDS_SubMesh.GetElements(), SMDS_MeshElement.GetType(), SMESHDS_SubMesh.NbElements(), and SMESH.NODE.

{
  SMESH_subMesh* SM = _impl->GetSubMeshContaining(ShapeID);
  if(!SM) return SMESH::ALL;

  SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS();
  if(!SDSM) return SMESH::ALL;

  if(SDSM->NbElements()==0)
    return (SM->GetSubShape().ShapeType() == TopAbs_VERTEX) ? SMESH::NODE : SMESH::ALL;

  SMDS_ElemIteratorPtr eIt = SDSM->GetElements();
  const SMDS_MeshElement* anElem = eIt->next();
  return ( SMESH::ElementType ) anElem->GetType();
}
SMESH::long_array * SMESH_Mesh_i::GetSubMeshNodesId ( CORBA::Long  ShapeID,
CORBA::Boolean  all 
) throw (SALOME::SALOME_Exception)

Returns ID of nodes for given submesh If param all==true - returns all nodes, else - returns only nodes on shapes.

Definition at line 2939 of file SMESH_Mesh_i.cxx.

References SMESHDS_SubMesh.GetElements(), SMDS_MeshElement.GetID(), SMESHDS_SubMesh.GetNodes(), SMESHDS_SubMesh.NbElements(), and SMDS_MeshElement.nodesIterator().

{
  SMESH::long_array_var aResult = new SMESH::long_array();

  SMESH_subMesh* SM = _impl->GetSubMeshContaining(ShapeID);
  if(!SM) return aResult._retn();

  SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS();
  if(!SDSM) return aResult._retn();

  set<int> theElems;
  if( !all || (SDSM->NbElements()==0) ) { // internal nodes or vertex submesh
    SMDS_NodeIteratorPtr nIt = SDSM->GetNodes();
    while ( nIt->more() ) {
      const SMDS_MeshNode* elem = nIt->next();
      theElems.insert( elem->GetID() );
    }
  }
  else { // all nodes of submesh elements
    SMDS_ElemIteratorPtr eIt = SDSM->GetElements();
    while ( eIt->more() ) {
      const SMDS_MeshElement* anElem = eIt->next();
      SMDS_ElemIteratorPtr nIt = anElem->nodesIterator();
      while ( nIt->more() ) {
        const SMDS_MeshElement* elem = nIt->next();
        theElems.insert( elem->GetID() );
      }
    }
  }

  aResult->length(theElems.size());
  set<int>::iterator itElem;
  int i = 0;
  for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
    aResult[i++] = *itElem;

  return aResult._retn();
}
SMESH::array_of_ElementType * SMESH_Mesh_i::GetTypes ( ) [virtual]

Returns types of elements it contains.

Definition at line 3652 of file SMESH_Mesh_i.cxx.

References _impl, SMESH.EDGE, SMESH.ELEM0D, SMESH.FACE, and SMESH.VOLUME.

{
  SMESH::array_of_ElementType_var types = new SMESH::array_of_ElementType;

  types->length( 4 );
  int nbTypes = 0;
  if (_impl->NbEdges())
    types[nbTypes++] = SMESH::EDGE;
  if (_impl->NbFaces())
    types[nbTypes++] = SMESH::FACE;
  if (_impl->NbVolumes())
    types[nbTypes++] = SMESH::VOLUME;
  if (_impl->Nb0DElements())
    types[nbTypes++] = SMESH::ELEM0D;
  types->length( nbTypes );

  return types._retn();
}
char * SMESH_Mesh_i::GetVersionString ( SMESH::MED_VERSION  version,
CORBA::Short  nbDigits 
)

Return string representation of a MED file version comprising nbDigits.

Definition at line 348 of file SMESH_Mesh_i.cxx.

{
  string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(MED::EVersion(version),
                                                               nbDigits);
  return CORBA::string_dup( ver.c_str() );
}
CORBA::Boolean SMESH_Mesh_i::HasDuplicatedGroupNamesMED ( )

Check group names for duplications.

Export in different formats.

Consider maximum group name length stored in MED file.

Definition at line 2391 of file SMESH_Mesh_i.cxx.

References _impl.

{
  return _impl->HasDuplicatedGroupNamesMED();
}
CORBA::Boolean SMESH_Mesh_i::HasModificationsToDiscard ( ) throw (SALOME::SALOME_Exception)

Return true if the mesh has been edited since a last total re-compute and those modifications may prevent successful partial re-compute.

Definition at line 2314 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->HasModificationsToDiscard();
}
CORBA::Boolean SMESH_Mesh_i::HasShapeToMesh ( ) throw (SALOME::SALOME_Exception)

return true if mesh has a shape to build a shape on

Definition at line 197 of file SMESH_Mesh_i.cxx.

References _impl, and SMESH_AdvancedEditor.res.

Referenced by addHypothesis(), SMESH_Gen_i.Load(), and removeHypothesis().

{
  Unexpect aCatch(SALOME_SalomeException);
  bool res = false;
  try {
    res = _impl->HasShapeToMesh();
  }
  catch(SALOME_Exception & S_ex) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
  return res;
}
SMESH::DriverMED_ReadStatus SMESH_Mesh_i::ImportMEDFile ( const char *  theFileName,
const char *  theMeshName 
) throw (SALOME::SALOME_Exception)

consult DriverMED_R_SMESHDS_Mesh.ReadStatus for returned value

ImportMEDFile.

Imports mesh data from MED file

Definition at line 304 of file SMESH_Mesh_i.cxx.

References ConvertDriverMEDReadStatus(), ex30_tepal.status, and SMESH_Nut.theFileName.

Referenced by SMESH_Gen_i.CreateMeshesFromMED().

{
  Unexpect aCatch(SALOME_SalomeException);
  int status;
  try {
    status = _impl->MEDToMesh( theFileName, theMeshName );
  }
  catch( SALOME_Exception& S_ex ) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
  catch ( ... ) {
    THROW_SALOME_CORBA_EXCEPTION("ImportMEDFile(): unknown exception", SALOME::BAD_PARAM);
  }

  CreateGroupServants();

  int major, minor, release;
  if( !MED::getMEDVersion( theFileName, major, minor, release ) )
    major = minor = release = -1;
  myFileInfo           = new SALOME_MED::MedFileInfo();
  myFileInfo->fileName = theFileName;
  myFileInfo->fileSize = 0;
#ifdef WIN32
  struct _stati64 d;
  if ( ::_stati64( theFileName, &d ) != -1 )
#else
  struct stat64 d;
  if ( ::stat64( theFileName, &d ) != -1 )
#endif
    myFileInfo->fileSize = d.st_size;
  myFileInfo->major    = major;
  myFileInfo->minor    = minor;
  myFileInfo->release  = release;

  return ConvertDriverMEDReadStatus(status);
}
int SMESH_Mesh_i::ImportSTLFile ( const char *  theFileName) throw (SALOME::SALOME_Exception)

ImportSTLFile.

Imports mesh data from STL file

Definition at line 381 of file SMESH_Mesh_i.cxx.

References SMESH_Nut.theFileName.

Referenced by SMESH_Gen_i.CreateMeshesFromSTL().

{
  // Read mesh with name = <theMeshName> into SMESH_Mesh
  _impl->STLToMesh( theFileName );

  return 1;
}
int SMESH_Mesh_i::ImportUNVFile ( const char *  theFileName) throw (SALOME::SALOME_Exception)

ImportUNVFile.

Imports mesh data from MED file

Definition at line 363 of file SMESH_Mesh_i.cxx.

References SMESH_Nut.theFileName.

Referenced by SMESH_Gen_i.CreateMeshesFromUNV().

{
  // Read mesh with name = <theMeshName> into SMESH_Mesh
  _impl->UNVToMesh( theFileName );

  CreateGroupServants();

  return 1;
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectGroups ( SMESH::SMESH_GroupBase_ptr  theGroup1,
SMESH::SMESH_GroupBase_ptr  theGroup2,
const char *  theName 
) throw (SALOME::SALOME_Exception)

IntersectGroups New group is created.

All mesh elements that are present in both initial groups are added to the new one.

Definition at line 1080 of file SMESH_Mesh_i.cxx.

References SMESH_test.i1, SMESH_test.i2, SMESH_AdvancedEditor.n1, and SMESH_AdvancedEditor.n2.

{
  if ( theGroup1->_is_nil() || theGroup2->_is_nil() ||
       theGroup1->GetType() != theGroup2->GetType() )
    return SMESH::SMESH_Group::_nil();

  // Create Intersection
  SMESH::SMESH_Group_var aResGrp = CreateGroup( theGroup1->GetType(), theName );
  if ( aResGrp->_is_nil() )
    return aResGrp;

  SMESH::long_array_var anIds1 = theGroup1->GetListOfID();
  SMESH::long_array_var anIds2 = theGroup2->GetListOfID();

  TColStd_MapOfInteger aMap1;

  for ( int i1 = 0, n1 = anIds1->length(); i1 < n1; i1++ )
    aMap1.Add( anIds1[ i1 ] );

  TColStd_SequenceOfInteger aSeq;

  for ( int i2 = 0, n2 = anIds2->length(); i2 < n2; i2++ )
    if ( aMap1.Contains( anIds2[ i2 ] ) )
      aSeq.Append( anIds2[ i2 ] );

  SMESH::long_array_var aResIds = new SMESH::long_array;
  aResIds->length( aSeq.Length() );

  for ( int resI = 0, resN = aSeq.Length(); resI < resN; resI++ )
    aResIds[ resI ] = aSeq( resI + 1 );

  aResGrp->Add( aResIds );

  // Clear python lines, created by CreateGroup() and Add()
  SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
  _gen_i->RemoveLastFromPythonScript(aStudy->StudyId());
  _gen_i->RemoveLastFromPythonScript(aStudy->StudyId());

  // Update Python script
  TPythonDump() << aResGrp << " = " << _this() << ".IntersectGroups( "
                << theGroup1 << ", " << theGroup2 << ", '" << theName << "')";

  return aResGrp._retn();
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectListOfGroups ( const SMESH::ListOfGroups theGroups,
const char *  theName 
) throw (SALOME::SALOME_Exception)

Intersect list of groups.

New group is created. All mesh elements that are present in all initial groups simultaneously are added to the new one.

Parameters:
theGroupslist of groups
theNamename of group to be created
Returns:
pointer on the group

Definition at line 1137 of file SMESH_Mesh_i.cxx.

References SMESH.ALL, and SMESH_BelongToGeom.anIds.

{
  if ( !theName )
    return SMESH::SMESH_Group::_nil();

  try
  {
    NCollection_DataMap< int, int > anIdToCount;
    SMESH::ElementType aType = SMESH::ALL;
    for ( int g = 0, n = theGroups.length(); g < n; g++ )
    {
      SMESH::SMESH_GroupBase_var aGrp = theGroups[ g ];
      if ( CORBA::is_nil( aGrp ) )
        continue;

      // check type
      SMESH::ElementType aCurrType = aGrp->GetType();
      if ( aType == SMESH::ALL )
        aType = aCurrType;
      else 
      {
        if ( aType != aCurrType )
          return SMESH::SMESH_Group::_nil();
      }

      // calculates number of occurance ids in groups
      SMESH::long_array_var aCurrIds = aGrp->GetListOfID();
      for ( int i = 0, n = aCurrIds->length(); i < n; i++ )
      {
        int aCurrId = aCurrIds[ i ];
        if ( !anIdToCount.IsBound( aCurrId ) )
          anIdToCount.Bind( aCurrId, 1 );
        else 
          anIdToCount( aCurrId ) = anIdToCount( aCurrId ) + 1;
      }
    }
    
    // create map of ids
    int nbGrp = theGroups.length();
    vector< int > anIds;
    NCollection_DataMap< int, int >::Iterator anIter( anIdToCount );
    for ( ; anIter.More(); anIter.Next() )
    {
      int aCurrId = anIter.Key();
      int aCurrNb = anIter.Value();
      if ( aCurrNb == nbGrp )
        anIds.push_back( aCurrId );
    }

    // Create group
    SMESH::SMESH_Group_var aResGrp = CreateGroup( aType, theName );
    if ( aResGrp->_is_nil() )
      return SMESH::SMESH_Group::_nil();
    
    // Create array of identifiers
    SMESH::long_array_var aResIds = new SMESH::long_array;
    aResIds->length( anIds.size() );
    
    //NCollection_Map< int >::Iterator aListIter( anIds );
    for ( int i = 0; i<anIds.size(); i++ )
    {
      aResIds[ i ] = anIds[i];
    }
    aResGrp->Add( aResIds );

    // Clear python lines, created by CreateGroup() and Add()
    SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
    _gen_i->RemoveLastFromPythonScript( aStudy->StudyId() );
    _gen_i->RemoveLastFromPythonScript( aStudy->StudyId() );

    // Update Python script
    
    TPythonDump() << aResGrp << " = " << _this() << ".IntersectListOfGroups( "
                  << &theGroups << ", '" << theName << "' )";

    return aResGrp._retn();
  }
  catch( ... )
  {
    return SMESH::SMESH_Group::_nil();
  }
}
CORBA::Boolean SMESH_Mesh_i::IsMediumNode ( CORBA::Long  ide,
CORBA::Long  idn 
)

Returns true if given node is medium node in given quadratic element.

Definition at line 3249 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindElement(), SMDS_Mesh.FindNode(), and SMDS_MeshElement.IsMediumNode().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL ) return false;
  // try to find node
  const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(idn);
  if(!aNode) return false;
  // try to find element
  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(ide);
  if(!elem) return false;

  return elem->IsMediumNode(aNode);
}
CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem ( CORBA::Long  idn,
SMESH::ElementType  theElemType 
)

Returns true if given node is medium node in one of quadratic elements.

Definition at line 3271 of file SMESH_Mesh_i.cxx.

References _impl, SMESH.EDGE, SMESH.FACE, SMDS_Mesh.FindNode(), SMESH_MesherHelper.IsMedium(), SMDSAbs_All, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, and SMESH.VOLUME.

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL ) return false;

  // try to find node
  const SMDS_MeshNode* aNode = aSMESHDS_Mesh->FindNode(idn);
  if(!aNode) return false;

  SMESH_MesherHelper aHelper( *(_impl) );

  SMDSAbs_ElementType aType;
  if(theElemType==SMESH::EDGE) aType = SMDSAbs_Edge;
  else if(theElemType==SMESH::FACE) aType = SMDSAbs_Face;
  else if(theElemType==SMESH::VOLUME) aType = SMDSAbs_Volume;
  else aType = SMDSAbs_All;

  return aHelper.IsMedium(aNode,aType);
}
CORBA::Boolean SMESH_Mesh_i::IsPoly ( CORBA::Long  id)

Returns true if given element is polygon.

Definition at line 3382 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindElement(), and SMDS_MeshElement.IsPoly().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL ) return false;
  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
  if(!elem) return false;
  return elem->IsPoly();
}
CORBA::Boolean SMESH_Mesh_i::IsQuadratic ( CORBA::Long  id)

Returns true if given element is quadratic.

Definition at line 3398 of file SMESH_Mesh_i.cxx.

References _impl, SMDS_Mesh.FindElement(), and SMDS_MeshElement.IsQuadratic().

{
  SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
  if ( aSMESHDS_Mesh == NULL ) return false;
  const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id);
  if(!elem) return false;
  return elem->IsQuadratic();
}
CORBA::Long SMESH_Mesh_i::Nb0DElements ( ) throw (SALOME::SALOME_Exception)

Definition at line 2587 of file SMESH_Mesh_i.cxx.

References _impl.

Referenced by NbElements().

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->Nb0DElements();
}
CORBA::Long SMESH_Mesh_i::NbEdges ( ) throw (SALOME::SALOME_Exception)

Definition at line 2598 of file SMESH_Mesh_i.cxx.

References _impl.

Referenced by NbElements().

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbEdges();
}
CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2604 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbEdges( (SMDSAbs_ElementOrder) order);
}
CORBA::Long SMESH_Mesh_i::NbElements ( ) throw (SALOME::SALOME_Exception)

Definition at line 2576 of file SMESH_Mesh_i.cxx.

References Nb0DElements(), NbEdges(), NbFaces(), and NbVolumes().

Referenced by CheckGeomGroupModif(), and GetElementsId().

{
  Unexpect aCatch(SALOME_SalomeException);
  return Nb0DElements() + NbEdges() + NbFaces() + NbVolumes();
}
CORBA::Long SMESH_Mesh_i::NbFaces ( ) throw (SALOME::SALOME_Exception)

Definition at line 2616 of file SMESH_Mesh_i.cxx.

References _impl.

Referenced by NbElements().

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbFaces();
}
CORBA::Long SMESH_Mesh_i::NbFacesOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2640 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbFaces( (SMDSAbs_ElementOrder) order);
}
CORBA::Long SMESH_Mesh_i::NbGroups ( ) throw (SALOME::SALOME_Exception)

Get number of groups existing in the mesh.

Definition at line 928 of file SMESH_Mesh_i.cxx.

References _mapGroups.

Referenced by checkGroupNames().

{
  Unexpect aCatch(SALOME_SalomeException);
  return _mapGroups.size();
}
CORBA::Long SMESH_Mesh_i::NbHexas ( ) throw (SALOME::SALOME_Exception)

Definition at line 2678 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbHexas();
}
CORBA::Long SMESH_Mesh_i::NbHexasOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2716 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbHexas( (SMDSAbs_ElementOrder) order);
}
CORBA::Long SMESH_Mesh_i::NbNodes ( ) throw (SALOME::SALOME_Exception)

Definition at line 2565 of file SMESH_Mesh_i.cxx.

References _impl.

Referenced by CheckGeomGroupModif(), SMESH_Gen_i.GetHypothesisParameterValues(), and GetNodesId().

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbNodes();
}
CORBA::Long SMESH_Mesh_i::NbPolygons ( ) throw (SALOME::SALOME_Exception)

Definition at line 2634 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbPolygons();
}
CORBA::Long SMESH_Mesh_i::NbPolyhedrons ( ) throw (SALOME::SALOME_Exception)

Definition at line 2696 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbPolyhedrons();
}
CORBA::Long SMESH_Mesh_i::NbPrisms ( ) throw (SALOME::SALOME_Exception)

Definition at line 2690 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbPrisms();
}
CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2730 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbPrisms( (SMDSAbs_ElementOrder) order);
}
CORBA::Long SMESH_Mesh_i::NbPyramids ( ) throw (SALOME::SALOME_Exception)

Definition at line 2684 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbPyramids();
}
CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2723 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbPyramids( (SMDSAbs_ElementOrder) order);
}
CORBA::Long SMESH_Mesh_i::NbQuadrangles ( ) throw (SALOME::SALOME_Exception)

Definition at line 2628 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbQuadrangles();
}
CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2654 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbQuadrangles( (SMDSAbs_ElementOrder) order);
}
CORBA::Long SMESH_Mesh_i::NbSubMesh ( ) throw (SALOME::SALOME_Exception)

Definition at line 2742 of file SMESH_Mesh_i.cxx.

References _mapSubMesh_i.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _mapSubMesh_i.size();
}
CORBA::Long SMESH_Mesh_i::NbTetras ( ) throw (SALOME::SALOME_Exception)

Definition at line 2672 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbTetras();
}
CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2709 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbTetras( (SMDSAbs_ElementOrder) order);
}
CORBA::Long SMESH_Mesh_i::NbTriangles ( ) throw (SALOME::SALOME_Exception)

Definition at line 2622 of file SMESH_Mesh_i.cxx.

References _impl.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbTriangles();
}
CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2647 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbTriangles( (SMDSAbs_ElementOrder) order);
}
CORBA::Long SMESH_Mesh_i::NbVolumes ( ) throw (SALOME::SALOME_Exception)

Definition at line 2666 of file SMESH_Mesh_i.cxx.

References _impl.

Referenced by NbElements().

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbVolumes();
}
CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder ( SMESH::ElementOrder  order) throw (SALOME::SALOME_Exception)

Definition at line 2702 of file SMESH_Mesh_i.cxx.

{
  Unexpect aCatch(SALOME_SalomeException);
  return _impl->NbVolumes( (SMDSAbs_ElementOrder) order);
}
TopoDS_Shape SMESH_Mesh_i::newGroupShape ( TGeomGroupData groupData) [private]

Return new group contents if it has been changed and update group data.

Definition at line 1614 of file SMESH_Mesh_i.cxx.

References _gen_i, SMESH_Mesh_i.TGeomGroupData._groupEntry, SMESH_Mesh_i.TGeomGroupData._indices, SMESH_Gen_i.GeomObjectToShape(), SMESH_Gen_i.GetCurrentStudy(), SMESH_Gen_i.GetCurrentStudyID(), SMESH_Gen_i.GetGeomEngine(), SMESH_Gen_i.GetShapeReader(), SMESH_test.ids, and SMESH_Gen_i.SObjectToObject().

Referenced by CheckGeomGroupModif().

{
  TopoDS_Shape newShape;

  // get geom group
  SALOMEDS::Study_var study = _gen_i->GetCurrentStudy();
  if ( study->_is_nil() ) return newShape; // means "not changed"
  SALOMEDS::SObject_var groupSO = study->FindObjectID( groupData._groupEntry.c_str() );
  if ( !groupSO->_is_nil() )
  {
    CORBA::Object_var groupObj = _gen_i->SObjectToObject( groupSO );
    if ( CORBA::is_nil( groupObj )) return newShape;
    GEOM::GEOM_Object_var geomGroup = GEOM::GEOM_Object::_narrow( groupObj );

    // get indices of group items
    set<int> curIndices;
    GEOM::GEOM_Gen_var geomGen = _gen_i->GetGeomEngine();
    GEOM::GEOM_IGroupOperations_var groupOp =
      geomGen->GetIGroupOperations( _gen_i->GetCurrentStudyID() );
    GEOM::ListOfLong_var ids = groupOp->GetObjects( geomGroup );
    for ( int i = 0; i < ids->length(); ++i )
      curIndices.insert( ids[i] );

    if ( groupData._indices == curIndices )
      return newShape; // group not changed

    // update data
    groupData._indices = curIndices;

    GEOM_Client* geomClient = _gen_i->GetShapeReader();
    if ( !geomClient ) return newShape;
    TCollection_AsciiString groupIOR = geomGen->GetStringFromIOR( geomGroup );
    geomClient->RemoveShapeFromBuffer( groupIOR );
    newShape = _gen_i->GeomObjectToShape( geomGroup );
  }    

  if ( newShape.IsNull() ) {
    // geom group becomes empty - return empty compound
    TopoDS_Compound compound;
    BRep_Builder().MakeCompound(compound);
    newShape = compound;
  }
  return newShape;
}
void SMESH_Mesh_i::PrepareForWriting ( const char *  file,
bool  overwrite = true 
) [static]

Definition at line 2396 of file SMESH_Mesh_i.cxx.

References SMESH_test5.aPath.

{
  TCollection_AsciiString aFullName ((char*)file);
  OSD_Path aPath (aFullName);
  OSD_File aFile (aPath);
  if (aFile.Exists()) {
    // existing filesystem node
    if (aFile.KindOfFile() == OSD_FILE) {
      if (aFile.IsWriteable()) {
        if (overwrite) {
          aFile.Reset();
          aFile.Remove();
        }
        if (aFile.Failed()) {
          TCollection_AsciiString msg ("File ");
          msg += aFullName + " cannot be replaced.";
          THROW_SALOME_CORBA_EXCEPTION(msg.ToCString(), SALOME::BAD_PARAM);
        }
      } else {
        TCollection_AsciiString msg ("File ");
        msg += aFullName + " cannot be overwritten.";
        THROW_SALOME_CORBA_EXCEPTION(msg.ToCString(), SALOME::BAD_PARAM);
      }
    } else {
      TCollection_AsciiString msg ("Location ");
      msg += aFullName + " is not a file.";
      THROW_SALOME_CORBA_EXCEPTION(msg.ToCString(), SALOME::BAD_PARAM);
    }
  } else {
    // nonexisting file; check if it can be created
    aFile.Reset();
    aFile.Build(OSD_WriteOnly, OSD_Protection());
    if (aFile.Failed()) {
      TCollection_AsciiString msg ("You cannot create the file ");
      msg += aFullName + ". Check the directory existance and access rights.";
      THROW_SALOME_CORBA_EXCEPTION(msg.ToCString(), SALOME::BAD_PARAM);
    } else {
      aFile.Close();
      aFile.Remove();
    }
  }
}
void SMESH_Mesh_i::removeGeomGroupData ( CORBA::Object_ptr  theSmeshObj) [private]

Remove GEOM group data relating to removed smesh object.

Definition at line 1596 of file SMESH_Mesh_i.cxx.

References _geomGroupData.

Referenced by ConvertToStandalone(), removeGroup(), and removeSubMesh().

{
  list<TGeomGroupData>::iterator
    data = _geomGroupData.begin(), dataEnd = _geomGroupData.end();
  for ( ; data != dataEnd; ++data ) {
    if ( theSmeshObj->_is_equivalent( data->_smeshObject )) {
      _geomGroupData.erase( data );
      return;
    }
  }
}
void SMESH_Mesh_i::RemoveGroup ( SMESH::SMESH_GroupBase_ptr  theGroup) throw (SALOME::SALOME_Exception)

Definition at line 817 of file SMESH_Mesh_i.cxx.

References SMESH_controls.aGroup, SMESH_GroupBase_i.GetLocalID(), and SMESH_Gen_i.GetServant().

Referenced by CheckGeomGroupModif(), and removeGroup().

{
  if ( theGroup->_is_nil() )
    return;

  SMESH_GroupBase_i* aGroup =
    dynamic_cast<SMESH_GroupBase_i*>( SMESH_Gen_i::GetServant( theGroup ).in() );
  if ( !aGroup )
    return;

  SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
  if ( !aStudy->_is_nil() )  {
    SALOMEDS::SObject_var aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup );

    if ( !aGroupSO->_is_nil() ) {
      // Update Python script
      TPythonDump() << _this() << ".RemoveGroup( " << aGroupSO << " )";

      // Remove group's SObject
      aStudy->NewBuilder()->RemoveObjectWithChildren( aGroupSO );
    }
  }

  // Remove the group from SMESH data structures
  removeGroup( aGroup->GetLocalID() );
}
void SMESH_Mesh_i::removeGroup ( const int  theId)

SMESH_Mesh_i.removeGroup.

Should be called by ~SMESH_Group_i()

Definition at line 2126 of file SMESH_Mesh_i.cxx.

References _impl, _mapGroups, ex21_lamp.group, MESSAGE, removeGeomGroupData(), and RemoveGroup().

Referenced by SMESH_GroupBase_i.~SMESH_GroupBase_i().

{
  if(MYDEBUG) MESSAGE("SMESH_Mesh_i::removeGroup()" );
  if ( _mapGroups.find( theId ) != _mapGroups.end() ) {
    SMESH::SMESH_GroupBase_ptr group = _mapGroups[theId];
    _mapGroups.erase( theId );
    removeGeomGroupData( group );
    if (! _impl->RemoveGroup( theId ))
    {
      // it seems to be a call up from _impl caused by hyp modification (issue 0020918)
      RemoveGroup( group );
    }
  }
}
void SMESH_Mesh_i::RemoveGroupWithContents ( SMESH::SMESH_GroupBase_ptr  theGroup) throw (SALOME::SALOME_Exception)

RemoveGroupWithContents Remove group with its contents.

Definition at line 850 of file SMESH_Mesh_i.cxx.

References SMESH_controls.aGroup, SMESH_BelongToGeom.anIds, SMESH_GroupBase_i.GetListOfID(), GetMeshEditor(), SMESH_Gen_i.GetServant(), SMESH_GroupBase_i.GetType(), and SMESH.NODE.

{
  if ( theGroup->_is_nil() )
    return;

  SMESH_GroupBase_i* aGroup =
    dynamic_cast<SMESH_GroupBase_i*>( SMESH_Gen_i::GetServant( theGroup ).in() );
  if ( !aGroup )
    return;

  SMESH::long_array_var anIds = aGroup->GetListOfID();
  SMESH::SMESH_MeshEditor_var aMeshEditor = SMESH_Mesh_i::GetMeshEditor();

  TPythonDump pyDump; // Supress dump from RemoveNodes/Elements() and RemoveGroup()

  // Remove contents
  if ( aGroup->GetType() == SMESH::NODE )
    aMeshEditor->RemoveNodes( anIds );
  else
    aMeshEditor->RemoveElements( anIds );

  // Remove group
  RemoveGroup( theGroup );

  // Update Python script
  pyDump << _this() << ".RemoveGroupWithContents( " << theGroup << " )";
}
SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh_i::removeHypothesis ( GEOM::GEOM_Object_ptr  aSubShapeObject,
SMESH::SMESH_Hypothesis_ptr  anHyp 
)

Definition at line 564 of file SMESH_Mesh_i.cxx.

References _gen_i, _impl, SMESH_Gen_i.GeomObjectToShape(), HasShapeToMesh(), SMESH.HYP_OK, MESSAGE, and ex30_tepal.status.

Referenced by removeSubMesh().

{
  if(MYDEBUG) MESSAGE("removeHypothesis()");
  // **** proposer liste de subShape (selection multiple)

  if (CORBA::is_nil(aSubShapeObject) && HasShapeToMesh())
    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_Hypothesis::Hypothesis_Status status = SMESH_Hypothesis::HYP_OK;
  try
  {
    TopoDS_Shape myLocSubShape;
    //use PseudoShape in case if mesh has no shape
    if(HasShapeToMesh())
      myLocSubShape = _gen_i->GeomObjectToShape( aSubShapeObject);
    else
      myLocSubShape = _impl->GetShapeToMesh();

    int hypId = myHyp->GetId();
    status = _impl->RemoveHypothesis(myLocSubShape, hypId);
//     if ( !SMESH_Hypothesis::IsStatusFatal(status) ) EAP: hyp can be used on many subshapes
//       _mapHypo.erase( hypId );
  }
  catch(SALOME_Exception & S_ex)
  {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
  return status;
}
SMESH::Hypothesis_Status SMESH_Mesh_i::RemoveHypothesis ( GEOM::GEOM_Object_ptr  aSubShapeObject,
SMESH::SMESH_Hypothesis_ptr  anHyp 
) throw (SALOME::SALOME_Exception)

Definition at line 532 of file SMESH_Mesh_i.cxx.

References SMESH_Hypothesis.IsStatusFatal(), and ex30_tepal.status.

{
  Unexpect aCatch(SALOME_SalomeException);
  SMESH_Hypothesis::Hypothesis_Status status = removeHypothesis( aSubShapeObject, anHyp );

  if ( !SMESH_Hypothesis::IsStatusFatal(status) )
    _gen_i->RemoveHypothesisFromShape(_gen_i->GetCurrentStudy(), _this(),
                                      aSubShapeObject, anHyp );

  // Update Python script
    // Update Python script
  if(_impl->HasShapeToMesh()) {
  TPythonDump() << "status = " << _this() << ".RemoveHypothesis( "
                << aSubShapeObject << ", " << anHyp << " )";
  }
  else {
    TPythonDump() << "status = " << _this() << ".RemoveHypothesis( "
                  << anHyp << " )";
  }

  return ConvertHypothesisStatus(status);
}
void SMESH_Mesh_i::removeSubMesh ( SMESH::SMESH_subMesh_ptr  theSubMesh,
GEOM::GEOM_Object_ptr  theSubShapeObject 
)

Definition at line 2023 of file SMESH_Mesh_i.cxx.

References _impl, _mapSubMesh, _mapSubMesh_i, _mapSubMeshIor, GetHypothesisList(), SMESH_demo_hexa2_upd.hyp, MESSAGE, removeGeomGroupData(), and removeHypothesis().

{
  MESSAGE("SMESH_Mesh_i::removeSubMesh()");
  if ( theSubMesh->_is_nil() /*|| theSubShapeObject->_is_nil()*/ )
    return;

  if ( theSubShapeObject->_is_nil() )  // not published shape (IPAL13617)
  {
    CORBA::Long shapeId = theSubMesh->GetId();
    if ( _mapSubMesh.find( shapeId ) != _mapSubMesh.end())
    {
      TopoDS_Shape S = _mapSubMesh[ shapeId ]->GetSubShape();
      if ( !S.IsNull() )
      {
        list<const SMESHDS_Hypothesis*> hyps = _impl->GetHypothesisList( S );
        list<const SMESHDS_Hypothesis*>::const_iterator hyp = hyps.begin();
        for ( ; hyp != hyps.end(); ++hyp )
          _impl->RemoveHypothesis(S, (*hyp)->GetID());
      }
    }
  }
  else
  {
    try {
      SMESH::ListOfHypothesis_var aHypList = GetHypothesisList( theSubShapeObject );
      for ( int i = 0, n = aHypList->length(); i < n; i++ ) {
        removeHypothesis( theSubShapeObject, aHypList[i] );
      }
    }
    catch( const SALOME::SALOME_Exception& ) {
      INFOS("SMESH_Mesh_i::removeSubMesh(): exception caught!");
    }
    removeGeomGroupData( theSubShapeObject );
  }
  int subMeshId = theSubMesh->GetId();

  _mapSubMesh.erase(subMeshId);
  _mapSubMesh_i.erase(subMeshId);
  _mapSubMeshIor.erase(subMeshId);
  if(MYDEBUG) MESSAGE("SMESH_Mesh_i::removeSubMesh() completed");
}
void SMESH_Mesh_i::RemoveSubMesh ( SMESH::SMESH_subMesh_ptr  theSubMesh) throw (SALOME::SALOME_Exception)

Definition at line 697 of file SMESH_Mesh_i.cxx.

References SMESH_Gen_i.GetRefOnShapeTag(), and MESSAGE.

Referenced by CheckGeomGroupModif().

{
  if(MYDEBUG) MESSAGE("SMESH_Mesh_i::RemoveSubMesh");
  if ( theSubMesh->_is_nil() )
    return;

  GEOM::GEOM_Object_var aSubShapeObject;
  SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
  if ( !aStudy->_is_nil() )  {
    // Remove submesh's SObject
    SALOMEDS::SObject_var anSO = _gen_i->ObjectToSObject( aStudy, theSubMesh );
    if ( !anSO->_is_nil() ) {
      long aTag = SMESH_Gen_i::GetRefOnShapeTag();
      SALOMEDS::SObject_var anObj, aRef;
      if ( anSO->FindSubObject( aTag, anObj ) && anObj->ReferencedObject( aRef ) )
        aSubShapeObject = GEOM::GEOM_Object::_narrow( aRef->GetObject() );

//       if ( aSubShapeObject->_is_nil() ) // not published shape (IPAL13617)
//         aSubShapeObject = theSubMesh->GetSubShape();

      aStudy->NewBuilder()->RemoveObjectWithChildren( anSO );

      // Update Python script
      TPythonDump() << _this() << ".RemoveSubMesh( " << anSO << " )";
    }
  }

  removeSubMesh( theSubMesh, aSubShapeObject.in() );
}
void SMESH_Mesh_i::SetAutoColor ( CORBA::Boolean  theAutoColor) throw (SALOME::SALOME_Exception)

Auto color.

Definition at line 2355 of file SMESH_Mesh_i.cxx.

References getUniqueColor().

{
  Unexpect aCatch(SALOME_SalomeException);
  _impl->SetAutoColor(theAutoColor);

  TPythonDump pyDump; // not to dump group->SetColor() from below code
  pyDump<<_this()<<".SetAutoColor( "<<theAutoColor<<" )";

  std::list<SALOMEDS::Color> aReservedColors;
  map<int, SMESH::SMESH_GroupBase_ptr>::iterator it = _mapGroups.begin();
  for ( ; it != _mapGroups.end(); it++ ) {
    if ( CORBA::is_nil( it->second )) continue;
    SALOMEDS::Color aColor = getUniqueColor( aReservedColors );
    it->second->SetColor( aColor );
    aReservedColors.push_back( aColor );
  }
}
void SMESH_Mesh_i::SetImpl ( ::SMESH_Mesh impl)

Definition at line 2256 of file SMESH_Mesh_i.cxx.

References _impl, and MESSAGE.

Referenced by SMESH_Gen_i.createMesh().

{
  if(MYDEBUG) MESSAGE("SMESH_Mesh_i::SetImpl");
  _impl = impl;
  if ( _impl )
    _impl->SetRemoveGroupCallUp( new TRmGroupCallUp_i(this));
}
CORBA::Boolean SMESH_Mesh_i::SetMeshOrder ( const SMESH::submesh_array_array theSubMeshArray)

Set submesh object order.

Parameters:
theSubMeshArraysubmesh array order

Definition at line 4045 of file SMESH_Mesh_i.cxx.

References _mapSubMesh, SMESH_subMesh.CLEAN, findCommonSubMesh(), GetImpl(), PAL_MESH_041_mesh.mesh, and SMESH_AdvancedEditor.res.

{
  bool res = false;
  ::SMESH_Mesh& mesh = GetImpl();

  TPythonDump aPythonDump; // prevent dump of called methods
  aPythonDump << "isDone = " << _this() << ".SetMeshOrder( [ ";

  TListOfListOfInt subMeshOrder;
  for ( int i = 0, n = theSubMeshArray.length(); i < n; i++ )
  {
    const SMESH::submesh_array& aSMArray = theSubMeshArray[i];
    TListOfInt subMeshIds;
    aPythonDump << "[ ";
    // Collect subMeshes which should be clear
    //  do it list-by-list, because modification of submesh order
    //  take effect between concurrent submeshes only
    set<const SMESH_subMesh*> subMeshToClear;
    list<const SMESH_subMesh*> subMeshList;
    for ( int j = 0, jn = aSMArray.length(); j < jn; j++ )
    {
      const SMESH::SMESH_subMesh_var subMesh = SMESH::SMESH_subMesh::_duplicate(aSMArray[j]);
      if ( j > 0 )
        aPythonDump << ", ";
      aPythonDump << subMesh;
      subMeshIds.push_back( subMesh->GetId() );
      // detect common parts of submeshes
      if ( _mapSubMesh.find(subMesh->GetId()) != _mapSubMesh.end() )
        findCommonSubMesh( subMeshList, _mapSubMesh[ subMesh->GetId() ], subMeshToClear );
    }
    aPythonDump << " ]";
    subMeshOrder.push_back( subMeshIds );

    // clear collected submeshes
    set<const SMESH_subMesh*>::iterator clrIt = subMeshToClear.begin();
    for ( ; clrIt != subMeshToClear.end(); clrIt++ ) {
      SMESH_subMesh* sm = (SMESH_subMesh*)*clrIt;
        if ( sm )
          sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
        // ClearSubMesh( *clrIt );
      }
  }
  aPythonDump << " ])";

  mesh.SetMeshOrder( subMeshOrder );
  res = true;
  
  return res;
}
void SMESH_Mesh_i::SetParameters ( const char *  theParameters)

Sets list of notebook variables used for Mesh operations separated by ":" symbol.

Definition at line 3605 of file SMESH_Mesh_i.cxx.

References SMESH_Gen_i.GetSMESHGen(), and SMESH_Gen_i.UpdateParameters().

{
  SMESH_Gen_i::GetSMESHGen()->UpdateParameters(SMESH::SMESH_Mesh::_narrow(_this()),
                                               CORBA::string_dup(theParameters));
}
void SMESH_Mesh_i::SetShape ( GEOM::GEOM_Object_ptr  theShapeObject) throw (SALOME::SALOME_Exception)

SetShape.

Associates <this> mesh with <theShape> and puts a reference to <theShape> into the current study; the previous shape is substituted by the new one.

Definition at line 177 of file SMESH_Mesh_i.cxx.

Referenced by SMESH_Gen_i.CreateMesh(), and SMESH_Gen_i.Load().

{
  Unexpect aCatch(SALOME_SalomeException);
  try {
    _impl->ShapeToMesh( _gen_i->GeomObjectToShape( theShapeObject ));
  }
  catch(SALOME_Exception & S_ex) {
    THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
  }
  // to track changes of GEOM groups
  addGeomGroupData( theShapeObject, _this() );
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups ( SMESH::SMESH_GroupBase_ptr  theGroup1,
SMESH::SMESH_GroupBase_ptr  theGroup2,
const char *  theName 
) throw (SALOME::SALOME_Exception)

UnionGroups New group is created.

All mesh elements that are present in initial groups are added to the new one

Definition at line 940 of file SMESH_Mesh_i.cxx.

References SMESH_test.i1, SMESH_test.i2, SMESH_AdvancedEditor.n1, and SMESH_AdvancedEditor.n2.

{
  try
  {
    if ( theGroup1->_is_nil() || theGroup2->_is_nil() ||
         theGroup1->GetType() != theGroup2->GetType() )
      return SMESH::SMESH_Group::_nil();

    // Create Union
    SMESH::SMESH_Group_var aResGrp = CreateGroup( theGroup1->GetType(), theName );
    if ( aResGrp->_is_nil() )
      return SMESH::SMESH_Group::_nil();

    SMESH::long_array_var anIds1 = theGroup1->GetListOfID();
    SMESH::long_array_var anIds2 = theGroup2->GetListOfID();

    TColStd_MapOfInteger aResMap;

    for ( int i1 = 0, n1 = anIds1->length(); i1 < n1; i1++ )
      aResMap.Add( anIds1[ i1 ] );

    for ( int i2 = 0, n2 = anIds2->length(); i2 < n2; i2++ )
      aResMap.Add( anIds2[ i2 ] );

    SMESH::long_array_var aResIds = new SMESH::long_array;
    aResIds->length( aResMap.Extent() );

    int resI = 0;
    TColStd_MapIteratorOfMapOfInteger anIter( aResMap );
    for( ; anIter.More(); anIter.Next() )
      aResIds[ resI++ ] = anIter.Key();

    aResGrp->Add( aResIds );

    // Clear python lines, created by CreateGroup() and Add()
    SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
    _gen_i->RemoveLastFromPythonScript(aStudy->StudyId());
    _gen_i->RemoveLastFromPythonScript(aStudy->StudyId());

    // Update Python script
    TPythonDump() << aResGrp << " = " << _this() << ".UnionGroups( "
                  << theGroup1 << ", " << theGroup2 << ", '"
                  << theName << "' )";

    return aResGrp._retn();
  }
  catch( ... )
  {
    return SMESH::SMESH_Group::_nil();
  }
}
SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionListOfGroups ( const SMESH::ListOfGroups theGroups,
const char *  theName 
) throw (SALOME::SALOME_Exception)

Union list of groups.

New group is created. All mesh elements that are present in initial groups are added to the new one.

Parameters:
theGroupslist of groups
theNamename of group to be created
Returns:
pointer on the group

Definition at line 1004 of file SMESH_Mesh_i.cxx.

References SMESH.ALL, and SMESH_BelongToGeom.anIds.

{
  if ( !theName )
    return SMESH::SMESH_Group::_nil();

  try
  {
    vector< int > anIds;
    SMESH::ElementType aType = SMESH::ALL;
    for ( int g = 0, n = theGroups.length(); g < n; g++ )
    {
      SMESH::SMESH_GroupBase_var aGrp = theGroups[ g ];
      if ( CORBA::is_nil( aGrp ) )
        continue;

      // check type
      SMESH::ElementType aCurrType = aGrp->GetType();
      if ( aType == SMESH::ALL )
        aType = aCurrType;
      else 
      {
        if ( aType != aCurrType )
          return SMESH::SMESH_Group::_nil();
      }

      // unite ids
      SMESH::long_array_var aCurrIds = aGrp->GetListOfID();
      for ( int i = 0, n = aCurrIds->length(); i < n; i++ )
      {
        int aCurrId = aCurrIds[ i ];
        anIds.push_back( aCurrId );
      }
    }

    // Create group
    SMESH::SMESH_Group_var aResGrp = CreateGroup( aType, theName );
    if ( aResGrp->_is_nil() )
      return SMESH::SMESH_Group::_nil();
    
    // Create array of identifiers
    SMESH::long_array_var aResIds = new SMESH::long_array;
    aResIds->length( anIds.size() );
    
    //NCollection_Map< int >::Iterator anIter( anIds );
    for ( int i = 0; i<anIds.size(); i++ )
    {
      aResIds[ i ] = anIds[i];
    }
    aResGrp->Add( aResIds );

    // Clear python lines, created by CreateGroup() and Add()
    SALOMEDS::Study_ptr aStudy = _gen_i->GetCurrentStudy();
    _gen_i->RemoveLastFromPythonScript( aStudy->StudyId() );
    _gen_i->RemoveLastFromPythonScript( aStudy->StudyId() );

    // Update Python script
    
    TPythonDump() << aResGrp << " = " << _this() << ".UnionListOfGroups( "
                  << &theGroups << ", '" << theName << "' )";

    return aResGrp._retn();
  }
  catch( ... )
  {
    return SMESH::SMESH_Group::_nil();
  }
}

Field Documentation

Definition at line 577 of file SMESH_Mesh_i.hxx.

Referenced by addGeomGroupData(), CheckGeomGroupModif(), and removeGeomGroupData().

int SMESH_Mesh_i._id [private]

Definition at line 560 of file SMESH_Mesh_i.hxx.

Referenced by GetId(), and SMESH_Mesh_i().

std::map<int, SMESH::SMESH_GroupBase_ptr> SMESH_Mesh_i._mapGroups [private]
std::map<int, SMESH::SMESH_Hypothesis_ptr> SMESH_Mesh_i._mapHypo [private]

Definition at line 564 of file SMESH_Mesh_i.hxx.

Referenced by addHypothesis(), and ~SMESH_Mesh_i().

std::map<int, SMESH::SMESH_subMesh_ptr> SMESH_Mesh_i._mapSubMeshIor [private]

Definition at line 561 of file SMESH_Mesh_i.hxx.

Referenced by GetStudyId(), and SMESH_Mesh_i().

SALOME_MED::MedFileInfo_var SMESH_Mesh_i.myFileInfo [private]

Definition at line 565 of file SMESH_Mesh_i.hxx.

Referenced by GetMEDFileInfo().

int SMESH_Mesh_i::myIdGenerator = 0 [static, private]

Definition at line 557 of file SMESH_Mesh_i.hxx.

Referenced by SMESH_Mesh_i().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS