Version: 8.3.0
SMESHGUI_SelectionOp Class Reference

#include <SMESHGUI_SelectionOp.h>

Inheritance diagram for SMESHGUI_SelectionOp:

Public Types

typedef QList< intIdList
 

Public Member Functions

 SMESHGUI_SelectionOp (const Selection_Mode=ActorSelection)
 List of node or element ids. More...
 
virtual ~SMESHGUI_SelectionOp ()
 

Static Public Member Functions

static void extractIds (const QStringList &, IdList &, const QChar)
 

Protected Types

enum  EntityType { Object, MeshNode, MeshElement }
 

Protected Slots

virtual void onActivateObject (int)
 Installs filter corresponding to certain object selection widget. More...
 
virtual void onDeactivateObject (int)
 Removes filter corresponding to certain object selection widget. More...
 
virtual void onSelectionChanged (int)
 Empty default implementation. More...
 
virtual void onTextChanged (int, const QStringList &)
 Default implementation allowing user to edit selected ids "by hands". More...
 
virtual void onOk ()
 
virtual bool onApply ()
 
virtual void onCancel ()
 
void onHelp ()
 

Protected Member Functions

virtual void startOperation ()
 This enumeration is used in typeById method to distinguish objects, mesh nodes and mesh elements, because node end element ids may overlap. More...
 
virtual void commitOperation ()
 
virtual void abortOperation ()
 
virtual void selectionDone ()
 
virtual void initDialog ()
 sets the dialog widgets to state just after operation start More...
 
virtual SUIT_SelectionFiltercreateFilter (const int) const
 Creates filter being used when certain object selection widget is active If no filter must be used, then function must return 0 if id is negative, then function must return filter for common using independently of active widget. More...
 
void removeCustomFilters ()
 Remove only filters set by this operation (they are in map myFilters ) More...
 
Selection_Mode selectionMode () const
 Return what selection mode is set in VTK viewer. More...
 
void setSelectionMode (const Selection_Mode)
 Set selection mode in VTK viewer. More...
 
void highlight (const Handle(SALOME_InteractiveObject)&, const bool, const bool=true)
 Hilight object in VTK viewer. More...
 
void addOrRemoveIndex (const Handle(SALOME_InteractiveObject)&, const TColStd_MapOfInteger &, const bool isModeShift)
 Select some nodes or elements in VTK. More...
 
SVTK_ViewWindow * viewWindow () const
 
SVTK_Selector * selector () const
 
virtual void selected (QStringList &, SMESHGUI_Dialog::TypesList &, QStringList &) const
 Get names, types and ids of selected objects. More...
 
virtual int typeById (const QString &, const EntityType) const
 Find type by id. More...
 
virtual QChar idChar () const
 Char using to divide <entry> and <id> in string id representation. By default, '#'. More...
 
void selectedIds (const int, IdList &) const
 Try to find in certain object selection widget selected node or element ids and return it. More...
 
void extractIds (const QStringList &, IdList &) const
 Find in QStringList correct node or element ids representation and append integer(id) to IdList. More...
 
SMESH::SMESH_Mesh_var mesh () const
 Return selected mesh if selection mode isn't ActorSelection and only one object is selected. More...
 
SMESH_Actoractor () const
 Return actor according to selected mesh if selection mode isn't ActorSelection. More...
 
virtual bool isReadyToStart () const
 
virtual void setIsApplyAndClose (const bool theFlag)
 
virtual bool isApplyAndClose () const
 
virtual void setDialogActive (const bool)
 Set according dialog active or inactive. More...
 
SMESHGUIgetSMESHGUI () const
 
bool isStudyLocked (const bool=true) const
 Verifies whether study of operation is locked. More...
 
 _PTR (Study) studyDS() const
 
virtual bool isValid (SUIT_Operation *) const
 Verifies whether given operator is valid for this one. More...
 

Protected Attributes

QString myHelpFileName
 
bool myIsApplyAndClose
 

Private Types

typedef QMap< int,
SUIT_SelectionFilter * > 
Filters
 

Private Attributes

Filters myFilters
 
Selection_Mode myDefSelectionMode
 
Selection_Mode myOldSelectionMode
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
Object 
MeshNode 
MeshElement 

Constructor & Destructor Documentation

SMESHGUI_SelectionOp::SMESHGUI_SelectionOp ( const Selection_Mode  mode = ActorSelection)

List of node or element ids.

SMESHGUI_SelectionOp::~SMESHGUI_SelectionOp ( )
virtual

References removeCustomFilters().

Member Function Documentation

void SMESHGUI_SelectionOp::abortOperation ( )
protectedvirtual
SMESH_Actor * SMESHGUI_SelectionOp::actor ( ) const
protected

Return actor according to selected mesh if selection mode isn't ActorSelection.

References SMESH::FindActorByObject(), and mesh().

Referenced by SMESHGUI_RevolutionDlg::ClickOnApply(), SMESHGUI_Make2DFrom3DOp::compute2DMesh(), SMESHGUI_ShapeByMeshOp::onElemIdChanged(), and onTextChanged().

void SMESHGUI_SelectionOp::addOrRemoveIndex ( const Handle(SALOME_InteractiveObject)&  obj,
const TColStd_MapOfInteger &  indices,
const bool  isModeShift 
)
protected

Select some nodes or elements in VTK.

References selector().

Referenced by SMESHGUI_FindElemByPointOp::onElemSelected(), and SMESHGUI_ReorientFacesOp::onTextChange().

void SMESHGUI_SelectionOp::commitOperation ( )
protectedvirtual
SUIT_SelectionFilter * SMESHGUI_SelectionOp::createFilter ( const int  ) const
protectedvirtual

Creates filter being used when certain object selection widget is active If no filter must be used, then function must return 0 if id is negative, then function must return filter for common using independently of active widget.

Reimplemented in SMESHGUI_Make2DFrom3DOp, SMESHGUI_Add0DElemsOnAllNodesOp, SMESHGUI_MeshOp, SMESHGUI_SplitBiQuadOp, SMESHGUI_ConvToQuadOp, SMESHGUI_GroupOnShapeOp, and SMESHGUI_ReorientFacesOp.

Referenced by onActivateObject().

void SMESHGUI_SelectionOp::extractIds ( const QStringList &  ids,
IdList list,
const QChar  idchar 
)
static
void SMESHGUI_SelectionOp::extractIds ( const QStringList &  ids,
IdList list 
) const
protected

Find in QStringList correct node or element ids representation and append integer(id) to IdList.

References extractIds(), and idChar().

void SMESHGUI_SelectionOp::highlight ( const Handle(SALOME_InteractiveObject)&  obj,
const bool  hilight,
const bool  immediately = true 
)
protected

Hilight object in VTK viewer.

References viewWindow().

Referenced by SMESHGUI_ReorientFacesOp::onTextChange(), and onTextChanged().

QChar SMESHGUI_SelectionOp::idChar ( ) const
protectedvirtual

Char using to divide <entry> and <id> in string id representation. By default, '#'.

Referenced by extractIds(), selected(), and typeById().

void SMESHGUI_SelectionOp::initDialog ( )
protectedvirtual

sets the dialog widgets to state just after operation start

Reimplemented from SMESHGUI_Operation.

bool SMESHGUI_Operation::isApplyAndClose ( ) const
protectedvirtualinherited
bool SMESHGUI_Operation::isReadyToStart ( ) const
protectedvirtualinherited
bool SMESHGUI_Operation::isStudyLocked ( const bool  theMess = true) const
protectedinherited

Verifies whether study of operation is locked.

Parameters
theMess- specifies whether message box must be shown if study is locked
Returns
State of study.

Verifies whether study of operation is locked. If second parameter is TRUE and study is locked when corresponding message box appears

References SMESHGUI::desktop(), and studyDS().

Referenced by SMESHGUI_Operation::isReadyToStart(), SMESHGUI_GroupOnShapeOp::onApply(), SMESHGUI_ReorientFacesOp::onApply(), SMESHGUI_MakeNodeAtPointOp::onApply(), SMESHGUI_MeshOp::onApply(), and SMESHGUI_Make2DFrom3DOp::onApply().

bool SMESHGUI_Operation::isValid ( SUIT_Operation *  theOtherOp) const
protectedvirtualinherited

Verifies whether given operator is valid for this one.

Parameters
theOtherOp- other operation
Returns
Returns TRUE if the given operator is valid for this one, FALSE otherwise

Virtual method redefined from base class verifies whether given operator is valid for this one (i.e. can be started "above" this operator). In current implementation method returns false if theOtherOp operation is not intended for deleting objects or mesh elements.

Reimplemented in SMESHGUI_BaseComputeOp, and SMESHGUI_MeshOp.

Referenced by SMESHGUI_MeshOp::isValid().

void SMESHGUI_SelectionOp::onActivateObject ( int  id)
protectedvirtualslot
bool SMESHGUI_Operation::onApply ( )
protectedvirtualslotinherited
void SMESHGUI_Operation::onCancel ( )
protectedvirtualslotinherited
void SMESHGUI_SelectionOp::onDeactivateObject ( int  id)
protectedvirtualslot

Removes filter corresponding to certain object selection widget.

References removeCustomFilters().

Referenced by startOperation().

void SMESHGUI_Operation::onHelp ( )
protectedslotinherited
void SMESHGUI_Operation::onOk ( )
protectedvirtualslotinherited
void SMESHGUI_SelectionOp::onSelectionChanged ( int  )
protectedvirtualslot

Empty default implementation.

In successors it may be used for more advanced selection checking. This slot is connected to signal when the selection changed in some object selection widget

Referenced by startOperation().

void SMESHGUI_SelectionOp::onTextChanged ( int  ,
const QStringList &  list 
)
protectedvirtualslot

Default implementation allowing user to edit selected ids "by hands".

In order to run default mechanism, you must set for some object selection widget the "name indication" to "ListOfNames", "read only" state to false and connect the dialog's signal "objectChanged" to this slot Warning: this mechanism can process only integer ids, NOT MESH OR GROUP NAMES!!!

References actor(), extractIds(), SMDS_Mesh::FindElement(), SMDS_Mesh::FindNode(), SMESH_Actor::GetObject(), highlight(), selected(), selectionMode(), and selector().

Referenced by SMESHGUI_Add0DElemsOnAllNodesOp::onTextChanged().

void SMESHGUI_SelectionOp::removeCustomFilters ( )
protected
void SMESHGUI_SelectionOp::selected ( QStringList &  ,
SMESHGUI_Dialog::TypesList &  ,
QStringList &   
) const
protectedvirtual
void SMESHGUI_SelectionOp::selectedIds ( const int  id,
IdList list 
) const
protected

Try to find in certain object selection widget selected node or element ids and return it.

References extractIds().

Selection_Mode SMESHGUI_SelectionOp::selectionMode ( ) const
protected
void SMESHGUI_Operation::setDialogActive ( const bool  active)
protectedvirtualinherited

Set according dialog active or inactive.

References MESHCUT::d, and SMESHGUI_Dialog::setContentActive().

void SMESHGUI_Operation::setIsApplyAndClose ( const bool  theFlag)
protectedvirtualinherited
int SMESHGUI_SelectionOp::typeById ( const QString &  str,
const EntityType  objtype 
) const
protectedvirtual

Field Documentation

Selection_Mode SMESHGUI_SelectionOp::myDefSelectionMode
private

Referenced by startOperation().

Filters SMESHGUI_SelectionOp::myFilters
private
bool SMESHGUI_Operation::myIsApplyAndClose
protectedinherited
Selection_Mode SMESHGUI_SelectionOp::myOldSelectionMode
private