Version: 9.12.0
SMESHGUI_TreeElemInfo Class Reference

Show mesh element information as the tree. More...

#include <SMESHGUI_MeshInfo.h>

Inheritance diagram for SMESHGUI_TreeElemInfo:

Data Structures

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

Signals

void itemInfo (int type, const QString &ids)
 

Public Member Functions

 SMESHGUI_TreeElemInfo (QWidget *=0)
 Constructor. More...
 
void showInfo (const SMESH::SelectionProxy &, uint, bool)
 Show information on given node / element. More...
 
void showInfo (const SMESH::SelectionProxy &, QSet< uint >, bool)
 Show information on given nodes / elements. More...
 
void showInfo (const SMESH::SelectionProxy &)
 Show information on given group. More...
 
void clear ()
 Reset panel (clear all data). More...
 
void saveInfo (QTextStream &)
 Write information from panel to output stream. More...
 

Protected Types

enum  { ShowNone , ShowNodes , ShowElements }
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *)
 
void information (const QList< uint > &)
 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...
 
QWidgetcentralWidget () const
 Get central area widget. More...
 
SMESH::SelectionProxy proxy () const
 Get current mesh proxy object information is shown on. More...
 
int what () const
 Get current info mode. More...
 
QString type2str (int, bool=false)
 Get title for given element type. More...
 
QString stype2str (int)
 Get title for given shape type. More...
 
QString etype2str (int)
 Get title for given element type. More...
 
QString ctrl2str (int)
 Get title for given quality control. More...
 
void writeInfo (InfoWriter *, const QList< uint > &)
 Write information on given mesh nodes / elements. More...
 

Private Slots

void itemDoubleClicked (QTreeWidgetItem *, int)
 
void saveExpanded (QTreeWidgetItem *)
 
void showPrevious ()
 Show previous chunk of information. More...
 
void showNext ()
 Show next chunk of information. More...
 
void updateControls ()
 Update control widget state. More...
 

Private Member Functions

QTreeWidgetItem * createItem (QTreeWidgetItem *=0, int=0)
 Create new item and add it to the tree. More...
 
QString expandedResource (QTreeWidgetItem *)
 

Private Attributes

QTreeWidgetmyInfo
 
QWidgetmyFrame
 
ExtraWidgetmyExtra
 
SMESH::SelectionProxy myProxy
 
int myWhat
 
QList< uint > myIDs
 
int myIndex
 

Detailed Description

Show mesh element information as the tree.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
ShowNone 
ShowNodes 
ShowElements 

Constructor & Destructor Documentation

◆ SMESHGUI_TreeElemInfo()

SMESHGUI_TreeElemInfo::SMESHGUI_TreeElemInfo ( QWidget parent = 0)

Constructor.

Parameters
parentParent widget. Defaults to 0.

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

Member Function Documentation

◆ centralWidget()

QWidget * SMESHGUI_ElemInfo::centralWidget ( ) const
protectedinherited

Get central area widget.

Returns
Central widget.

References SMESHGUI_ElemInfo::myFrame.

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

◆ clear()

◆ clearInternal()

void SMESHGUI_TreeElemInfo::clearInternal ( )
protectedvirtual

Internal clean-up (reset widget)

Reimplemented from SMESHGUI_ElemInfo.

References myInfo.

Referenced by information().

◆ contextMenuEvent()

void SMESHGUI_TreeElemInfo::contextMenuEvent ( QContextMenuEvent *  e)
protected

◆ createItem()

QTreeWidgetItem * SMESHGUI_TreeElemInfo::createItem ( QTreeWidgetItem *  parent = 0,
int  options = 0 
)
private

Create new item and add it to the tree.

Parameters
parentParent tree widget item. Defaults to 0 (top-level item).
optionsItem flags. Defaults to 0 (none).
Returns
New tree widget item.

References expandedResource(), myInfo, and SMESHGUI::resourceMgr().

◆ ctrl2str()

QString SMESHGUI_ElemInfo::ctrl2str ( int  control)
protectedinherited

◆ etype2str()

◆ expandedResource()

QString SMESHGUI_TreeElemInfo::expandedResource ( QTreeWidgetItem *  theItem)
private

◆ information()

void SMESHGUI_TreeElemInfo::information ( const QList< uint > &  ids)
protectedvirtual

Show mesh element information.

Parameters
idsNodes / elements IDs.

Implements SMESHGUI_ElemInfo.

References clearInternal(), myInfo, and SMESHGUI_ElemInfo::writeInfo().

◆ itemDoubleClicked

void SMESHGUI_TreeElemInfo::itemDoubleClicked ( QTreeWidgetItem *  theItem,
int   
)
privateslot

◆ itemInfo

void SMESHGUI_ElemInfo::itemInfo ( int  type,
const QString &  ids 
)
signalinherited

◆ nodeInfo()

void SMESHGUI_TreeElemInfo::nodeInfo ( const SMDS_MeshNode ,
int  ,
int  ,
QTreeWidgetItem *   
)
protected

Show node information.

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

◆ proxy()

SMESH::SelectionProxy SMESHGUI_ElemInfo::proxy ( ) const
protectedinherited

Get current mesh proxy object information is shown on.

Returns
Current proxy.

References SMESHGUI_ElemInfo::myProxy.

Referenced by SMESHGUI_ElemInfo::showInfo(), and SMESHGUI_ElemInfo::writeInfo().

◆ saveExpanded

void SMESHGUI_TreeElemInfo::saveExpanded ( QTreeWidgetItem *  theItem)
privateslot

◆ saveInfo()

void SMESHGUI_ElemInfo::saveInfo ( QTextStream &  out)
virtualinherited

Write information from panel to output stream.

Parameters
outText stream output.

Implements SMESHGUI_Info.

References SMESHGUI_ElemInfo::myIDs, and SMESHGUI_ElemInfo::writeInfo().

Referenced by SMESHGUI_MeshInfoDlg::dump().

◆ showInfo() [1/3]

void SMESHGUI_ElemInfo::showInfo ( const SMESH::SelectionProxy proxy)
inherited

Show information on given group.

Parameters
proxyObject to compute information on (group).

References SMESH::ALL, SMESHGUI_ElemInfo::clear(), SMESH::SelectionProxy::groupElementType(), SMESH::SelectionProxy::ids(), SMESH::NODE, SMESHGUI_ElemInfo::proxy(), and SMESHGUI_ElemInfo::showInfo().

◆ showInfo() [2/3]

void SMESHGUI_ElemInfo::showInfo ( const SMESH::SelectionProxy proxy,
QSet< uint >  ids,
bool  isElement 
)
inherited

Show information on given nodes / elements.

Parameters
proxyObject to compute information on (mesh, sub-mesh, group, ID source).
idsMesh nodes / elements IDs.
isElementIf true, show element info; otherwise show node info.

References SMESHGUI_ElemInfo::clear(), SMESHGUI_ElemInfo::information(), SMESHGUI_ElemInfo::myIDs, SMESHGUI_ElemInfo::myIndex, SMESHGUI_ElemInfo::myProxy, SMESHGUI_ElemInfo::myWhat, SMESHGUI_ElemInfo::proxy(), SMESH::SelectionProxy::refresh(), SMESHGUI_ElemInfo::ShowElements, SMESHGUI_ElemInfo::ShowNodes, SMESHGUI_ElemInfo::updateControls(), and SMESHGUI_ElemInfo::what().

◆ showInfo() [3/3]

void SMESHGUI_ElemInfo::showInfo ( const SMESH::SelectionProxy proxy,
uint  id,
bool  isElement 
)
inherited

Show information on given node / element.

Parameters
proxyObject to compute information on (mesh, sub-mesh, group, ID source).
idMesh node / element ID.
isElementIf true, show element info; otherwise show node info.

References SMESHGUI_ElemInfo::proxy().

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

◆ showNext

void SMESHGUI_ElemInfo::showNext ( )
privateslotinherited

◆ showPrevious

void SMESHGUI_ElemInfo::showPrevious ( )
privateslotinherited

◆ stype2str()

QString SMESHGUI_ElemInfo::stype2str ( int  type)
protectedinherited

Get title for given shape type.

Parameters
typeShape type.
Returns
Shape type's title.

References EDGE, and FACE.

Referenced by SMESHGUI_ElemInfo::writeInfo().

◆ type2str()

QString SMESHGUI_ElemInfo::type2str ( int  type,
bool  multiple = false 
)
protectedinherited

Get title for given element type.

Parameters
typeMesh element type.
multipleUse plural form. Defaults to false.
Returns
Element type's title.

References SMDSAbs_0DElement, SMDSAbs_Ball, SMDSAbs_Edge, SMDSAbs_Face, and SMDSAbs_Volume.

Referenced by SMESHGUI_ElemInfo::writeInfo().

◆ updateControls

◆ what()

int SMESHGUI_ElemInfo::what ( ) const
protectedinherited

Get current info mode.

Returns
Current panel mode.

References SMESHGUI_ElemInfo::myWhat.

Referenced by expandedResource(), SMESHGUI_ElemInfo::showInfo(), and SMESHGUI_ElemInfo::writeInfo().

◆ writeInfo()

void SMESHGUI_ElemInfo::writeInfo ( InfoWriter writer,
const QList< uint > &  ids 
)
protectedinherited

Write information on given mesh nodes / elements.

Parameters
writerInformation writer.
idsNodes / elements IDs.

References SMESH::ALL, SMESH::SelectionProxy::color(), SMESHGUI_ElemInfo::ctrl2str(), SMESH::SelectionProxy::elementConnectivity(), SMESH::SelectionProxy::elementEntityType(), SMESH::SelectionProxy::elementGravityCenter(), SMESH::SelectionProxy::elementGroups(), SMESH::SelectionProxy::elementNormal(), SMESH::SelectionProxy::elementPosition(), SMESH::SelectionProxy::elementType(), SMESH::Entity_Polyhedra, SMESH::Entity_Quad_Polyhedra, SMESHGUI_ElemInfo::etype2str(), SMESH::FT_AspectRatio, SMESH::FT_Undefined, SMESH::SelectionProxy::GroupFilter, SMESH::SelectionProxy::GroupGeom, SMESH::SelectionProxy::GroupStd, SMESH::Position::hasU(), SMESH::Position::hasV(), InfoWriter::indent(), SMESH::Position::isValid(), SMESH::SelectionProxy::name(), SMESH::SelectionProxy::nodeConnectivity(), SMESH::SelectionProxy::nodeCoordinates(), SMESH::SelectionProxy::nodeGroups(), SMESH::SelectionProxy::nodePosition(), SMESH::SelectionProxy::perFaceConnectivity(), SMESHGUI_ElemInfo::proxy(), SMESHGUI::resourceMgr(), InfoWriter::separator(), SMESH::Position::shapeId(), SMESH::SelectionProxy::shapeName(), SMESH::Position::shapeType(), SMESHGUI_ElemInfo::ShowElements, SMESHGUI_ElemInfo::ShowNodes, SMESH::SelectionProxy::size(), SMDSAbs_Ball, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, SMESHGUI_ElemInfo::stype2str(), SMESH::SelectionProxy::type(), SMESHGUI_ElemInfo::type2str(), SMESH::Position::u(), InfoWriter::unindent(), SMESH::Position::v(), SMESHGUI_ElemInfo::what(), and InfoWriter::write().

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

Field Documentation

◆ myExtra

ExtraWidget* SMESHGUI_ElemInfo::myExtra
privateinherited

◆ myFrame

QWidget* SMESHGUI_ElemInfo::myFrame
privateinherited

◆ myIDs

◆ myIndex

◆ myInfo

QTreeWidget* SMESHGUI_TreeElemInfo::myInfo
private

◆ myProxy

SMESH::SelectionProxy SMESHGUI_ElemInfo::myProxy
privateinherited

◆ myWhat

int SMESHGUI_ElemInfo::myWhat
privateinherited