Back to index

salome-smesh  6.5.0
Defines | Functions
SMESHGUI_MeshOp.cxx File Reference
#include "SMESHGUI_MeshOp.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshDlg.h"
#include "SMESHGUI_ShapeByMeshDlg.h"
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI_Hypotheses.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_GEOMGenUtils.h"
#include <SMESH_TypeFilter.hxx>
#include <SMESH_NumberFilter.hxx>
#include <GEOM_SelectionFilter.h>
#include <GEOMBase.h>
#include <GeometryGUI.h>
#include <SalomeApp_Tools.h>
#include <SalomeApp_Application.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_UpdateFlags.h>
#include <SUIT_MessageBox.h>
#include <SUIT_OverrideCursor.h>
#include <SUIT_Session.h>
#include <SALOME_InteractiveObject.hxx>
#include <SALOME_ListIO.hxx>
#include <SALOMEDS_SComponent.hxx>
#include <SALOMEDS_SObject.hxx>
#include <QStringList>
#include <QLineEdit>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Shell.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <SALOMEconfig.h>

Go to the source code of this file.




 _PTR (SObject) SMESHGUI_MeshOp
 find an existing submesh by the selected shape
static bool isCompatible (const HypothesisData *theAlgoData, const HypothesisData *theHypData, const int theHypType)
 check compatibility of the algorithm and another algorithm or hypothesis
static int getTabDim (const QObject *tab, SMESHGUI_MeshDlg *dlg)
 Returns tab dimention

Define Documentation


Definition at line 77 of file SMESHGUI_MeshOp.cxx.

Function Documentation

_PTR ( SObject  )

find an existing submesh by the selected shape

Return values:
_PTR(SObject)- the found submesh SObject

Definition at line 424 of file SMESHGUI_MeshOp.cxx.

  QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
  QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
  _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
  _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
  if ( pMesh && pGeom ) {
    GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
    if ( !geom->_is_nil() ) {
      int tag = -1;
      switch ( geom->GetShapeType() ) {
      case GEOM::VERTEX:   tag = SMESH::Tag_SubMeshOnVertex;   break;
      case GEOM::EDGE:     tag = SMESH::Tag_SubMeshOnEdge;     break;
      case GEOM::WIRE:     tag = SMESH::Tag_SubMeshOnWire;     break;
      case GEOM::FACE:     tag = SMESH::Tag_SubMeshOnFace;     break;
      case GEOM::SHELL:    tag = SMESH::Tag_SubMeshOnShell;    break;
      case GEOM::SOLID:    tag = SMESH::Tag_SubMeshOnSolid;    break;
      case GEOM::COMPOUND: tag = SMESH::Tag_SubMeshOnCompound; break;
      _PTR(GenericAttribute) anAttr;
      _PTR(SObject) aSubmeshRoot;
      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
      if ( pMesh->FindSubObject( tag, aSubmeshRoot ) )
        _PTR(ChildIterator) smIter = aStudy->NewChildIterator( aSubmeshRoot );
        for ( ; smIter->More(); smIter->Next() )
          _PTR(SObject) aSmObj = smIter->Value();
          if ( ! aSmObj->FindAttribute( anAttr, "AttributeIOR" ))
          _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSmObj);
          for ( ; anIter1->More(); anIter1->Next()) {
            _PTR(SObject) pGeom2 = anIter1->Value();
            if ( pGeom2->ReferencedObject( pGeom2 ) &&
                 pGeom2->GetID() == pGeom->GetID() )
              return aSmObj;
  return _PTR(SObject)();

Here is the call graph for this function:

static int getTabDim ( const QObject *  tab,
SMESHGUI_MeshDlg *  dlg 
) [static]

Returns tab dimention

tab- the tab in the dlg
dlg- my dialogue
Return values:
int- dimention

Definition at line 1011 of file SMESHGUI_MeshOp.cxx.

  int aDim = -1;
  for (int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++)
    if (tab == dlg->tab(i))
      aDim = i;
  return aDim;
static bool isCompatible ( const HypothesisData theAlgoData,
const HypothesisData theHypData,
const int  theHypType 
) [static]

check compatibility of the algorithm and another algorithm or hypothesis

theAlgoData- algorithm data
theHypData- hypothesis data
theHypType- hypothesis type
theHypTypeName- hypothesis type name, must be provided if 2-nd arg is not algo
Return values:
bool- check result

Definition at line 783 of file SMESHGUI_MeshOp.cxx.

  if ( !theAlgoData )
    return true;

  if ( theHypType == SMESHGUI_MeshOp::Algo )
    return SMESH::IsCompatibleAlgorithm( theAlgoData, theHypData );

  bool isOptional;
  return ( SMESH::IsAvailableHypothesis( theAlgoData, theHypData->TypeName, isOptional ));

Here is the call graph for this function: