Version: 9.12.0
SMESH_Swig Class Reference

SMESH GUI Python interface. More...

#include <libSMESH_Swig.h>

Public Member Functions

 SMESH_Swig ()
 Constructor. More...
 
 ~SMESH_Swig ()
 Destructor. More...
 
void Init ()
 Initialize SMESH GUI Python interface. More...
 
const char * publish (const char *, const char *=0)
 Publish object. More...
 
void rename (const char *, const char *)
 Set new study name of given object. More...
 
const char * AddNewMesh (const char *, const char *=0)
 Publish mesh in the active study. More...
 
const char * AddNewHypothesis (const char *, const char *=0)
 Publish hypothesis in the active study. More...
 
const char * AddNewAlgorithm (const char *, const char *=0)
 Publish algorithm in the active study. More...
 
const char * AddNewAlgorithms (const char *, const char *=0)
 
void SetShape (const char *, const char *)
 Add reference on a shape for mesh in a study. More...
 
void SetHypothesis (const char *, const char *)
 Assign hypothesis to mesh or sub-mesh. More...
 
void SetAlgorithms (const char *, const char *)
 Assign algorithm to mesh or sub-mesh. More...
 
void UnSetHypothesis (const char *)
 Anassign hypothesis or algorithm from mesh or sub-mesh. More...
 
const char * AddSubMesh (const char *, const char *, int, const char *=0)
 Publish sub-mesh in the active study. More...
 
const char * AddSubMeshOnShape (const char *, const char *, const char *, int, const char *=0)
 Publish sub-mesh in the active study. More...
 
void SetName (const char *, const char *)
 Set new study name of given object. More...
 
void SetMeshIcon (const char *, const bool, const bool)
 Set mesh icon according to compute status. More...
 
void display (const char *, int=0, bool=true)
 Display mesh object. More...
 
void erase (const char *, int=0, bool=true)
 Erase mesh object. More...
 
void update (const char *)
 Update mesh object. More...
 
Properties properties (const char *, int=0)
 Get mesh object's visual properties. More...
 
void setProperties (const char *, const Properties &, int=0)
 Set mesh object's visual properties. More...
 
bool nodesNumbering (const char *, int=0)
 Check if nodes numbering is switched on. More...
 
void setNodesNumbering (const char *, bool, int=0)
 Switch nodes numbering on/off. More...
 
bool elementsNumbering (const char *, int=0)
 Check if elements numbering is switched on. More...
 
void setElementsNumbering (const char *, bool, int=0)
 Switch elements numbering on/off. More...
 
DisplayMode displayMode (const char *, int=0)
 Get mesh object's display mode. More...
 
void setDisplayMode (const char *, DisplayMode, int=0)
 Set mesh object's display mode. More...
 
bool shrinkMode (const char *, int=0)
 Check if shrink mode is switched on. More...
 
void setShrinkMode (const char *, bool, int=0)
 Switch shrink mode on/off. More...
 
double opacity (const char *, int=0)
 Get mesh object's opacity. More...
 
void setOpacity (const char *, double, int=0)
 Set mesh object's opacity. More...
 
bool isOrientationShown (const char *, int=0)
 Check if faces orientation vectors are shown. More...
 
void setOrientationShown (const char *, bool, int=0)
 Show/hide faces orientation vectors. More...
 
int entitiesShown (const char *, int=0)
 Get mesh object's visible entities. More...
 
void setEntitiesShown (const char *, int, int=0)
 Set mesh object's visible entities. More...
 
bool isEntityShown (const char *, EntityMode, int=0)
 Check if given mesh object's entity is shown. More...
 
void setEntityShown (const char *, EntityMode, bool, int=0)
 Show/hide entity for given mesh object. More...
 
void CreateAndDisplayActor (const char *)
 Display mesh in the currently active view window. More...
 
void EraseActor (const char *, const bool=false)
 Erase mesh in the view window(s). More...
 
void UpdateActor (const char *Mesh_Entry)
 Update mesh object. More...
 
actorAspect GetActorAspect (const char *, int=0)
 Get mesh object's properties. More...
 
void SetActorAspect (const actorAspect &, const char *, int=0)
 Set mesh object's properties. More...
 
SelectionMode getSelectionMode (int=0)
 Get selection mode of view window. More...
 
void setSelectionMode (SelectionMode, int=0)
 Set selection mode to view window. More...
 
std::vector< int > getSelected (const char *)
 Get selected elements of the mesh, sub-mesh or group. More...
 
std::vector< std::pair< int, int > > getSelectedEdgeOfCell (const char *)
 Get selected pseudo-edges (specified by two nodes) of the mesh, sub-mesh or group. More...
 
void select (const char *, std::vector< int >, bool=false)
 Select elements of the mesh, sub-mesh or group. More...
 
void select (const char *, int, bool=false)
 Select element of the mesh, sub-mesh or group. More...
 
void select (const char *, std::vector< std::pair< int, int > >, bool=false)
 Select pseudo-edges (specified by two nodes) of the mesh, sub-mesh or group. More...
 

Private Member Functions

void init ()
 Initialize interface. More...
 

Detailed Description

SMESH GUI Python interface.

Constructor & Destructor Documentation

◆ SMESH_Swig()

SMESH_Swig::SMESH_Swig ( )

Constructor.

References init().

◆ ~SMESH_Swig()

SMESH_Swig::~SMESH_Swig ( )

Destructor.

Member Function Documentation

◆ AddNewAlgorithm()

const char * SMESH_Swig::AddNewAlgorithm ( const char *  ior,
const char *  name = 0 
)

Publish algorithm in the active study.

Deprecated:
Publishing is done automatically.
Parameters
iorIOR of the algorithm.
nameName of the algorithm (optional).
Returns
UID of the data object.

References publish().

◆ AddNewAlgorithms()

const char * SMESH_Swig::AddNewAlgorithms ( const char *  ior,
const char *  name = 0 
)
Deprecated:
Publishing is done automatically.
Deprecated:
Synonym of AddNewAlgorithm().
Parameters
iorIOR of the algorithm.
nameName of the algorithm (optional).
Returns
UID of the data object.

References publish().

◆ AddNewHypothesis()

const char * SMESH_Swig::AddNewHypothesis ( const char *  ior,
const char *  name = 0 
)

Publish hypothesis in the active study.

Deprecated:
Publishing is done automatically.
Parameters
iorIOR of the hypothesis.
nameName of the hypothesis (optional).
Returns
UID of the data object.

References publish().

◆ AddNewMesh()

const char * SMESH_Swig::AddNewMesh ( const char *  ior,
const char *  name = 0 
)

Publish mesh in the active study.

Deprecated:
Publishing is done automatically.
Parameters
iorIOR of the mesh.
nameName of the mesh (optional).
Returns
UID of the data object.

References publish().

◆ AddSubMesh()

const char * SMESH_Swig::AddSubMesh ( const char *  ,
const char *  ior,
int  ,
const char *  name = 0 
)

Publish sub-mesh in the active study.

Deprecated:
Publishing is done automatically.
Parameters
meshUidParent mesh's study UID (not used).
iorIOR of the sub-mesh.
shapeTypeGEOM shape's type (not used).
nameName of the sub-mesh (optional).
Returns
UID of the data object.

References publish().

◆ AddSubMeshOnShape()

const char * SMESH_Swig::AddSubMeshOnShape ( const char *  ,
const char *  ,
const char *  ior,
int  ,
const char *  name = 0 
)

Publish sub-mesh in the active study.

Deprecated:
Publishing is done automatically.
Parameters
meshUidParent mesh's study UID (not used).
shapeUidGEOM shape's study UID (not used).
iorIOR of the sub-mesh.
shapeTypeGEOM shape's type (not used).
nameName of the sub-mesh (optional).
Returns
UID of the data object.

References publish().

◆ CreateAndDisplayActor()

void SMESH_Swig::CreateAndDisplayActor ( const char *  meshUid)

Display mesh in the currently active view window.

Deprecated:
Use display() method.
Parameters
meshUidMesh's study UID.

References display().

◆ display()

void SMESH_Swig::display ( const char *  uid,
int  viewUid = 0,
bool  updateViewer = true 
)

Display mesh object.

Parameters
uidObject's study UID or IOR.
viewUidView window UID (0 means currently active view window; if there's no view, it is created). Default: 0.
updateViewer"Update view" flag. Default: true.

References SMESH::_PTR(), and init().

Referenced by CreateAndDisplayActor().

◆ displayMode()

DisplayMode SMESH_Swig::displayMode ( const char *  uid,
int  viewUid = 0 
)

Get mesh object's display mode.

Parameters
uidMesh object's study UID or IOR.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
Display mode (UndefinedMode if actor isn't found).

References SMESH::_PTR(), init(), and UndefinedMode.

◆ elementsNumbering()

bool SMESH_Swig::elementsNumbering ( const char *  uid,
int  viewUid = 0 
)

Check if elements numbering is switched on.

Parameters
uidMesh object's study UID or IOR.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
true if elements numbering is switched on; false otherwise.

References SMESH::_PTR(), and init().

◆ entitiesShown()

int SMESH_Swig::entitiesShown ( const char *  uid,
int  viewUid = 0 
)

Get mesh object's visible entities.

Parameters
uidMesh object's study UID or IOR.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
Enumerator describing entities being visible.

References SMESH::_PTR(), EntityNone, and init().

◆ erase()

void SMESH_Swig::erase ( const char *  uid,
int  viewUid = 0,
bool  updateViewer = true 
)

Erase mesh object.

Parameters
uidObject's study UID or IOR.
viewUidView window UID (0 means currently active view window); -1 means "all view windows". Default: 0.
updateViewer"Update view" flag. Default: true.

References SMESH::_PTR(), and init().

Referenced by EraseActor().

◆ EraseActor()

void SMESH_Swig::EraseActor ( const char *  meshUid,
const bool  allViewers = false 
)

Erase mesh in the view window(s).

Deprecated:
Use erase() method.
Parameters
meshUidMesh's study UID.
allViewersIf true, mesh is removed from all views. Default: false.

References erase().

◆ GetActorAspect()

actorAspect SMESH_Swig::GetActorAspect ( const char *  meshUid,
int  viewUid = 0 
)

Get mesh object's properties.

Deprecated:
Use properties() method.
Parameters
meshUidMesh's study UID.
viewUidView window UID (0 means currently active view window). Default: 0.

References properties().

◆ getSelected()

std::vector< int > SMESH_Swig::getSelected ( const char *  uid)

Get selected elements of the mesh, sub-mesh or group.

Parameters
uidMesh object's study UID or IOR.
Returns
List of selected mesh elements.

References SMESH::_PTR(), and init().

◆ getSelectedEdgeOfCell()

std::vector< std::pair< int, int > > SMESH_Swig::getSelectedEdgeOfCell ( const char *  uid)

Get selected pseudo-edges (specified by two nodes) of the mesh, sub-mesh or group.

Parameters
uidMesh object's study UID or IOR.
idsList of pairs containing two nodes IDs.
appendIf true, pseudo-edges are added to current selection; otherwise, previous selection is cleared.

References SMESH::_PTR(), and init().

◆ getSelectionMode()

SelectionMode SMESH_Swig::getSelectionMode ( int  viewUid = 0)

Get selection mode of view window.

Parameters
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
Current selection mode.

References init().

◆ Init()

void SMESH_Swig::Init ( )

Initialize SMESH GUI Python interface.

Deprecated:
Interface is initialized automatically.

◆ init()

◆ isEntityShown()

bool SMESH_Swig::isEntityShown ( const char *  uid,
EntityMode  entity,
int  viewUid = 0 
)

Check if given mesh object's entity is shown.

Parameters
uidMesh object's study UID or IOR.
entityMesh entity.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
true if entity is shown; false otherwise.

References SMESH::_PTR(), and init().

◆ isOrientationShown()

bool SMESH_Swig::isOrientationShown ( const char *  uid,
int  viewUid = 0 
)

Check if faces orientation vectors are shown.

Parameters
uidMesh object's study UID or IOR.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
true if faces orientation vectors are shown; false otherwise.

References SMESH::_PTR(), and init().

◆ nodesNumbering()

bool SMESH_Swig::nodesNumbering ( const char *  uid,
int  viewUid = 0 
)

Check if nodes numbering is switched on.

Parameters
uidMesh object's study UID or IOR.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
true if nodes numbering is switched on; false otherwise.

References SMESH::_PTR(), and init().

◆ opacity()

double SMESH_Swig::opacity ( const char *  uid,
int  viewUid = 0 
)

Get mesh object's opacity.

Parameters
uidMesh object's study UID or IOR.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
Opacity value.

References SMESH::_PTR(), and init().

Referenced by setOpacity().

◆ properties()

Properties SMESH_Swig::properties ( const char *  uid,
int  viewUid = 0 
)

Get mesh object's visual properties.

Parameters
uidMesh object's study UID or IOR.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
Properties data structure.

References SMESH::_PTR(), and init().

Referenced by GetActorAspect().

◆ publish()

const char * SMESH_Swig::publish ( const char *  ior,
const char *  name = 0 
)

Publish object.

Parameters
iorIOR of the mesh object to publish.
nameStudy name of the object; if not given, name is assigned automatically.
Returns
UID of the data object.

References SMESHGUI::GetSMESHGen(), and init().

Referenced by AddNewAlgorithm(), AddNewAlgorithms(), AddNewHypothesis(), AddNewMesh(), AddSubMesh(), and AddSubMeshOnShape().

◆ rename()

void SMESH_Swig::rename ( const char *  uid,
const char *  name 
)

Set new study name of given object.

Parameters
uidObject's study UID or IOR.
nameNew name of the object.

References SMESH::_PTR(), and init().

Referenced by SetName().

◆ select() [1/3]

void SMESH_Swig::select ( const char *  uid,
int  id,
bool  append = false 
)

Select element of the mesh, sub-mesh or group.

Parameters
uidMesh object's study UID or IOR.
idMesh element.
appendIf true, element is added to current selection; otherwise, previous selection is cleared.

References SMESH::_PTR(), and init().

◆ select() [2/3]

void SMESH_Swig::select ( const char *  uid,
std::vector< int >  ids,
bool  append = false 
)

Select elements of the mesh, sub-mesh or group.

Parameters
uidMesh object's study UID or IOR.
idsList of mesh elements.
appendIf true, elements are added to current selection; otherwise, previous selection is cleared.

References SMESH::_PTR(), and init().

◆ select() [3/3]

void SMESH_Swig::select ( const char *  uid,
std::vector< std::pair< int, int > >  ids,
bool  append = false 
)

Select pseudo-edges (specified by two nodes) of the mesh, sub-mesh or group.

Parameters
uidMesh object's study UID or IOR.
idsList of pairs containing two nodes IDs.
appendIf true, pseudo-edges are added to current selection; otherwise, previous selection is cleared.

References SMESH::_PTR(), and init().

◆ SetActorAspect()

void SMESH_Swig::SetActorAspect ( const actorAspect aspect,
const char *  meshUid,
int  viewUid = 0 
)

Set mesh object's properties.

Deprecated:
Use setProperties() method.
Parameters
meshUidMesh's study UID.
viewUidView window UID (0 means currently active view window). Default: 0.

References setProperties().

◆ SetAlgorithms()

void SMESH_Swig::SetAlgorithms ( const char *  ,
const char *   
)

Assign algorithm to mesh or sub-mesh.

Deprecated:
Publishing is done automatically.
Parameters
meshUidMesh's or sub-mesh's study UID (not used).
algoUIDAlgorithm's study UID (not used).

◆ setDisplayMode()

void SMESH_Swig::setDisplayMode ( const char *  uid,
DisplayMode  mode,
int  viewUid = 0 
)

Set mesh object's display mode.

Parameters
uidMesh object's study UID or IOR.
modeDisplay mode.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), and init().

◆ setElementsNumbering()

void SMESH_Swig::setElementsNumbering ( const char *  uid,
bool  numbering,
int  viewUid = 0 
)

Switch elements numbering on/off.

Parameters
uidMesh object's study UID or IOR.
numberingtrue to switch elements numbering on; false otherwise.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), and init().

◆ setEntitiesShown()

void SMESH_Swig::setEntitiesShown ( const char *  uid,
int  entities,
int  viewUid = 0 
)

Set mesh object's visible entities.

Parameters
uidMesh object's study UID or IOR.
entitiesEnumerator describing entities to be shown.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), and init().

◆ setEntityShown()

void SMESH_Swig::setEntityShown ( const char *  uid,
EntityMode  entity,
bool  show,
int  viewUid = 0 
)

Show/hide entity for given mesh object.

Parameters
uidMesh object's study UID or IOR.
entityMesh entity.
showVisibility status.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), and init().

◆ SetHypothesis()

void SMESH_Swig::SetHypothesis ( const char *  ,
const char *   
)

Assign hypothesis to mesh or sub-mesh.

Deprecated:
Publishing is done automatically.
Parameters
meshUidMesh's or sub-mesh's study UID (not used).
hypoUIDHypothesis's study UID (not used).

◆ SetMeshIcon()

void SMESH_Swig::SetMeshIcon ( const char *  ,
const bool  ,
const bool   
)

Set mesh icon according to compute status.

Deprecated:
Publishing is done automatically.
Parameters
meshUidMesh's study UID (not used).
isComputedFlag pointing that mesh is computed or no (not used).
isEmptyFlag pointing that mesh is empty or no (not used).

◆ SetName()

void SMESH_Swig::SetName ( const char *  uid,
const char *  name 
)

Set new study name of given object.

Deprecated:
Use rename() method.
Parameters
uidObject's study UID or IOR.
nameNew name of the object.

References rename().

◆ setNodesNumbering()

void SMESH_Swig::setNodesNumbering ( const char *  uid,
bool  numbering,
int  viewUid = 0 
)

Switch nodes numbering on/off.

Parameters
uidMesh object's study UID or IOR.
numberingtrue to switch nodes numbering on; false otherwise.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), and init().

◆ setOpacity()

void SMESH_Swig::setOpacity ( const char *  uid,
double  opacity,
int  viewUid = 0 
)

Set mesh object's opacity.

Parameters
uidMesh object's study UID or IOR.
opacityOpacity value.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), init(), and opacity().

◆ setOrientationShown()

void SMESH_Swig::setOrientationShown ( const char *  uid,
bool  shown,
int  viewUid = 0 
)

Show/hide faces orientation vectors.

Parameters
uidMesh object's study UID or IOR.
showntrue to show faces orientation vectors; false otherwise.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), and init().

◆ setProperties()

void SMESH_Swig::setProperties ( const char *  uid,
const Properties props,
int  viewUid = 0 
)

Set mesh object's visual properties.

Parameters
uidMesh object's study UID or IOR.
propsProperties data structure.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), and init().

Referenced by SetActorAspect().

◆ setSelectionMode()

void SMESH_Swig::setSelectionMode ( SelectionMode  mode,
int  viewUid = 0 
)

Set selection mode to view window.

Parameters
viewUidView window UID (0 means currently active view window); Default: 0.
modeSelection mode.

References init().

◆ SetShape()

void SMESH_Swig::SetShape ( const char *  ,
const char *   
)

Add reference on a shape for mesh in a study.

Deprecated:
Publishing is done automatically.
Parameters
shapeUidGEOM shape's study UID (not used).
meshUidMesh's study UID (not used).

◆ setShrinkMode()

void SMESH_Swig::setShrinkMode ( const char *  uid,
bool  shrink,
int  viewUid = 0 
)

Switch shrink mode on/off.

Parameters
uidMesh object's study UID or IOR.
shrinktrue to switch shrink mode on; false otherwise.
viewUidView window UID (0 means currently active view window); Default: 0.

References SMESH::_PTR(), and init().

◆ shrinkMode()

bool SMESH_Swig::shrinkMode ( const char *  uid,
int  viewUid = 0 
)

Check if shrink mode is switched on.

Parameters
uidMesh object's study UID or IOR.
viewUidView window UID (0 means currently active view window); Default: 0.
Returns
true if shrink mode is switched on; false otherwise.

References SMESH::_PTR(), and init().

◆ UnSetHypothesis()

void SMESH_Swig::UnSetHypothesis ( const char *  )

Anassign hypothesis or algorithm from mesh or sub-mesh.

Deprecated:
Unpublishing is done automatically.
Parameters
uidHypothesis's or algorithm's study UID (not used).

◆ update()

void SMESH_Swig::update ( const char *  uid)

Update mesh object.

Parameters
uidObject's study UID or IOR.

References SMESH::_PTR(), Handle(), init(), and SMESH::Update().

Referenced by UpdateActor().

◆ UpdateActor()

void SMESH_Swig::UpdateActor ( const char *  meshUid)

Update mesh object.

Deprecated:
Use update() method.
Parameters
meshUidMesh's study UID.

References update().