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

SMESHGUI_RevolutionDlg Class Reference

#include <SMESHGUI_RevolutionDlg.h>

Inheritance diagram for SMESHGUI_RevolutionDlg:
Inheritance graph
[legend]

Public Member Functions

 SMESHGUI_RevolutionDlg (SMESHGUI *)
 ~SMESHGUI_RevolutionDlg ()
void reject ()
void showPreview ()
void hidePreview ()

Protected Slots

virtual void onDisplaySimulation (bool)
void toDisplaySimulation ()

Protected Member Functions

void connectPreviewControl ()
virtual void setIsApplyAndClose (const bool theFlag)
virtual bool isApplyAndClose () const

Protected Attributes

SMESHGUImySMESHGUI
QCheckBox * myPreviewCheckBox
bool myIsApplyAndClose

Private Types

enum  { NONE_SELECT, POINT_SELECT, FACE_SELECT }

Private Slots

void ConstructorsClicked (int)
void ClickOnOk ()
void ClickOnCancel ()
bool ClickOnApply ()
void ClickOnHelp ()
void SetEditCurrentArgument ()
void SelectionIntoArgument ()
void DeactivateActiveDialog ()
void ActivateThisDialog ()
void onTextChange (const QString &)
void onAngleTextChange (const QString &)
void onSelectMesh (bool)
void onVectorChanged ()
void onSelectVectorMenu (QAction *)
void onSelectVectorButton ()
void setFilters ()

Private Member Functions

void Init (bool=true)
void closeEvent (QCloseEvent *)
void enterEvent (QEvent *)
void keyPressEvent (QKeyEvent *)
int GetConstructorId ()
bool IsAxisOk ()
bool isValid ()
 Handle (SALOME_InteractiveObject) myIO

Private Attributes

SMESHGUI_IdValidatormyIdValidator
LightApp_SelectionMgr * mySelectionMgr
int myNbOkElements
QString myElementsId
QWidgetmyEditCurrentArgument
SVTK_Selector * mySelector
SMESH::SMESH_IDSource_var mySelectedObject
bool myBusy
SMESH::SMESH_Mesh_var myMesh
SMESH_ActormyActor
SMESH_LogicalFiltermyMeshOrSubMeshOrGroupFilter
SMESHGUI_MeshEditPreviewmySimulation
SALOME_ActormyPreviewActor
QGroupBoxConstructorsBox
QButtonGroup * GroupConstructors
QRadioButton * RadioButton1
QRadioButton * RadioButton2
QGroupBoxGroupButtons
QPushButton * buttonOk
QPushButton * buttonCancel
QPushButton * buttonApply
QPushButton * buttonHelp
QGroupBoxGroupArguments
QGroupBoxGroupAxis
QLabel * TextLabelElements
QPushButton * SelectElementsButton
QLineEdit * LineEditElements
QCheckBox * CheckBoxMesh
QCheckBox * MakeGroupsCheck
QGroupBoxGroupAngleBox
QButtonGroup * GroupAngle
QRadioButton * RadioButton3
QRadioButton * RadioButton4
QLabel * TextLabelPoint
QPushButton * SelectPointButton
QLabel * TextLabelX
SMESHGUI_SpinBoxSpinBox_X
QLabel * TextLabelY
SMESHGUI_SpinBoxSpinBox_Y
QLabel * TextLabelZ
SMESHGUI_SpinBoxSpinBox_Z
QLabel * TextLabelVector
QPushButton * SelectVectorButton
QLabel * TextLabelDX
SMESHGUI_SpinBoxSpinBox_DX
QLabel * TextLabelDY
SMESHGUI_SpinBoxSpinBox_DY
QLabel * TextLabelDZ
SMESHGUI_SpinBoxSpinBox_DZ
QLabel * TextLabelAngle
SMESHGUI_SpinBoxSpinBox_Angle
QLabel * TextLabelNbSteps
SalomeApp_IntSpinBox * SpinBox_NbSteps
QLabel * TextLabelTolerance
SMESHGUI_SpinBoxSpinBox_Tolerance
QMenu * SelectVectorMenu
QMap< QAction *, intmyMenuActions
int myVectorDefinition
QString myHelpFileName
QString myIDs
QPushButton * myFilterBtn
SMESHGUI_FilterDlgmyFilterDlg

Detailed Description

Definition at line 69 of file SMESHGUI_RevolutionDlg.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
NONE_SELECT 
POINT_SELECT 
FACE_SELECT 

Definition at line 80 of file SMESHGUI_RevolutionDlg.h.


Constructor & Destructor Documentation

SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg ( SMESHGUI theModule)

Definition at line 91 of file SMESHGUI_RevolutionDlg.cxx.

References buttonApply, buttonCancel, buttonHelp, buttonOk, CheckBoxMesh, ClickOnApply(), ClickOnCancel(), ClickOnHelp(), ClickOnOk(), SMESHGUI_PreviewDlg.connectPreviewControl(), ConstructorsBox, ConstructorsClicked(), COORD_MAX, COORD_MIN, DeactivateActiveDialog(), FACE_SELECT, SMESH.GetResourceMgr(), SMESH.GetSelector(), SMESH.GetViewWindow(), GROUP, GroupAngle, GroupAngleBox, GroupArguments, GroupAxis, GroupButtons, GroupConstructors, Init(), LineEditElements, SMESH_LogicalFilter.LO_OR, MakeGroupsCheck, MARGIN, MESHorSUBMESH, myFilterBtn, myHelpFileName, myIdValidator, myMenuActions, myMeshOrSubMeshOrGroupFilter, SMESHGUI_PreviewDlg.myPreviewCheckBox, mySelectionMgr, mySelector, mySimulation, SMESHGUI_PreviewDlg.mySMESHGUI, onAngleTextChange(), onSelectMesh(), onSelectVectorButton(), onSelectVectorMenu(), onTextChange(), onVectorChanged(), POINT_SELECT, RadioButton1, RadioButton2, RadioButton3, RadioButton4, SMESHGUI_SpinBox.RangeStepAndValidator(), SelectElementsButton, SelectionIntoArgument(), SelectPointButton, SelectVectorButton, SelectVectorMenu, SMESHGUI.SetActiveDialogBox(), SetEditCurrentArgument(), setFilters(), SPACING, SpinBox_Angle, SpinBox_DX, SpinBox_DY, SpinBox_DZ, SpinBox_NbSteps, SpinBox_Tolerance, SpinBox_X, SpinBox_Y, SpinBox_Z, TextLabelAngle, TextLabelDX, TextLabelDY, TextLabelDZ, TextLabelElements, TextLabelNbSteps, TextLabelPoint, TextLabelTolerance, TextLabelVector, TextLabelX, TextLabelY, TextLabelZ, and SMESHGUI_PreviewDlg.toDisplaySimulation().

  : SMESHGUI_PreviewDlg( theModule ),
    mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
    myVectorDefinition(NONE_SELECT),
    myFilterDlg( 0 ),
    mySelectedObject(SMESH::SMESH_IDSource::_nil()),
    myActor(0)
{
  mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));

  SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
  QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
  QPixmap image1 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
  QPixmap image2 ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));

  setModal(false);
  setAttribute(Qt::WA_DeleteOnClose, true);
  setWindowTitle(tr("REVOLUTION_AROUND_AXIS"));
  setSizeGripEnabled(true);
  
  QVBoxLayout* SMESHGUI_RevolutionDlgLayout = new QVBoxLayout(this);
  SMESHGUI_RevolutionDlgLayout->setSpacing(SPACING);
  SMESHGUI_RevolutionDlgLayout->setMargin(MARGIN);

  /***************************************************************/
  ConstructorsBox = new QGroupBox(tr("SMESH_REVOLUTION"), this);
  GroupConstructors = new QButtonGroup(this);
  QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
  ConstructorsBoxLayout->setSpacing(SPACING);
  ConstructorsBoxLayout->setMargin(MARGIN);

  RadioButton1 = new QRadioButton(ConstructorsBox);
  RadioButton1->setIcon(image0);
  RadioButton2 = new QRadioButton(ConstructorsBox);
  RadioButton2->setIcon(image1);

  ConstructorsBoxLayout->addWidget(RadioButton1);
  ConstructorsBoxLayout->addWidget(RadioButton2);
  GroupConstructors->addButton(RadioButton1, 0);
  GroupConstructors->addButton(RadioButton2, 1);

  /***************************************************************/
  GroupArguments = new QGroupBox(tr("REVOLUTION_1D"), this);
  QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
  GroupArgumentsLayout->setSpacing(SPACING);
  GroupArgumentsLayout->setMargin(MARGIN);

  myIdValidator = new SMESHGUI_IdValidator(this);

  // Controls for elements selection
  TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);

  SelectElementsButton = new QPushButton(GroupArguments);
  SelectElementsButton->setIcon(image2);

  LineEditElements  = new QLineEdit(GroupArguments);
  LineEditElements->setValidator(myIdValidator);
  LineEditElements->setMaxLength(-1);
  myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
  connect(myFilterBtn,   SIGNAL(clicked()), this, SLOT(setFilters()));

  // Control for the whole mesh selection
  CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);

  // Controls for axis defining
  GroupAxis = new QGroupBox(tr("SMESH_AXIS"), GroupArguments);
  QGridLayout* GroupAxisLayout = new QGridLayout(GroupAxis);
  GroupAxisLayout->setSpacing(SPACING);
  GroupAxisLayout->setMargin(MARGIN);

  TextLabelPoint = new QLabel(tr("SMESH_POINT"), GroupAxis);
  SelectPointButton  = new QPushButton(GroupAxis);
  SelectPointButton->setIcon(image2);

  TextLabelX = new QLabel(tr("SMESH_X"), GroupAxis);
  SpinBox_X = new SMESHGUI_SpinBox(GroupAxis);

  TextLabelY = new QLabel(tr("SMESH_Y"), GroupAxis);
  SpinBox_Y = new SMESHGUI_SpinBox(GroupAxis);

  TextLabelZ = new QLabel(tr("SMESH_Z"), GroupAxis);
  SpinBox_Z = new SMESHGUI_SpinBox(GroupAxis);

  TextLabelVector = new QLabel(tr("SMESH_VECTOR"), GroupAxis);
  SelectVectorButton = new QPushButton(GroupAxis);
  SelectVectorButton->setIcon(image2);

  TextLabelDX = new QLabel(tr("SMESH_DX"), GroupAxis);
  SpinBox_DX = new SMESHGUI_SpinBox(GroupAxis);

  TextLabelDY = new QLabel(tr("SMESH_DY"), GroupAxis);
  SpinBox_DY = new SMESHGUI_SpinBox(GroupAxis);

  TextLabelDZ = new QLabel(tr("SMESH_DZ"), GroupAxis);
  SpinBox_DZ = new SMESHGUI_SpinBox(GroupAxis);

  GroupAxisLayout->addWidget(TextLabelPoint,     0, 0);
  GroupAxisLayout->addWidget(SelectPointButton,  0, 1);
  GroupAxisLayout->addWidget(TextLabelX,         0, 2);
  GroupAxisLayout->addWidget(SpinBox_X,          0, 3);
  GroupAxisLayout->addWidget(TextLabelY,         0, 4);
  GroupAxisLayout->addWidget(SpinBox_Y,          0, 5);
  GroupAxisLayout->addWidget(TextLabelZ,         0, 6);
  GroupAxisLayout->addWidget(SpinBox_Z,          0, 7);
  GroupAxisLayout->addWidget(TextLabelVector,    1, 0);
  GroupAxisLayout->addWidget(SelectVectorButton, 1, 1);
  GroupAxisLayout->addWidget(TextLabelDX,        1, 2);
  GroupAxisLayout->addWidget(SpinBox_DX,         1, 3);
  GroupAxisLayout->addWidget(TextLabelDY,        1, 4);
  GroupAxisLayout->addWidget(SpinBox_DY,         1, 5);
  GroupAxisLayout->addWidget(TextLabelDZ,        1, 6);
  GroupAxisLayout->addWidget(SpinBox_DZ,         1, 7);

  // Controls for angle defining & number of steps defining
  GroupAngleBox = new QGroupBox(tr("SMESH_ANGLE"), GroupArguments);
  GroupAngle = new QButtonGroup(GroupAngleBox);
  QGridLayout* GroupAngleLayout = new QGridLayout(GroupAngleBox);
  GroupAngleLayout->setSpacing(6);
  GroupAngleLayout->setMargin(11);

  RadioButton3 = new QRadioButton(tr("ANGLE_BY_STEP"), GroupAngleBox);
  RadioButton4 = new QRadioButton(tr("TOTAL_ANGLE"),   GroupAngleBox);
  GroupAngle->addButton(RadioButton3, 0);
  GroupAngle->addButton(RadioButton4, 1);

  TextLabelAngle = new QLabel(tr("SMESH_ANGLE"), GroupAngleBox);
  SpinBox_Angle = new SMESHGUI_SpinBox(GroupAngleBox);

  TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupAngleBox);
  SpinBox_NbSteps = new SalomeApp_IntSpinBox(GroupAngleBox);

  GroupAngleLayout->addWidget(RadioButton3,     0, 0);
  GroupAngleLayout->addWidget(RadioButton4,     0, 1);
  GroupAngleLayout->addWidget(TextLabelAngle,   1, 0);
  GroupAngleLayout->addWidget(SpinBox_Angle,    1, 1);
  GroupAngleLayout->addWidget(TextLabelNbSteps, 2, 0);
  GroupAngleLayout->addWidget(SpinBox_NbSteps,  2, 1);

  // Controls for tolerance defining
  TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupArguments);
  SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments);

  // Control for mesh preview
  myPreviewCheckBox = new QCheckBox(tr("PREVIEW"), GroupArguments);

  // CheckBox for groups generation
  MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
  MakeGroupsCheck->setChecked(true);

  GroupArgumentsLayout->addWidget(TextLabelElements,    0, 0);
  GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
  GroupArgumentsLayout->addWidget(LineEditElements,     0, 2);
  GroupArgumentsLayout->addWidget(myFilterBtn,          0, 3);
  GroupArgumentsLayout->addWidget(CheckBoxMesh,         1, 0, 1, 4);
  GroupArgumentsLayout->addWidget(GroupAxis,            2, 0, 1, 4);
  GroupArgumentsLayout->addWidget(GroupAngleBox,        3, 0, 1, 4);
  GroupArgumentsLayout->addWidget(TextLabelTolerance,   4, 0, 1, 2);
  GroupArgumentsLayout->addWidget(SpinBox_Tolerance,    4, 2, 1, 2);
  GroupArgumentsLayout->addWidget(myPreviewCheckBox,    5, 0, 1, 4);
  GroupArgumentsLayout->addWidget(MakeGroupsCheck,      6, 0, 1, 4);

  /***************************************************************/
  GroupButtons = new QGroupBox(this);
  QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
  GroupButtonsLayout->setSpacing(SPACING);
  GroupButtonsLayout->setMargin(MARGIN);
  
  buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
  buttonOk->setAutoDefault(true);
  buttonOk->setDefault(true);
  buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
  buttonApply->setAutoDefault(true);
  buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
  buttonCancel->setAutoDefault(true);
  buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
  buttonHelp->setAutoDefault(true);

  GroupButtonsLayout->addWidget(buttonOk);
  GroupButtonsLayout->addSpacing(10);
  GroupButtonsLayout->addWidget(buttonApply);
  GroupButtonsLayout->addSpacing(10);
  GroupButtonsLayout->addStretch();
  GroupButtonsLayout->addWidget(buttonCancel);
  GroupButtonsLayout->addWidget(buttonHelp);

  /***************************************************************/
  SMESHGUI_RevolutionDlgLayout->addWidget(ConstructorsBox);
  SMESHGUI_RevolutionDlgLayout->addWidget(GroupArguments);
  SMESHGUI_RevolutionDlgLayout->addWidget(GroupButtons);

  /* Initialisations */
  SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
  SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");

  RadioButton3->setChecked(true);

  SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, "angle_precision");

  SpinBox_NbSteps->setRange(1, 999999);

  SpinBox_Tolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.00001, "len_tol_precision");

  RadioButton1->setChecked(true);

  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();

  mySMESHGUI->SetActiveDialogBox((QDialog*)this);

  // Costruction of the logical filter
  SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
  SMESH_TypeFilter* aSmeshGroupFilter    = new SMESH_TypeFilter (GROUP);

  QList<SUIT_SelectionFilter*> aListOfFilters;
  if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
  if (aSmeshGroupFilter)    aListOfFilters.append(aSmeshGroupFilter);

  myMeshOrSubMeshOrGroupFilter =
    new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);

  myHelpFileName = "revolution_page.html";

  Init();

  /*Create menu to vector selection*/
  SelectVectorMenu = new QMenu(this);
  myMenuActions[SelectVectorMenu->addAction( tr( "MEN_POINT_SELECT" ) )] = POINT_SELECT;
  myMenuActions[SelectVectorMenu->addAction( tr( "MEN_FACE_SELECT" ) )] = FACE_SELECT;
  connect( SelectVectorMenu, SIGNAL( triggered( QAction* ) ), SLOT( onSelectVectorMenu( QAction* ) ) );

  /* signals and slots connections */
  connect(buttonOk,     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
  connect(buttonApply,  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
  connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));

  connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
  connect(SelectPointButton,    SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
  connect(SelectVectorButton,   SIGNAL(clicked()), this, SLOT(onSelectVectorButton()));

  connect(SpinBox_X,  SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
  connect(SpinBox_Y,  SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
  connect(SpinBox_Z,  SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));

  connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
  connect(SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
  connect(SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));

  connect(mySMESHGUI,     SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
  connect(mySelectionMgr, SIGNAL(currentSelectionChanged()),      this, SLOT(SelectionIntoArgument()));
  /* to close dialog if study change */
  connect(mySMESHGUI,       SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
  connect(LineEditElements, SIGNAL(textChanged(const QString&)),   SLOT(onTextChange(const QString&)));
  connect(CheckBoxMesh,     SIGNAL(toggled(bool)),                 SLOT(onSelectMesh(bool)));

  connect(GroupAngle,        SIGNAL(buttonClicked(int)),   this, SLOT(toDisplaySimulation()));
  connect(SpinBox_Angle,     SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
  connect(SpinBox_NbSteps,   SIGNAL(valueChanged(int)),    this, SLOT(toDisplaySimulation()));
  connect(SpinBox_Tolerance, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));

  //To Connect preview check box
  connectPreviewControl();

  connect(SpinBox_Angle, SIGNAL(textChanged(const QString&)), this, SLOT(onAngleTextChange(const QString&)));

  ConstructorsClicked(0);
  SelectionIntoArgument();
}
SMESHGUI_RevolutionDlg::~SMESHGUI_RevolutionDlg ( )

Definition at line 368 of file SMESHGUI_RevolutionDlg.cxx.

References myFilterDlg, and mySimulation.

{
  delete mySimulation;
  if ( myFilterDlg ) {
    myFilterDlg->setParent( 0 );
    delete myFilterDlg;
    myFilterDlg = 0;
  }
}

Member Function Documentation

void SMESHGUI_RevolutionDlg::ActivateThisDialog ( ) [private, slot]
bool SMESHGUI_RevolutionDlg::ClickOnApply ( ) [private, slot]

Definition at line 475 of file SMESHGUI_RevolutionDlg.cxx.

References CheckBoxMesh, ConstructorsClicked(), SMESH.eDisplay, GetConstructorId(), SMESHGUI_SpinBox.GetValue(), GroupAngle, Init(), SMESHGUI.isActiveStudyLocked(), IsAxisOk(), isValid(), MakeGroupsCheck, SMESHGUI.Modified(), myElementsId, myMesh, myNbOkElements, mySelectedObject, SMESHGUI_PreviewDlg.mySMESHGUI, PI, SelectionIntoArgument(), SpinBox_Angle, SpinBox_DX, SpinBox_DY, SpinBox_DZ, SpinBox_NbSteps, SpinBox_Tolerance, SpinBox_X, SpinBox_Y, SpinBox_Z, SMESH.Update(), SMESH.UpdateView(), SMESH.AxisStruct.vx, SMESH.AxisStruct.vy, SMESH.AxisStruct.vz, SMESH.AxisStruct.x, SMESH.AxisStruct.y, and SMESH.AxisStruct.z.

Referenced by ClickOnOk(), and SMESHGUI_RevolutionDlg().

{
  if (mySMESHGUI->isActiveStudyLocked())
    return false;

  if (!isValid())
    return false;

  if (myNbOkElements && IsAxisOk()) {
    QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);

    SMESH::long_array_var anElementsId = new SMESH::long_array;

    anElementsId->length(aListElementsId.count());
    for (int i = 0; i < aListElementsId.count(); i++)
      anElementsId[i] = aListElementsId[i].toInt();

    SMESH::AxisStruct anAxis;

    anAxis.x =  SpinBox_X->GetValue();
    anAxis.y =  SpinBox_Y->GetValue();
    anAxis.z =  SpinBox_Z->GetValue();;
    anAxis.vx = SpinBox_DX->GetValue();
    anAxis.vy = SpinBox_DY->GetValue();
    anAxis.vz = SpinBox_DZ->GetValue();

    double anAngle = (SpinBox_Angle->GetValue())*PI/180;
    long aNbSteps = (long)SpinBox_NbSteps->value();
    double aTolerance = SpinBox_Tolerance->GetValue();

    if ( GroupAngle->checkedId() == 1 )
      anAngle = anAngle/aNbSteps;

    QStringList aParameters;
    aParameters << SpinBox_X->text();
    aParameters << SpinBox_Y->text();
    aParameters << SpinBox_Z->text();
    aParameters << SpinBox_DX->text();
    aParameters << SpinBox_DY->text();
    aParameters << SpinBox_DZ->text();
    aParameters << SpinBox_Angle->text();
    aParameters << SpinBox_NbSteps->text();
    aParameters << SpinBox_Tolerance->text();

    try {
      SUIT_OverrideCursor aWaitCursor;
      SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
      
      if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
        if( CheckBoxMesh->isChecked() ) {
          if( GetConstructorId() == 0 )
            SMESH::ListOfGroups_var groups = 
              aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
                                                           anAngle, aNbSteps, aTolerance);
          else
            SMESH::ListOfGroups_var groups = 
              aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
                                                           anAngle, aNbSteps, aTolerance);
        }
        else
          SMESH::ListOfGroups_var groups = 
            aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
                                                 anAngle, aNbSteps, aTolerance);
      }
      else {
        if( CheckBoxMesh->isChecked() ) {
          if( GetConstructorId() == 0 )
            aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
          else
            aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
        }
        else
          aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
      }

      myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
    } catch (...) {
    }

    SMESH::UpdateView();
    SMESH::Update(myIO, SMESH::eDisplay);
    if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
      mySMESHGUI->updateObjBrowser(true); // new groups may appear
    Init(false);
    ConstructorsClicked(GetConstructorId());
    mySelectedObject = SMESH::SMESH_IDSource::_nil();
    SelectionIntoArgument();

    SMESHGUI::Modified();
  }

  return true;
}
void SMESHGUI_RevolutionDlg::ClickOnCancel ( ) [private, slot]

