Version: 9.12.0
SMESHGUI_ElemInfo Class Referenceabstract

Base class for the mesh element information widget. More...

#include <SMESHGUI_MeshInfo.h>

Inheritance diagram for SMESHGUI_ElemInfo:

Signals

void itemInfo (int type, const QString &ids)
 

Public Member Functions

 SMESHGUI_ElemInfo (QWidget *=0)
 Constructor. More...
 
 ~SMESHGUI_ElemInfo ()
 Destructor. 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

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...
 
virtual void information (const QList< uint > &)=0
 Show information on given mesh nodes / elements. More...
 
virtual void clearInternal ()
 Internal clean-up (reset panel). More...
 

Private Slots

void showPrevious ()
 Show previous chunk of information. More...
 
void showNext ()
 Show next chunk of information. More...
 
void updateControls ()
 Update control widget state. More...
 

Private Attributes

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

Detailed Description

Base class for the mesh element information widget.

Displays the detail information about given mesh node(s) or element(s). Default class does not provide working implementation but onle general functionalities; main work is done in sub-classes.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
ShowNone 
ShowNodes 
ShowElements 

Constructor & Destructor Documentation

◆ SMESHGUI_ElemInfo()

SMESHGUI_ElemInfo::SMESHGUI_ElemInfo ( QWidget parent = 0)

Constructor.

Parameters
parentParent widget. Defaults to 0.

References clear(), myExtra, myFrame, ExtraWidget::next, ExtraWidget::prev, showNext(), showPrevious(), and SPACING.

◆ ~SMESHGUI_ElemInfo()

SMESHGUI_ElemInfo::~SMESHGUI_ElemInfo ( )

Destructor.

Member Function Documentation

◆ centralWidget()

QWidget * SMESHGUI_ElemInfo::centralWidget ( ) const
protected

Get central area widget.

Returns
Central widget.

References myFrame.

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

◆ clear()

void SMESHGUI_ElemInfo::clear ( )

Reset panel (clear all data).

References clearInternal(), myIDs, myIndex, and updateControls().

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

◆ clearInternal()

void SMESHGUI_ElemInfo::clearInternal ( )
protectedvirtual

Internal clean-up (reset panel).

Default implementation does nothing; the method has to be redefined in sub-classes to perform internal clean-up.

Reimplemented in SMESHGUI_TreeElemInfo, and SMESHGUI_SimpleElemInfo.

Referenced by clear().

◆ ctrl2str()

QString SMESHGUI_ElemInfo::ctrl2str ( int  control)
protected

◆ etype2str()

◆ information()

void SMESHGUI_ElemInfo::information ( const QList< uint > &  ids)
protectedpure virtual

Show information on given mesh nodes / elements.

This function has to be redefined in sub-classes.

Parameters
idsNodes / elements IDs.

Implemented in SMESHGUI_TreeElemInfo, and SMESHGUI_SimpleElemInfo.

Referenced by showInfo(), showNext(), and showPrevious().

◆ itemInfo

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

◆ proxy()

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

Get current mesh proxy object information is shown on.

Returns
Current proxy.

References myProxy.

Referenced by showInfo(), and writeInfo().

◆ saveInfo()

void SMESHGUI_ElemInfo::saveInfo ( QTextStream &  out)
virtual

Write information from panel to output stream.

Parameters
outText stream output.

Implements SMESHGUI_Info.

References myIDs, and writeInfo().

Referenced by SMESHGUI_MeshInfoDlg::dump().

◆ showInfo() [1/3]

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

Show information on given group.

Parameters
proxyObject to compute information on (group).

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

◆ showInfo() [2/3]

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

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 clear(), information(), myIDs, myIndex, myProxy, myWhat, proxy(), SMESH::SelectionProxy::refresh(), ShowElements, ShowNodes, updateControls(), and what().

◆ showInfo() [3/3]

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

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 proxy().

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

◆ showNext

void SMESHGUI_ElemInfo::showNext ( )
privateslot

Show next chunk of information.

References information(), myIDs, myIndex, and updateControls().

Referenced by SMESHGUI_ElemInfo().

◆ showPrevious

void SMESHGUI_ElemInfo::showPrevious ( )
privateslot

Show previous chunk of information.

References information(), myIDs, myIndex, and updateControls().

Referenced by SMESHGUI_ElemInfo().

◆ stype2str()

QString SMESHGUI_ElemInfo::stype2str ( int  type)
protected

Get title for given shape type.

Parameters
typeShape type.
Returns
Shape type's title.

References EDGE, and FACE.

Referenced by writeInfo().

◆ type2str()

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

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 writeInfo().

◆ updateControls

void SMESHGUI_ElemInfo::updateControls ( )
privateslot

Update control widget state.

References myExtra, myIDs, myIndex, and ExtraWidget::updateControls().

Referenced by clear(), showInfo(), showNext(), and showPrevious().

◆ what()

int SMESHGUI_ElemInfo::what ( ) const
protected

Get current info mode.

Returns
Current panel mode.

References myWhat.

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

◆ writeInfo()

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

Write information on given mesh nodes / elements.

Parameters
writerInformation writer.
idsNodes / elements IDs.

References SMESH::ALL, SMESH::SelectionProxy::color(), 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, 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(), proxy(), SMESHGUI::resourceMgr(), InfoWriter::separator(), SMESH::Position::shapeId(), SMESH::SelectionProxy::shapeName(), SMESH::Position::shapeType(), ShowElements, ShowNodes, SMESH::SelectionProxy::size(), SMDSAbs_Ball, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, stype2str(), SMESH::SelectionProxy::type(), type2str(), SMESH::Position::u(), InfoWriter::unindent(), SMESH::Position::v(), what(), and InfoWriter::write().

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

Field Documentation

◆ myExtra

ExtraWidget* SMESHGUI_ElemInfo::myExtra
private

◆ myFrame

QWidget* SMESHGUI_ElemInfo::myFrame
private

Referenced by centralWidget(), and SMESHGUI_ElemInfo().

◆ myIDs

QList<uint> SMESHGUI_ElemInfo::myIDs
private

◆ myIndex

int SMESHGUI_ElemInfo::myIndex
private

◆ myProxy

SMESH::SelectionProxy SMESHGUI_ElemInfo::myProxy
private

Referenced by proxy(), and showInfo().

◆ myWhat

int SMESHGUI_ElemInfo::myWhat
private

Referenced by showInfo(), and what().