Provide operations over the selected object. More...
#include <SMESHGUI_SelectionProxy.h>
Public Types | |
| enum | Type { Unknown , Mesh , Submesh , Group , GroupStd , GroupGeom , GroupFilter } |
Public Member Functions | |
| SelectionProxy () | |
| Default constructor. More... | |
| SelectionProxy (const Handle(SALOME_InteractiveObject)&) | |
| Constructor. More... | |
| SelectionProxy (SMESH::SMESH_IDSource_ptr) | |
| Constructor. More... | |
| SelectionProxy (const SelectionProxy &) | |
| Copy constructor. More... | |
| SelectionProxy & | operator= (const SelectionProxy &) |
| Assignment operator. More... | |
| bool | operator== (const SelectionProxy &) |
| Equality comparison operator. More... | |
| void | refresh () |
| Re-initialize proxy. More... | |
| bool | isNull () const |
| Check if proxy is null. More... | |
| operator bool () const | |
| Boolean conversion operator. More... | |
| SMESH::SMESH_IDSource_ptr | object () const |
| const | Handle (SALOME_InteractiveObject) &io() const |
| SMESH_Actor * | actor () const |
| bool | isValid () const |
| void | load () |
| QString | name () const |
| Get name. More... | |
| Type | type () const |
| Get type. More... | |
| MeshInfo | meshInfo () const |
| Get mesh information. More... | |
| SelectionProxy | mesh () const |
| Get parent mesh. More... | |
| bool | hasShapeToMesh () const |
| Check if parent mesh has shape to mesh. More... | |
| GEOM::GEOM_Object_ptr | shape () const |
| Get referenced GEOM object. More... | |
| QString | shapeName () const |
| Get name of referenced GEOM object. More... | |
| int | shapeType () const |
| Get type of referenced GEOM object. More... | |
| bool | isMeshLoaded () const |
| Check if mesh has been loaded from study file. More... | |
| bool | hasNode (int) |
| Check if node with given ID is present in the mesh. More... | |
| bool | nodeCoordinates (int, XYZ &) |
| Get node coordinates. More... | |
| bool | nodeConnectivity (int, Connectivity &) |
| Get node connectivity. More... | |
| bool | nodePosition (int, Position &) |
| Get node position on a shape. More... | |
| QList< SelectionProxy > | nodeGroups (int) const |
| Get groups given node belongs to. More... | |
| bool | hasElement (int) |
| Check if element with given ID is present in the mesh. More... | |
| SMESH::ElementType | elementType (int) const |
| Get type of given mesh element. More... | |
| int | elementEntityType (int) const |
| Get entity type of given mesh element. More... | |
| bool | elementConnectivity (SMESH::smIdType, Connectivity &) |
| Get element connectivity. More... | |
| bool | perFaceConnectivity (int, Connectivity &, int &) |
| Get volume element connectivity. More... | |
| bool | elementPosition (int, Position &) |
| Get element position on a shape. More... | |
| bool | elementGravityCenter (int, XYZ &) |
| Get gravity center of given element. More... | |
| bool | elementNormal (int, XYZ &) |
| Get normal vector to given element (face). More... | |
| bool | elementControl (int, int, double, double &) const |
| Get quality control's value for given element. More... | |
| QList< SelectionProxy > | elementGroups (int) const |
| Get groups given element belongs to. More... | |
| MedInfo | medFileInfo () const |
| Get MED file information. More... | |
| QList< SelectionProxy > | submeshes () const |
| Get child sub-meshes. More... | |
| QList< SelectionProxy > | groups () const |
| Get child groups. More... | |
| SMESH::ElementType | groupElementType () const |
| Get element type (for group). More... | |
| QColor | color () const |
| Get color (for group). More... | |
| SMESH::smIdType | size (bool=false) const |
| Get size (for group). More... | |
| SMESH::smIdType | nbNodes (bool=false) const |
| Get number of underlying nodes (for group of elements). More... | |
| QSet< uint > | ids () const |
| Get list of nodes / elements IDs for the mesh group. More... | |
Private Member Functions | |
| Handle (SALOME_InteractiveObject) myIO | |
| void | init () |
| Perform internal initialization. More... | |
Private Attributes | |
| SMESH::SMESH_IDSource_var | myObject |
| SMESH_Actor * | myActor |
| bool | myDirty |
Provide operations over the selected object.
The selection proxy class is aimed to use in dialogs to access mesh object data either from actor or directly from CORBA reference, depending on what of them is accessible. This is useful in situations when some information is needed, but an actor was not created yet.
Selection proxy can be constructed in two ways:
| SMESH::SelectionProxy::SelectionProxy | ( | ) |
Default constructor.
Creates null proxy.
| SMESH::SelectionProxy::SelectionProxy | ( | const Handle(SALOME_InteractiveObject)& | io | ) |
| SMESH::SelectionProxy::SelectionProxy | ( | SMESH::SMESH_IDSource_ptr | object | ) |
| SMESH::SelectionProxy::SelectionProxy | ( | const SelectionProxy & | other | ) |
| SMESH_Actor * SMESH::SelectionProxy::actor | ( | ) | const |
Referenced by SMESHGUI_MeshInfoDlg::idChanged(), and SMESHGUI_MeshInfoDlg::showInfo().
| QColor SMESH::SelectionProxy::color | ( | ) | const |
Get color (for group).
For other mesh objects result is undefined.
Referenced by SMESHGUI_AddInfo::groupInfo(), and SMESHGUI_ElemInfo::writeInfo().
| bool SMESH::SelectionProxy::elementConnectivity | ( | SMESH::smIdType | id, |
| Connectivity & | connectivity | ||
| ) |
Get element connectivity.
| id | Mesh element ID. |
| connectivity | Return element connectivity. |
true if result is valid; false otherwise. References SMDS_Mesh::FindElement(), SMDS_MeshElement::GetID(), SMDS_MeshElement::GetMesh(), SMDS_MeshElement::nodeIterator(), and SMDSAbs_Node.
Referenced by SMESHGUI_ElemInfo::writeInfo().
| bool SMESH::SelectionProxy::elementControl | ( | int | id, |
| int | control, | ||
| double | precision, | ||
| double & | value | ||
| ) | const |
Get quality control's value for given element.
| id | Mesh element ID. |
| control | Quality control type. |
| precision | Precision for control's value. |
| value | Returned quality control's value. |
true if result is valid; false otherwise. References SMDS_Mesh::FindElement(), SMESH::FT_Area, SMESH::FT_AspectRatio, SMESH::FT_AspectRatio3D, SMESH::FT_BallDiameter, SMESH::FT_Length, SMESH::FT_Length2D, SMESH::FT_Length3D, SMESH::FT_MaxElementLength2D, SMESH::FT_MaxElementLength3D, SMESH::FT_MinimumAngle, SMESH::FT_ScaledJacobian, SMESH::FT_Skew, SMESH::FT_Taper, SMESH::FT_Volume3D, SMESH::FT_Warping, SMESH::FT_Warping3D, SMDS_MeshElement::GetMesh(), SMESHGUI::GetSMESHGen(), and SMDS_MeshElement::GetType().
| int SMESH::SelectionProxy::elementEntityType | ( | int | id | ) | const |
Get entity type of given mesh element.
| id | Mesh element ID. |
References SMESH::Entity_Last, SMDS_Mesh::FindElement(), SMDS_MeshElement::GetEntityType(), and SMDS_MeshElement::GetMesh().
Referenced by SMESHGUI_ElemInfo::writeInfo().
| bool SMESH::SelectionProxy::elementGravityCenter | ( | int | id, |
| SMESH::XYZ & | xyz | ||
| ) |
Get gravity center of given element.
| id | Mesh element ID. |
| xyz | Returned gravity center. |
true if result is valid; false otherwise. References SMESH::XYZ::add(), SMESH::XYZ::divide(), SMDS_Mesh::FindElement(), SMDS_MeshElement::GetMesh(), SMDS_MeshElement::NbNodes(), SMDS_MeshElement::nodesIterator(), SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
Referenced by SMESHGUI_MeshInfoDlg::idChanged(), and SMESHGUI_ElemInfo::writeInfo().
| QList< SMESH::SelectionProxy > SMESH::SelectionProxy::elementGroups | ( | int | id | ) | const |
Get groups given element belongs to.
| id | Mesh element ID. |
References SMESH::NODE.
Referenced by SMESHGUI_ElemInfo::writeInfo().
| bool SMESH::SelectionProxy::elementNormal | ( | int | id, |
| SMESH::XYZ & | xyz | ||
| ) |
Get normal vector to given element (face).
| id | Mesh element ID. |
| xyz | Returned normal vector. |
true if result is valid; false otherwise. References SMDS_Mesh::FindElement(), SMDS_MeshElement::GetMesh(), SMESH::getNormale(), SMDS_MeshElement::GetType(), and SMDSAbs_Face.
Referenced by SMESHGUI_ElemInfo::writeInfo().
Get element position on a shape.
| id | Mesh element ID. |
| position | Returned element position. |
true if result is valid; false otherwise. References SMESH::Position::setShapeId(), and SMESH::Position::setShapeType().
Referenced by SMESHGUI_ElemInfo::writeInfo().
| SMESH::ElementType SMESH::SelectionProxy::elementType | ( | int | id | ) | const |
Get type of given mesh element.
| id | Mesh element ID. |
References SMESH::ALL, SMDS_Mesh::FindElement(), SMDS_MeshElement::GetMesh(), and SMDS_MeshElement::GetType().
Referenced by SMESHGUI_ElemInfo::writeInfo().
| SMESH::ElementType SMESH::SelectionProxy::groupElementType | ( | ) | const |
Get element type (for group).
For other mesh objects result is undefined.
References SMESH::ALL.
Referenced by SMESHGUI_AddInfo::groupInfo(), SMESHGUI_AddInfo::showGroups(), SMESHGUI_BaseInfo::showInfo(), and SMESHGUI_ElemInfo::showInfo().
| QList< SMESH::SelectionProxy > SMESH::SelectionProxy::groups | ( | ) | const |
Get child groups.
Referenced by SMESHGUI_AddInfo::meshInfo(), and GroupCombo::setSource().
| const SMESH::SelectionProxy::Handle | ( | SALOME_InteractiveObject | ) | const & |
|
private |
| bool SMESH::SelectionProxy::hasElement | ( | int | id | ) |
Check if element with given ID is present in the mesh.
| id | Mesh element ID. |
true if mesh contains element; false otherwise. References SMDS_Mesh::FindElement(), and SMDS_MeshElement::GetMesh().
Referenced by SMESHGUI_MeshInfoDlg::idChanged().
| bool SMESH::SelectionProxy::hasNode | ( | int | id | ) |
Check if node with given ID is present in the mesh.
| id | Mesh node ID. |
true if mesh contains node; false otherwise. References SMDS_Mesh::FindNode(), and SMDS_MeshElement::GetMesh().
Referenced by SMESHGUI_MeshInfoDlg::idChanged().
| bool SMESH::SelectionProxy::hasShapeToMesh | ( | ) | const |
Check if parent mesh has shape to mesh.
true if Parent mesh is built on a shape; false otherwise. | QSet< uint > SMESH::SelectionProxy::ids | ( | ) | const |
Get list of nodes / elements IDs for the mesh group.
Referenced by SMESHGUI_ElemInfo::showInfo().
|
private |
Perform internal initialization.
References SMESH::_PTR(), and SMESH::FindActorByEntry().
Referenced by SelectionProxy().
| bool SMESH::SelectionProxy::isMeshLoaded | ( | ) | const |
Check if mesh has been loaded from study file.
true if mesh was loaded; false otherwise. Referenced by SMESHGUI_AddInfo::groupInfo().
| bool SMESH::SelectionProxy::isNull | ( | ) | const |
Check if proxy is null.
true if proxy is null; false otherwise. | bool SMESH::SelectionProxy::isValid | ( | ) | const |
Referenced by SMESHGUI_BaseInfo::showInfo().
| void SMESH::SelectionProxy::load | ( | ) |
Referenced by InfoComputor::compute(), and SMESHGUI_BaseInfo::loadMesh().
| SMESH::MedInfo SMESH::SelectionProxy::medFileInfo | ( | ) | const |
Get MED file information.
The result contains valid data only if proxy refers to mesh object which has been imported from the MED file.
References SMESH::MedInfo::setFileName(), SMESH::MedInfo::setSize(), and SMESH::MedInfo::setVersion().
Referenced by SMESHGUI_AddInfo::meshInfo().
| SMESH::SelectionProxy SMESH::SelectionProxy::mesh | ( | ) | const |
Get parent mesh.
Referenced by SMESHGUI_AddInfo::groupInfo(), and SMESHGUI_AddInfo::subMeshInfo().
| SMESH::MeshInfo SMESH::SelectionProxy::meshInfo | ( | ) | const |
Get mesh information.
References SMESH::MeshInfo::addInfo(), SMESH::Entity_Last, and SMESH::Entity_Node.
Referenced by SMESHGUI_BaseInfo::showInfo().
| QString SMESH::SelectionProxy::name | ( | ) | const |
Get name.
Referenced by SMESHGUI_AddInfo::groupInfo(), GroupCombo::Item::Item(), SMESHGUI_AddInfo::showGroups(), SMESHGUI_BaseInfo::showInfo(), SMESHGUI_AddInfo::showInfo(), SMESHGUI_CtrlInfo::showInfo(), SMESHGUI_AddInfo::showSubMeshes(), SMESHGUI_AddInfo::subMeshInfo(), and SMESHGUI_ElemInfo::writeInfo().
| SMESH::smIdType SMESH::SelectionProxy::nbNodes | ( | bool | autoCompute = false | ) | const |
Get number of underlying nodes (for group of elements).
For other mesh objects result is undefined.
| autoCompute | Compute size if it is unavailable. Defaults to false. |
References SMESHGUI::resourceMgr().
Referenced by InfoComputor::compute(), and SMESHGUI_AddInfo::groupInfo().
| bool SMESH::SelectionProxy::nodeConnectivity | ( | int | id, |
| SMESH::Connectivity & | connectivity | ||
| ) |
Get node connectivity.
| id | Mesh node ID. |
| connectivity | Returned node connectivity. |
true if result is valid; false otherwise. References SMESH::ALL, SMDS_Mesh::FindNode(), SMDS_MeshElement::GetID(), SMDS_MeshNode::GetInverseElementIterator(), SMDS_MeshElement::GetMesh(), and SMDS_MeshElement::GetType().
Referenced by SMESHGUI_ElemInfo::writeInfo().
| bool SMESH::SelectionProxy::nodeCoordinates | ( | int | id, |
| SMESH::XYZ & | xyz | ||
| ) |
Get node coordinates.
| id | Mesh node ID. |
| xyz | Returned node coordinates. |
true if result is valid; false otherwise. References SMDS_Mesh::FindNode(), SMDS_MeshElement::GetMesh(), SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
Referenced by SMESHGUI_ElemInfo::writeInfo().
| QList< SMESH::SelectionProxy > SMESH::SelectionProxy::nodeGroups | ( | int | id | ) | const |
Get groups given node belongs to.
| id | Mesh node ID. |
References SMESH::NODE.
Referenced by SMESHGUI_ElemInfo::writeInfo().
Get node position on a shape.
| id | Mesh node ID. |
| position | Returned node position. |
true if result is valid; false otherwise. References EDGE, FACE, SMESH::Position::setShapeId(), SMESH::Position::setShapeType(), SMESH::Position::setU(), and SMESH::Position::setV().
Referenced by SMESHGUI_ElemInfo::writeInfo().
| SMESH::SMESH_IDSource_ptr SMESH::SelectionProxy::object | ( | ) | const |
| SMESH::SelectionProxy::operator bool | ( | ) | const |
Boolean conversion operator.
true if proxy is not null; false otherwise. | SMESH::SelectionProxy & SMESH::SelectionProxy::operator= | ( | const SelectionProxy & | other | ) |
| bool SMESH::SelectionProxy::operator== | ( | const SelectionProxy & | other | ) |
Equality comparison operator.
| other | Proxy to compare with. |
true if two proxies are equal; false otherwise. References myObject.
| bool SMESH::SelectionProxy::perFaceConnectivity | ( | int | id, |
| Connectivity & | connectivity, | ||
| int & | nbNodes | ||
| ) |
Get volume element connectivity.
| id | Mesh element ID. |
| connectivity | Return nodal connectivity of each facet numbered from 1 |
| nbNodes | Return number of unique nodes. |
true if result is valid; false otherwise. References SMDS_Mesh::FindElement(), SMDS_VolumeTool::GetFaceNodes(), SMDS_MeshElement::GetID(), SMDS_MeshElement::GetMesh(), SMDS_VolumeTool::NbFaceNodes(), SMDS_VolumeTool::NbFaces(), and SMDS_VolumeTool::Set().
Referenced by SMESHGUI_ElemInfo::writeInfo().
| void SMESH::SelectionProxy::refresh | ( | ) |
Re-initialize proxy.
Referenced by SMESHGUI_ElemInfo::showInfo().
| GEOM::GEOM_Object_ptr SMESH::SelectionProxy::shape | ( | ) | const |
Get referenced GEOM object.
The result contains valid pointer only if proxy refers to mesh, sub-mesh or group created on a geometry.
| QString SMESH::SelectionProxy::shapeName | ( | ) | const |
Get name of referenced GEOM object.
The result contains non-empty name only if proxy refers to mesh, sub-mesh or group created on a geometry, and if that geometry has valid name.
References SMESH::_PTR().
Referenced by SMESHGUI_AddInfo::groupInfo(), SMESHGUI_AddInfo::meshInfo(), SMESHGUI_AddInfo::subMeshInfo(), and SMESHGUI_ElemInfo::writeInfo().
| int SMESH::SelectionProxy::shapeType | ( | ) | const |
Get type of referenced GEOM object.
The result contains valid type only if proxy refers to mesh, sub-mesh or group created on a geometry.
Referenced by SMESHGUI_AddInfo::showSubMeshes().
| SMESH::smIdType SMESH::SelectionProxy::size | ( | bool | autoCompute = false | ) | const |
Get size (for group).
For other mesh objects result is undefined.
| autoCompute | Compute size if it is unavailable. Defaults to false. |
Referenced by InfoComputor::compute(), SMESHGUI_AddInfo::groupInfo(), and SMESHGUI_ElemInfo::writeInfo().
| QList< SMESH::SelectionProxy > SMESH::SelectionProxy::submeshes | ( | ) | const |
Get child sub-meshes.
Referenced by SMESHGUI_AddInfo::meshInfo().
| SMESH::SelectionProxy::Type SMESH::SelectionProxy::type | ( | ) | const |
Get type.
Referenced by SMESHGUI_AddInfo::groupInfo(), GroupCombo::setSource(), SMESHGUI_BaseInfo::showInfo(), SMESHGUI_AddInfo::showInfo(), and SMESHGUI_ElemInfo::writeInfo().
|
private |
Referenced by operator=(), and SelectionProxy().
|
private |
Referenced by operator=(), and SelectionProxy().
|
private |
Referenced by operator=(), operator==(), and SelectionProxy().