Version: 8.3.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,
TType2HypList
TDim2Type2HypList
 
typedef QList< intIdList
 

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 processSet ()
 One step of hypothesis/algorithm list creation. 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 ()
 Updates dialog's look and feel. More...
 
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)
 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...
 
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
 

Protected Attributes

QString myHelpFileName
 
bool myIsApplyAndClose
 

Private Types

typedef QList< HypothesisData * > THypDataList
 
typedef QMap< QString, boolTHypLabelIsAppMap
 

Private Member Functions

bool isValid (QString &) const
 Verifies validity of input data. More...
 
bool isCompatibleToGeometry (HypothesisData *, QString, GEOM::GEOM_Object_var)
 check compatibility of the geometry More...
 
bool isCompatibleToMeshType (HypothesisData *, QString)
 check compatibility of the mesh type More...
 
void availableHyps (const int, const int, QStringList &, THypDataList &, HypothesisData *=0, HypothesisData *=0, const QString &="")
 Gets 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 &)
 Creates sub-mesh. More...
 
bool editMeshOrSubMesh (QString &)
 Edits mesh or sub-mesh. 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
 Gets current hypothesis or algorithms. 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
 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 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 createMeshTypeList (QStringList &)
 Create available list types of mesh. More...
 
void setAvailableMeshType (const QStringList &)
 Set available types of mesh. More...
 
void setFilteredAlgoData (const int, const int)
 Set a filtered list of available algorithms by mesh type. More...
 
QString currentMeshTypeName (const int) const
 Get current name types of mesh. More...
 

Private Attributes

SMESHGUI_MeshDlgmyDlg
 
SMESHGUI_ShapeByMeshOpmyShapeByMeshOp
 
bool myToCreate
 
bool myIsMesh
 
bool myIsOnGeometry
 TRUE if edited mesh accotiated with geometrical object. More...
 
bool myHasConcurrentSubBefore
 
TDim2Type2HypList myExistingHyps
 all hypothesis of SMESH module More...
 
TDim2Type2HypList myObjHyps
 hypothesis assigned to the current More...
 
THypDataList myAvailableHypData [4][NbHypTypes]
 
QString myLastGeomToSelect
 
THypLabelIsAppMap myHypMapIsApplicable
 
bool myIgnoreAlgoSelection
 
HypothesesSetmyHypoSet
 
int myDim
 
int myType
 
int myMaxShapeDim
 
QString myObjectToSelect
 

Detailed Description

Operation for mech creation or editing.

This operation is used for mech creation or editing.

Member Typedef Documentation

typedef QList<int> SMESHGUI_SelectionOp::IdList
inherited
typedef std::pair<SMESH::SMESH_Hypothesis_var, QString> SMESHGUI_MeshOp::THypItem
typedef QMap<QString, bool> SMESHGUI_MeshOp::THypLabelIsAppMap
private

Member Enumeration Documentation

enum SMESHGUI_SelectionOp::EntityType
protectedinherited
Enumerator
Object 
MeshNode 
MeshElement 
Enumerator
Algo 
MainHyp 
AddHyp 
NbHypTypes 
Enumerator
MT_ANY 
MT_TRIANGULAR 
MT_QUADRILATERAL 
MT_TETRAHEDRAL 
MT_HEXAHEDRAL 

Constructor & Destructor Documentation

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

Destructor.

References myDlg.

Member Function Documentation

void SMESHGUI_SelectionOp::abortOperation ( )
protectedvirtualinherited
SMESH_Actor * SMESHGUI_SelectionOp::actor ( ) const
protectedinherited
void SMESHGUI_SelectionOp::addOrRemoveIndex ( const Handle(SALOME_InteractiveObject)&  obj,
const TColStd_MapOfInteger &  indices,
const bool  isModeShift 
)
protectedinherited
void SMESHGUI_MeshOp::availableHyps ( const int  theDim,
const int  theHypType,
QStringList &  theHyps,
THypDataList theDataList,
HypothesisData thePrevAlgoData = 0,
HypothesisData theNextAlgoData = 0,
const QString &  theMeshType = "" 
)
private

Gets 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)

Gets available hypotheses or algorithm in accordance with input parameters

References _PTR(), AddHyp, Algo, SMESH::DIM_2D, SMESHGUI_MeshDlg::Geom, SMESH::GetAvailableHypotheses(), SMESH::GetGeom(), SMESH::GetGroupTitle(), SMESH::GetHypothesisData(), HypothesisData::GroupID, HypothesisData::InputTypes, isCompatible(), isCompatibleToGeometry(), isCompatibleToMeshType(), HypothesisData::Label, myDlg, myHypMapIsApplicable, myIsMesh, myIsOnGeometry, myLastGeomToSelect, myToCreate, SMESHGUI_MeshDlg::Obj, HypothesisData::Priority, SObject(), and studyDS().

