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... | |
SMESH GUI Python interface.
SMESH_Swig::SMESH_Swig | ( | ) |
Constructor.
References init().
SMESH_Swig::~SMESH_Swig | ( | ) |
Destructor.
const char * SMESH_Swig::AddNewAlgorithm | ( | const char * | ior, |
const char * | name = 0 |
||
) |
Publish algorithm in the active study.
ior | IOR of the algorithm. |
name | Name of the algorithm (optional). |
References publish().
const char * SMESH_Swig::AddNewAlgorithms | ( | const char * | ior, |
const char * | name = 0 |
||
) |
ior | IOR of the algorithm. |
name | Name of the algorithm (optional). |
References publish().
const char * SMESH_Swig::AddNewHypothesis | ( | const char * | ior, |
const char * | name = 0 |
||
) |
Publish hypothesis in the active study.
ior | IOR of the hypothesis. |
name | Name of the hypothesis (optional). |
References publish().
const char * SMESH_Swig::AddNewMesh | ( | const char * | ior, |
const char * | name = 0 |
||
) |
Publish mesh in the active study.
ior | IOR of the mesh. |
name | Name of the mesh (optional). |
References publish().
const char * SMESH_Swig::AddSubMesh | ( | const char * | , |
const char * | ior, | ||
int | , | ||
const char * | name = 0 |
||
) |
Publish sub-mesh in the active study.
meshUid | Parent mesh's study UID (not used). |
ior | IOR of the sub-mesh. |
shapeType | GEOM shape's type (not used). |
name | Name of the sub-mesh (optional). |
References publish().
const char * SMESH_Swig::AddSubMeshOnShape | ( | const char * | , |
const char * | , | ||
const char * | ior, | ||
int | , | ||
const char * | name = 0 |
||
) |
Publish sub-mesh in the active study.
meshUid | Parent mesh's study UID (not used). |
shapeUid | GEOM shape's study UID (not used). |
ior | IOR of the sub-mesh. |
shapeType | GEOM shape's type (not used). |
name | Name of the sub-mesh (optional). |
References publish().
void SMESH_Swig::CreateAndDisplayActor | ( | const char * | meshUid | ) |
Display mesh in the currently active view window.
meshUid | Mesh's study UID. |
References display().
void SMESH_Swig::display | ( | const char * | uid, |
int | viewUid = 0 , |
||
bool | updateViewer = true |
||
) |
Display mesh object.
uid | Object's study UID or IOR. |
viewUid | View 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 SMESH_Swig::displayMode | ( | const char * | uid, |
int | viewUid = 0 |
||
) |
Get mesh object's display mode.
uid | Mesh object's study UID or IOR. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), init(), and UndefinedMode.
bool SMESH_Swig::elementsNumbering | ( | const char * | uid, |
int | viewUid = 0 |
||
) |
Check if elements numbering is switched on.
uid | Mesh object's study UID or IOR. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
true
if elements numbering is switched on; false
otherwise. References SMESH::_PTR(), and init().
int SMESH_Swig::entitiesShown | ( | const char * | uid, |
int | viewUid = 0 |
||
) |
Get mesh object's visible entities.
uid | Mesh object's study UID or IOR. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), EntityNone, and init().
void SMESH_Swig::erase | ( | const char * | uid, |
int | viewUid = 0 , |
||
bool | updateViewer = true |
||
) |
Erase mesh object.
uid | Object's study UID or IOR. |
viewUid | View 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().
void SMESH_Swig::EraseActor | ( | const char * | meshUid, |
const bool | allViewers = false |
||
) |
Erase mesh in the view window(s).
meshUid | Mesh's study UID. |
allViewers | If true , mesh is removed from all views. Default: false . |
References erase().
actorAspect SMESH_Swig::GetActorAspect | ( | const char * | meshUid, |
int | viewUid = 0 |
||
) |
Get mesh object's properties.
meshUid | Mesh's study UID. |
viewUid | View window UID (0 means currently active view window). Default: 0. |
References properties().
std::vector< int > SMESH_Swig::getSelected | ( | const char * | uid | ) |
Get selected elements of the mesh, sub-mesh or group.
uid | Mesh object's study UID or IOR. |
References SMESH::_PTR(), and init().
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.
uid | Mesh object's study UID or IOR. |
ids | List of pairs containing two nodes IDs. |
append | If true , pseudo-edges are added to current selection; otherwise, previous selection is cleared. |
References SMESH::_PTR(), and init().
SelectionMode SMESH_Swig::getSelectionMode | ( | int | viewUid = 0 | ) |
Get selection mode of view window.
viewUid | View window UID (0 means currently active view window); Default: 0. |
References init().
void SMESH_Swig::Init | ( | ) |
Initialize SMESH GUI Python interface.
|
private |
Initialize interface.
References SMESHGUI::GetSMESHGen(), and SMESHGUI::GetSMESHGUI().
Referenced by display(), displayMode(), elementsNumbering(), entitiesShown(), erase(), getSelected(), getSelectedEdgeOfCell(), getSelectionMode(), isEntityShown(), isOrientationShown(), nodesNumbering(), opacity(), properties(), publish(), rename(), select(), setDisplayMode(), setElementsNumbering(), setEntitiesShown(), setEntityShown(), setNodesNumbering(), setOpacity(), setOrientationShown(), setProperties(), setSelectionMode(), setShrinkMode(), shrinkMode(), SMESH_Swig(), and update().
bool SMESH_Swig::isEntityShown | ( | const char * | uid, |
EntityMode | entity, | ||
int | viewUid = 0 |
||
) |
Check if given mesh object's entity is shown.
uid | Mesh object's study UID or IOR. |
entity | Mesh entity. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
true
if entity is shown; false
otherwise. References SMESH::_PTR(), and init().
bool SMESH_Swig::isOrientationShown | ( | const char * | uid, |
int | viewUid = 0 |
||
) |
Check if faces orientation vectors are shown.
uid | Mesh object's study UID or IOR. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
true
if faces orientation vectors are shown; false
otherwise. References SMESH::_PTR(), and init().
bool SMESH_Swig::nodesNumbering | ( | const char * | uid, |
int | viewUid = 0 |
||
) |
Check if nodes numbering is switched on.
uid | Mesh object's study UID or IOR. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
true
if nodes numbering is switched on; false
otherwise. References SMESH::_PTR(), and init().
double SMESH_Swig::opacity | ( | const char * | uid, |
int | viewUid = 0 |
||
) |
Get mesh object's opacity.
uid | Mesh object's study UID or IOR. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
Referenced by setOpacity().
Properties SMESH_Swig::properties | ( | const char * | uid, |
int | viewUid = 0 |
||
) |
Get mesh object's visual properties.
uid | Mesh object's study UID or IOR. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
Referenced by GetActorAspect().
const char * SMESH_Swig::publish | ( | const char * | ior, |
const char * | name = 0 |
||
) |
Publish object.
ior | IOR of the mesh object to publish. |
name | Study name of the object; if not given, name is assigned automatically. |
References SMESHGUI::GetSMESHGen(), and init().
Referenced by AddNewAlgorithm(), AddNewAlgorithms(), AddNewHypothesis(), AddNewMesh(), AddSubMesh(), and AddSubMeshOnShape().
void SMESH_Swig::rename | ( | const char * | uid, |
const char * | name | ||
) |
Set new study name of given object.
uid | Object's study UID or IOR. |
name | New name of the object. |
References SMESH::_PTR(), and init().
Referenced by SetName().
void SMESH_Swig::select | ( | const char * | uid, |
int | id, | ||
bool | append = false |
||
) |
Select element of the mesh, sub-mesh or group.
uid | Mesh object's study UID or IOR. |
id | Mesh element. |
append | If true , element is added to current selection; otherwise, previous selection is cleared. |
References SMESH::_PTR(), and init().
void SMESH_Swig::select | ( | const char * | uid, |
std::vector< int > | ids, | ||
bool | append = false |
||
) |
Select elements of the mesh, sub-mesh or group.
uid | Mesh object's study UID or IOR. |
ids | List of mesh elements. |
append | If true , elements are added to current selection; otherwise, previous selection is cleared. |
References SMESH::_PTR(), and init().
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.
uid | Mesh object's study UID or IOR. |
ids | List of pairs containing two nodes IDs. |
append | If true , pseudo-edges are added to current selection; otherwise, previous selection is cleared. |
References SMESH::_PTR(), and init().
void SMESH_Swig::SetActorAspect | ( | const actorAspect & | aspect, |
const char * | meshUid, | ||
int | viewUid = 0 |
||
) |
Set mesh object's properties.
meshUid | Mesh's study UID. |
viewUid | View window UID (0 means currently active view window). Default: 0. |
References setProperties().
void SMESH_Swig::SetAlgorithms | ( | const char * | , |
const char * | |||
) |
Assign algorithm to mesh or sub-mesh.
meshUid | Mesh's or sub-mesh's study UID (not used). |
algoUID | Algorithm's study UID (not used). |
void SMESH_Swig::setDisplayMode | ( | const char * | uid, |
DisplayMode | mode, | ||
int | viewUid = 0 |
||
) |
Set mesh object's display mode.
uid | Mesh object's study UID or IOR. |
mode | Display mode. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
void SMESH_Swig::setElementsNumbering | ( | const char * | uid, |
bool | numbering, | ||
int | viewUid = 0 |
||
) |
Switch elements numbering on/off.
uid | Mesh object's study UID or IOR. |
numbering | true to switch elements numbering on; false otherwise. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
void SMESH_Swig::setEntitiesShown | ( | const char * | uid, |
int | entities, | ||
int | viewUid = 0 |
||
) |
Set mesh object's visible entities.
uid | Mesh object's study UID or IOR. |
entities | Enumerator describing entities to be shown. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
void SMESH_Swig::setEntityShown | ( | const char * | uid, |
EntityMode | entity, | ||
bool | show, | ||
int | viewUid = 0 |
||
) |
Show/hide entity for given mesh object.
uid | Mesh object's study UID or IOR. |
entity | Mesh entity. |
show | Visibility status. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
void SMESH_Swig::SetHypothesis | ( | const char * | , |
const char * | |||
) |
Assign hypothesis to mesh or sub-mesh.
meshUid | Mesh's or sub-mesh's study UID (not used). |
hypoUID | Hypothesis's study UID (not used). |
void SMESH_Swig::SetMeshIcon | ( | const char * | , |
const bool | , | ||
const bool | |||
) |
Set mesh icon according to compute status.
meshUid | Mesh's study UID (not used). |
isComputed | Flag pointing that mesh is computed or no (not used). |
isEmpty | Flag pointing that mesh is empty or no (not used). |
void SMESH_Swig::SetName | ( | const char * | uid, |
const char * | name | ||
) |
Set new study name of given object.
uid | Object's study UID or IOR. |
name | New name of the object. |
References rename().
void SMESH_Swig::setNodesNumbering | ( | const char * | uid, |
bool | numbering, | ||
int | viewUid = 0 |
||
) |
Switch nodes numbering on/off.
uid | Mesh object's study UID or IOR. |
numbering | true to switch nodes numbering on; false otherwise. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
void SMESH_Swig::setOpacity | ( | const char * | uid, |
double | opacity, | ||
int | viewUid = 0 |
||
) |
Set mesh object's opacity.
uid | Mesh object's study UID or IOR. |
opacity | Opacity value. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), init(), and opacity().
void SMESH_Swig::setOrientationShown | ( | const char * | uid, |
bool | shown, | ||
int | viewUid = 0 |
||
) |
Show/hide faces orientation vectors.
uid | Mesh object's study UID or IOR. |
shown | true to show faces orientation vectors; false otherwise. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
void SMESH_Swig::setProperties | ( | const char * | uid, |
const Properties & | props, | ||
int | viewUid = 0 |
||
) |
Set mesh object's visual properties.
uid | Mesh object's study UID or IOR. |
props | Properties data structure. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
Referenced by SetActorAspect().
void SMESH_Swig::setSelectionMode | ( | SelectionMode | mode, |
int | viewUid = 0 |
||
) |
Set selection mode to view window.
viewUid | View window UID (0 means currently active view window); Default: 0. |
mode | Selection mode. |
References init().
void SMESH_Swig::SetShape | ( | const char * | , |
const char * | |||
) |
Add reference on a shape for mesh in a study.
shapeUid | GEOM shape's study UID (not used). |
meshUid | Mesh's study UID (not used). |
void SMESH_Swig::setShrinkMode | ( | const char * | uid, |
bool | shrink, | ||
int | viewUid = 0 |
||
) |
Switch shrink mode on/off.
uid | Mesh object's study UID or IOR. |
shrink | true to switch shrink mode on; false otherwise. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
References SMESH::_PTR(), and init().
bool SMESH_Swig::shrinkMode | ( | const char * | uid, |
int | viewUid = 0 |
||
) |
Check if shrink mode is switched on.
uid | Mesh object's study UID or IOR. |
viewUid | View window UID (0 means currently active view window); Default: 0. |
true
if shrink mode is switched on; false
otherwise. References SMESH::_PTR(), and init().
void SMESH_Swig::UnSetHypothesis | ( | const char * | ) |
Anassign hypothesis or algorithm from mesh or sub-mesh.
uid | Hypothesis's or algorithm's study UID (not used). |
void SMESH_Swig::update | ( | const char * | uid | ) |
Update mesh object.
uid | Object's study UID or IOR. |
References SMESH::_PTR(), Handle(), init(), and SMESH::Update().
Referenced by UpdateActor().
void SMESH_Swig::UpdateActor | ( | const char * | meshUid | ) |
Update mesh object.
meshUid | Mesh's study UID. |
References update().