Back to index

salome-smesh  6.5.0
Public Member Functions
SMESH::SMESH_Mesh Interface Reference

import "SMESH_Mesh.idl";

Inheritance diagram for SMESH::SMESH_Mesh:
Inheritance graph
[legend]
Collaboration diagram for SMESH::SMESH_Mesh:
Collaboration graph
[legend]

List of all members.

Public Member Functions

boolean HasShapeToMesh () raises (SALOME::SALOME_Exception)
 Return true if there is a geometry to be meshed.
GEOM::GEOM_Object GetShapeToMesh () raises (SALOME::SALOME_Exception)
 Get geom shape to mesh.
boolean IsLoaded () raises (SALOME::SALOME_Exception)
 Return false if the mesh is not yet fully loaded from the study file.
void Load () raises (SALOME::SALOME_Exception)
 Load full mesh data from the study file.
void Clear () raises (SALOME::SALOME_Exception)
 Remove all nodes and elements.
submesh_array GetSubMeshes () raises (SALOME::SALOME_Exception)
 Get the list of sub-meshes existing in the mesh.
void ClearSubMesh (in long ShapeID) raises (SALOME::SALOME_Exception)
 Remove all nodes and elements of submesh.
SMESH_subMesh GetSubMesh (in GEOM::GEOM_Object aSubObject, in string name) raises (SALOME::SALOME_Exception)
 Get the subMesh object associated to a Sub-shape.
void RemoveSubMesh (in SMESH_subMesh aSubMesh) raises (SALOME::SALOME_Exception)
 Remove a submesh.
SMESH_Group CreateGroup (in ElementType elem_type, in string name) raises (SALOME::SALOME_Exception)
 Create a group.
SMESH_GroupOnGeom CreateGroupFromGEOM (in ElementType elemType, in string name, in GEOM::GEOM_Object geomObject) raises (SALOME::SALOME_Exception)
 Create a group from geometry.
SMESH_GroupOnFilter CreateGroupFromFilter (in ElementType elemType, in string name, in SMESH::Filter filter) raises (SALOME::SALOME_Exception)
 Create a group from filter.
void RemoveGroup (in SMESH_GroupBase aGroup) raises (SALOME::SALOME_Exception)
 Remove a group.
void RemoveGroupWithContents (in SMESH_GroupBase aGroup) raises (SALOME::SALOME_Exception)
 Remove group with its contents.
ListOfGroups GetGroups () raises (SALOME::SALOME_Exception)
 Get the list of groups existing in the mesh.
long NbGroups () raises (SALOME::SALOME_Exception)
 Get number of groups existing in the mesh.
SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1, in SMESH_GroupBase aGroup2, in string name) raises (SALOME::SALOME_Exception)
 Union of two groups New group is created.
SMESH_Group UnionListOfGroups (in ListOfGroups aListOfGroups, in string name) raises (SALOME::SALOME_Exception)
 Union of list of groups New group is created.
SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1, in SMESH_GroupBase aGroup2, in string name) raises (SALOME::SALOME_Exception)
 Intersection of two groups New group is created.
SMESH_Group IntersectListOfGroups (in ListOfGroups aListOfGroups, in string name) raises (SALOME::SALOME_Exception)
 Intersection of list of groups New group is created.
SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup, in SMESH_GroupBase aToolGroup, in string name) raises (SALOME::SALOME_Exception)
 Cut of two groups New group is created.
SMESH_Group CutListOfGroups (in ListOfGroups aMainGroups, in ListOfGroups aToolGroups, in string name) raises (SALOME::SALOME_Exception)
 Cut of lists of groups New group is created.
SMESH_Group CreateDimGroup (in ListOfGroups aListOfGroups, in ElementType anElemType, in string name) raises (SALOME::SALOME_Exception)
 Create groups of entities from existing groups of superior dimensions New group is created.
SMESH_Group ConvertToStandalone (in SMESH_GroupBase theGroupOn) raises (SALOME::SALOME_Exception)
 Convert group on geometry or on filter into standalone group.
Hypothesis_Status AddHypothesis (in GEOM::GEOM_Object aSubObject, in SMESH_Hypothesis anHyp) raises (SALOME::SALOME_Exception)
 Add hypothesis to the mesh, under a particular Sub-shape (or the main shape itself) The Add method is only used to prepare the build of the mesh and store the algorithms and associated parameters.
Hypothesis_Status RemoveHypothesis (in GEOM::GEOM_Object aSubObject, in SMESH_Hypothesis anHyp) raises (SALOME::SALOME_Exception)
 Remove an hypothesis previouly added with AddHypothesis.
ListOfHypothesis GetHypothesisList (in GEOM::GEOM_Object aSubObject) raises (SALOME::SALOME_Exception)
 Get the list of hypothesis added on a sub-shape.
log_array GetLog (in boolean clearAfterGet) raises (SALOME::SALOME_Exception)
 Get the log of nodes and elements added or removed since previous clear of the log.
void ClearLog () raises (SALOME::SALOME_Exception)
 Clear the log of nodes and elements added or removed since previous clear.
void SetAutoColor (in boolean theAutoColor) raises (SALOME::SALOME_Exception)
 Toggle auto color mode on the object.
boolean GetAutoColor () raises (SALOME::SALOME_Exception)
 Get flag of object's auto color mode.
long GetId ()
 Get the internal Id.
long GetStudyId ()
 Get the study Id.
SMESH_MeshEditor GetMeshEditor () raises (SALOME::SALOME_Exception)
 Obtain instance of SMESH_MeshEditor.
SMESH_MeshEditor GetMeshEditPreviewer () raises (SALOME::SALOME_Exception)
 Return SMESH_MeshEditor that would not modify the mesh but fill MeshPreviewStruct.
boolean HasModificationsToDiscard () raises (SALOME::SALOME_Exception)
 Return true if the mesh has been edited since a total re-compute and those modifications may prevent successful partial re-compute.
boolean HasDuplicatedGroupNamesMED ()
 Check group names for duplications.
void ExportToMEDX (in string file, in boolean auto_groups, in MED_VERSION version, in boolean overwrite) raises (SALOME::SALOME_Exception)
 Export Mesh to different MED Formats .
void ExportPartToMED (in SMESH_IDSource meshPart, in string file, in boolean auto_groups, in MED_VERSION version, in boolean overwrite) raises (SALOME::SALOME_Exception)
 Export a part of Mesh into a MED file .
void ExportToMED (in string file, in boolean auto_groups, in MED_VERSION theVersion) raises (SALOME::SALOME_Exception)
 Export Mesh to different MED Formats Works, just the same as ExportToMEDX, with overwrite parameter equal to true.
void ExportMED (in string file, in boolean auto_groups) raises (SALOME::SALOME_Exception)
 Export Mesh to MED_V2_1 MED format Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_V2_1 and overwrite parameter equal to true The method is kept in order to support old functionality.
