Back to index

salome-smesh  6.5.0
Defines | Enumerations | Functions
SMESHGUI_GroupOnShapeDlg.cxx File Reference
#include "SMESHGUI_GroupOnShapeDlg.h"
#include "SMESH_TypeFilter.hxx"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_GEOMGenUtils.h"
#include <GeometryGUI.h>
#include <GEOM_SelectionFilter.h>
#include <SUIT_Session.h>
#include <SUIT_OverrideCursor.h>
#include <LightApp_Application.h>
#include <LightApp_UpdateFlags.h>
#include <SUIT_ResourceMgr.h>
#include <SALOMEconfig.h>
#include <QGroupBox>
#include <QLayout>
#include <QFrame>
#include <QLabel>
#include <QPushButton>
#include <QListWidget>
#include <QLineEdit>

Go to the source code of this file.

Defines

#define SPACING   6
#define MARGIN   11

Enumerations

enum  { _MESH, _ELEM_GEOM, _NODE_GEOM }

Functions

static SMESH::ElementType elementType (GEOM::GEOM_Object_var &geom)
 return type of mesh group by geom object

Define Documentation

#define MARGIN   11

Definition at line 56 of file SMESHGUI_GroupOnShapeDlg.cxx.

#define SPACING   6

Definition at line 55 of file SMESHGUI_GroupOnShapeDlg.cxx.


Enumeration Type Documentation

anonymous enum
Enumerator:
_MESH 
_ELEM_GEOM 
_NODE_GEOM 

Definition at line 58 of file SMESHGUI_GroupOnShapeDlg.cxx.


Function Documentation

static SMESH::ElementType elementType ( GEOM::GEOM_Object_var &  geom) [static]

return type of mesh group by geom object

Definition at line 207 of file SMESHGUI_GroupOnShapeDlg.cxx.

{
  if ( !geom->_is_nil() ) {
    switch ( geom->GetShapeType() ) {
    case GEOM::VERTEX:   return SMESH::NODE;
    case GEOM::EDGE:     return SMESH::EDGE;
    case GEOM::WIRE:     return SMESH::EDGE;
    case GEOM::FACE:     return SMESH::FACE;
    case GEOM::SHELL:    return SMESH::FACE;
    case GEOM::SOLID:    return SMESH::VOLUME;
    case GEOM::COMPSOLID:return SMESH::VOLUME;
    case GEOM::COMPOUND: break;
    default:             return SMESH::ALL;
    }
    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
    GEOM::GEOM_IShapesOperations_var aShapeOp =
      SMESH::GetGEOMGen()->GetIShapesOperations(aStudy->StudyId());

    if ( geom->GetType() == 37 ) { // geom group
      GEOM::GEOM_IGroupOperations_var  aGroupOp =
        SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
      if ( !aGroupOp->_is_nil() ) {
        GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom );
        GEOM::ListOfLong_var        ids = aGroupOp->GetObjects( geom );
        if ( ids->length() && !mainShape->_is_nil() && !aShapeOp->_is_nil() ) {
          GEOM::GEOM_Object_var member = aShapeOp->GetSubShape( mainShape, ids[0] );
          return elementType( member );
        }
      }
    }
    else if ( !aShapeOp->_is_nil() ) { // just a compoud shape
      GEOM::ListOfLong_var ids = aShapeOp->SubShapeAllIDs( geom, GEOM::SHAPE, false );
      if ( ids->length() ) {
        GEOM::GEOM_Object_var member = aShapeOp->GetSubShape( geom, ids[0] );
        return elementType( member );
      }
    }
  }
  return SMESH::ALL;
}

Here is the call graph for this function: