Tab for tab widget containing controls for definition of algorithms and hypotheses. More...
#include <SMESHGUI_MeshDlg.h>
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 |
Tab for tab widget containing controls for definition of algorithms and hypotheses.
SMESHGUI_MeshTab::SMESHGUI_MeshTab | ( | QWidget * | theParent | ) |
Tab for tab widget containing controls for definition of algorithms and hypotheses.
Constructor
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.
|
virtual |
Destructor.
void SMESHGUI_MeshTab::addHyp | ( | const int | theId, |
const QString & | theHyp | ||
) |
Adds hypothesis in combo box of available ones.
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().
|
private |
Adds an item in a control corresponding to type.
[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().
Emitted when "Create hypothesis" button clicked.
Referenced by onCreateHyp().
Gets current hypothesis.
theId | - identifier of hypothesis (main or additional, see HypType enumeration) |
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().
Emitted when "Edit hypothesis" button clicked.
Referenced by onEditHyp().
|
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().
|
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().
|
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().
|
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().
|
privateslot |
Removes a current additional hyp from myAddHypList.
SLOT called when myLessAddHypBtn ("minus") clicked
References AddHyp, addItem(), and myAddHypList.
Referenced by SMESHGUI_MeshTab().
|
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 | ( | ) |
|
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.
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().
Sets current hypothesis.
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.
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().
|
private |
Referenced by addHyp(), addItem(), getCurrentIndex(), nbAddHypTypes(), onHyp(), onLessAddHyp(), setCurrentHyp(), setExistingHyps(), and SMESHGUI_MeshTab().
|
private |
Referenced by onCreateHyp(), setAvailableHyps(), and setExistingHyps().
|
private |
Referenced by onCreateHyp(), setAvailableHyps(), and SMESHGUI_MeshTab().
|
private |
Referenced by addHyp(), onEditHyp(), onHyp(), onMoreAddHyp(), reset(), setAvailableHyps(), setCurrentHyp(), setExistingHyps(), and SMESHGUI_MeshTab().
|
private |
Referenced by addHyp(), addItem(), getCurrentIndex(), onHyp(), onMoreAddHyp(), reset(), setAvailableHyps(), setCurrentHyp(), setExistingHyps(), and SMESHGUI_MeshTab().
|
private |
Referenced by onHyp(), setExistingHyps(), and SMESHGUI_MeshTab().
|
private |
Referenced by addHyp(), onHyp(), onMoreAddHyp(), setCurrentHyp(), setExistingHyps(), and SMESHGUI_MeshTab().