Version: 9.16.0
SMESHGUI_AddNodeOnFaceOp Class Reference

Operation to split a face into triangles by creating a new node on the face and connecting it to the face nodes. More...

#include <SMESHGUI_AddNodeOnFaceDlg.h>

Inheritance diagram for SMESHGUI_AddNodeOnFaceOp:

Public Types

typedef QList< int > IdList
 

Public Member Functions

 SMESHGUI_AddNodeOnFaceOp ()
 Constructor. More...
 
virtual ~SMESHGUI_AddNodeOnFaceOp ()
 Destructor. More...
 
virtual LightApp_Dialogdlg () const
 Gets dialog of this operation. More...
 
virtual void deactivateCurrentViewOperation ()
 Deactivate current operation in active VTK viewer. More...
 

Static Public Member Functions

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

Protected Types

enum  EntityType { Object , MeshNode , MeshElement }
 

Protected Slots

virtual bool onApply ()
 perform it's intention action: split a face More...
 
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 void onCancel ()
 
void onHelp ()
 

Protected Member Functions

virtual void startOperation () override
 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 stopOperation () override
 Stops operation. More...
 
virtual void activateSelection () override
 Activate selection. More...
 
bool isValid (QString &)
 Check selected face id validity. More...
 
virtual void processStyleEvents (unsigned long event, void *calldata) override
 Process interactor style events () Virtual method. More...
 
virtual void processInteractorEvents (unsigned long event, void *calldata) override
 Process Generic Render Window Interactor events. More...
 
virtual void addObserver ()
 
virtual void removeObserver ()
 
void extractIds (const QStringList &, IdList &) const
 Find in QStringList correct node or element ids representation and append integer(id) to IdList. 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)
 Highlight object in VTK viewer. More...
 
void addOrRemoveIndex (const Handle(SALOME_InteractiveObject)&, const SVTK_TVtkIDsMap &, 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...
 
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
 
virtual bool isValid (SUIT_Operation *) const
 Verifies whether given operator is valid for this one. More...
 

Static Protected Member Functions

static void ProcessStyleEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 Process interactor style events Static method. More...
 
static void ProcessInteractorEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 Process Generic Render Window Interactor events. More...
 

Protected Attributes

vtkInteractorStyle * myInteractorStyle
 
SVTK_RenderWindowInteractor * myRWInteractor
 
double myInteractorStypePriority
 
double myInteractorPriority
 
vtkSmartPointer< vtkCallbackCommand > myStyleEventCallbackCommand
 
vtkSmartPointer< vtkCallbackCommand > myInteractorEventCallbackCommand
 
QString myHelpFileName
 
bool myIsApplyAndClose
 

Private Types

typedef QMap< int, SUIT_SelectionFilter * > Filters
 

Private Slots

void onSelectionDone ()
 SLOT called when selection changed. More...
 
void redisplayPreview ()
 update preview More...
 
void onSelTypeChange ()
 SLOT. More...
 
void onTextChange (const QString &)
 SLOT called when the face id is manually changed. More...
 
void onOpenView ()
 SLOT called when the viewer opened. More...
 
void onCloseView ()
 SLOT called when the viewer closed. More...
 
void pointLocationChanged (bool)
 SLOT called when 'Node on face' checkbox is changed. More...
 
void onDestCoordChanged ()
 SLOT called when destination coordinates are changed. More...
 

Private Attributes

SMESHGUI_AddNodeOnFaceDlgmyDlg
 
SUIT_SelectionFiltermyFilter
 
SMESHGUImySMESHGUI
 
SMESHGUI_MeshEditPreviewmySimulation
 
SMESH_ActormyMeshActor
 
bool myNoPreview
 
bool myUpdateDestination
 
bool myDestCoordChanged
 
vtkCellPicker * myFacePicker
 
Filters myFilters
 
Selection_Mode myDefSelectionMode
 
Selection_Mode myOldSelectionMode
 

Detailed Description

Operation to split a face into triangles by creating a new node on the face and connecting it to the face nodes.

Member Typedef Documentation

◆ Filters

typedef QMap<int, SUIT_SelectionFilter*> SMESHGUI_SelectionOp::Filters
privateinherited

◆ IdList

typedef QList<int> SMESHGUI_SelectionOp::IdList
inherited

Member Enumeration Documentation

◆ EntityType

enum SMESHGUI_SelectionOp::EntityType
protectedinherited
Enumerator
Object 
MeshNode 
MeshElement 

Constructor & Destructor Documentation

◆ SMESHGUI_AddNodeOnFaceOp()

◆ ~SMESHGUI_AddNodeOnFaceOp()

SMESHGUI_AddNodeOnFaceOp::~SMESHGUI_AddNodeOnFaceOp ( )
virtual

Destructor.

References myDlg, myFacePicker, and mySimulation.

Member Function Documentation

◆ abortOperation()

void SMESHGUI_SelectionOp::abortOperation ( )
protectedvirtualinherited

◆ activateSelection()

void SMESHGUI_AddNodeOnFaceOp::activateSelection ( )
overrideprotectedvirtual

Activate selection.

References onSelTypeChange(), and SMESH::SetPointRepresentation().

◆ actor()

SMESH_Actor * SMESHGUI_SelectionOp::actor ( ) const
protectedinherited

◆ addObserver()

◆ addOrRemoveIndex()

void SMESHGUI_SelectionOp::addOrRemoveIndex ( const Handle(SALOME_InteractiveObject)&  obj,
const SVTK_TVtkIDsMap &  indices,
const bool  isModeShift 
)
protectedinherited

◆ commitOperation()

◆ createFilter()

SUIT_SelectionFilter * SMESHGUI_SelectionOp::createFilter ( const int  ) const
protectedvirtualinherited

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_Add0DElemsOnAllNodesOp, SMESHGUI_ConvToQuadOp, SMESHGUI_CreateDualMeshOp, SMESHGUI_GroupOnShapeOp, SMESHGUI_Make2DFrom3DOp, SMESHGUI_MakeFull2DFrom3DOp, SMESHGUI_MeshOp, SMESHGUI_ReorientFacesOp, and SMESHGUI_SplitBiQuadOp.

Referenced by SMESHGUI_SelectionOp::onActivateObject().

◆ deactivateCurrentViewOperation()

void SMESHGUI_InteractiveOp::deactivateCurrentViewOperation ( )
virtualinherited

Deactivate current operation in active VTK viewer.

References SMESHGUI_Operation::getSMESHGUI(), and SMESH::GetViewWindow().

◆ dlg()

LightApp_Dialog * SMESHGUI_AddNodeOnFaceOp::dlg ( ) const
virtual

Gets dialog of this operation.

Return values
LightApp_Dialog*- pointer to dialog of this operation

References myDlg.

Referenced by onApply().

◆ extractIds() [1/2]

void SMESHGUI_SelectionOp::extractIds ( const QStringList &  ids,
IdList list 
) const
protectedinherited

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

References SMESHGUI_SelectionOp::extractIds(), and SMESHGUI_SelectionOp::idChar().

◆ extractIds() [2/2]

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

◆ getSMESHGUI()

◆ highlight()

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

◆ idChar()

QChar SMESHGUI_SelectionOp::idChar ( ) const
protectedvirtualinherited

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

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

◆ initDialog()

void SMESHGUI_SelectionOp::initDialog ( )
protectedvirtualinherited

sets the dialog widgets to state just after operation start

Reimplemented from SMESHGUI_Operation.

◆ isApplyAndClose()

◆ isReadyToStart()

bool SMESHGUI_Operation::isReadyToStart ( ) const
protectedvirtualinherited

◆ isValid() [1/2]

◆ isValid() [2/2]

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_MeshOp, and SMESHGUI_BaseComputeOp.

Referenced by SMESHGUI_MeshOp::isValid().

◆ mesh()

◆ onActivateObject

◆ onApply

◆ onCancel

void SMESHGUI_Operation::onCancel ( )
protectedvirtualslotinherited

◆ onCloseView

void SMESHGUI_AddNodeOnFaceOp::onCloseView ( )
privateslot

SLOT called when the viewer closed.

References mySimulation.

Referenced by startOperation(), and stopOperation().

◆ onDeactivateObject

void SMESHGUI_SelectionOp::onDeactivateObject ( int  )
protectedvirtualslotinherited

Removes filter corresponding to certain object selection widget.

References SMESHGUI_SelectionOp::removeCustomFilters().

Referenced by SMESHGUI_SelectionOp::startOperation().

◆ onDestCoordChanged

void SMESHGUI_AddNodeOnFaceOp::onDestCoordChanged ( )
privateslot

SLOT called when destination coordinates are changed.

References myDlg, SMESHGUI_AddNodeOnFaceDlg::myPointOnFace, myUpdateDestination, pointLocationChanged(), and redisplayPreview().

Referenced by SMESHGUI_AddNodeOnFaceOp().

◆ onHelp

void SMESHGUI_Operation::onHelp ( )
protectedslotinherited

◆ onOk

void SMESHGUI_Operation::onOk ( )
protectedvirtualslotinherited

◆ onOpenView

void SMESHGUI_AddNodeOnFaceOp::onOpenView ( )
privateslot

◆ onSelectionChanged

void SMESHGUI_SelectionOp::onSelectionChanged ( int  )
protectedvirtualslotinherited

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 SMESHGUI_SelectionOp::startOperation().

◆ onSelectionDone

◆ onSelTypeChange

void SMESHGUI_AddNodeOnFaceOp::onSelTypeChange ( )
privateslot

◆ onTextChange

void SMESHGUI_AddNodeOnFaceOp::onTextChange ( const QString &  theText)
privateslot

◆ onTextChanged

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

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 SMESHGUI_SelectionOp::actor(), SMESHGUI_SelectionOp::extractIds(), SMDS_Mesh::FindElement(), SMDS_Mesh::FindNode(), SMESH_Actor::GetObject(), SMESHGUI_SelectionOp::highlight(), SMESHGUI_SelectionOp::selected(), SMESHGUI_SelectionOp::selectionMode(), and SMESHGUI_SelectionOp::selector().

Referenced by SMESHGUI_Add0DElemsOnAllNodesOp::onTextChanged().

◆ pointLocationChanged

◆ processInteractorEvents()

void SMESHGUI_AddNodeOnFaceOp::processInteractorEvents ( unsigned long  theEvent,
void *  theCallData 
)
overrideprotectedvirtual

Process Generic Render Window Interactor events.

Virtual method. Should be overridden in inherited classes.

Reimplemented from SMESHGUI_InteractiveOp.

References SMESH::GetViewWindow(), isValid(), SMESHGUI_AddNodeOnFaceDlg::myDestBtn, myDlg, SMESHGUI_InteractiveOp::myRWInteractor, and mySMESHGUI.

◆ ProcessInteractorEvents()

void SMESHGUI_InteractiveOp::ProcessInteractorEvents ( vtkObject *  object,
unsigned long  event,
void *  clientdata,
void *  calldata 
)
staticprotectedinherited

Process Generic Render Window Interactor events.

Static method. Used by vtkCallbackCommand->SetCallback method.

References SMESHGUI_InteractiveOp::processInteractorEvents().

Referenced by SMESHGUI_InteractiveOp::SMESHGUI_InteractiveOp().

◆ processStyleEvents()

◆ ProcessStyleEvents()

void SMESHGUI_InteractiveOp::ProcessStyleEvents ( vtkObject *  object,
unsigned long  event,
void *  clientdata,
void *  calldata 
)
staticprotectedinherited

Process interactor style events Static method.

Used by vtkCallbackCommand->SetCallback method.

References SMESHGUI_InteractiveOp::processStyleEvents().

Referenced by SMESHGUI_InteractiveOp::SMESHGUI_InteractiveOp().

◆ redisplayPreview

◆ removeCustomFilters()

◆ removeObserver()

◆ selected()

◆ selectedIds()

void SMESHGUI_SelectionOp::selectedIds ( const int  id,
IdList list 
) const
protectedinherited

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

References SMESHGUI_SelectionOp::extractIds().

◆ selectionDone()

◆ selectionMode()

◆ selector()

◆ setDialogActive()

void SMESHGUI_Operation::setDialogActive ( const bool  active)
protectedvirtualinherited

Set according dialog active or inactive.

References MESHCUT::d.

◆ setIsApplyAndClose()

void SMESHGUI_Operation::setIsApplyAndClose ( const bool  theFlag)
protectedvirtualinherited

◆ setSelectionMode()

◆ startOperation()

◆ stopOperation()

void SMESHGUI_AddNodeOnFaceOp::stopOperation ( )
overrideprotectedvirtual

◆ typeById()

int SMESHGUI_SelectionOp::typeById ( const QString &  str,
const EntityType  objtype 
) const
protectedvirtualinherited

◆ viewWindow()

Field Documentation

◆ myDefSelectionMode

Selection_Mode SMESHGUI_SelectionOp::myDefSelectionMode
privateinherited

◆ myDestCoordChanged

bool SMESHGUI_AddNodeOnFaceOp::myDestCoordChanged
private

◆ myDlg

◆ myFacePicker

vtkCellPicker* SMESHGUI_AddNodeOnFaceOp::myFacePicker
private

◆ myFilter

SUIT_SelectionFilter* SMESHGUI_AddNodeOnFaceOp::myFilter
private

◆ myFilters

Filters SMESHGUI_SelectionOp::myFilters
privateinherited

◆ myHelpFileName

◆ myInteractorEventCallbackCommand

vtkSmartPointer<vtkCallbackCommand> SMESHGUI_InteractiveOp::myInteractorEventCallbackCommand
protectedinherited

◆ myInteractorPriority

double SMESHGUI_InteractiveOp::myInteractorPriority
protectedinherited

◆ myInteractorStyle

◆ myInteractorStypePriority

double SMESHGUI_InteractiveOp::myInteractorStypePriority
protectedinherited

◆ myIsApplyAndClose

bool SMESHGUI_Operation::myIsApplyAndClose
protectedinherited

◆ myMeshActor

◆ myNoPreview

bool SMESHGUI_AddNodeOnFaceOp::myNoPreview
private

◆ myOldSelectionMode

Selection_Mode SMESHGUI_SelectionOp::myOldSelectionMode
privateinherited

◆ myRWInteractor

◆ mySimulation

◆ mySMESHGUI

◆ myStyleEventCallbackCommand

vtkSmartPointer<vtkCallbackCommand> SMESHGUI_InteractiveOp::myStyleEventCallbackCommand
protectedinherited

◆ myUpdateDestination

bool SMESHGUI_AddNodeOnFaceOp::myUpdateDestination
private