Definition at line 583 of file SMESHGUI_RevolutionDlg.cxx.

References reject().

Referenced by ClickOnOk(), and SMESHGUI_RevolutionDlg().

{
  reject();
}
void SMESHGUI_RevolutionDlg::ClickOnHelp ( ) [private, slot]

Definition at line 597 of file SMESHGUI_RevolutionDlg.cxx.

References myHelpFileName, and SMESHGUI_PreviewDlg.mySMESHGUI.

Referenced by keyPressEvent(), and SMESHGUI_RevolutionDlg().

{
  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
  if (app) 
    app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
  else {
    QString platform;
#ifdef WIN32
    platform = "winapplication";
#else
    platform = "application";
#endif
    SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
                             arg(app->resourceMgr()->stringValue("ExternalBrowser", 
                                                                 platform)).
                             arg(myHelpFileName));
  }
}
void SMESHGUI_RevolutionDlg::ClickOnOk ( ) [private, slot]

Definition at line 573 of file SMESHGUI_RevolutionDlg.cxx.

References ClickOnApply(), and ClickOnCancel().

Referenced by SMESHGUI_RevolutionDlg().

{
  if( ClickOnApply() )
    ClickOnCancel();
}
void SMESHGUI_RevolutionDlg::closeEvent ( QCloseEvent *  ) [private]

