Version: 9.16.0
SMESHGUI_MeshOp Class Reference

Operation for mech creation or editing. More...

#include <SMESHGUI_MeshOp.h>

Inheritance diagram for SMESHGUI_MeshOp:

Public Types

enum  HypType { Algo = 0 , MainHyp , AddHyp , NbHypTypes }
 
enum  MeshType {
  MT_ANY = 0 , MT_TRIANGULAR , MT_QUADRILATERAL , MT_TETRAHEDRAL ,
  MT_HEXAHEDRAL
}
 
typedef std::pair< SMESH::SMESH_Hypothesis_var, QString > THypItem
 
typedef QList< THypItemTHypList
 
typedef int THypType
 
typedef QMap< THypType, THypListTType2HypList
 
typedef int THypDim
 
typedef QMap< THypDim, TType2HypListTDim2Type2HypList
 
typedef QList< int > IdList
 

Public Member Functions

 SMESHGUI_MeshOp (const bool, const bool=true)
 Constructor. More...
 
virtual ~SMESHGUI_MeshOp ()
 Destructor. More...
 
virtual LightApp_Dialogdlg () const
 Gets dialog of this operation. 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 ()
 Creates or edits mesh. More...
 
void onCreateHyp (const int, const int)
 Create hypothesis. More...
 
void onEditHyp (const int, const int)
 Calls plugin methods for hypothesis editing. More...
 
void onHypoSet (const QString &)
 Creates and selects hypothesis of hypotheses set. More...
 
void onGeomSelectionByMesh (bool)
 SLOT. More...
 
void onPublishShapeByMeshDlg (SUIT_Operation *)
 SLOT. More...
 
void onCloseShapeByMeshDlg (SUIT_Operation *)
 SLOT. More...
 
void onAlgoSelected (const int, const int=-1)
 Set available algos and hypos according to the selected algorithm. More...
 
void onHypoCreated (int)
 Necessary steps after hypothesis creation. More...
 
void onHypoEdited (int)
 Necessary steps after hypothesis edition. More...
 
void onAlgoSetByMeshType (const int, const int)
 SLOT. 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 ()
 Creates dialog if necessary and shows it. More...
 
virtual void commitOperation ()
 Selects a recently created mesh or sub-mesh if necessary. More...
 
virtual void selectionDone ()
 
virtual SUIT_SelectionFiltercreateFilter (const int) const
 Creates selection filter. More...
 
virtual bool isValid (SUIT_Operation *) const
 Verifies whether given operator is valid for this one. More...
 
void extractIds (const QStringList &, IdList &) const
 Find in QStringList correct node or element ids representation and append integer(id) to IdList. More...
 
virtual void abortOperation ()
 
virtual void initDialog ()
 sets the dialog widgets to state just after operation start 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
 

Protected Attributes

QString myHelpFileName
 
bool myIsApplyAndClose
 

Private Types

typedef QList< HypothesisData * > THypDataList
 
typedef QMap< QString, boolTHypLabelIsAppMap
 
typedef QMap< int, SUIT_SelectionFilter * > Filters
 

Private Member Functions

bool isValid (QString &) const
 Verifies validity of input data. More...
 
bool isCompatibleToGeometry (HypothesisData *, const int)
 check compatibility of the geometry More...
 
bool isCompatibleToMeshType (HypothesisData *, const int)
 check compatibility of the mesh type More...
 
void availableHyps (const int, const int, QStringList &, THypDataList &, HypothesisData *=0, HypothesisData *=0, const QString &="")
 Get available hypotheses or algorithms. More...
 
void existingHyps (const int, const int, _PTR(SObject), QStringList &, THypList &, HypothesisData *=0) const
 Gets existing hypotheses or algorithms. More...
 
HypothesisDatahypData (const int, const int, const int)
 access to hypothesis data More...
 
void createHypothesis (const int, const int, const QString &)
 Create hypothesis and update dialog. More...
 
bool createMesh (QString &, QStringList &)
 Creates mesh. More...
 
bool createSubMesh (QString &, QStringList &)
 Create sub-mesh. More...
 
bool editMeshOrSubMesh (QString &, QStringList &)
 Edits mesh or sub-mesh. More...
 
void createSubMeshOnInternalEdges (SMESH::SMESH_Mesh_ptr mesh, GEOM::GEOM_Object_ptr mainShape)
 Create a sub-mesh on internal edges in the case where the global algorithm is of type 1D-2D[-3D] so that the internal edges would remain not meshed. More...
 
bool checkSubMeshConcurrency (SMESH::SMESH_Mesh_ptr mesh, SMESH::SMESH_subMesh_ptr submesh, bool askUser=false)
 Checks if a concurrent sub-meshes appear as result of sub-mesh creation/edition and, if (askUser) , proposes the uses to set up a desired order of sub-mesh computation. More...
 
int currentHyp (const int, const int) const
 Return index of current hypothesis or algorithm. More...
 
bool isSelectedHyp (int, int, int) const
 Checks if a hypothesis is selected. More...
 