void ExportSAUV (in string file, in boolean auto_groups) raises (SALOME::SALOME_Exception)
 Export Mesh to SAUV formatted file Write a temporary med file and use med2sauv.
string GetVersionString (in MED_VERSION version, in short nbDigits)
 Return string representation of a MED file version comprising nbDigits.
void ExportDAT (in string file) raises (SALOME::SALOME_Exception)
 Export Mesh to DAT, UNV and STL Formats (UNV supported version is I-DEAS 10)
void ExportUNV (in string file) raises (SALOME::SALOME_Exception)
 Export the mesh to an UNV file.
void ExportSTL (in string file, in boolean isascii) raises (SALOME::SALOME_Exception)
 Export the mesh to an STL file.
void ExportCGNS (in SMESH_IDSource meshPart, in string file, in boolean overwrite) raises (SALOME::SALOME_Exception)
 Export the mesh to the CGNS file.
void ExportPartToDAT (in SMESH_IDSource meshPart, in string file) raises (SALOME::SALOME_Exception)
void ExportPartToUNV (in SMESH_IDSource meshPart, in string file) raises (SALOME::SALOME_Exception)
void ExportPartToSTL (in SMESH_IDSource meshPart, in string file, in boolean isascii) raises (SALOME::SALOME_Exception)
SALOME_MED::MESH GetMEDMesh () raises (SALOME::SALOME_Exception)
 Get MED Mesh.
long NbNodes () raises (SALOME::SALOME_Exception)
 Get informations about mesh contents.
long NbElements () raises (SALOME::SALOME_Exception)
long Nb0DElements () raises (SALOME::SALOME_Exception)
 Return number of edges of given order in the mesh.
long NbEdges () raises (SALOME::SALOME_Exception)
 Return number of edges of given order in the mesh.
long NbEdgesOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbFaces () raises (SALOME::SALOME_Exception)
 Return number of faces of given order in the mesh.
long NbFacesOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbTriangles () raises (SALOME::SALOME_Exception)
 Return the number of faces in the mesh.
long NbTrianglesOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbQuadrangles () raises (SALOME::SALOME_Exception)
 Return the number nodes faces in the mesh.
long NbQuadranglesOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbBiQuadQuadrangles () raises (SALOME::SALOME_Exception)
 Return number of biquadratic quadrangles in the mesh.
long NbPolygons () raises (SALOME::SALOME_Exception)
 Return the number of polygonal faces in the mesh.
long NbVolumes () raises (SALOME::SALOME_Exception)
 Return number of volumes of given order in the mesh.
long NbVolumesOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbTetras () raises (SALOME::SALOME_Exception)
 Return number of tetrahedrons of given order in the mesh.
long NbTetrasOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbHexas () raises (SALOME::SALOME_Exception)
 Return number of hexahedrons of given order in the mesh.
long NbHexasOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbTriQuadraticHexas () raises (SALOME::SALOME_Exception)
 Return number of triquadratic hexahedrons in the mesh.
long NbPyramids () raises (SALOME::SALOME_Exception)
 Return number of pyramids of given order in the mesh.
long NbPyramidsOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbPrisms () raises (SALOME::SALOME_Exception)
 Return number of prisms (penthahedrons) of given order in the mesh.
long NbPrismsOfOrder (in ElementOrder order) raises (SALOME::SALOME_Exception)
long NbHexagonalPrisms () raises (SALOME::SALOME_Exception)
 Return number of hexagonal prisms in the mesh.
long NbPolyhedrons () raises (SALOME::SALOME_Exception)
 Return number of polyhedrons in the mesh.
long NbSubMesh () raises (SALOME::SALOME_Exception)
 Return number of submeshes in the mesh.
long_array GetElementsId () raises (SALOME::SALOME_Exception)
long_array GetElementsByType (in ElementType theType) raises (SALOME::SALOME_Exception)
long_array GetNodesId () raises (SALOME::SALOME_Exception)
ElementType GetElementType (in long id, in boolean iselem) raises (SALOME::SALOME_Exception)
 Returns type of mesh element.
EntityType GetElementGeomType (in long id) raises (SALOME::SALOME_Exception)
long_array GetSubMeshElementsId (in long ShapeID) raises (SALOME::SALOME_Exception)
long_array GetSubMeshNodesId (in long ShapeID, in boolean all) raises (SALOME::SALOME_Exception)
ElementType GetSubMeshElementType (in long ShapeID) raises (SALOME::SALOME_Exception)
submesh_array_array GetMeshOrder ()
 Methods to set meshing order of submeshes.
boolean SetMeshOrder (in submesh_array_array theSubMeshArray)
 Set submesh object order.
string Dump ()
 Get mesh description.
long long GetMeshPtr ()
 Get mesh pointer.
double_array GetNodeXYZ (in long id)
 Get XYZ coordinates of node as list of double If there is not node for given ID - returns empty list.
long_array GetNodeInverseElements (in long id)
 For given node returns list of IDs of inverse elements If there is not node for given ID - returns empty list.
NodePosition GetNodePosition (in long NodeID)
 Return position of a node on shape.
long GetShapeID (in long id)
 If given element is node returns IDs of shape from position If there is not node for given ID - returns -1.
