Version: 6.3.1
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Private Attributes

SMESHGUI_MeshOrderOp Class Reference

Operator to check and modify mesh computation submesh priority (order) More...

#include <SMESHGUI_MeshOrderOp.h>

Inheritance diagram for SMESHGUI_MeshOrderOp:
Inheritance graph
[legend]

Public Member Functions

 SMESHGUI_MeshOrderOp ()
 Constructor.
virtual ~SMESHGUI_MeshOrderOp ()
 Destructor.

Protected Slots

virtual bool onApply ()
 Apply changes.
virtual void onCancel ()
 Apply changes.
virtual void onOk ()
void onHelp ()

Protected Member Functions

virtual LightApp_Dialogdlg () const
 Return operation dialog.
virtual void startOperation ()
 perform it's intention action: compute 2D mesh on 3D
virtual void initDialog ()
 sets the dialog widgets to state just after operation start
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.
SMESHGUIgetSMESHGUI () const
bool isStudyLocked (const bool=true) const
 Verifies whether study of operation is locked.
 _PTR (Study) studyDS() const
virtual bool isValid (SUIT_Operation *) const
 Verifies whether given operator is valid for this one.

Protected Attributes

QString myHelpFileName
bool myIsApplyAndClose

Private Attributes

SMESHGUI_MeshOrderDlgmyDlg
SMESHGUI_MeshOrderMgrmyMgr

Detailed Description

Operator to check and modify mesh computation submesh priority (order)

Definition at line 68 of file SMESHGUI_MeshOrderOp.h.


Constructor & Destructor Documentation

SMESHGUI_MeshOrderOp::SMESHGUI_MeshOrderOp ( )

Constructor.

Definition at line 50 of file SMESHGUI_MeshOrderOp.cxx.

References myDlg, and SMESHGUI_Operation.myHelpFileName.

  : SMESHGUI_Operation(), myDlg(0), myMgr(0)
{
  myDlg = new SMESHGUI_MeshOrderDlg( desktop() );
  
  myHelpFileName = "constructing_meshes_page.html#mesh_order_anchor";
}
SMESHGUI_MeshOrderOp::~SMESHGUI_MeshOrderOp ( ) [virtual]

Destructor.

Definition at line 64 of file SMESHGUI_MeshOrderOp.cxx.

{
}

Member Function Documentation

SMESHGUI_Operation._PTR ( Study  ) const [protected, inherited]
LightApp_Dialog * SMESHGUI_MeshOrderOp::dlg ( ) const [protected, virtual]

Return operation dialog.

Definition at line 74 of file SMESHGUI_MeshOrderOp.cxx.

References myDlg.

{
  return myDlg;
}
SMESHGUI * SMESHGUI_Operation::getSMESHGUI ( ) const [protected, inherited]
void SMESHGUI_MeshOrderOp::initDialog ( ) [protected, virtual]

sets the dialog widgets to state just after operation start

Init dialog and mesh order box.

Reimplemented from SMESHGUI_Operation.

Definition at line 98 of file SMESHGUI_MeshOrderOp.cxx.

References SMESH.GetMeshByIO(), SMESHGUI_MeshOrderMgr.GetMeshOrder(), SMESHGUI_MeshOrderDlg.GetMeshOrderBox(), myDlg, myMgr, onCancel(), and SMESHGUI_MeshOrderMgr.SetMesh().

{
  if (!myDlg )
    return;
  
  SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
  // check selection
  LightApp_SelectionMgr *Sel = selectionMgr();
  SALOME_ListIO selected; Sel->selectedObjects( selected );

  if (selected.Extent() == 1)
    aMesh = SMESH::GetMeshByIO(selected.First());
  if (aMesh->_is_nil()) {
    SUIT_MessageBox::warning(desktop(),
                             tr("SMESH_WRN_WARNING"),
                             tr("SMESH_WRN_NO_AVAILABLE_DATA"));
    onCancel();
    return;
  }

  myMgr = new SMESHGUI_MeshOrderMgr( myDlg->GetMeshOrderBox() );
  myMgr->SetMesh( aMesh );
  if ( !myMgr->GetMeshOrder() ) {
    SUIT_MessageBox::information(desktop(),
                             tr("SMESH_INFORMATION"),
                             tr("SMESH_NO_CONCURENT_MESH"));
    
    onCancel();
    return;
  }
}
bool SMESHGUI_Operation::isApplyAndClose ( ) const [protected, virtual, inherited]
bool SMESHGUI_Operation::isReadyToStart ( ) const [protected, virtual, inherited]

Definition at line 115 of file SMESHGUI_Operation.cxx.

References SMESHGUI_Operation.getSMESHGUI(), and SMESHGUI_Operation.isStudyLocked().

{
  if ( !LightApp_Operation::isReadyToStart() )
    return false;
  else if ( getSMESHGUI() == 0 )
  {
    SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
                              tr( "NO_MODULE" ) );
    return false;
  }
  else if ( isStudyLocked() )
    return false;

  return true;
}
bool SMESHGUI_Operation::isStudyLocked ( const bool  theMess = true) const [protected, inherited]

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

Definition at line 247 of file SMESHGUI_Operation.cxx.

References SMESHGUI.desktop().

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

{
  if ( studyDS() )
  {
    if ( studyDS()->GetProperties()->IsLocked() )
    {
      if ( theMess )
        SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
                                  tr( "WRN_STUDY_LOCKED" ) );
      return true;
    }
  }

  return false;
}
bool SMESHGUI_Operation::isValid ( SUIT_Operation *  theOtherOp) const [protected, virtual, inherited]

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 retuns false if theOtherOp operation is not intended for deleting objects or mesh elements.

Reimplemented in SMESHGUI_BaseComputeOp, and SMESHGUI_MeshOp.

Definition at line 273 of file SMESHGUI_Operation.cxx.

{
  static QStringList anOps;
  if ( anOps.count() == 0 )
  {
    anOps.append( "SMESHGUI_DeleteOp" );
    // to do add other operations here
  }

  return ( theOtherOp &&
         ( ( theOtherOp->inherits("SMESHGUI_Operation") && ( !anOps.contains(theOtherOp->metaObject()->className() ) || anOps.contains(metaObject()->className()) ) ) ||
           ( theOtherOp->inherits("LightApp_ShowHideOp") ) ) );

  return true;
}
bool SMESHGUI_MeshOrderOp::onApply ( ) [protected, virtual, slot]

Apply changes.

Reimplemented from SMESHGUI_Operation.

Definition at line 136 of file SMESHGUI_MeshOrderOp.cxx.

References SMESHGUI.Modified(), myMgr, SMESH_AdvancedEditor.res, and SMESHGUI_MeshOrderMgr.SetMeshOrder().

{
  SUIT_OverrideCursor aWaitCursor;
  bool res = myMgr ? myMgr->SetMeshOrder() : false;

  if( res )
    SMESHGUI::Modified();

  delete myMgr;
  myMgr = 0;

  return res;
}
void SMESHGUI_MeshOrderOp::onCancel ( ) [protected, virtual, slot]

Apply changes.

Reimplemented from SMESHGUI_Operation.

Definition at line 156 of file SMESHGUI_MeshOrderOp.cxx.

References myMgr.

Referenced by initDialog().

{
  delete myMgr;
  myMgr = 0;

  abort();
}
void SMESHGUI_Operation::onHelp ( ) [protected, slot, inherited]

Definition at line 191 of file SMESHGUI_Operation.cxx.

References SMESHGUI_Operation.getSMESHGUI(), and SMESHGUI_Operation.myHelpFileName.

Referenced by SMESHGUI_Operation.startOperation(), and SMESHGUI_PrecomputeOp.startOperation().

{
  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
  if (app)
    app->onHelpContextModule(getSMESHGUI() ? app->moduleName(getSMESHGUI()->moduleName()) : QString(""), myHelpFileName);
  else {
    QString platform;
#ifdef WIN32
    platform = "winapplication";
#else
    platform = "application";
#endif
    SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"),
                              tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
                              arg(app->resourceMgr()->stringValue("ExternalBrowser",
                                                                  platform)).
                              arg(myHelpFileName) );
  }
}
void SMESHGUI_Operation::onOk ( ) [protected, virtual, slot, inherited]
void SMESHGUI_Operation::setDialogActive ( const bool  active) [protected, virtual, inherited]

Set according dialog active or inactive.

Definition at line 135 of file SMESHGUI_Operation.cxx.

References ex13_hole1partial.d, and SMESHGUI_Dialog.setContentActive().

{
  LightApp_Operation::setDialogActive( active );

  SMESHGUI_Dialog* d = dynamic_cast<SMESHGUI_Dialog*>( dlg() );
  if( d )
    d->setContentActive( active );

}
void SMESHGUI_Operation::setIsApplyAndClose ( const bool  theFlag) [protected, virtual, inherited]

Definition at line 224 of file SMESHGUI_Operation.cxx.

References SMESHGUI_Operation.myIsApplyAndClose.

Referenced by SMESHGUI_Operation.onOk().

{
  myIsApplyAndClose = theFlag;
}
void SMESHGUI_MeshOrderOp::startOperation ( ) [protected, virtual]

perform it's intention action: compute 2D mesh on 3D

Reimplemented from SMESHGUI_Operation.

Definition at line 85 of file SMESHGUI_MeshOrderOp.cxx.

References myDlg, myMgr, and SMESHGUI_Dialog.show().


Field Documentation

Definition at line 89 of file SMESHGUI_MeshOrderOp.h.

Referenced by dlg(), initDialog(), SMESHGUI_MeshOrderOp(), and startOperation().

QString SMESHGUI_Operation.myHelpFileName [protected, inherited]

Definition at line 90 of file SMESHGUI_MeshOrderOp.h.

Referenced by initDialog(), onApply(), onCancel(), and startOperation().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS