Version: 8.3.0
SMESHGUI_TreeElemInfo Class Reference

Represents mesh element information in the tree-like form. More...

#include <SMESHGUI_MeshInfo.h>

Inheritance diagram for SMESHGUI_TreeElemInfo:

Data Structures

class  ItemDelegate
 Item delegate for tree mesh info widget. More...
 

Signals

void itemInfo (int)
 
void itemInfo (const QString &)
 

Public Member Functions

 SMESHGUI_TreeElemInfo (QWidget *=0)
 Constructor. More...
 
void saveInfo (QTextStream &out)
 
void setSource (SMESH_Actor *)
 Set mesh data source (actor) More...
 
void showInfo (long, bool)
 Show mesh element information. More...
 
void showInfo (QSet< long >, bool)
 Show mesh element information. More...
 
void clear ()
 Clear mesh element information widget. More...
 
gp_XYZ getGravityCenter (const SMDS_MeshElement *e)
 

Protected Types

typedef QMap< int, QList< int > > Connectivity
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *e)
 
void information (const QList< long > &)
 Show mesh element information. More...
 
void nodeInfo (const SMDS_MeshNode *, int, int, QTreeWidgetItem *)
 Show node information. More...
 
void clearInternal ()
 Internal clean-up (reset widget) More...
 
QWidgetframe () const
 Get central area widget. More...
 
SMESH_Actoractor () const
 Get actor. More...
 
bool isElements () const
 Get current info mode. More...
 
Connectivity nodeConnectivity (const SMDS_MeshNode *)
 Get node connectivity. More...
 
QString formatConnectivity (Connectivity, int)
 Format connectivity data to string representation. More...
 
XYZ gravityCenter (const SMDS_MeshElement *)
 Calculate gravity center of the mesh element. More...
 
XYZ normal (const SMDS_MeshElement *)
 Calculate normal vector to the mesh face. More...
 

Private Types

enum  { Bold = 0x01, All = 0x80 }
 

Private Slots

void itemDoubleClicked (QTreeWidgetItem *, int)
 
void saveExpanded (QTreeWidgetItem *)
 

Private Member Functions

QTreeWidgetItem * createItem (QTreeWidgetItem *=0, int=0)
 Create new tree item. More...
 
QString expandedResource (QTreeWidgetItem *)
 

Private Attributes

QTreeWidgetmyInfo
 

Detailed Description

Represents mesh element information in the tree-like form.

Member Typedef Documentation

typedef QMap< int, QList<int> > SMESHGUI_ElemInfo::Connectivity
protectedinherited

Member Enumeration Documentation

anonymous enum
private
Enumerator
Bold 
All 

Constructor & Destructor Documentation

SMESHGUI_TreeElemInfo::SMESHGUI_TreeElemInfo ( QWidget parent = 0)

Constructor.

Parameters
parentparent widget

References SMESHGUI_ElemInfo::frame(), itemDoubleClicked(), myInfo, and saveExpanded().

Member Function Documentation

SMESH_Actor * SMESHGUI_ElemInfo::actor ( ) const
protectedinherited

Get actor.

Returns
actor being used

References SMESHGUI_ElemInfo::myActor.

Referenced by SMESHGUI_SimpleElemInfo::information(), information(), and SMESHGUI_ElemInfo::setSource().

void SMESHGUI_TreeElemInfo::clearInternal ( )
protectedvirtual

Internal clean-up (reset widget)

Reimplemented from SMESHGUI_ElemInfo.

References myInfo.

Referenced by information().

void SMESHGUI_TreeElemInfo::contextMenuEvent ( QContextMenuEvent *  e)
protected
QTreeWidgetItem * SMESHGUI_TreeElemInfo::createItem ( QTreeWidgetItem *  parent = 0,
int  flags = 0 
)
private

Create new tree item.

Parameters
parentparent tree widget item
flagsitem flag
Returns
new tree widget item

References All, Bold, expandedResource(), itemDepth(), myInfo, and SMESHGUI::resourceMgr().

Referenced by information(), and nodeInfo().

QString SMESHGUI_TreeElemInfo::expandedResource ( QTreeWidgetItem *  theItem)
private
QString SMESHGUI_ElemInfo::formatConnectivity ( Connectivity  connectivity,
int  type 
)
protectedinherited

Format connectivity data to string representation.

Parameters
connectivityconnetivity map
typeelement type
Returns
string representation of the connectivity

Referenced by SMESHGUI_SimpleElemInfo::information(), information(), and nodeInfo().

QWidget * SMESHGUI_ElemInfo::frame ( ) const
protectedinherited

Get central area widget.

Returns
central widget

References SMESHGUI_ElemInfo::myFrame.

Referenced by SMESHGUI_SimpleElemInfo::SMESHGUI_SimpleElemInfo(), and SMESHGUI_TreeElemInfo().

gp_XYZ SMESHGUI_ElemInfo::getGravityCenter ( const SMDS_MeshElement e)
inherited
SMESHGUI_ElemInfo::XYZ SMESHGUI_ElemInfo::gravityCenter ( const SMDS_MeshElement element)
protectedinherited
void SMESHGUI_TreeElemInfo::information ( const QList< long > &  ids)
protectedvirtual

Show mesh element information.

Parameters
idsmesh nodes / elements identifiers

Implements SMESHGUI_ElemInfo.