int nbDlgHypTypes (const int) const
 Returns nb of HypType's taking into account possible several selected additional hypotheses which are coded as additional HypType's. More...
 
bool isAccessibleDim (const int) const
 Returns true if hypotheses of given dim can be assigned. More...
 
void setCurrentHyp (const int, const int, const int, const bool=false)
 Sets current hypothesis or algorithms. More...
 
void setDefaultName (const QString &prefix="") const
 Generates default and sets mesh/submesh name. More...
 
SMESH::SMESH_Hypothesis_var getAlgo (const int)
 Gets algorithm or creates it if necessary. More...
 
void readMesh ()
 Reads parameters of an edited mesh/sub-mesh and assigns them to the dialog. More...
 
QString name (_PTR(SObject)) const
 Gets name of object. More...
 
int find (const SMESH::SMESH_Hypothesis_var &, const THypList &) const
 Finds hypothesis in input list. More...
 
SMESH::SMESH_Hypothesis_var getInitParamsHypothesis (const QString &, const QString &, const SMESH::HypInitParams *prm=0) const
 If create or edit a submesh, return a hypothesis holding parameters used to mesh a sub-shape. More...
 
void initHypCreator (SMESHGUI_GenericHypothesisCreator *aCreator)
 initialize a hypothesis creator More...
 
bool getAverageSize (double &averageSize)
 Ask the user to enter an average size which will be used to create hypotheses of a hypo-set basing on this size. More...
 
bool isSubshapeOk () const
 check if selected shape is a sub-shape of the shape to mesh More...
 
char * isSubmeshIgnored () const
 Return name of the algorithm that does not support sub-meshes and makes sub-mesh creation useless. More...
 
 _PTR (SObject) getSubmeshByGeom() const
 
void selectObject (_PTR(SObject)) const
 Selects a SObject. More...
 
void updateMeshTypeList ()
 Update available list of mesh types. More...
 
void updateHypoSets ()
 Update available list of hypothesis sets. More...
 
void setFilteredAlgoData ()
 Update list of algorithms and hypotheses according to currently selected algorithm, geometry and mesh type. More...
 
QStringList getHypoNames ()
 Return names of all existing hypotheses. More...
 
void logSmeshParams ()
 Log meshers info. More...
 

Private Attributes

SMESHGUI_MeshDlgmyDlg
 
SMESHGUI_ShapeByMeshOpmyShapeByMeshOp
 
bool myToCreate
 
bool myIsMesh
 
bool myIsOnGeometry
 TRUE if edited mesh is based on geometry. More...
 
bool myHasConcurrentSubBefore
 
bool myIsInvalidSubMesh
 "invalid sub-mesh" is edited More...
 
QString myGeomEntry
 
GEOM::GEOM_Object_var myGeom
 
TDim2Type2HypList myExistingHyps
 all hypothesis of SMESH module More...
 
TDim2Type2HypList myObjHyps
 hypothesis assigned to the current More...
 
THypDataList myAvailableHypData [4][NbHypTypes]
 
QString myLastGeomEntry
 
THypLabelIsAppMap myHypMapIsApplicable
 
bool myIgnoreAlgoSelection
 
int myDim
 
int myType
 
int myMaxShapeDim
 
HypothesesSetmyHypoSet
 
double myAverageSize
 
QString myObjectToSelect
 
Filters myFilters
 
Selection_Mode myDefSelectionMode
 
Selection_Mode myOldSelectionMode
 

Detailed Description

Operation for mech creation or editing.

This operation is used for mech creation or editing.

Member Typedef Documentation

◆ Filters

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

◆ IdList

typedef QList<int> SMESHGUI_SelectionOp::IdList
inherited

◆ TDim2Type2HypList

◆ THypDataList

◆ THypDim

◆ THypItem

typedef std::pair<SMESH::SMESH_Hypothesis_var, QString> SMESHGUI_MeshOp::THypItem

◆ THypLabelIsAppMap

typedef QMap<QString, bool> SMESHGUI_MeshOp::THypLabelIsAppMap
private

◆ THypList

◆ THypType

◆ TType2HypList

Member Enumeration Documentation

◆ EntityType

enum SMESHGUI_SelectionOp::EntityType
protectedinherited
Enumerator
Object 
MeshNode 
MeshElement 

◆ HypType

Enumerator
Algo 
MainHyp 
AddHyp 
NbHypTypes 

◆ MeshType

Enumerator
MT_ANY 
MT_TRIANGULAR 
MT_QUADRILATERAL 
MT_TETRAHEDRAL 
MT_HEXAHEDRAL 

Constructor & Destructor Documentation

◆ SMESHGUI_MeshOp()

SMESHGUI_MeshOp::SMESHGUI_MeshOp ( const bool  theToCreate,
const bool  theIsMesh = true 
)

Constructor.

Parameters
theToCreate- if this parameter is true then operation is used for creation, for editing otherwise

Initialize operation

References myIsOnGeometry, and myMaxShapeDim.