Referenced by onAlgoSelected(), processSet(), selectionDone(), setFilteredAlgoData(), and startOperation().

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(), myDlg, myToCreate, SMESHGUI_SelectionOp::onActivateObject(), SMESHGUI::OnGUIEvent(), SMESHOp::OpMeshOrder, selectionDone(), selectObject(), and SObject().

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

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.

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.

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(), SMESH::GetHypothesisCreator(), SMESH::GetHypothesisData(), getInitParamsHypothesis(), initHypCreator(), HypothesisData::Label, myDim, myDlg, myExistingHyps, myType, onHypoCreated(), SMESHGUI_SelectionOp::removeCustomFilters(), and HypothesisData::ServerLibName.

Referenced by onCreateHyp(), and processSet().

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

Creates mesh.

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

Creates mesh

References _PTR(), AddHyp, SMESH::AddHypothesisOnMesh(), currentHyp(), SMESH::DIM_0D, SMESH::DIM_3D, SMESHGUI_MeshDlg::Geom, getAlgo(), SMESHGUI::GetSMESHGen(), isAccessibleDim(), MainHyp, Min(), myDlg, myExistingHyps, nbDlgHypTypes(), SMESHGUI_MeshDlg::Obj, setDefaultName(), SMESH::SetName(), SObject(), and studyDS().

Referenced by onApply().

void SMESHGUI_MeshOp::createMeshTypeList ( QStringList &  theTypeMesh)
private

Create available list types of mesh.

Parameters
theTypeMesh- Output list of available types of mesh

References myMaxShapeDim.

Referenced by selectionDone(), and startOperation().

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

Creates 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

Creates sub-mesh

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

Referenced by onApply().

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

Gets current hypothesis or algorithms.

Parameters
theDim- dimension of hypothesis or algorithm
theHypType- Type of hypothesis (Algo, MainHyp, AddHyp)
Return values
int- current hypothesis or algorithms

Gets current hypothesis or algorithms

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

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

QString SMESHGUI_MeshOp::currentMeshTypeName ( const int  theIndex) const
private

Get current name types of mesh.

Parameters
theIndex- current index types of mesh
Return values
QString- result

References MT_ANY, MT_HEXAHEDRAL, MT_QUADRILATERAL, MT_TETRAHEDRAL, and MT_TRIANGULAR.

Referenced by onAlgoSelected(), and setFilteredAlgoData().

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 isValid(), onApply(), onEditHyp(), and selectionDone().

bool SMESHGUI_MeshOp::editMeshOrSubMesh ( QString &  theMess)
private

Edits mesh or sub-mesh.

Parameters
theMess- Output parameter intended for returning error message
Return values
bool- TRUE if mesh is edited successfully, FALSE otherwise

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

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

Referenced by onApply().

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, SObject(), SMESH::Tag_AlgorithmsRoot, SMESH::Tag_HypothesisRoot, SMESH::Tag_RefOnAppliedAlgorithms, and SMESH::Tag_RefOnAppliedHypothesis.

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

void SMESHGUI_SelectionOp::extractIds ( const QStringList &  ids,
IdList list,
const QChar  idchar 
)
staticinherited
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().

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

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, myExistingHyps, and SObject().

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

SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getInitParamsHypothesis ( const QString &  aHypType,
const QString &  aServerLib 
) 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(), SMESHGUI_MeshDlg::Geom, SMESH::GetShapeOnMeshOrSubMesh(), SMESHGUI::GetSMESHGen(), SMESHGUI_MeshDlg::Mesh, myDlg, myIsMesh, myToCreate, SMESHGUI_MeshDlg::Obj, SObject(), and studyDS().

Referenced by createHypothesis(), and onEditHyp().

void SMESHGUI_SelectionOp::highlight ( const Handle(SALOME_InteractiveObject)&  obj,
const bool  hilight,
const bool  immediately = true 
)
protectedinherited
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 onAlgoSelected(), onHypoCreated(), and setFilteredAlgoData().

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

void SMESHGUI_SelectionOp::initDialog ( )
protectedvirtualinherited

sets the dialog widgets to state just after operation start

Reimplemented from SMESHGUI_Operation.

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(), and onAlgoSelected().

bool SMESHGUI_Operation::isApplyAndClose ( ) const
protectedvirtualinherited
bool SMESHGUI_MeshOp::isCompatibleToGeometry ( HypothesisData theAlgoData,
QString  theCurrentGeomToSelect,
GEOM::GEOM_Object_var  theGeomVar 
)
private

check compatibility of the geometry

Parameters
theAlgoData- to select hypos able to be used by this algo
theCurrentGeomToSelect- the current name of the selected geometry
theGeomVar- currently selected geometry
Return values
bool- check result

References SMESH::IsApplicable(), HypothesisData::Label, myHypMapIsApplicable, myIsMesh, myLastGeomToSelect, and HypothesisData::TypeName.

Referenced by availableHyps().

bool SMESHGUI_MeshOp::isCompatibleToMeshType ( HypothesisData theAlgoData,
QString  theMeshType 
)
private

check compatibility of the mesh type

Parameters
theAlgoData- to select hypos able to be used by this algo
theMeshType- type of mesh for filtering algorithms
Return values
bool- check result

References HypothesisData::OutputTypes.

Referenced by availableHyps().

bool SMESHGUI_Operation::isReadyToStart ( ) const
protectedvirtualinherited
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().

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(), onApply(), and SMESHGUI_Make2DFrom3DOp::onApply().

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(), aGeomEntry, Algo, existingHyps(), SMESHGUI_MeshDlg::Geom, SMESH::GetHypothesisData(), HypothesisData::InputTypes, HypothesisData::IsSupportSubmeshes, SMESHGUI_MeshDlg::Mesh, myDlg, myIsMesh, myToCreate, SObject(), and studyDS().

Referenced by selectionDone().

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(), SMESHGUI_MeshDlg::Geom, SMESH::GetGEOMGen(), SMESHGUI_MeshDlg::Mesh, SMESHGUI_SelectionOp::mesh(), myDlg, myIsMesh, myToCreate, SObject(), and studyDS().

Referenced by isValid().

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

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, myIsMesh, myToCreate, SMESHGUI_MeshDlg::Obj, SObject(), and studyDS().

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

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

void SMESHGUI_MeshOp::onAlgoSetByMeshType ( const int  theTabIndex,
const int  theIndex 
)
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().

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_Operation::isStudyLocked(), isValid(), SMESHGUI::Modified(), myDlg, myIsMesh, myObjectToSelect, myToCreate, and setDefaultName().

void SMESHGUI_Operation::onCancel ( )
protectedvirtualslotinherited
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().

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 cerated

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

void SMESHGUI_SelectionOp::onDeactivateObject ( int  id)
protectedvirtualslotinherited

Removes filter corresponding to certain object selection widget.

References SMESHGUI_SelectionOp::removeCustomFilters().

Referenced by SMESHGUI_SelectionOp::startOperation().

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

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(), SMESHGUI_ShapeByMeshOp::SetMesh(), SObject(), and studyDS().

Referenced by startOperation().

void SMESHGUI_Operation::onHelp ( )
protectedslotinherited
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, myHypoSet, myType, SMESHGUI_SelectionOp::onActivateObject(), processSet(), and SMESHGUI_MeshDlg::tab().

Referenced by createHypothesis().

void SMESHGUI_MeshOp::onHypoEdited ( int  result)
protectedslot

Necessary steps after hypothesis edition.

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

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

Referenced by onEditHyp().

void SMESHGUI_MeshOp::onHypoSet ( const QString &  theSetName)
protectedslot

Creates and selects hypothesis of hypotheses set.

Parameters
theSetName- The name of hypotheses set

References AddHyp, Algo, SMESH::DIM_0D, SMESH::DIM_3D, SMESH::GetHypothesesSet(), HypothesesSet::init(), MainHyp, myHypoSet, processSet(), and setCurrentHyp().

Referenced by startOperation().

void SMESHGUI_Operation::onOk ( )
protectedvirtualslotinherited
void SMESHGUI_MeshOp::onPublishShapeByMeshDlg ( SUIT_Operation *  op)
protectedslot
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().

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

void SMESHGUI_MeshOp::processSet ( )
protectedslot
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().

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

Selects a SObject.

Parameters
theSObj- the SObject to select

References Handle().

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

void SMESHGUI_MeshOp::setAvailableMeshType ( const QStringList &  theTypeMesh)
private

Set available types of mesh.

Parameters
theTypeMesh- List of available types of mesh

References myDlg, and SMESHGUI_MeshDlg::setAvailableMeshType().

Referenced by selectionDone(), and startOperation().

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 onAlgoSelected(), onHypoSet(), processSet(), readMesh(), and setFilteredAlgoData().

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, SMESHGUI_MeshDlg::Obj, and SObject().

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

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
protectedvirtualinherited

Field Documentation

int SMESHGUI_MeshOp::myDim
private

Referenced by createHypothesis(), and onHypoCreated().

bool SMESHGUI_MeshOp::myHasConcurrentSubBefore
private
THypLabelIsAppMap SMESHGUI_MeshOp::myHypMapIsApplicable
private
HypothesesSet* SMESHGUI_MeshOp::myHypoSet
private
bool SMESHGUI_MeshOp::myIgnoreAlgoSelection
private
bool SMESHGUI_Operation::myIsApplyAndClose
protectedinherited
bool SMESHGUI_MeshOp::myIsOnGeometry
private

TRUE if edited mesh accotiated with geometrical object.

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

QString SMESHGUI_MeshOp::myLastGeomToSelect
private
int SMESHGUI_MeshOp::myMaxShapeDim
private
QString SMESHGUI_MeshOp::myObjectToSelect
private
TDim2Type2HypList SMESHGUI_MeshOp::myObjHyps
private

hypothesis assigned to the current

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

SMESHGUI_ShapeByMeshOp* SMESHGUI_MeshOp::myShapeByMeshOp
private
int SMESHGUI_MeshOp::myType
private

Referenced by createHypothesis(), and onHypoCreated().