References _PTR(), SMESHGUI_ElemInfo::actor(), All, Bold, clearInternal(), createItem(), EDGE, FACE, SMESHGUI_ElemInfo::formatConnectivity(), SMDS_MeshElement::GetEntityType(), SMDS_VolumeTool::GetFaceNodes(), SMDS_MeshElement::GetGeomType(), SMESH_Actor::GetObject(), SMDS_MeshElement::GetType(), SMESHGUI_ElemInfo::gravityCenter(), SMESHGUI_ElemInfo::isElements(), SMDS_MeshElement::IsPoly(), SMDS_MeshElement::IsQuadratic(), SMDS_VolumeTool::NbFaceNodes(), SMDS_VolumeTool::NbFaces(), SMDS_MeshElement::NbNodes(), SMDS_VtkVolume::NbUniqueNodes(), SMESH::NODE, SMESHGUI_ElemInfo::nodeConnectivity(), nodeInfo(), SMDS_MeshElement::nodesIterator(), SMESHGUI_ElemInfo::normal(), SMESHGUI::resourceMgr(), SMESH::ElementPosition::shapeID, SMESH::ElementPosition::shapeType, SMDSAbs_0DElement, SMDSAbs_Ball, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, SMDSEntity_BiQuad_Quadrangle, SMDSEntity_BiQuad_Triangle, SMDSEntity_Hexa, SMDSEntity_Hexagonal_Prism, SMDSEntity_Penta, SMDSEntity_Polygon, SMDSEntity_Polyhedra, SMDSEntity_Pyramid, SMDSEntity_Quad_Hexa, SMDSEntity_Quad_Penta, SMDSEntity_Quad_Polygon, SMDSEntity_Quad_Polyhedra, SMDSEntity_Quad_Pyramid, SMDSEntity_Quad_Quadrangle, SMDSEntity_Quad_Tetra, SMDSEntity_Quad_Triangle, SMDSEntity_Quadrangle, SMDSEntity_Tetra, SMDSEntity_Triangle, SMDSEntity_TriQuad_Hexa, SMDSGeom_POLYHEDRA, SObject(), SMDS_VtkVolume::uniqueNodesIterator(), SMDS_MeshNode::X(), SMESHGUI_ElemInfo::XYZ::x(), SMDS_MeshNode::Y(), SMESHGUI_ElemInfo::XYZ::y(), SMDS_MeshNode::Z(), and SMESHGUI_ElemInfo::XYZ::z().

bool SMESHGUI_ElemInfo::isElements ( ) const
protectedinherited

Get current info mode.

Returns
true if mesh element information is shown or false if node information is shown

References SMESHGUI_ElemInfo::myIsElement.

Referenced by expandedResource(), SMESHGUI_SimpleElemInfo::information(), and information().

void SMESHGUI_TreeElemInfo::itemDoubleClicked ( QTreeWidgetItem *  theItem,
int  theColumn 
)
privateslot
void SMESHGUI_ElemInfo::itemInfo ( int  )
signalinherited
void SMESHGUI_ElemInfo::itemInfo ( const QString &  )
signalinherited
SMESHGUI_ElemInfo::Connectivity SMESHGUI_ElemInfo::nodeConnectivity ( const SMDS_MeshNode node)
protectedinherited

Get node connectivity.

Parameters
nodemesh node
Returns
node connectivity map

References SMDS_MeshElement::GetID(), SMDS_MeshNode::GetInverseElementIterator(), and SMDS_MeshElement::GetType().

Referenced by SMESHGUI_SimpleElemInfo::information(), information(), and nodeInfo().

void SMESHGUI_TreeElemInfo::nodeInfo ( const SMDS_MeshNode node,
int  index,
int  nbNodes,
QTreeWidgetItem *  parentItem 
)
protected

Show node information.

Parameters
nodemesh node for showing
indexindex of current node
nbNodesnumber of unique nodes in element
parentItemparent item of tree

References Bold, createItem(), SMESHGUI_ElemInfo::formatConnectivity(), SMDS_MeshElement::GetID(), SMESHGUI_ElemInfo::nodeConnectivity(), SMESHGUI::resourceMgr(), SMDSAbs_0DElement, SMDSAbs_Ball, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().

Referenced by information().

SMESHGUI_ElemInfo::XYZ SMESHGUI_ElemInfo::normal ( const SMDS_MeshElement element)
protectedinherited

Calculate normal vector to the mesh face.

Parameters
elementmesh face

References SMESH::getNormale().

Referenced by SMESHGUI_SimpleElemInfo::information(), and information().

void SMESHGUI_TreeElemInfo::saveExpanded ( QTreeWidgetItem *  theItem)
privateslot
void SMESHGUI_TreeElemInfo::saveInfo ( QTextStream &  out)
virtual

Implements SMESHGUI_ElemInfo.

References itemDepth(), and myInfo.

void SMESHGUI_ElemInfo::setSource ( SMESH_Actor actor)
inherited

Set mesh data source (actor)

Parameters
actormesh object actor

References SMESHGUI_ElemInfo::actor(), SMESHGUI_ElemInfo::clear(), SMESHGUI_ElemInfo::myActor, and SMESHGUI_ElemInfo::myIsElement.

Referenced by SMESHGUI_MeshInfoDlg::showInfo().

void SMESHGUI_ElemInfo::showInfo ( long  id,
bool  isElem 
)
inherited

Show mesh element information.

Parameters
idmesh node / element ID
isElemshow mesh element information if true or mesh node information if false

Referenced by SMESHGUI_MeshInfoDlg::idChanged(), and SMESHGUI_MeshInfoDlg::showInfo().

void SMESHGUI_ElemInfo::showInfo ( QSet< long >  ids,
bool  isElem 
)
inherited

Show mesh element information.

Parameters
idsmesh nodes / elements identifiers
isElemshow mesh element information if true or mesh node information if false

References SMESHGUI_ElemInfo::information(), SMESHGUI_ElemInfo::myIDs, SMESHGUI_ElemInfo::myIndex, SMESHGUI_ElemInfo::myIsElement, and SMESHGUI_ElemInfo::updateControls().

Field Documentation

QTreeWidget* SMESHGUI_TreeElemInfo::myInfo
private