long GetShapeIDForElem (in 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.
long GetElemNbNodes (in long id)
 Returns number of nodes for given element If there is not element for given ID - returns -1.
long_array GetElemNodes (in long id)
 Returns IDs of nodes of given element.
long GetElemNode (in long id, in 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.
boolean IsMediumNode (in long ide, in long idn)
 Returns true if given node is medium node in given quadratic element.
boolean IsMediumNodeOfAnyElem (in long idn, in ElementType elem_type)
 Returns true if given node is medium node in one of quadratic elements.
long ElemNbEdges (in long id)
 Returns number of edges for given element.
long ElemNbFaces (in long id)
 Returns number of faces for given element.
long_array GetElemFaceNodes (in long elemId, in short faceIndex)
 Returns nodes of given face (counted from zero) for given volumic element.
long FindElementByNodes (in long_array nodes)
 Returns an element based on all given nodes.
boolean IsPoly (in long id)
 Returns true if given element is polygon.
boolean IsQuadratic (in long id)
 Returns true if given element is quadratic.
double_array BaryCenter (in long id)
 Returns XYZ coordinates of bary center for given element as list of double If there is not element for given ID - returns empty list.
SALOME_MED::MedFileInfo GetMEDFileInfo ()
 Gets information about imported MED file.
void SetParameters (in string theParameters)
 Sets list of notebook variables used for Mesh operations separated by ":" symbol.
string GetParameters ()
 Returns list of notebook variables used for Mesh operations separated by ":" symbol.
string_array GetLastParameters ()
 Returns list of notebook variables used for last Mesh operation.
long_array GetIDs ()
 Returns a sequence of all element IDs.
long_array GetMeshInfo ()
 Returns statistic of mesh elements.
array_of_ElementType GetTypes ()
 Returns types of elements it contains.
SMESH_Mesh GetMesh ()
 Returns the mesh.
boolean IsMeshInfoCorrect ()
 Returns false if GetMeshInfo() returns incorrect information that may happen if mesh data is not yet fully loaded from the file of study.

Detailed Description

Definition at line 301 of file SMESH_Mesh.idl.


Member Function Documentation

SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh::AddHypothesis ( in GEOM::GEOM_Object  aSubObject,
in SMESH_Hypothesis  anHyp 
) raises (SALOME::SALOME_Exception)

Add hypothesis to the mesh, under a particular Sub-shape (or the main shape itself) The Add method is only used to prepare the build of the mesh and store the algorithms and associated parameters.

Actual job of mesh the shape is done by MESH_Gen.

  • aSubShape : sub-shape obtained by a shape explode in GEOM (or main shape)
  • anHyp : hypothesis object
    Returns:
  • OK if the hypothesis is compatible with the sub-shape (and all previous hypothesis on the sub-shape)
  • NOK if the hypothesis is not compatible with the sub-shape (or one previous hypothesis on the sub-shape) raises exception if hypothesis has not been created

Definition at line 549 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  if(MYDEBUG) MESSAGE("SMESH_Mesh::AddHypothesis");

  SMESH_subMesh *subMesh = GetSubMesh(aSubShape);
  if ( !subMesh || !subMesh->GetId())
    return SMESH_Hypothesis::HYP_BAD_SUBSHAPE;

  StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
  if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
  {
    if(MYDEBUG) MESSAGE("Hypothesis ID does not give an hypothesis");
    if(MYDEBUG) {
      SCRUTE(_studyId);
      SCRUTE(anHypId);
    }
    throw SALOME_Exception(LOCALIZED("hypothesis does not exist"));
  }

  SMESH_Hypothesis *anHyp = sc->mapHypothesis[anHypId];
  MESSAGE( "SMESH_Mesh::AddHypothesis " << anHyp->GetName() );

  bool isGlobalHyp = IsMainShape( aSubShape );

  // NotConformAllowed can be only global
  if ( !isGlobalHyp )
  {
    // NOTE: this is not a correct way to check a name of hypothesis,
    // there should be an attribute of hypothesis saying that it can/can't
    // be global/local
    string hypName = anHyp->GetName();
    if ( hypName == "NotConformAllowed" )
    {
      if(MYDEBUG) MESSAGE( "Hypotesis <NotConformAllowed> can be only global" );
      return SMESH_Hypothesis::HYP_INCOMPATIBLE;
    }
  }

  // shape 

  bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO );
  int event = isAlgo ? SMESH_subMesh::ADD_ALGO : SMESH_subMesh::ADD_HYP;

  SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp);

  // sub-shapes
  if (!SMESH_Hypothesis::IsStatusFatal(ret) &&
      anHyp->GetDim() <= SMESH_Gen::GetShapeDim(aSubShape)) // is added on father
  {
    event = isAlgo ? SMESH_subMesh::ADD_FATHER_ALGO : SMESH_subMesh::ADD_FATHER_HYP;

    SMESH_Hypothesis::Hypothesis_Status ret2 =
      subMesh->SubMeshesAlgoStateEngine(event, anHyp);
    if (ret2 > ret)
      ret = ret2;

    // check concurent hypotheses on ancestors
    if (ret < SMESH_Hypothesis::HYP_CONCURENT && !isGlobalHyp )
    {
      SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false,false);
      while ( smIt->more() ) {
        SMESH_subMesh* sm = smIt->next();
        if ( sm->IsApplicableHypotesis( anHyp )) {
          ret2 = sm->CheckConcurentHypothesis( anHyp->GetType() );
          if (ret2 > ret) {
            ret = ret2;
            break;
          }
        }
      }
    }
  }
  HasModificationsToDiscard(); // to reset _isModified flag if a mesh becomes empty

  GetMeshDS()->Modified();

  if(MYDEBUG) subMesh->DumpAlgoState(true);
  if(MYDEBUG) SCRUTE(ret);
  return ret;
}

Here is the call graph for this function:

Returns XYZ coordinates of bary center for given element as list of double If there is not element for given ID - returns empty list.

void SMESH_Mesh::Clear ( ) raises (SALOME::SALOME_Exception)

Remove all nodes and elements.

Definition at line 348 of file SMESH_Mesh.cxx.

{
  // clear mesh data
  _myMeshDS->ClearMesh();

  // update compute state of submeshes
  if ( SMESH_subMesh *sm = GetSubMeshContaining( GetShapeToMesh() ) )
  {
    sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
    sm->ComputeSubMeshStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
    sm->ComputeStateEngine( SMESH_subMesh::CLEAN ); // for event listeners (issue 0020918)
    sm->ComputeSubMeshStateEngine( SMESH_subMesh::CLEAN );
  }
  _isModified = false;
}
void SMESH_Mesh::ClearLog ( ) raises (SALOME::SALOME_Exception)

Clear the log of nodes and elements added or removed since previous clear.

Must be used immediately after GetLog if clearAfterGet is false.

Definition at line 863 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  if(MYDEBUG) MESSAGE("SMESH_Mesh::ClearLog");
  _myMeshDS->GetScript()->Clear();
}
void SMESH_Mesh::ClearSubMesh ( in long  ShapeID) raises (SALOME::SALOME_Exception)

Remove all nodes and elements of submesh.

Remove all nodes and elements of indicated shape.

Definition at line 370 of file SMESH_Mesh.cxx.

{
  // clear sub-meshes; get ready to re-compute as a side-effect 
  if ( SMESH_subMesh *sm = GetSubMeshContaining( theShapeId ) )
  {
    SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true,
                                                             /*complexShapeFirst=*/false);
    while ( smIt->more() )
    {
      sm = smIt->next();
      TopAbs_ShapeEnum shapeType = sm->GetSubShape().ShapeType();      
      if ( shapeType == TopAbs_VERTEX || shapeType < TopAbs_SOLID )
        // all other shapes depends on vertices so they are already cleaned
        sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
      // to recompute even if failed
      sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
    }
  }
}
SMESH_Group * SMESH_Mesh::ConvertToStandalone ( in SMESH_GroupBase  theGroupOn) raises (SALOME::SALOME_Exception)

Convert group on geometry or on filter into standalone group.

Convert group on geometry into standalone group.

Definition at line 1845 of file SMESH_Mesh.cxx.

