Version: 8.3.0
SMESHGUI_MeshTab Class Reference

Tab for tab widget containing controls for definition of algorithms and hypotheses. More...

#include <SMESHGUI_MeshDlg.h>

Inheritance diagram for SMESHGUI_MeshTab:

Public Types

enum  HypType { Algo = 0, MainHyp, AddHyp, MoreAddHyp }
 To differ main algorithms, hypotheses and additional ones. More...
 

Signals

void createHyp (const int, const int)
 Emitted when "Create hypothesis" button clicked. More...
 
void editHyp (const int, const int)
 Emitted when "Edit hypothesis" button clicked. More...
 
void selectAlgo (const int)
 Emitted when an algorithm is selected. More...
 

Public Member Functions

 SMESHGUI_MeshTab (QWidget *)
 Tab for tab widget containing controls for definition of algorithms and hypotheses. More...
 
virtual ~SMESHGUI_MeshTab ()
 Destructor. More...
 
void setAvailableHyps (const int, const QStringList &)
 Sets available hypothesis or algorithms. More...
 
void setExistingHyps (const int, const QStringList &, bool=false)
 Sets existing hypothesis. More...
 
void addHyp (const int, const QString &)
 Adds hypothesis in combo box of available ones. More...
 
void setCurrentHyp (const int, const int)
 Sets current hypothesis. More...
 
int currentHyp (const int) const
 Gets current hypothesis. More...
 
int nbAddHypTypes () const
 Returns nb of selected supplementary additional hypotheses. More...
 
void reset ()
 Resets all tab fields. More...
 

Private Slots

void onCreateHyp ()
 Emits createHyp( const int ) signal. More...
 
void onEditHyp ()
 Emits editHyp( const int ) signal. More...
 
void onHyp (int)
 Updates "Edit hypothesis" button state. More...
 
void onMoreAddHyp ()
 Adds a current additional hyp to myAddHypList. More...
 
void onLessAddHyp ()
 Removes a current additional hyp from myAddHypList. More...
 

Private Member Functions

void addItem (const QString &txt, const int type, const int index, const bool isGroup=false)
 Adds an item in a control corresponding to type. More...
 
int getCurrentIndex (const int type, const bool curByType=false) const
 Returns index of hyp of a given type. More...
 

Private Attributes

QMap< int, QStringList > myAvailableHypTypes
 
QMap< int, QtxToolButton * > myHypCombo
 
QMap< int, QToolButton * > myCreateHypBtn
 
QMap< int, QToolButton * > myEditHypBtn
 
QToolButton * myMoreAddHypBtn
 
QToolButton * myLessAddHypBtn
 
QListWidget * myAddHypList
 

Detailed Description

Tab for tab widget containing controls for definition of algorithms and hypotheses.

Member Enumeration Documentation

To differ main algorithms, hypotheses and additional ones.

Enumerator
Algo 

algorithms

MainHyp 

main hypothesis

AddHyp 

additional hypothesis

MoreAddHyp 

since several additional hypothesis are possible, the 2-nd, 3-d etc

Constructor & Destructor Documentation

SMESHGUI_MeshTab::SMESHGUI_MeshTab ( QWidget theParent)

Tab for tab widget containing controls for definition of algorithms and hypotheses.

Constructor

Parameters
theParent- Parent widget for this tab

Makes tab's look and feel

References AddHyp, Algo, MainHyp, MARGIN, MoreAddHyp, myAddHypList, myCreateHypBtn, myEditHypBtn, myHypCombo, myLessAddHypBtn, myMoreAddHypBtn, onCreateHyp(), onEditHyp(), onHyp(), onLessAddHyp(), onMoreAddHyp(), setAvailableHyps(), and SPACING.

SMESHGUI_MeshTab::~SMESHGUI_MeshTab ( )
virtual

Destructor.

Member Function Documentation

void SMESHGUI_MeshTab::addHyp ( const int  theId,
const QString &  theHyp 
)

Adds hypothesis in combo box of available ones.

Parameters
theId- identifier of hypothesis (main or additional, see HypType enumeration)
theHyp- name of hypothesis to be added

Adds hypothesis in combo box of available ones. This method is called by operation after creation of new hypothesis.

References AddHyp, addItem(), myAddHypList, myEditHypBtn, myHypCombo, and myMoreAddHypBtn.

Referenced by SMESHGUI_MeshOp::onHypoCreated().

void SMESHGUI_MeshTab::addItem ( const QString &  txt,
const int  type,
const int  index,
const bool  isGroup = false 
)
private

Adds an item in a control corresponding to type.

Parameters
[in]txt- item text
[in]type- HypType
[in]index- index of item in a list of items
[in]isGroup- is the item a group title

References AddHyp, myAddHypList, and myHypCombo.

Referenced by addHyp(), onLessAddHyp(), onMoreAddHyp(), setAvailableHyps(), setCurrentHyp(), and setExistingHyps().

void SMESHGUI_MeshTab::createHyp ( const int  ,
const int   
)
signal

Emitted when "Create hypothesis" button clicked.

Referenced by onCreateHyp().

int SMESHGUI_MeshTab::currentHyp ( const int  theId) const

Gets current hypothesis.

Parameters
theId- identifier of hypothesis (main or additional, see HypType enumeration)
Return values
int- index of current hypothesis

Gets current hypothesis Use theId > AddHyp to get more than selected addetional hyps (see nbAddHypTypes()).

References getCurrentIndex().

Referenced by SMESHGUI_MeshOp::currentHyp(), and onMoreAddHyp().

void SMESHGUI_MeshTab::editHyp ( const int  ,
const int   
)
signal

Emitted when "Edit hypothesis" button clicked.

Referenced by onEditHyp().

int SMESHGUI_MeshTab::getCurrentIndex ( const int  type,
const bool  curByType = false 
) const
private

Returns index of hyp of a given type.

References AddHyp, myAddHypList, and myHypCombo.

Referenced by currentHyp(), and onEditHyp().

int SMESHGUI_MeshTab::nbAddHypTypes ( ) const

Returns nb of selected supplementary additional hypotheses.

Access to their indices is via currentHyp( AddHyp + i ) where i is within the range 0 <= i < this->nbAddHypTypes()

References myAddHypList.

Referenced by SMESHGUI_MeshOp::nbDlgHypTypes().

void SMESHGUI_MeshTab::onCreateHyp ( )
privateslot

Emits createHyp( const int ) signal.

SLOT called when "Create hypothesis" button clicked specifies sender and emits createHyp( const int ) signal

References AddHyp, createHyp(), MainHyp, myAvailableHypTypes, and myCreateHypBtn.

Referenced by SMESHGUI_MeshTab().

void SMESHGUI_MeshTab::onEditHyp ( )
privateslot

Emits editHyp( const int ) signal.

SLOT called when "Edit hypothesis" button clicked specifies sender and emits editHyp( const int ) signal

References AddHyp, editHyp(), getCurrentIndex(), MainHyp, Min(), MoreAddHyp, and myEditHypBtn.

Referenced by SMESHGUI_MeshTab().

void SMESHGUI_MeshTab::onHyp ( int  theIndex)
privateslot

Updates "Edit hypothesis" button state.

SLOT called when current hypothesis changed. Disables "Edit hypothesis" button if current hypothesis is <None>, enables otherwise. If an algorithm changed, emits selectAlgo( theIndex ) signal

References AddHyp, Algo, MainHyp, MoreAddHyp, myAddHypList, myEditHypBtn, myHypCombo, myLessAddHypBtn, myMoreAddHypBtn, and selectAlgo().

Referenced by SMESHGUI_MeshTab().

void SMESHGUI_MeshTab::onLessAddHyp ( )
privateslot

Removes a current additional hyp from myAddHypList.

SLOT called when myLessAddHypBtn ("minus") clicked

References AddHyp, addItem(), and myAddHypList.

Referenced by SMESHGUI_MeshTab().

void SMESHGUI_MeshTab::onMoreAddHyp ( )
privateslot

Adds a current additional hyp to myAddHypList.

SLOT called when myMoreAddHypBtn ("plus") clicked

References AddHyp, addItem(), currentHyp(), MoreAddHyp, myEditHypBtn, myHypCombo, and myMoreAddHypBtn.

Referenced by SMESHGUI_MeshTab().

void SMESHGUI_MeshTab::reset ( )

Resets all tab fields.

Resets all tab fields

References AddHyp, Algo, myEditHypBtn, and myHypCombo.

void SMESHGUI_MeshTab::selectAlgo ( const int  )
signal

Emitted when an algorithm is selected.

Referenced by onHyp().

void SMESHGUI_MeshTab::setAvailableHyps ( const int  theId,
const QStringList &  theHyps 
)

Sets available hypothesis or algorithms.

Parameters
theId- identifier of hypothesis (main or additional, see HypType enumeration)
theHyps- list of available hypothesis names

Sets available main or additional hypothesis for this tab

References addItem(), Algo, myAvailableHypTypes, myCreateHypBtn, myEditHypBtn, and myHypCombo.

Referenced by SMESHGUI_MeshOp::onAlgoSelected(), SMESHGUI_MeshOp::processSet(), SMESHGUI_MeshOp::selectionDone(), SMESHGUI_MeshOp::setCurrentHyp(), SMESHGUI_MeshOp::setFilteredAlgoData(), SMESHGUI_MeshTab(), and SMESHGUI_MeshOp::startOperation().

void SMESHGUI_MeshTab::setCurrentHyp ( const int  theId,
const int  theIndex 
)

Sets current hypothesis.

Parameters
theId- identifier of hypothesis (main or additional, see HypType enumeration)
theIndex- index of hypothesis to be set as current

Sets current hypothesis

References AddHyp, addItem(), myAddHypList, myEditHypBtn, myHypCombo, and myMoreAddHypBtn.

Referenced by SMESHGUI_MeshOp::setCurrentHyp().

void SMESHGUI_MeshTab::setExistingHyps ( const int  theId,
const QStringList &  theHyps,
bool  theDefaultAvlbl = false 
)

Sets existing hypothesis.

Parameters
theId- identifier of hypothesis (main or additional, see HypType enumeration)
theHyps- list of available hypothesis names
theDefaultAvlbl- true means that the algorithm can work w/o hypothesis with some default parameters

Sets existing main or additional hypothesis for this tab

References AddHyp, addItem(), Algo, MoreAddHyp, myAddHypList, myAvailableHypTypes, myEditHypBtn, myHypCombo, myLessAddHypBtn, and myMoreAddHypBtn.

Referenced by SMESHGUI_MeshOp::onAlgoSelected(), SMESHGUI_MeshOp::readMesh(), SMESHGUI_MeshOp::setCurrentHyp(), and SMESHGUI_MeshOp::startOperation().

Field Documentation

QListWidget* SMESHGUI_MeshTab::myAddHypList
private
QMap<int, QStringList> SMESHGUI_MeshTab::myAvailableHypTypes
private
QMap<int, QToolButton*> SMESHGUI_MeshTab::myCreateHypBtn
private
QMap<int, QToolButton*> SMESHGUI_MeshTab::myEditHypBtn
private
QMap<int, QtxToolButton*> SMESHGUI_MeshTab::myHypCombo
private
QToolButton* SMESHGUI_MeshTab::myLessAddHypBtn
private
QToolButton* SMESHGUI_MeshTab::myMoreAddHypBtn
private