◆ ~SMESHGUI_MeshOp()

SMESHGUI_MeshOp::~SMESHGUI_MeshOp ( )
virtual

Destructor.

References myDlg.

Member Function Documentation

◆ _PTR()

◆ abortOperation()

void SMESHGUI_SelectionOp::abortOperation ( )
protectedvirtualinherited

◆ actor()

SMESH_Actor * SMESHGUI_SelectionOp::actor ( ) const
protectedinherited

◆ addOrRemoveIndex()

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

◆ availableHyps()

void SMESHGUI_MeshOp::availableHyps ( const int  theDim,
const int  theHypType,
QStringList &  theHyps,
THypDataList theDataList,
HypothesisData thePrevAlgoData = 0,
HypothesisData theNextAlgoData = 0,
const QString &  = "" 
)
private

Get available hypotheses or algorithms.

Parameters
theDim- specifies dimension of returned hypotheses/algorifms
theHypType- specifies whether algorims or hypotheses or additional ones are retrieved (possible values are in HypType enumeration)
theHyps- output list of hypotheses' names
thePrevAlgoData- to select hypos able to be used by previously algo (optional)
theNextAlgoData- to select hypos able to be used by next algo (optional)
theMeshType- type of mesh for filtering algorithms (optional)

Get available hypotheses or algorithm in accordance with input parameters. Result (theHyps) optionally depends on the following:

  • selected algorithm(s)
  • selected geometry
  • selected mesh type

References AddHyp, Algo, SMESH::GetAvailableHypotheses(), SMESH::GetGroupTitle(), SMESH::GetHypothesisData(), HypothesisData::GroupID, isCompatible(), isCompatibleToGeometry(), isCompatibleToMeshType(), HypothesisData::Label, myIsMesh, myIsOnGeometry, and HypothesisData::Priority.

Referenced by onAlgoSelected(), readMesh(), setFilteredAlgoData(), and updateHypoSets().

◆ checkSubMeshConcurrency()

bool SMESHGUI_MeshOp::checkSubMeshConcurrency ( SMESH::SMESH_Mesh_ptr  mesh,
SMESH::SMESH_subMesh_ptr  submesh,
bool  askUser = false 
)
private

Checks if a concurrent sub-meshes appear as result of sub-mesh creation/edition and, if (askUser) , proposes the uses to set up a desired order of sub-mesh computation.

Returns true if a sub-mesh concurrency detected.

References _PTR(), SMESHGUI_MeshDlg::getActiveObject(), SMESHGUI::GetSMESHGUI(), SMESHGUI_SelectionOp::mesh(), myDlg, myToCreate, SMESHGUI_SelectionOp::onActivateObject(), SMESHGUI::OnGUIEvent(), SMESHOp::OpMeshOrder, selectionDone(), and selectObject().

Referenced by createSubMesh(), editMeshOrSubMesh(), and readMesh().

◆ commitOperation()

void SMESHGUI_MeshOp::commitOperation ( )
protectedvirtual

Selects a recently created mesh or sub-mesh if necessary.

Virtual method redefined from base class called when operation is committed selects a recently created mesh or sub-mesh if necessary. Allows to perform selection when the custom selection filters are removed.

Reimplemented from SMESHGUI_SelectionOp.

References SMESHGUI_SelectionOp::commitOperation(), and myObjectToSelect.

◆ createFilter()

SUIT_SelectionFilter * SMESHGUI_MeshOp::createFilter ( const int  theId) const
protectedvirtual

Creates selection filter.

Parameters
theId- identifier of current selection widget
Return values
SUIT_SelectionFilter*- pointer to the created filter or null

Creates selection filter in accordance with identifier of current selection widget

Reimplemented from SMESHGUI_SelectionOp.

References SMESHGUI_MeshDlg::Geom, SMESH::MESH, SMESHGUI_MeshDlg::Mesh, SMESH::MESHorSUBMESH, myToCreate, and SMESHGUI_MeshDlg::Obj.

◆ createHypothesis()

void SMESHGUI_MeshOp::createHypothesis ( const int  theDim,
const int  theType,
const QString &  theTypeName 
)
private

Create hypothesis and update dialog.

Parameters
theDim- dimension of hypothesis to be created
theType- hypothesis category (algorithm, hypothesis, additional hypothesis)
theTypeName- specifies hypothesis to be created

References HypothesisData::ClientLibName, SMESHGUI_GenericHypothesisCreator::create(), SMESH::CreateHypothesis(), getHypoNames(), SMESH::GetHypothesisCreator(), SMESH::GetHypothesisData(), getInitParamsHypothesis(), initHypCreator(), HypothesisData::Label, myDim, myDlg, myType, onHypoCreated(), SMESHGUI_SelectionOp::removeCustomFilters(), and HypothesisData::ServerLibName.

Referenced by onCreateHyp(), and onHypoSet().

◆ createMesh()

bool SMESHGUI_MeshOp::createMesh ( QString &  theMess,
QStringList &  theEntryList 
)
private