{
  SMESH_Group* aGroup = 0;
  map < int, SMESH_Group * >::iterator itg = _mapGroup.find( theGroupID );
  if ( itg == _mapGroup.end() )
    return aGroup;

  SMESH_Group* anOldGrp = (*itg).second;
  SMESHDS_GroupBase* anOldGrpDS = anOldGrp->GetGroupDS();
  if ( !anOldGrp || !anOldGrpDS )
    return aGroup;

  // create new standalone group
  aGroup = new SMESH_Group (theGroupID, this, anOldGrpDS->GetType(), anOldGrp->GetName() );
  _mapGroup[theGroupID] = aGroup;

  SMESHDS_Group* aNewGrpDS = dynamic_cast<SMESHDS_Group*>( aGroup->GetGroupDS() );
  GetMeshDS()->RemoveGroup( anOldGrpDS );
  GetMeshDS()->AddGroup( aNewGrpDS );

  // add elements (or nodes) into new created group
  SMDS_ElemIteratorPtr anItr = anOldGrpDS->GetElements();
  while ( anItr->more() )
    aNewGrpDS->Add( (anItr->next())->GetID() );

  // set color
  aNewGrpDS->SetColor( anOldGrpDS->GetColor() );

  // remove old group
  delete anOldGrp;

  return aGroup;
}

Here is the call graph for this function:

SMESH_Group SMESH::SMESH_Mesh::CreateDimGroup ( in ListOfGroups  aListOfGroups,
in ElementType  anElemType,
in string  name 
) raises (SALOME::SALOME_Exception)

Create groups of entities from existing groups of superior dimensions New group is created.

System 1) extracts all nodes from each group, 2) combines all elements of specified dimension laying on these nodes.

SMESH_Group SMESH::SMESH_Mesh::CreateGroup ( in ElementType  elem_type,
in string  name 
) raises (SALOME::SALOME_Exception)

Create a group.

SMESH_GroupOnFilter SMESH::SMESH_Mesh::CreateGroupFromFilter ( in ElementType  elemType,
in string  name,
in SMESH::Filter  filter 
) raises (SALOME::SALOME_Exception)

Create a group from filter.

SMESH_GroupOnGeom SMESH::SMESH_Mesh::CreateGroupFromGEOM ( in ElementType  elemType,
in string  name,
in GEOM::GEOM_Object  geomObject 
) raises (SALOME::SALOME_Exception)

Create a group from geometry.

SMESH_Group SMESH::SMESH_Mesh::CutGroups ( in SMESH_GroupBase  aMainGroup,
in SMESH_GroupBase  aToolGroup,
in string  name 
) raises (SALOME::SALOME_Exception)

Cut of two groups 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

SMESH_Group SMESH::SMESH_Mesh::CutListOfGroups ( in ListOfGroups  aMainGroups,
in ListOfGroups  aToolGroups,
in string  name 
) raises (SALOME::SALOME_Exception)

Cut of 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

ostream & SMESH_Mesh::Dump ( )

Get mesh description.

Definition at line 1761 of file SMESH_Mesh.cxx.

{
  int clause = 0;
  save << "========================== Dump contents of mesh ==========================" << endl << endl;
  save << ++clause << ") Total number of nodes:   \t"    << NbNodes() << endl;
  save << ++clause << ") Total number of edges:   \t"    << NbEdges() << endl;
  save << ++clause << ") Total number of faces:   \t"    << NbFaces() << endl;
  save << ++clause << ") Total number of polygons:\t"    << NbPolygons() << endl;
  save << ++clause << ") Total number of volumes:\t"     << NbVolumes() << endl;
  save << ++clause << ") Total number of polyhedrons:\t" << NbPolyhedrons() << endl << endl;
  for ( int isQuadratic = 0; isQuadratic < 2; ++isQuadratic )
  {
    string orderStr = isQuadratic ? "quadratic" : "linear";
    SMDSAbs_ElementOrder order  = isQuadratic ? ORDER_QUADRATIC : ORDER_LINEAR;

    save << ++clause << ") Total number of " << orderStr << " edges:\t" << NbEdges(order) << endl;
    save << ++clause << ") Total number of " << orderStr << " faces:\t" << NbFaces(order) << endl;
    if ( NbFaces(order) > 0 ) {
      int nb3 = NbTriangles(order);
      int nb4 = NbQuadrangles(order);
      save << clause << ".1) Number of " << orderStr << " triangles:  \t" << nb3 << endl;
      save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl;
      if ( nb3 + nb4 !=  NbFaces(order) ) {
        map<int,int> myFaceMap;
        SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator();
        while( itFaces->more( ) ) {
          int nbNodes = itFaces->next()->NbNodes();
          if ( myFaceMap.find( nbNodes ) == myFaceMap.end() )
            myFaceMap[ nbNodes ] = 0;
          myFaceMap[ nbNodes ] = myFaceMap[ nbNodes ] + 1;
        }
        save << clause << ".3) Faces in detail: " << endl;
        map <int,int>::iterator itF;
        for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
          save << "--> nb nodes: " << itF->first << " - nb elemens:\t" << itF->second << endl;
      }
    }
    save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
    if ( NbVolumes(order) > 0 ) {
      int nb8 = NbHexas(order);
      int nb4 = NbTetras(order);
      int nb5 = NbPyramids(order);
      int nb6 = NbPrisms(order);
      save << clause << ".1) Number of " << orderStr << " hexahedrons:\t" << nb8 << endl;
      save << clause << ".2) Number of " << orderStr << " tetrahedrons:\t" << nb4 << endl;
      save << clause << ".3) Number of " << orderStr << " prisms:      \t" << nb6 << endl;
      save << clause << ".4) Number of " << orderStr << " pyramids:\t" << nb5 << endl;
      if ( nb8 + nb4 + nb5 + nb6 != NbVolumes(order) ) {
        map<int,int> myVolumesMap;
        SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
        while( itVolumes->more( ) ) {
          int nbNodes = itVolumes->next()->NbNodes();
          if ( myVolumesMap.find( nbNodes ) == myVolumesMap.end() )
            myVolumesMap[ nbNodes ] = 0;
          myVolumesMap[ nbNodes ] = myVolumesMap[ nbNodes ] + 1;
        }
        save << clause << ".5) Volumes in detail: " << endl;
        map <int,int>::iterator itV;
        for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
          save << "--> nb nodes: " << itV->first << " - nb elemens:\t" << itV->second << endl;
      }
    }
    save << endl;
  }
  save << "===========================================================================" << endl;
  return save;
}
long SMESH::SMESH_Mesh::ElemNbEdges ( in long  id)

Returns number of edges for given element.

long SMESH::SMESH_Mesh::ElemNbFaces ( in long  id)

Returns number of faces for given element.

void SMESH_Mesh::ExportCGNS ( in SMESH_IDSource  meshPart,
in string  file,
in boolean  overwrite 
) raises (SALOME::SALOME_Exception)

Export the mesh to the CGNS file.

Definition at line 1380 of file SMESH_Mesh.cxx.

{
  int res = Driver_Mesh::DRS_FAIL;
#ifdef WITH_CGNS
  DriverCGNS_Write myWriter;
  myWriter.SetFile( file );
  myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
  myWriter.SetMeshName( SMESH_Comment("Mesh_") << meshDS->GetPersistentId());
  res = myWriter.Perform();
#endif
  if ( res != Driver_Mesh::DRS_OK )
    throw SALOME_Exception("Export failed");
}
void SMESH_Mesh::ExportDAT ( in string  file) raises (SALOME::SALOME_Exception)

Export Mesh to DAT, UNV and STL Formats (UNV supported version is I-DEAS 10)

Export the mesh to a DAT file.

Definition at line 1313 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  DriverDAT_W_SMDS_Mesh myWriter;
  myWriter.SetFile( file );
  myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
  myWriter.SetMeshId(_idDoc);
  myWriter.Perform();
}
void SMESH_Mesh::ExportMED ( in string  file,
in boolean  auto_groups 
) raises (SALOME::SALOME_Exception)

Export Mesh to MED_V2_1 MED format Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_V2_1 and overwrite parameter equal to true The method is kept in order to support old functionality.

Export the mesh to a med file.

Definition at line 1214 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);

  DriverMED_W_SMESHDS_Mesh myWriter;
  myWriter.SetFile    ( file, MED::EVersion(theVersion) );
  myWriter.SetMesh    ( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS   );
  if ( !theMeshName ) 
    myWriter.SetMeshId  ( _idDoc      );
  else {
    myWriter.SetMeshId  ( -1          );
    myWriter.SetMeshName( theMeshName );
  }

  if ( theAutoGroups ) {
    myWriter.AddGroupOfNodes();
    myWriter.AddGroupOfEdges();
    myWriter.AddGroupOfFaces();
    myWriter.AddGroupOfVolumes();
  }

  // Pass groups to writer. Provide unique group names.
  //set<string> aGroupNames; // Corrected for Mantis issue 0020028
  if ( !meshPart )
  {
    map< SMDSAbs_ElementType, set<string> > aGroupNames;
    char aString [256];
    int maxNbIter = 10000; // to guarantee cycle finish
    for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
      SMESH_Group*       aGroup   = it->second;
      SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
      if ( aGroupDS ) {
        SMDSAbs_ElementType aType = aGroupDS->GetType();
        string aGroupName0 = aGroup->GetName();
        aGroupName0.resize(MAX_MED_GROUP_NAME_LENGTH);
        string aGroupName = aGroupName0;
        for (int i = 1; !aGroupNames[aType].insert(aGroupName).second && i < maxNbIter; i++) {
          sprintf(&aString[0], "GR_%d_%s", i, aGroupName0.c_str());
          aGroupName = aString;
          aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH);
        }
        aGroupDS->SetStoreName( aGroupName.c_str() );
        myWriter.AddGroup( aGroupDS );
      }
    }
  }
  // Perform export
  myWriter.Perform();
}

Here is the call graph for this function:

void SMESH::SMESH_Mesh::ExportPartToDAT ( in SMESH_IDSource  meshPart,
in string  file 
) raises (SALOME::SALOME_Exception)
void SMESH::SMESH_Mesh::ExportPartToMED ( in SMESH_IDSource  meshPart,
in string  file,
in boolean  auto_groups,
in MED_VERSION  version,
in boolean  overwrite 
) raises (SALOME::SALOME_Exception)

Export a part of Mesh into a MED file .

  • meshPart : a part of mesh to store
  • file : name of the MED file
  • version : define the version of format of MED file, that will be created
  • overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
void SMESH::SMESH_Mesh::ExportPartToSTL ( in SMESH_IDSource  meshPart,
in string  file,
in boolean  isascii 
) raises (SALOME::SALOME_Exception)
void SMESH::SMESH_Mesh::ExportPartToUNV ( in SMESH_IDSource  meshPart,
in string  file 
) raises (SALOME::SALOME_Exception)
void SMESH_Mesh::ExportSAUV ( in string  file,
in boolean  auto_groups 
) raises (SALOME::SALOME_Exception)

Export Mesh to SAUV formatted file Write a temporary med file and use med2sauv.

Definition at line 1269 of file SMESH_Mesh.cxx.

{
  std::string medfilename(file);
  medfilename += ".med";
  std::string cmd;
#ifdef WNT
  cmd = "%PYTHONBIN% ";
#else
  cmd = "python ";
#endif
  cmd += "-c \"";
  cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
  cmd += "\"";
  system(cmd.c_str());
  ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, 1);
#ifdef WNT
  cmd = "%PYTHONBIN% ";
#else
  cmd = "python ";
#endif
  cmd += "-c \"";
  cmd += "from medutilities import convert ; convert(r'" + medfilename + "', 'MED', 'GIBI', 1, r'" + file + "')";
  cmd += "\"";
  system(cmd.c_str());
#ifdef WNT
  cmd = "%PYTHONBIN% ";
#else
  cmd = "python ";
#endif
  cmd += "-c \"";
  cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
  cmd += "\"";
  system(cmd.c_str());
}
void SMESH_Mesh::ExportSTL ( in string  file,
in boolean  isascii 
) raises (SALOME::SALOME_Exception)

Export the mesh to an STL file.

Definition at line 1361 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  DriverSTL_W_SMDS_Mesh myWriter;
  myWriter.SetFile( file );
  myWriter.SetIsAscii( isascii );
  myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS);
  myWriter.SetMeshId(_idDoc);
  myWriter.Perform();
}
void SMESH::SMESH_Mesh::ExportToMED ( in string  file,
in boolean  auto_groups,
in MED_VERSION  theVersion 
) raises (SALOME::SALOME_Exception)

Export Mesh to different MED Formats Works, just the same as ExportToMEDX, with overwrite parameter equal to true.

The method is kept in order to support old functionality

void SMESH::SMESH_Mesh::ExportToMEDX ( in string  file,
in boolean  auto_groups,
in MED_VERSION  version,
in boolean  overwrite 
) raises (SALOME::SALOME_Exception)

Export Mesh to different MED Formats .

  • file : name of the MED file
  • auto_groups : boolean parameter for creating/not creating the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; the typical use is auto_groups=false.
  • version : define the version of format of MED file, that will be created
  • overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
void SMESH_Mesh::ExportUNV ( in string  file) raises (SALOME::SALOME_Exception)

Export the mesh to an UNV file.

Definition at line 1330 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  DriverUNV_W_SMDS_Mesh myWriter;
  myWriter.SetFile( file );
  myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
  myWriter.SetMeshId(_idDoc);
  //  myWriter.SetGroups(_mapGroup);

  if ( !meshPart )
  {
    for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
      SMESH_Group*       aGroup   = it->second;
      SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
      if ( aGroupDS ) {
        string aGroupName = aGroup->GetName();
        aGroupDS->SetStoreName( aGroupName.c_str() );
        myWriter.AddGroup( aGroupDS );
      }
    }
  }
  myWriter.Perform();
}

Here is the call graph for this function:

Returns an element based on all given nodes.

bool SMESH_Mesh::GetAutoColor ( ) raises (SALOME::SALOME_Exception)

Get flag of object's auto color mode.

Definition at line 1128 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _isAutoColor;
}
EntityType SMESH::SMESH_Mesh::GetElementGeomType ( in long  id) raises (SALOME::SALOME_Exception)
long_array SMESH::SMESH_Mesh::GetElementsByType ( in ElementType  theType) raises (SALOME::SALOME_Exception)

Here is the caller graph for this function:

long_array SMESH::SMESH_Mesh::GetElementsId ( ) raises (SALOME::SALOME_Exception)

Here is the caller graph for this function:

SMDSAbs_ElementType SMESH_Mesh::GetElementType ( in long  id,
in boolean  iselem 
) raises (SALOME::SALOME_Exception)

Returns type of mesh element.

Definition at line 1834 of file SMESH_Mesh.cxx.

{
  return _myMeshDS->GetElementType( id, iselem );
}

Here is the caller graph for this function:

long_array SMESH::SMESH_Mesh::GetElemFaceNodes ( in long  elemId,
in short  faceIndex 
)

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

long SMESH::SMESH_Mesh::GetElemNbNodes ( in long  id)

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

Here is the caller graph for this function:

long SMESH::SMESH_Mesh::GetElemNode ( in long  id,
in 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.

Returns IDs of nodes of given element.

SMESH_Mesh::GroupIteratorPtr SMESH_Mesh::GetGroups ( ) raises (SALOME::SALOME_Exception)

Get the list of groups existing in the mesh.

Return iterator on all existing groups.

Definition at line 1675 of file SMESH_Mesh.cxx.

{
  typedef map <int, SMESH_Group *> TMap;
  return GroupIteratorPtr( new SMDS_mapIterator<TMap>( _mapGroup ));
}

Here is the caller graph for this function:

const list< const SMESHDS_Hypothesis * > & SMESH_Mesh::GetHypothesisList ( in GEOM::GEOM_Object  aSubObject) raises (SALOME::SALOME_Exception)

Get the list of hypothesis added on a sub-shape.

Definition at line 714 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetHypothesis(aSubShape);
}

Here is the caller graph for this function:

Get the internal Id.

Returns a sequence of all element IDs.

Returns list of notebook variables used for last Mesh operation.

const list< SMESHDS_Command * > & SMESH_Mesh::GetLog ( in boolean  clearAfterGet) raises (SALOME::SALOME_Exception)

Get the log of nodes and elements added or removed since previous clear of the log.

  • clearAfterGet : log is emptied after Get (safe if concurrents access)

Definition at line 851 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  if(MYDEBUG) MESSAGE("SMESH_Mesh::GetLog");
  return _myMeshDS->GetScript()->GetCommands();
}
SALOME_MED::MedFileInfo SMESH::SMESH_Mesh::GetMEDFileInfo ( )

Gets information about imported MED file.

SALOME_MED::MESH SMESH::SMESH_Mesh::GetMEDMesh ( ) raises (SALOME::SALOME_Exception)

Get MED Mesh.

Returns the mesh.

Here is the caller graph for this function:

SMESH_MeshEditor SMESH::SMESH_Mesh::GetMeshEditor ( ) raises (SALOME::SALOME_Exception)

Obtain instance of SMESH_MeshEditor.

Here is the caller graph for this function:

SMESH_MeshEditor SMESH::SMESH_Mesh::GetMeshEditPreviewer ( ) raises (SALOME::SALOME_Exception)

Return SMESH_MeshEditor that would not modify the mesh but fill MeshPreviewStruct.

Returns statistic of mesh elements.

Returns:
array of number enityties by index of EntityType

Methods to set meshing order of submeshes.

return submesh order if any

Return submesh objects list in meshing order

Definition at line 1907 of file SMESH_Mesh.cxx.

{
  return _mySubMeshOrder;
}

Get mesh pointer.

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

Here is the caller graph for this function:

Return position of a node on shape.

long_array SMESH::SMESH_Mesh::GetNodesId ( ) raises (SALOME::SALOME_Exception)

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

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

long SMESH::SMESH_Mesh::GetShapeID ( in long  id)

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

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

TopoDS_Shape SMESH_Mesh::GetShapeToMesh ( ) raises (SALOME::SALOME_Exception)

Get geom shape to mesh.

Return geometry to be meshed.

A result sould not be nil. Use HasShapeToMesh() to know if a returned shape

(It may be a PseudoShape()!)

Definition at line 278 of file SMESH_Mesh.cxx.

{
  return _myMeshDS->ShapeToMesh();
}

Here is the caller graph for this function:

Get the study Id.

SMESH_subMesh * SMESH_Mesh::GetSubMesh ( in GEOM::GEOM_Object  aSubObject,
in string  name 
) raises (SALOME::SALOME_Exception)

Get the subMesh object associated to a Sub-shape.

Get or Create the SMESH_subMesh object implementation.

The subMesh object gives access to nodes and elements IDs. SubMesh will be used instead of Sub-shape in a next idl version to adress a specific subMesh...

Definition at line 876 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  SMESH_subMesh *aSubMesh;
  int index = _myMeshDS->ShapeToIndex(aSubShape);

  // for submeshes on GEOM Group
  if (( !index || index > _nbSubShapes ) && aSubShape.ShapeType() == TopAbs_COMPOUND ) {
    TopoDS_Iterator it( aSubShape );
    if ( it.More() )
    {
      index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );
      if ( index > _nbSubShapes ) _nbSubShapes = index; // not to create sm for this group again

      // fill map of Ancestors
      fillAncestorsMap(aSubShape);
    }
  }
//   if ( !index )
//     return NULL; // neither sub-shape nor a group

  map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.find(index);
  if ( i_sm != _mapSubMesh.end())
  {
    aSubMesh = i_sm->second;
  }
  else
  {
    aSubMesh = new SMESH_subMesh(index, this, _myMeshDS, aSubShape);
    _mapSubMesh[index] = aSubMesh;
  }
  return aSubMesh;
}

Here is the caller graph for this function:

long_array SMESH::SMESH_Mesh::GetSubMeshElementsId ( in long  ShapeID) raises (SALOME::SALOME_Exception)
ElementType SMESH::SMESH_Mesh::GetSubMeshElementType ( in long  ShapeID) raises (SALOME::SALOME_Exception)
submesh_array SMESH::SMESH_Mesh::GetSubMeshes ( ) raises (SALOME::SALOME_Exception)

Get the list of sub-meshes existing in the mesh.

long_array SMESH::SMESH_Mesh::GetSubMeshNodesId ( in long  ShapeID,
in boolean  all 
) raises (SALOME::SALOME_Exception)

Returns types of elements it contains.

It's empty if the SMESH_IDSource contains no IDs

string SMESH::SMESH_Mesh::GetVersionString ( in MED_VERSION  version,
in short  nbDigits 
)

Return string representation of a MED file version comprising nbDigits.

Check group names for duplications.

Check if any groups of the same type have equal names.

Consider maximum group name length stored in MED file.

Definition at line 1191 of file SMESH_Mesh.cxx.

{
  //set<string> aGroupNames; // Corrected for Mantis issue 0020028
  map< SMDSAbs_ElementType, set<string> > aGroupNames;
  for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ )
  {
    SMESH_Group* aGroup = it->second;
    SMDSAbs_ElementType aType = aGroup->GetGroupDS()->GetType();
    string aGroupName = aGroup->GetName();
    aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH);
    if (!aGroupNames[aType].insert(aGroupName).second)
      return true;
  }

  return false;
}

Here is the call graph for this function:

bool SMESH_Mesh::HasModificationsToDiscard ( ) raises (SALOME::SALOME_Exception)

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

Definition at line 1156 of file SMESH_Mesh.cxx.

{
  if ( ! _isModified )
    return false;

  // return true if the next Compute() will be partial and
  // existing but changed elements may prevent successful re-compute
  bool hasComputed = false, hasNotComputed = false;
  map <int, SMESH_subMesh*>::const_iterator i_sm = _mapSubMesh.begin();
  for ( ; i_sm != _mapSubMesh.end() ; ++i_sm )
    switch ( i_sm->second->GetSubShape().ShapeType() )
    {
    case TopAbs_EDGE:
    case TopAbs_FACE:
    case TopAbs_SOLID:
      if ( i_sm->second->IsMeshComputed() )
        hasComputed = true;
      else
        hasNotComputed = true;
      if ( hasComputed && hasNotComputed)
        return true;
    }

  if ( NbNodes() < 1 )
    const_cast<SMESH_Mesh*>(this)->_isModified = false;

  return false;
}
boolean SMESH::SMESH_Mesh::HasShapeToMesh ( ) raises (SALOME::SALOME_Exception)

Return true if there is a geometry to be meshed.

Here is the caller graph for this function:

SMESH_Group SMESH::SMESH_Mesh::IntersectGroups ( in SMESH_GroupBase  aGroup1,
in SMESH_GroupBase  aGroup2,
in string  name 
) raises (SALOME::SALOME_Exception)

Intersection of two groups New group is created.

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

SMESH_Group SMESH::SMESH_Mesh::IntersectListOfGroups ( in ListOfGroups  aListOfGroups,
in string  name 
) raises (SALOME::SALOME_Exception)

Intersection of list of groups New group is created.

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

boolean SMESH::SMESH_Mesh::IsLoaded ( ) raises (SALOME::SALOME_Exception)

Return false if the mesh is not yet fully loaded from the study file.

boolean SMESH::SMESH_Mesh::IsMediumNode ( in long  ide,
in long  idn 
)

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

boolean SMESH::SMESH_Mesh::IsMediumNodeOfAnyElem ( in long  idn,
in ElementType  elem_type 
)

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

Returns false if GetMeshInfo() returns incorrect information that may happen if mesh data is not yet fully loaded from the file of study.

boolean SMESH::SMESH_Mesh::IsPoly ( in long  id)

Returns true if given element is polygon.

boolean SMESH::SMESH_Mesh::IsQuadratic ( in long  id)

Returns true if given element is quadratic.

void SMESH_Mesh::Load ( ) raises (SALOME::SALOME_Exception)

Load full mesh data from the study file.

Load mesh from study file.

Definition at line 336 of file SMESH_Mesh.cxx.

{
  if (_callUp)
    _callUp->Load();
}
int SMESH_Mesh::Nb0DElements ( ) raises (SALOME::SALOME_Exception)

Return number of edges of given order in the mesh.

Definition at line 1413 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().Nb0DElements();
}
int SMESH_Mesh::NbBiQuadQuadrangles ( ) raises (SALOME::SALOME_Exception)

Return number of biquadratic quadrangles in the mesh.

Definition at line 1473 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbBiQuadQuadrangles();
}
int SMESH_Mesh::NbEdges ( ) raises (SALOME::SALOME_Exception)

Return number of edges of given order in the mesh.

Definition at line 1425 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbEdges(order);
}
long SMESH::SMESH_Mesh::NbEdgesOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
long SMESH::SMESH_Mesh::NbElements ( ) raises (SALOME::SALOME_Exception)
int SMESH_Mesh::NbFaces ( ) raises (SALOME::SALOME_Exception)

Return number of faces of given order in the mesh.

Definition at line 1437 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbFaces(order);
}
long SMESH::SMESH_Mesh::NbFacesOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
long SMESH::SMESH_Mesh::NbGroups ( ) raises (SALOME::SALOME_Exception)

Get number of groups existing in the mesh.

int SMESH_Mesh::NbHexagonalPrisms ( ) raises (SALOME::SALOME_Exception)

Return number of hexagonal prisms in the mesh.

Definition at line 1569 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbHexPrisms();
}
int SMESH_Mesh::NbHexas ( ) raises (SALOME::SALOME_Exception)

Return number of hexahedrons of given order in the mesh.

Definition at line 1521 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbHexas(order);
}
long SMESH::SMESH_Mesh::NbHexasOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
int SMESH_Mesh::NbNodes ( ) raises (SALOME::SALOME_Exception)

Get informations about mesh contents.

Return number of nodes in the mesh.

Definition at line 1401 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->NbNodes();
}

Here is the caller graph for this function:

int SMESH_Mesh::NbPolygons ( ) raises (SALOME::SALOME_Exception)

Return the number of polygonal faces in the mesh.

Definition at line 1485 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbPolygons();
}
int SMESH_Mesh::NbPolyhedrons ( ) raises (SALOME::SALOME_Exception)

Return number of polyhedrons in the mesh.

Definition at line 1581 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbPolyhedrons();
}
int SMESH_Mesh::NbPrisms ( ) raises (SALOME::SALOME_Exception)

Return number of prisms (penthahedrons) of given order in the mesh.

Definition at line 1557 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbPrisms(order);
}
long SMESH::SMESH_Mesh::NbPrismsOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
int SMESH_Mesh::NbPyramids ( ) raises (SALOME::SALOME_Exception)

Return number of pyramids of given order in the mesh.