Definition at line 916 of file SMESHGUI_RevolutionDlg.cxx.

References SMESH.GetCurrentVtkView(), SMESH.GetViewWindow(), mySelectionMgr, SMESHGUI_PreviewDlg.mySMESHGUI, SMESH.RemoveFilters(), SMESHGUI.ResetState(), and SMESH.SetPointRepresentation().

{
  /* same than click on cancel button */
  disconnect(mySelectionMgr, 0, this, 0);
  mySelectionMgr->clearFilters();
  //mySelectionMgr->clearSelected();
  if (SMESH::GetCurrentVtkView()) {
    SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
    SMESH::SetPointRepresentation(false);
  }
  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
    aViewWindow->SetSelectionMode(ActorSelection);
  mySMESHGUI->ResetState();
}
void SMESHGUI_PreviewDlg::connectPreviewControl ( ) [protected, inherited]
void SMESHGUI_RevolutionDlg::ConstructorsClicked ( int  constructorId) [private, slot]

Definition at line 418 of file SMESHGUI_RevolutionDlg.cxx.

References buttonApply, buttonOk, CheckBoxMesh, SMESH.GetViewWindow(), GroupArguments, LineEditElements, myEditCurrentArgument, myIDs, myNbOkElements, mySelectionMgr, mySimulation, SMESHGUI_PreviewDlg.mySMESHGUI, onSelectMesh(), SelectionIntoArgument(), SMESH.SetPointRepresentation(), and SMESHGUI_MeshEditPreview.SetVisibility().

Referenced by ActivateThisDialog(), ClickOnApply(), and SMESHGUI_RevolutionDlg().

{
  disconnect(mySelectionMgr, 0, this, 0);

  /*  SALOME_ListIO io;
  mySelectionMgr->selectedObjects( io );
  SALOME_ListIO aList;
  mySelectionMgr->setSelectedObjects( aList );*/

  buttonApply->setEnabled(false);
  buttonOk->setEnabled(false);
  mySimulation->SetVisibility(false);

  Selection_Mode aSelMode = ActorSelection;

  switch (constructorId) {
  case 0:
    {
      GroupArguments->setTitle(tr("REVOLUTION_1D"));
      aSelMode = EdgeSelection;
      break;
    }
  case 1:
    {
      GroupArguments->setTitle(tr("REVOLUTION_2D"));
      aSelMode = FaceSelection;
      break;
    }
  }

  if (myEditCurrentArgument != (QWidget*)LineEditElements) {
    SMESH::SetPointRepresentation(false);
  }

  if (!CheckBoxMesh->isChecked())
    {
      LineEditElements->clear();
      myIDs.clear();
      myNbOkElements = 0;
      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
        aViewWindow->SetSelectionMode(aSelMode);
    }

  myEditCurrentArgument = (QWidget*)LineEditElements;
  LineEditElements->setFocus();

  if (CheckBoxMesh->isChecked())
    onSelectMesh(true);

  connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
  //  mySelectionMgr->setSelectedObjects( io );
}
void SMESHGUI_RevolutionDlg::DeactivateActiveDialog ( ) [private, slot]
void SMESHGUI_RevolutionDlg::enterEvent ( QEvent *  ) [private]

Definition at line 906 of file SMESHGUI_RevolutionDlg.cxx.

References ActivateThisDialog(), and ConstructorsBox.

{
  if (!ConstructorsBox->isEnabled())
    ActivateThisDialog();
}
int SMESHGUI_RevolutionDlg::GetConstructorId ( ) [private]
SMESHGUI_RevolutionDlg.Handle ( SALOME_InteractiveObject  ) [private]
void SMESHGUI_PreviewDlg::hidePreview ( ) [inherited]
void SMESHGUI_RevolutionDlg::Init ( bool  ResetControls = true) [private]
bool SMESHGUI_PreviewDlg::isApplyAndClose ( ) const [protected, virtual, inherited]
bool SMESHGUI_RevolutionDlg::IsAxisOk ( ) [private]
bool SMESHGUI_RevolutionDlg::isValid ( ) [private]

Definition at line 1178 of file SMESHGUI_RevolutionDlg.cxx.

References SpinBox_Angle, SpinBox_DX, SpinBox_DY, SpinBox_DZ, SpinBox_NbSteps, SpinBox_Tolerance, SpinBox_X, SpinBox_Y, and SpinBox_Z.

Referenced by ClickOnApply().

{
  QString msg;
  bool ok = true;
  ok = SpinBox_X->isValid( msg, true ) && ok;
  ok = SpinBox_Y->isValid( msg, true ) && ok;
  ok = SpinBox_Z->isValid( msg, true ) && ok;
  ok = SpinBox_DX->isValid( msg, true ) && ok;
  ok = SpinBox_DY->isValid( msg, true ) && ok;
  ok = SpinBox_DZ->isValid( msg, true ) && ok;
  ok = SpinBox_Angle->isValid( msg, true ) && ok;
  ok = SpinBox_NbSteps->isValid( msg, true ) && ok;
  ok = SpinBox_Tolerance->isValid( msg, true ) && ok;

  if( !ok ) {
    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
    if ( !msg.isEmpty() )
      str += "\n" + msg;
    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
    return false;
  }
  return true;
}
void SMESHGUI_RevolutionDlg::keyPressEvent ( QKeyEvent *  e) [private]

Definition at line 1025 of file SMESHGUI_RevolutionDlg.cxx.

References ClickOnHelp().

{
  QDialog::keyPressEvent( e );
  if ( e->isAccepted() )
    return;

  if ( e->key() == Qt::Key_F1 ) {
    e->accept();
    ClickOnHelp();
  }
}
void SMESHGUI_RevolutionDlg::onAngleTextChange ( const QString &  theNewText) [private, slot]

Definition at line 621 of file SMESHGUI_RevolutionDlg.cxx.

References RadioButton3, RadioButton4, and SpinBox_Angle.

Referenced by SMESHGUI_RevolutionDlg().

{
  bool isNumber;
  SpinBox_Angle->text().toDouble( &isNumber );
  if( !isNumber )
    RadioButton3->setChecked( true );
  RadioButton4->setEnabled( isNumber );
}
void SMESHGUI_RevolutionDlg::onDisplaySimulation ( bool  toDisplayPreview) [protected, virtual, slot]

Reimplemented from SMESHGUI_PreviewDlg.

Definition at line 1041 of file SMESHGUI_RevolutionDlg.cxx.

References CheckBoxMesh, GetConstructorId(), SMESHGUI_SpinBox.GetValue(), GroupAngle, IsAxisOk(), myElementsId, myMesh, myNbOkElements, SMESHGUI_PreviewDlg.myPreviewCheckBox, mySelectedObject, mySimulation, PI, SMESHGUI_MeshEditPreview.SetData(), SMESHGUI_MeshEditPreview.SetVisibility(), SpinBox_Angle, SpinBox_DX, SpinBox_DY, SpinBox_DZ, SpinBox_NbSteps, SpinBox_Tolerance, SpinBox_X, SpinBox_Y, SpinBox_Z, SMESH.AxisStruct.vx, SMESH.AxisStruct.vy, SMESH.AxisStruct.vz, SMESH.AxisStruct.x, SMESH.AxisStruct.y, and SMESH.AxisStruct.z.

Referenced by Init(), onTextChange(), onVectorChanged(), and SelectionIntoArgument().

{
  if (myPreviewCheckBox->isChecked() && toDisplayPreview)
  {
    //display preview
    if (myNbOkElements && IsAxisOk())
    {
      QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
      
      SMESH::long_array_var anElementsId = new SMESH::long_array;
      
      anElementsId->length(aListElementsId.count());
      for (int i = 0; i < aListElementsId.count(); i++)
        anElementsId[i] = aListElementsId[i].toInt();
      
      SMESH::AxisStruct anAxis;
      
      anAxis.x =  SpinBox_X->GetValue();
      anAxis.y =  SpinBox_Y->GetValue();
      anAxis.z =  SpinBox_Z->GetValue();
      anAxis.vx = SpinBox_DX->GetValue();
      anAxis.vy = SpinBox_DY->GetValue();
      anAxis.vz = SpinBox_DZ->GetValue();
      
      double anAngle = (SpinBox_Angle->GetValue())*PI/180;
      long aNbSteps = (long)SpinBox_NbSteps->value();
      double aTolerance = SpinBox_Tolerance->GetValue();
      
      if (GroupAngle->checkedId() == 1)
        anAngle = anAngle/aNbSteps;
      
      try {
        SUIT_OverrideCursor aWaitCursor;
        SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
        if( CheckBoxMesh->isChecked() ) {
          if( GetConstructorId() == 0 )
            aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
                                               anAngle, aNbSteps, aTolerance);
          else
            aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
                                               anAngle, aNbSteps, aTolerance);
        }
        else
          aMeshEditor->RotationSweep(anElementsId.inout(), 
                                     anAxis, 
                                     anAngle, 
                                     aNbSteps, 
                                     aTolerance);
        SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
        mySimulation->SetData(aMeshPreviewStruct._retn());
      } catch (...) {}
    }
    else
    {
      mySimulation->SetVisibility(false);
    }
  }
  else
  {
    //erase preview
    mySimulation->SetVisibility(false);
  }
}
void SMESHGUI_RevolutionDlg::onSelectMesh ( bool  toSelectMesh) [private, slot]

Definition at line 935 of file SMESHGUI_RevolutionDlg.cxx.

References GetConstructorId(), SMESH.GetViewWindow(), LineEditElements, myEditCurrentArgument, myFilterBtn, myIDs, myIdValidator, myMeshOrSubMeshOrGroupFilter, mySelectionMgr, mySimulation, SMESHGUI_PreviewDlg.mySMESHGUI, onTextChange(), SelectionIntoArgument(), SMESH.SetPointRepresentation(), SMESHGUI_MeshEditPreview.SetVisibility(), and TextLabelElements.

Referenced by ConstructorsClicked(), Init(), and SMESHGUI_RevolutionDlg().

{
  if (toSelectMesh) {
    myIDs = LineEditElements->text();
    TextLabelElements->setText(tr("SMESH_NAME"));
  }
  else
    TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
  myFilterBtn->setEnabled(!toSelectMesh);

  if (myEditCurrentArgument != LineEditElements) {
    LineEditElements->clear();
    mySimulation->SetVisibility(false);
    return;
  }

  mySelectionMgr->clearFilters();
  SMESH::SetPointRepresentation(false);

  if (toSelectMesh) {
    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
      aViewWindow->SetSelectionMode(ActorSelection);
    mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
    LineEditElements->setReadOnly(true);
    LineEditElements->setValidator(0);
  } else {
    int aConstructorId = GetConstructorId();
    if (aConstructorId == 0)
      {
        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
          aViewWindow->SetSelectionMode(EdgeSelection);
      }
    else if (aConstructorId == 1)
      {
        if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
          aViewWindow->SetSelectionMode(FaceSelection);
      }

    LineEditElements->setReadOnly(false);
    LineEditElements->setValidator(myIdValidator);
    onTextChange(LineEditElements->text());
    mySimulation->SetVisibility(false);
  }

  SelectionIntoArgument();

  if (!toSelectMesh)
    LineEditElements->setText( myIDs );
}
void SMESHGUI_RevolutionDlg::onSelectVectorButton ( ) [private, slot]

Definition at line 1109 of file SMESHGUI_RevolutionDlg.cxx.

References SelectVectorMenu.

Referenced by SMESHGUI_RevolutionDlg().

                                                 {
  if(SelectVectorMenu) {
    SelectVectorMenu->exec( QCursor::pos() );
  }
}
void SMESHGUI_RevolutionDlg::onSelectVectorMenu ( QAction *  action) [private, slot]

Definition at line 1119 of file SMESHGUI_RevolutionDlg.cxx.

References FACE_SELECT, SMESH.GetViewWindow(), myEditCurrentArgument, myMenuActions, mySelectionMgr, SMESHGUI_PreviewDlg.mySMESHGUI, myVectorDefinition, POINT_SELECT, SelectionIntoArgument(), SMESH.SetPointRepresentation(), and SpinBox_DX.

Referenced by SMESHGUI_RevolutionDlg().

                                                               {
  if(!action)
    return;

  disconnect(mySelectionMgr, 0, this, 0);

  switch(myMenuActions[action]) {
  case POINT_SELECT: 
    SMESH::SetPointRepresentation(true);
    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
      aViewWindow->SetSelectionMode(NodeSelection);
    break;
    
  case FACE_SELECT: 
    SMESH::SetPointRepresentation(false);
    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
      aViewWindow->SetSelectionMode(FaceSelection);
    break;
  }

  myVectorDefinition = myMenuActions[action];
  myEditCurrentArgument = (QWidget*)SpinBox_DX;
  myEditCurrentArgument->setFocus();
  connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
  SelectionIntoArgument();
}
void SMESHGUI_RevolutionDlg::onTextChange ( const QString &  theNewText) [private, slot]

Definition at line 634 of file SMESHGUI_RevolutionDlg.cxx.

References buttonApply, buttonOk, SMDS_Mesh.FindElement(), SMDS_MeshElement.GetID(), SMESH_Actor.GetObject(), SMESH.GetViewWindow(), Handle(), IsAxisOk(), LineEditElements, myActor, myBusy, myElementsId, myNbOkElements, mySelector, SMESHGUI_PreviewDlg.mySMESHGUI, and onDisplaySimulation().

Referenced by onSelectMesh(), and SMESHGUI_RevolutionDlg().

{
  QLineEdit* send = (QLineEdit*)sender();

  if (myBusy) return;
  myBusy = true;

  if (send == LineEditElements)
    myNbOkElements = 0;

  buttonOk->setEnabled(false);
  buttonApply->setEnabled(false);

  // hilight entered elements
  SMDS_Mesh* aMesh = 0;
  if (myActor)
    aMesh = myActor->GetObject()->GetMesh();

  if (aMesh) {
    if (send == LineEditElements) {
      Handle(SALOME_InteractiveObject) anIO = myActor->getIO();

      TColStd_MapOfInteger newIndices;

      QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
      
      for (int i = 0; i < aListId.count(); i++) {
        const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
        if (e)
          newIndices.Add(e->GetID());
        myNbOkElements++;
      }

      mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
        aViewWindow->highlight( myActor->getIO(), true, true );
      
      myElementsId = theNewText;
    }
  }

  if (myNbOkElements && IsAxisOk()) {
    buttonOk->setEnabled(true);
    buttonApply->setEnabled(true);
  }
  onDisplaySimulation(true);

  myBusy = false;
}
void SMESHGUI_RevolutionDlg::onVectorChanged ( ) [private, slot]

Definition at line 1009 of file SMESHGUI_RevolutionDlg.cxx.

References buttonApply, buttonOk, IsAxisOk(), and onDisplaySimulation().

Referenced by SMESHGUI_RevolutionDlg().

{
  if (IsAxisOk()) {
    buttonOk->setEnabled(true);
    buttonApply->setEnabled(true);
  } else {
    buttonOk->setEnabled(false);
    buttonApply->setEnabled(false);
  }
  onDisplaySimulation(true);
}
void SMESHGUI_RevolutionDlg::reject ( )

Definition at line 588 of file SMESHGUI_RevolutionDlg.cxx.

Referenced by ClickOnCancel().

{
  close();
}
void SMESHGUI_RevolutionDlg::SelectionIntoArgument ( ) [private, slot]

Definition at line 688 of file SMESHGUI_RevolutionDlg.cxx.

References buttonApply, buttonOk, CheckBoxMesh, PAL_MESH_043_3D.face, FACE_SELECT, SMESH.FindActorByEntry(), SMESH.FindActorByObject(), SMDS_Mesh.FindElement(), SMDS_Mesh.FindNode(), SMESH.GetMeshByIO(), SMESH.GetNameOfSelectedElements(), SMESH.GetNameOfSelectedIObjects(), SMESH.GetNameOfSelectedNodes(), getNormale(), SMESH_Actor.GetObject(), SMESHGUI_SpinBox.GetValue(), GroupButtons, Handle(), IsAxisOk(), LineEditElements, MakeGroupsCheck, myActor, myBusy, myEditCurrentArgument, myElementsId, myMesh, myNbOkElements, mySelectedObject, mySelectionMgr, mySelector, myVectorDefinition, onDisplaySimulation(), POINT_SELECT, SMESHGUI_SpinBox.SetValue(), SpinBox_DX, SpinBox_DY, SpinBox_DZ, SpinBox_X, SpinBox_Y, SpinBox_Z, SMDS_MeshNode.X(), ex13_hole1partial.x, SMDS_MeshNode.Y(), ex13_hole1partial.y, and SMDS_MeshNode.Z().

Referenced by ActivateThisDialog(), ClickOnApply(), ConstructorsClicked(), onSelectMesh(), onSelectVectorMenu(), SetEditCurrentArgument(), and SMESHGUI_RevolutionDlg().

{
  if (myBusy) return;

  // clear
  QString aString = "";

  myBusy = true;
  if (myEditCurrentArgument == (QWidget*)LineEditElements) {
    LineEditElements->setText(aString);
    myNbOkElements = 0;
    buttonOk->setEnabled(false);
    buttonApply->setEnabled(false);
  }
  myBusy = false;

  if (!GroupButtons->isEnabled()) // inactive
    return;

  // get selected mesh
  const SALOME_ListIO& aList = mySelector->StoredIObjects();

  int nbSel = aList.Extent();
  if (nbSel != 1) 
    return;

  Handle(SALOME_InteractiveObject) IO = aList.First();
  SMESH::SMESH_Mesh_var aMeshVar = SMESH::GetMeshByIO(IO);
  if (aMeshVar->_is_nil())
    return;

  SMESH_Actor* anActor = SMESH::FindActorByObject(aMeshVar);
  if (!anActor)
    anActor = SMESH::FindActorByEntry(IO->getEntry());
  if (!anActor && !CheckBoxMesh->isChecked())
    return;

  int aNbUnits = 0;

  if (myEditCurrentArgument == (QWidget*)LineEditElements) {
    myElementsId = "";
    myMesh = aMeshVar;
    myActor = anActor;
    myIO = IO;

    // MakeGroups is available if there are groups
    if ( myMesh->NbGroups() == 0 ) {
      MakeGroupsCheck->setChecked(false);
      MakeGroupsCheck->setEnabled(false);
    } else {
      MakeGroupsCheck->setEnabled(true);
    }

    if (CheckBoxMesh->isChecked()) {
      SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);

      if (!SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
        mySelectedObject = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
      else
        return;
    } else {
      aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
      myElementsId = aString;
      if (aNbUnits < 1)
        return;
    }
    myNbOkElements = true;
  } else {

    SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
    if (!aMesh)
      return;

    bool isNodeSelected = (myEditCurrentArgument == (QWidget*)SpinBox_X ||
                           (myEditCurrentArgument == (QWidget*)SpinBox_DX && 
                            myVectorDefinition==POINT_SELECT));

    bool isFaceSelected = (myEditCurrentArgument == (QWidget*)SpinBox_DX && 
                           myVectorDefinition==FACE_SELECT);

    if(isNodeSelected) {
      aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString);
    }
    else if(isFaceSelected){
      aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
    }
    
    if (aNbUnits != 1)
      return;

    if(isNodeSelected) {
      const SMDS_MeshNode * n = aMesh->FindNode(aString.toInt());
      if (!n)
        return;

      double x = n->X();
      double y = n->Y();
      double z = n->Z();

      if (myEditCurrentArgument == (QWidget*)SpinBox_X) {
        SpinBox_X->SetValue(x);
        SpinBox_Y->SetValue(y);
        SpinBox_Z->SetValue(z);
      } else if (myEditCurrentArgument == (QWidget*)SpinBox_DX) {
        SpinBox_DX->SetValue(x - SpinBox_X->GetValue());
        SpinBox_DY->SetValue(y - SpinBox_Y->GetValue());
        SpinBox_DZ->SetValue(z - SpinBox_Z->GetValue());
      }
    }
    else if(isFaceSelected){
      const SMDS_MeshFace* face = dynamic_cast<const SMDS_MeshFace*>(aMesh->FindElement(aString.toInt()));
      if (!face)
        return;
      
      gp_XYZ aNormale = SMESH::getNormale(face);
      SpinBox_DX->SetValue(aNormale.X());
      SpinBox_DY->SetValue(aNormale.Y());
      SpinBox_DZ->SetValue(aNormale.Z());
      
    }
  }

  myBusy = true;
  if (myEditCurrentArgument == (QWidget*)LineEditElements)
    LineEditElements->setText(aString);
  myBusy = false;

  // OK
  if (myNbOkElements && IsAxisOk()) {
    buttonOk->setEnabled(true);
    buttonApply->setEnabled(true);
  }

  onDisplaySimulation(true);
}
void SMESHGUI_RevolutionDlg::SetEditCurrentArgument ( ) [private, slot]

Definition at line 828 of file SMESHGUI_RevolutionDlg.cxx.

References CheckBoxMesh, GetConstructorId(), SMESH.GetViewWindow(), LineEditElements, myEditCurrentArgument, myMeshOrSubMeshOrGroupFilter, mySelectionMgr, mySimulation, SMESHGUI_PreviewDlg.mySMESHGUI, SelectElementsButton, SelectionIntoArgument(), SelectPointButton, SMESH.SetPointRepresentation(), SMESHGUI_MeshEditPreview.SetVisibility(), and SpinBox_X.

Referenced by SMESHGUI_RevolutionDlg().

{
  QPushButton* send = (QPushButton*)sender();

  disconnect(mySelectionMgr, 0, this, 0);
  mySelectionMgr->clearSelected();
  mySelectionMgr->clearFilters();

  if (send == SelectElementsButton) {
    mySimulation->SetVisibility(false);
    myEditCurrentArgument = (QWidget*)LineEditElements;
    SMESH::SetPointRepresentation(false);
    if (CheckBoxMesh->isChecked()) {
      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
        aViewWindow->SetSelectionMode(ActorSelection);
      mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
    } else {
      int aConstructorId = GetConstructorId();
      if (aConstructorId == 0)
        {
          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
            aViewWindow->SetSelectionMode(EdgeSelection);
        }
      else if (aConstructorId == 1)
        {
          if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
            aViewWindow->SetSelectionMode(FaceSelection);
        }
    }
  } else if (send == SelectPointButton) {
    myEditCurrentArgument = (QWidget*)SpinBox_X;
    SMESH::SetPointRepresentation(true);
    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
      aViewWindow->SetSelectionMode(NodeSelection);
  }

  myEditCurrentArgument->setFocus();
  connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
  SelectionIntoArgument();
}
void SMESHGUI_RevolutionDlg::setFilters ( ) [private, slot]
void SMESHGUI_PreviewDlg::setIsApplyAndClose ( const bool  theFlag) [protected, virtual, inherited]
void SMESHGUI_PreviewDlg::showPreview ( ) [inherited]
void SMESHGUI_PreviewDlg::toDisplaySimulation ( ) [protected, slot, inherited]

Field Documentation

QPushButton* SMESHGUI_RevolutionDlg.buttonApply [private]
QPushButton* SMESHGUI_RevolutionDlg.buttonCancel [private]

Definition at line 114 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

QPushButton* SMESHGUI_RevolutionDlg.buttonHelp [private]

Definition at line 116 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

QPushButton* SMESHGUI_RevolutionDlg.buttonOk [private]
QButtonGroup* SMESHGUI_RevolutionDlg.GroupAngle [private]

Definition at line 124 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 118 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 109 of file SMESHGUI_RevolutionDlg.h.

Referenced by GetConstructorId(), and SMESHGUI_RevolutionDlg().

Definition at line 103 of file SMESHGUI_RevolutionDlg.h.

Referenced by Init(), onTextChange(), and SelectionIntoArgument().

Definition at line 101 of file SMESHGUI_RevolutionDlg.h.

Referenced by Init(), onTextChange(), and SelectionIntoArgument().

QPushButton* SMESHGUI_RevolutionDlg.myFilterBtn [private]

Definition at line 161 of file SMESHGUI_RevolutionDlg.h.

Referenced by onSelectMesh(), and SMESHGUI_RevolutionDlg().

Definition at line 162 of file SMESHGUI_RevolutionDlg.h.

Referenced by setFilters(), and ~SMESHGUI_RevolutionDlg().

Definition at line 158 of file SMESHGUI_RevolutionDlg.h.

Referenced by ClickOnHelp(), and SMESHGUI_RevolutionDlg().

QString SMESHGUI_RevolutionDlg.myIDs [private]

Definition at line 159 of file SMESHGUI_RevolutionDlg.h.

Referenced by ConstructorsClicked(), Init(), and onSelectMesh().

Definition at line 91 of file SMESHGUI_RevolutionDlg.h.

Referenced by onSelectMesh(), and SMESHGUI_RevolutionDlg().

QMap<QAction*,int> SMESHGUI_RevolutionDlg.myMenuActions [private]

Definition at line 154 of file SMESHGUI_RevolutionDlg.h.

Referenced by onSelectVectorMenu(), and SMESHGUI_RevolutionDlg().

SMESH::SMESH_Mesh_var SMESHGUI_RevolutionDlg.myMesh [private]

Definition at line 106 of file SMESHGUI_RevolutionDlg.h.

QCheckBox* SMESHGUI_PreviewDlg.myPreviewCheckBox [protected, inherited]
SMESH::SMESH_IDSource_var SMESHGUI_RevolutionDlg.mySelectedObject [private]
LightApp_SelectionMgr* SMESHGUI_RevolutionDlg.mySelectionMgr [private]
SVTK_Selector* SMESHGUI_RevolutionDlg.mySelector [private]
SMESHGUI* SMESHGUI_PreviewDlg.mySMESHGUI [protected, inherited]

Definition at line 61 of file SMESHGUI_PreviewDlg.h.

Referenced by SMESHGUI_TranslationDlg.ActivateThisDialog(), SMESHGUI_SymmetryDlg.ActivateThisDialog(), SMESHGUI_ScaleDlg.ActivateThisDialog(), SMESHGUI_RotationDlg.ActivateThisDialog(), ActivateThisDialog(), SMESHGUI_ExtrusionDlg.ActivateThisDialog(), SMESHGUI_ExtrusionAlongPathDlg.ActivateThisDialog(), SMESHGUI_TranslationDlg.ClickOnApply(), SMESHGUI_SymmetryDlg.ClickOnApply(), SMESHGUI_ScaleDlg.ClickOnApply(), SMESHGUI_RotationDlg.ClickOnApply(), ClickOnApply(), SMESHGUI_ExtrusionDlg.ClickOnApply(), SMESHGUI_ExtrusionAlongPathDlg.ClickOnApply(), SMESHGUI_TranslationDlg.ClickOnCancel(), SMESHGUI_SymmetryDlg.ClickOnCancel(), SMESHGUI_ScaleDlg.ClickOnCancel(), SMESHGUI_RotationDlg.ClickOnCancel(), SMESHGUI_TranslationDlg.ClickOnHelp(), SMESHGUI_SymmetryDlg.ClickOnHelp(), SMESHGUI_ScaleDlg.ClickOnHelp(), SMESHGUI_RotationDlg.ClickOnHelp(), ClickOnHelp(), SMESHGUI_ExtrusionDlg.ClickOnHelp(), SMESHGUI_ExtrusionAlongPathDlg.ClickOnHelp(), closeEvent(), SMESHGUI_ExtrusionDlg.closeEvent(), SMESHGUI_TranslationDlg.ConstructorsClicked(), SMESHGUI_SymmetryDlg.ConstructorsClicked(), SMESHGUI_ScaleDlg.ConstructorsClicked(), ConstructorsClicked(), SMESHGUI_ExtrusionDlg.ConstructorsClicked(), SMESHGUI_ExtrusionAlongPathDlg.ConstructorsClicked(), SMESHGUI_TranslationDlg.DeactivateActiveDialog(), SMESHGUI_SymmetryDlg.DeactivateActiveDialog(), SMESHGUI_ScaleDlg.DeactivateActiveDialog(), SMESHGUI_RotationDlg.DeactivateActiveDialog(), DeactivateActiveDialog(), SMESHGUI_ExtrusionDlg.DeactivateActiveDialog(), SMESHGUI_ExtrusionAlongPathDlg.DeactivateActiveDialog(), SMESHGUI_TranslationDlg.onSelectMesh(), SMESHGUI_SymmetryDlg.onSelectMesh(), SMESHGUI_ScaleDlg.onSelectMesh(), SMESHGUI_RotationDlg.onSelectMesh(), onSelectMesh(), SMESHGUI_ExtrusionDlg.onSelectMesh(), onSelectVectorMenu(), SMESHGUI_TranslationDlg.onTextChange(), SMESHGUI_SymmetryDlg.onTextChange(), SMESHGUI_ScaleDlg.onTextChange(), SMESHGUI_RotationDlg.onTextChange(), onTextChange(), SMESHGUI_ExtrusionDlg.onTextChange(), SMESHGUI_ExtrusionAlongPathDlg.onTextChange(), SMESHGUI_ExtrusionAlongPathDlg.reject(), SMESHGUI_TranslationDlg.SetEditCurrentArgument(), SMESHGUI_SymmetryDlg.SetEditCurrentArgument(), SMESHGUI_ScaleDlg.SetEditCurrentArgument(), SMESHGUI_RotationDlg.SetEditCurrentArgument(), SetEditCurrentArgument(), SMESHGUI_ExtrusionDlg.SetEditCurrentArgument(), SMESHGUI_ExtrusionAlongPathDlg.SetEditCurrentArgument(), SMESHGUI_TranslationDlg.setFilters(), SMESHGUI_SymmetryDlg.setFilters(), SMESHGUI_ScaleDlg.setFilters(), SMESHGUI_RotationDlg.setFilters(), setFilters(), SMESHGUI_ExtrusionDlg.setFilters(), SMESHGUI_ExtrusionAlongPathDlg.setFilters(), SMESHGUI_ExtrusionAlongPathDlg.SMESHGUI_ExtrusionAlongPathDlg(), SMESHGUI_ExtrusionDlg.SMESHGUI_ExtrusionDlg(), SMESHGUI_PreviewDlg.SMESHGUI_PreviewDlg(), SMESHGUI_RevolutionDlg(), SMESHGUI_RotationDlg.SMESHGUI_RotationDlg(), SMESHGUI_ScaleDlg.SMESHGUI_ScaleDlg(), SMESHGUI_SymmetryDlg.SMESHGUI_SymmetryDlg(), and SMESHGUI_TranslationDlg.SMESHGUI_TranslationDlg().

Definition at line 155 of file SMESHGUI_RevolutionDlg.h.

Referenced by onSelectVectorMenu(), and SelectionIntoArgument().

QRadioButton* SMESHGUI_RevolutionDlg.RadioButton1 [private]

Definition at line 110 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

QRadioButton* SMESHGUI_RevolutionDlg.RadioButton2 [private]

Definition at line 111 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

QRadioButton* SMESHGUI_RevolutionDlg.RadioButton3 [private]

Definition at line 126 of file SMESHGUI_RevolutionDlg.h.

Referenced by onAngleTextChange(), and SMESHGUI_RevolutionDlg().

QRadioButton* SMESHGUI_RevolutionDlg.RadioButton4 [private]

Definition at line 127 of file SMESHGUI_RevolutionDlg.h.

Referenced by onAngleTextChange(), and SMESHGUI_RevolutionDlg().

Definition at line 120 of file SMESHGUI_RevolutionDlg.h.

Referenced by SetEditCurrentArgument(), and SMESHGUI_RevolutionDlg().

Definition at line 130 of file SMESHGUI_RevolutionDlg.h.

Referenced by SetEditCurrentArgument(), and SMESHGUI_RevolutionDlg().

Definition at line 138 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 153 of file SMESHGUI_RevolutionDlg.h.

Referenced by onSelectVectorButton(), and SMESHGUI_RevolutionDlg().

SalomeApp_IntSpinBox* SMESHGUI_RevolutionDlg.SpinBox_NbSteps [private]

Definition at line 146 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 139 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 141 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 143 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 119 of file SMESHGUI_RevolutionDlg.h.

Referenced by onSelectMesh(), and SMESHGUI_RevolutionDlg().

Definition at line 148 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 129 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 150 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 137 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 131 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 133 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

Definition at line 135 of file SMESHGUI_RevolutionDlg.h.

Referenced by SMESHGUI_RevolutionDlg().

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