◆ createSubMesh()

bool SMESHGUI_MeshOp::createSubMesh ( QString &  theMess,
QStringList &  theEntryList 
)
private

Create sub-mesh.

Parameters
theMess- Output parameter intended for returning error message
theEntryList- List of entries of published objects
Return values
bool- TRUE if sub-mesh is created, FALSE otherwise

References _PTR(), AddHyp, SMESH::AddHypothesisOnSubMesh(), checkSubMeshConcurrency(), currentHyp(), SMESH::DIM_0D, SMESH::DIM_3D, SMESHGUI_MeshDlg::Geom, getAlgo(), SMESHGUI::GetSMESHGen(), isAccessibleDim(), MainHyp, SMESHGUI_MeshDlg::Mesh, myDlg, myExistingHyps, myIsInvalidSubMesh, nbDlgHypTypes(), SMESHGUI_MeshDlg::Obj, selectionDone(), selectObject(), and SMESH::SetName().

Referenced by onApply().

◆ createSubMeshOnInternalEdges()

void SMESHGUI_MeshOp::createSubMeshOnInternalEdges ( SMESH::SMESH_Mesh_ptr  mesh,
GEOM::GEOM_Object_ptr  mainShape 
)
private

◆ currentHyp()

int SMESHGUI_MeshOp::currentHyp ( const int  theDim,
const int  theHypType 
) const
private

Return index of current hypothesis or algorithm.

Parameters
theDim- dimension of hypothesis or algorithm
theHypType- Type of hypothesis (Algo, MainHyp, AddHyp)
Return values
int- index of current hypothesis or algorithm, -1 if None selected

References SMESHGUI_MeshTab::currentHyp(), myDlg, and SMESHGUI_MeshDlg::tab().

Referenced by createMesh(), createSubMesh(), editMeshOrSubMesh(), getAlgo(), isSelectedHyp(), logSmeshParams(), onAlgoSelected(), onHypoCreated(), readMesh(), and setFilteredAlgoData().

◆ dlg()

LightApp_Dialog * SMESHGUI_MeshOp::dlg ( ) const
virtual

Gets dialog of this operation.

Return values
LightApp_Dialog*- pointer to dialog of this operation

References myDlg.

Referenced by getAverageSize(), isValid(), onApply(), and onEditHyp().

◆ editMeshOrSubMesh()

bool SMESHGUI_MeshOp::editMeshOrSubMesh ( QString &  theMess,
QStringList &  theEntryList 
)
private

Edits mesh or sub-mesh.

Parameters
theMess- Output parameter intended for returning error message
theEntryList- List of entries of published objects
Return values
bool- TRUE if mesh is edited successfully, FALSE otherwise

Assigns new name hypotheses and algorithms to the mesh or sub-mesh

References _PTR(), AddHyp, SMESH::AddHypothesisOnMesh(), SMESH::AddHypothesisOnSubMesh(), Algo, checkSubMeshConcurrency(), createSubMeshOnInternalEdges(), currentHyp(), SMESH::DIM_0D, SMESH::DIM_2D, SMESH::DIM_3D, existingHyps(), find(), getAlgo(), SMESHGUI::GetSMESHGen(), isSelectedHyp(), MainHyp, myDlg, myExistingHyps, myHasConcurrentSubBefore, myIsOnGeometry, myObjHyps, nbDlgHypTypes(), SMESHGUI_MeshDlg::Obj, SMESH::RemoveHypothesisOrAlgorithmOnMesh(), and SMESH::SetName().

Referenced by onApply().

◆ existingHyps()

void SMESHGUI_MeshOp::existingHyps ( const int  theDim,
const int  theHypType,
_PTR(SObject)  theFather,
QStringList &  theHyps,
THypList theHypList,
HypothesisData theAlgoData = 0 
) const
private

Gets existing hypotheses or algorithms.

Parameters
theDim- specifies dimension of returned hypotheses/algorifms
theHypType- specifies whether algorims or hypotheses or additional ones are retrieved (possible values are in HypType enumeration)
theFather- start object for finding ( may be component, mesh, or sub-mesh )
theHyps- output list of names.
theHypVars- output list of variables.
theAlgoData- to select hypos able to be used by this algo (optional)

Gets existing (i.e. already created) hypotheses or algorithm in accordance with input parameters.

WARNING: when using this method to get hyps existing in Mesh component, call availableHyps() before in order to get only hyps of available types that was filtered by availableHyps()

References _PTR(), AddHyp, Algo, HypothesisData::Dim, SMESH::GetHypothesisData(), HypothesisData::IsAuxOrNeedHyp, isCompatible(), myAvailableHypData, SMESH::Tag_AlgorithmsRoot, SMESH::Tag_HypothesisRoot, SMESH::Tag_RefOnAppliedAlgorithms, and SMESH::Tag_RefOnAppliedHypothesis.

Referenced by editMeshOrSubMesh(), getAlgo(), isSubmeshIgnored(), onAlgoSelected(), onHypoCreated(), and readMesh().

◆ 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

◆ find()

int SMESHGUI_MeshOp::find ( const SMESH::SMESH_Hypothesis_var &  theHyp,
const THypList theHypList 
) const
private

Finds hypothesis in input list.

Parameters
theHyp- hypothesis to be found
theHypList- input list of hypotheses
Return values
int- index of hypothesis or -1 if it is not found

Finds position of hypothesis in input list

Referenced by editMeshOrSubMesh(), onAlgoSelected(), and readMesh().

◆ getAlgo()

SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo ( const int  theDim)
private

Gets algorithm or creates it if necessary.

Parameters
theDim- specifies dimension of returned hypotheses/algorifms
Return values
SMESH::SMESH_Hypothesis_var- algorithm

Gets algorithm or creates it if necessary

References _PTR(), Algo, HypothesisData::ClientLibName, SMESHGUI_GenericHypothesisCreator::create(), SMESH::CreateHypothesis(), currentHyp(), existingHyps(), SMESH::GetHypothesisCreator(), SMESH::GetHypothesisData(), HypothesisData::Label, myAvailableHypData, myDlg, and myExistingHyps.

Referenced by createMesh(), createSubMesh(), createSubMeshOnInternalEdges(), and editMeshOrSubMesh().

◆ getAverageSize()

bool SMESHGUI_MeshOp::getAverageSize ( double &  averageSize)
private

Ask the user to enter an average size which will be used to create hypotheses of a hypo-set basing on this size.

Parameters
[out]averageSize- average element size
Returns
bool - false if the user canceled the dialog

References dlg(), SMESHGUI_GenericHypothesisCreator::edit(), HypothesesSet::getCommonHypoSetHypoType(), SMESH::GetHypothesisCreator(), SMESH::GetHypothesisData(), getInitParamsHypothesis(), hypData(), initHypCreator(), myDlg, onHypoEdited(), HypothesisData::ServerLibName, and HypothesisData::TypeName.

Referenced by onHypoSet().

◆ getHypoNames()

QStringList SMESHGUI_MeshOp::getHypoNames ( )
private

Return names of all existing hypotheses.

References myExistingHyps.

Referenced by createHypothesis(), createSubMeshOnInternalEdges(), and onHypoSet().

◆ getInitParamsHypothesis()

SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getInitParamsHypothesis ( const QString &  aHypType,
const QString &  aServerLib,
const SMESH::HypInitParams aParams = 0 
) const
private

If create or edit a submesh, return a hypothesis holding parameters used to mesh a sub-shape.

Parameters
aHypType- The hypothesis type name
aServerLib- Server library name
hypData- The structure holding the hypothesis type etc.
Return values
SMESH::SMESH_Hypothesis_var- the hypothesis holding parameter values

References _PTR(), SMESH::HypInitParams::averageLength, SMESHGUI_MeshDlg::Geom, SMESH::GetShapeOnMeshOrSubMesh(), SMESHGUI::GetSMESHGen(), SMESHGUI_MeshDlg::Mesh, myDlg, myIsMesh, myToCreate, SMESHGUI_MeshDlg::Obj, SMESH::HypInitParams::quadDominated, and SMESH::HypInitParams::way.

Referenced by createHypothesis(), createSubMeshOnInternalEdges(), getAverageSize(), onEditHyp(), and onHypoSet().

◆ getSMESHGUI()

◆ highlight()

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

◆ hypData()

HypothesisData * SMESHGUI_MeshOp::hypData ( const int  theDim,
const int  theHypType,
const int  theIndex 
)
private

access to hypothesis data

Parameters
theDim- hyp dimension
theHypType- hyp type (Algo,MainHyp or AddHyp)
theIndex- index in the list
Return values
HypothesisData*- result data, may be 0

References SMESH::DIM_3D, myAvailableHypData, and NbHypTypes.

Referenced by getAverageSize(), logSmeshParams(), onAlgoSelected(), onHypoCreated(), and setFilteredAlgoData().

◆ 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.

◆ initHypCreator()

◆ isAccessibleDim()

bool SMESHGUI_MeshOp::isAccessibleDim ( const int  theDim) const
private

Returns true if hypotheses of given dim can be assigned.

Parameters
theDim- hypotheses dimension
Return values
bool- result

References SMESHGUI_MeshDlg::isTabEnabled(), and myDlg.

Referenced by createMesh(), createSubMesh(), createSubMeshOnInternalEdges(), and onAlgoSelected().

◆ isApplyAndClose()

bool SMESHGUI_Operation::isApplyAndClose ( ) const
protectedvirtualinherited

◆ isCompatibleToGeometry()

bool SMESHGUI_MeshOp::isCompatibleToGeometry ( HypothesisData theAlgoData,
const int  theDim 
)
private

check compatibility of the geometry

Parameters
theAlgoData- to select hypos able to be used by this algo
theDim- algo dimension
Return values
bool- check result

References SMESH::IsApplicable(), myGeom, myGeomEntry, myHypMapIsApplicable, myIsMesh, myLastGeomEntry, and HypothesisData::TypeName.

Referenced by availableHyps().

◆ isCompatibleToMeshType()

bool SMESHGUI_MeshOp::isCompatibleToMeshType ( HypothesisData theAlgoData,
const int  theDim 
)
private

check compatibility of the mesh type

Parameters
theAlgoData- to select hypos able to be used by this algo
theDim- algo dimension
Return values
bool- check result

References SMESHGUI_MeshDlg::currentMeshType(), MT_ANY, MT_HEXAHEDRAL, MT_QUADRILATERAL, MT_TETRAHEDRAL, MT_TRIANGULAR, myDlg, and HypothesisData::OutputTypes.

Referenced by availableHyps().

◆ isReadyToStart()

bool SMESHGUI_Operation::isReadyToStart ( ) const
protectedvirtualinherited

◆ isSelectedHyp()

bool SMESHGUI_MeshOp::isSelectedHyp ( int  theDim,
int  theHypType,
int  theIndex 
) const
private

Checks if a hypothesis is selected.

References AddHyp, currentHyp(), and nbDlgHypTypes().

Referenced by editMeshOrSubMesh().

◆ isSubmeshIgnored()

char * SMESHGUI_MeshOp::isSubmeshIgnored ( ) const
private

Return name of the algorithm that does not support sub-meshes and makes sub-mesh creation useless.

Return values
char*- string is to be deleted!!!

References _PTR(), Algo, existingHyps(), SMESHGUI_MeshDlg::Geom, SMESH::GetHypothesisData(), HypothesisData::InputTypes, HypothesisData::IsSupportSubmeshes, SMESHGUI_MeshDlg::Mesh, myDlg, myIsMesh, and myToCreate.

◆ isSubshapeOk()

bool SMESHGUI_MeshOp::isSubshapeOk ( ) const
private

check if selected shape is a sub-shape of the shape to mesh

Return values
bool- check result

References _PTR(), SMESH::ContainsSubShape(), SMESHGUI_MeshDlg::Geom, SMESHGUI_MeshDlg::Mesh, SMESHGUI_SelectionOp::mesh(), myDlg, myIsMesh, and myToCreate.

Referenced by isValid().

◆ isValid() [1/2]

bool SMESHGUI_MeshOp::isValid ( QString &  theMess) const
private

Verifies validity of input data.

Parameters
theMess- Output parameter intended for returning error message
Return values
bool- TRUE if input data is valid, false otherwise

Verifies validity of input data. This method is called when "Apply" or "OK" button is pressed before mesh creation or editing.

References _PTR(), dlg(), SMESHGUI_MeshDlg::Geom, isSubshapeOk(), SMESHGUI_MeshDlg::Mesh, myDlg, myIsInvalidSubMesh, myIsMesh, myToCreate, and SMESHGUI_MeshDlg::Obj.

◆ isValid() [2/2]

bool SMESHGUI_MeshOp::isValid ( SUIT_Operation *  theOp) const
protectedvirtual

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

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 from SMESHGUI_Operation.

References SMESHGUI_Operation::isValid().

Referenced by onApply().

◆ logSmeshParams()

void SMESHGUI_MeshOp::logSmeshParams ( )
private

◆ mesh()

◆ name()

QString SMESHGUI_MeshOp::name ( _PTR(SObject)  theSO) const
private

Gets name of object.

Parameters
theSO- SObject
Return values
QString- name of object

Gets name of object

References _PTR().

Referenced by createMesh(), and readMesh().

◆ nbDlgHypTypes()

int SMESHGUI_MeshOp::nbDlgHypTypes ( const int  dim) const
private

Returns nb of HypType's taking into account possible several selected additional hypotheses which are coded as additional HypType's.

References myDlg, SMESHGUI_MeshTab::nbAddHypTypes(), NbHypTypes, and SMESHGUI_MeshDlg::tab().

Referenced by createMesh(), createSubMesh(), editMeshOrSubMesh(), isSelectedHyp(), and onAlgoSelected().

◆ onActivateObject

◆ onAlgoSelected

◆ onAlgoSetByMeshType

void SMESHGUI_MeshOp::onAlgoSetByMeshType ( const int  ,
const int   
)
protectedslot

SLOT.

Is called when the user select type of mesh

Parameters
theTabIndex- Index of current active tab
theIndex- Index of current type of mesh

References setFilteredAlgoData().

Referenced by startOperation().

◆ onApply

bool SMESHGUI_MeshOp::onApply ( )
protectedvirtualslot

Creates or edits mesh.

Return values
bool- TRUE if operation is performed successfully, FALSE otherwise

Virtual slot redefined from the base class called when "Apply" button is clicked creates or edits mesh

References createMesh(), createSubMesh(), dlg(), editMeshOrSubMesh(), SMESHGUI_Operation::isApplyAndClose(), SMESHGUI::isStudyLocked(), isValid(), logSmeshParams(), SMESHGUI::Modified(), myDlg, myHypoSet, myIsInvalidSubMesh, myIsMesh, myObjectToSelect, myToCreate, and setDefaultName().

◆ onCancel

void SMESHGUI_Operation::onCancel ( )
protectedvirtualslotinherited

◆ onCloseShapeByMeshDlg

void SMESHGUI_MeshOp::onCloseShapeByMeshDlg ( SUIT_Operation *  op)
protectedslot

SLOT.

Is called when Close is pressed in SMESHGUI_ShapeByMeshDlg

References myDlg, myShapeByMeshOp, and SMESHGUI_Dialog::show().

Referenced by onGeomSelectionByMesh().

◆ onCreateHyp

void SMESHGUI_MeshOp::onCreateHyp ( const int  theHypType,
const int  theIndex 
)
protectedslot

Create hypothesis.

Parameters
theHypType- hypothesis category (main or additional)
theIndex- index of type of hypothesis to be created

Specifies dimension of hypothesis to be created (using sender() method), specifies its type and calls method for hypothesis creation

References createHypothesis(), getTabDim(), myAvailableHypData, and myDlg.

Referenced by startOperation().

◆ onDeactivateObject

void SMESHGUI_SelectionOp::onDeactivateObject ( int  )
protectedvirtualslotinherited

Removes filter corresponding to certain object selection widget.

References SMESHGUI_SelectionOp::removeCustomFilters().

Referenced by SMESHGUI_SelectionOp::startOperation().

◆ onEditHyp

void SMESHGUI_MeshOp::onEditHyp ( const int  theHypType,
const int  theIndex 
)
protectedslot

Calls plugin methods for hypothesis editing.

Parameters
theHypType- specifies whether main hypothesis or additional one is edited
theIndex- index of existing hypothesis

Calls plugin methods for hypothesis editing

References dlg(), SMESHGUI_GenericHypothesisCreator::edit(), SMESH::GetHypothesisCreator(), getInitParamsHypothesis(), getTabDim(), initHypCreator(), myDlg, myExistingHyps, onHypoEdited(), SMESHGUI_SelectionOp::removeCustomFilters(), and SMESHGUI_GenericHypothesisCreator::setInitParamsHypothesis().

Referenced by startOperation().

◆ onGeomSelectionByMesh

void SMESHGUI_MeshOp::onGeomSelectionByMesh ( bool  theByMesh)
protectedslot

SLOT.

Is called when the user selects a way of geometry selection

Parameters
theByMesh- true if the user wants to find geometry by mesh element

References _PTR(), SMESHGUI_Operation::getSMESHGUI(), SMESHGUI_MeshDlg::Mesh, myDlg, myShapeByMeshOp, onCloseShapeByMeshDlg(), onPublishShapeByMeshDlg(), and SMESHGUI_ShapeByMeshOp::SetMesh().

Referenced by startOperation().

◆ onHelp

void SMESHGUI_Operation::onHelp ( )
protectedslotinherited

◆ onHypoCreated

void SMESHGUI_MeshOp::onHypoCreated ( int  result)
protectedslot

Necessary steps after hypothesis creation.

Parameters
result- creation result: 0 = rejected 1 = accepted 2 = additional value meaning that slot is called not from dialog box

References _PTR(), SMESHGUI_MeshTab::addHyp(), Algo, currentHyp(), existingHyps(), SMESHGUI_MeshDlg::getActiveObject(), hypData(), myDim, myDlg, myExistingHyps, myType, SMESHGUI_SelectionOp::onActivateObject(), SMESHGUI_Dialog::show(), and SMESHGUI_MeshDlg::tab().

Referenced by createHypothesis(), and onHypoSet().

◆ onHypoEdited

void SMESHGUI_MeshOp::onHypoEdited ( int  )
protectedslot

Necessary steps after hypothesis edition.

Parameters
result- creation result: 0 = rejected 1 = accepted

References SMESHGUI_MeshDlg::getActiveObject(), myDlg, SMESHGUI_SelectionOp::onActivateObject(), and SMESHGUI_Dialog::show().

Referenced by getAverageSize(), and onEditHyp().

◆ onHypoSet

◆ onOk

void SMESHGUI_Operation::onOk ( )
protectedvirtualslotinherited

◆ onPublishShapeByMeshDlg

void SMESHGUI_MeshOp::onPublishShapeByMeshDlg ( SUIT_Operation *  op)
protectedslot

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

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

◆ readMesh()

◆ removeCustomFilters()

◆ 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()

virtual void SMESHGUI_MeshOp::selectionDone ( )
protectedvirtual

◆ selectionMode()

◆ selectObject()

void SMESHGUI_MeshOp::selectObject ( _PTR(SObject)  theSObj) const
private

Selects a SObject.

Parameters
theSObj- the SObject to select

References Handle().

Referenced by checkSubMeshConcurrency(), createSubMesh(), and onPublishShapeByMeshDlg().

◆ selector()

◆ setCurrentHyp()

void SMESHGUI_MeshOp::setCurrentHyp ( const int  theDim,
const int  theHypType,
const int  theIndex,
const bool  updateHypsOnAlgoDeselection = false 
)
private

Sets current hypothesis or algorithms.

Parameters
theDim- dimension of hypothesis or algorithm
theHypType- Type of hypothesis (Algo, MainHyp, AddHyp)
theIndex- Index of hypothesis
updateHypsOnAlgoDeselection- to clear and disable hyps if algo deselected

Gets current hypothesis or algorithms

References AddHyp, Algo, MainHyp, myDlg, myIgnoreAlgoSelection, SMESHGUI_MeshTab::setAvailableHyps(), SMESHGUI_MeshTab::setCurrentHyp(), SMESHGUI_MeshTab::setExistingHyps(), and SMESHGUI_MeshDlg::tab().

Referenced by createSubMeshOnInternalEdges(), onAlgoSelected(), onHypoSet(), readMesh(), and setFilteredAlgoData().

◆ setDefaultName()

void SMESHGUI_MeshOp::setDefaultName ( const QString &  thePrefix = "") const
private

Generates default and sets mesh/submesh name.

Generates and sets default mesh/submesh name(Mesh_1, Mesh_2, etc.)

References _PTR(), myDlg, myIsMesh, and SMESHGUI_MeshDlg::Obj.

Referenced by createMesh(), onApply(), and startOperation().

◆ setDialogActive()

void SMESHGUI_Operation::setDialogActive ( const bool  active)
protectedvirtualinherited

Set according dialog active or inactive.

References MESHCUT::d.

◆ setFilteredAlgoData()

◆ setIsApplyAndClose()

void SMESHGUI_Operation::setIsApplyAndClose ( const bool  theFlag)
protectedvirtualinherited

◆ setSelectionMode()

◆ startOperation()

◆ typeById()

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

◆ updateHypoSets()

◆ updateMeshTypeList()

void SMESHGUI_MeshOp::updateMeshTypeList ( )
private

Update available list of mesh types.

References myDlg, myMaxShapeDim, and SMESHGUI_MeshDlg::setAvailableMeshType().

Referenced by setFilteredAlgoData(), and startOperation().

◆ viewWindow()

Field Documentation

◆ myAvailableHypData

◆ myAverageSize

double SMESHGUI_MeshOp::myAverageSize
private

◆ myDefSelectionMode

Selection_Mode SMESHGUI_SelectionOp::myDefSelectionMode
privateinherited

◆ myDim

int SMESHGUI_MeshOp::myDim
private

◆ myDlg

◆ myExistingHyps

TDim2Type2HypList SMESHGUI_MeshOp::myExistingHyps
private

◆ myFilters

Filters SMESHGUI_SelectionOp::myFilters
privateinherited

◆ myGeom

GEOM::GEOM_Object_var SMESHGUI_MeshOp::myGeom
private

◆ myGeomEntry

QString SMESHGUI_MeshOp::myGeomEntry
private

◆ myHasConcurrentSubBefore

bool SMESHGUI_MeshOp::myHasConcurrentSubBefore
private

◆ myHelpFileName

◆ myHypMapIsApplicable

THypLabelIsAppMap SMESHGUI_MeshOp::myHypMapIsApplicable
private

◆ myHypoSet

HypothesesSet* SMESHGUI_MeshOp::myHypoSet
private

◆ myIgnoreAlgoSelection

bool SMESHGUI_MeshOp::myIgnoreAlgoSelection
private

◆ myIsApplyAndClose

bool SMESHGUI_Operation::myIsApplyAndClose
protectedinherited

◆ myIsInvalidSubMesh

bool SMESHGUI_MeshOp::myIsInvalidSubMesh
private

"invalid sub-mesh" is edited

Referenced by createSubMesh(), isValid(), onApply(), and readMesh().

◆ myIsMesh

◆ myIsOnGeometry

bool SMESHGUI_MeshOp::myIsOnGeometry
private

TRUE if edited mesh is based on geometry.

Referenced by availableHyps(), editMeshOrSubMesh(), initHypCreator(), readMesh(), and SMESHGUI_MeshOp().

◆ myLastGeomEntry

QString SMESHGUI_MeshOp::myLastGeomEntry
private

◆ myMaxShapeDim

int SMESHGUI_MeshOp::myMaxShapeDim
private

◆ myObjectToSelect

QString SMESHGUI_MeshOp::myObjectToSelect
private

◆ myObjHyps

TDim2Type2HypList SMESHGUI_MeshOp::myObjHyps
private

hypothesis assigned to the current

Referenced by editMeshOrSubMesh(), onAlgoSelected(), and readMesh().

◆ myOldSelectionMode

Selection_Mode SMESHGUI_SelectionOp::myOldSelectionMode
privateinherited

◆ myShapeByMeshOp

SMESHGUI_ShapeByMeshOp* SMESHGUI_MeshOp::myShapeByMeshOp
private

◆ myToCreate

◆ myType

int SMESHGUI_MeshOp::myType
private