Definition at line 1545 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbPyramids(order);
}
long SMESH::SMESH_Mesh::NbPyramidsOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
int SMESH_Mesh::NbQuadrangles ( ) raises (SALOME::SALOME_Exception)

Return the number nodes faces in the mesh.

Definition at line 1461 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbQuadrangles(order);
}
long SMESH::SMESH_Mesh::NbQuadranglesOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
int SMESH_Mesh::NbSubMesh ( ) raises (SALOME::SALOME_Exception)

Return number of submeshes in the mesh.

Definition at line 1593 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->NbSubMesh();
}
int SMESH_Mesh::NbTetras ( ) raises (SALOME::SALOME_Exception)

Return number of tetrahedrons of given order in the mesh.

Definition at line 1509 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbTetras(order);
}
long SMESH::SMESH_Mesh::NbTetrasOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
int SMESH_Mesh::NbTriangles ( ) raises (SALOME::SALOME_Exception)

Return the number of faces in the mesh.

Definition at line 1449 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbTriangles(order);
}
long SMESH::SMESH_Mesh::NbTrianglesOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
int SMESH_Mesh::NbTriQuadraticHexas ( ) raises (SALOME::SALOME_Exception)

Return number of triquadratic hexahedrons in the mesh.

Definition at line 1533 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbTriQuadHexas();
}
int SMESH_Mesh::NbVolumes ( ) raises (SALOME::SALOME_Exception)

Return number of volumes of given order in the mesh.

Definition at line 1497 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  return _myMeshDS->GetMeshInfo().NbVolumes(order);
}
long SMESH::SMESH_Mesh::NbVolumesOfOrder ( in ElementOrder  order) raises (SALOME::SALOME_Exception)
bool SMESH_Mesh::RemoveGroup ( in SMESH_GroupBase  aGroup) raises (SALOME::SALOME_Exception)

Remove a group.

Definition at line 1729 of file SMESH_Mesh.cxx.

{
  if (_mapGroup.find(theGroupID) == _mapGroup.end())
    return false;
  GetMeshDS()->RemoveGroup( _mapGroup[theGroupID]->GetGroupDS() );
  delete _mapGroup[theGroupID];
  _mapGroup.erase (theGroupID);
  if (_callUp)
    _callUp->RemoveGroup( theGroupID );
  return true;
}
void SMESH::SMESH_Mesh::RemoveGroupWithContents ( in SMESH_GroupBase  aGroup) raises (SALOME::SALOME_Exception)

Remove group with its contents.

SMESH_Hypothesis::Hypothesis_Status SMESH_Mesh::RemoveHypothesis ( in GEOM::GEOM_Object  aSubObject,
in SMESH_Hypothesis  anHyp 
) raises (SALOME::SALOME_Exception)

Remove an hypothesis previouly added with AddHypothesis.

Definition at line 639 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  if(MYDEBUG) MESSAGE("SMESH_Mesh::RemoveHypothesis");
  
  StudyContextStruct *sc = _gen->GetStudyContext(_studyId);
  if (sc->mapHypothesis.find(anHypId) == sc->mapHypothesis.end())
    throw SALOME_Exception(LOCALIZED("hypothesis does not exist"));
  
  SMESH_Hypothesis *anHyp = sc->mapHypothesis[anHypId];
  if(MYDEBUG) {
    int hypType = anHyp->GetType();
    SCRUTE(hypType);
  }
  
  // shape 
  
  bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO );
  int event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP;

  SMESH_subMesh *subMesh = GetSubMesh(aSubShape);

  SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp);

  // there may appear concurrent hyps that were covered by the removed hyp
  if (ret < SMESH_Hypothesis::HYP_CONCURENT &&
      subMesh->IsApplicableHypotesis( anHyp ) &&
      subMesh->CheckConcurentHypothesis( anHyp->GetType() ) != SMESH_Hypothesis::HYP_OK)
    ret = SMESH_Hypothesis::HYP_CONCURENT;

  // sub-shapes
  if (!SMESH_Hypothesis::IsStatusFatal(ret) &&
      anHyp->GetDim() <= SMESH_Gen::GetShapeDim(aSubShape)) // is removed from father
  {
    event = isAlgo ? SMESH_subMesh::REMOVE_FATHER_ALGO : SMESH_subMesh::REMOVE_FATHER_HYP;

    SMESH_Hypothesis::Hypothesis_Status ret2 =
      subMesh->SubMeshesAlgoStateEngine(event, anHyp);
    if (ret2 > ret) // more severe
      ret = ret2;

    // check concurent hypotheses on ancestors
    if (ret < SMESH_Hypothesis::HYP_CONCURENT && !IsMainShape( aSubShape ) )
    {
      SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false,false);
      while ( smIt->more() ) {
        SMESH_subMesh* sm = smIt->next();
        if ( sm->IsApplicableHypotesis( anHyp )) {
          ret2 = sm->CheckConcurentHypothesis( anHyp->GetType() );
          if (ret2 > ret) {
            ret = ret2;
            break;
          }
        }
      }
    }
  }

  HasModificationsToDiscard(); // to reset _isModified flag if mesh become empty

  GetMeshDS()->Modified();

  if(MYDEBUG) subMesh->DumpAlgoState(true);
  if(MYDEBUG) SCRUTE(ret);
  return ret;
}
void SMESH::SMESH_Mesh::RemoveSubMesh ( in SMESH_subMesh  aSubMesh) raises (SALOME::SALOME_Exception)

Remove a submesh.

void SMESH_Mesh::SetAutoColor ( in boolean  theAutoColor) raises (SALOME::SALOME_Exception)

Toggle auto color mode on the object.

Auto color functionality.

  • theAutoColor : flag which toggles auto color mode.

Definition at line 1122 of file SMESH_Mesh.cxx.

{
  Unexpect aCatch(SalomeException);
  _isAutoColor = theAutoColor;
}
void SMESH_Mesh::SetMeshOrder ( in submesh_array_array  theSubMeshArray)

Set submesh object order.

remove submesh order from Mesh

Definition at line 1896 of file SMESH_Mesh.cxx.

{
  _mySubMeshOrder = theOrder;
}
void SMESH::SMESH_Mesh::SetParameters ( in string  theParameters)

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

Parameters:
theParametersis a string containing the notebook variables
SMESH_Group SMESH::SMESH_Mesh::UnionGroups ( in SMESH_GroupBase  aGroup1,
in SMESH_GroupBase  aGroup2,
in string  name 
) raises (SALOME::SALOME_Exception)

Union of two groups New group is created.

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

SMESH_Group SMESH::SMESH_Mesh::UnionListOfGroups ( in ListOfGroups  aListOfGroups,
in string  name 
) raises (SALOME::SALOME_Exception)

Union of list of groups New group is created.

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


The documentation for this interface was generated from the following files: