X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_ClippingDlg.h;h=ed92330f27031525500e2a878919f8441eb2c4b7;hp=6a2bb493ffffec99751f753d70a0dd25b7a545dd;hb=7af78cc3d0b95ec53ab6ec83a92b1df4a9fb6b2a;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.h b/src/SMESHGUI/SMESHGUI_ClippingDlg.h index 6a2bb493f..ed92330f2 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.h +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.h @@ -1,62 +1,62 @@ -// SMESH SMESHGUI : GUI for SMESH component +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// File : SMESHGUI_TransparencyDlg.h -// Author : Nicolas REJNERI -// Module : SMESH -// $Header$ +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// SMESH SMESHGUI : GUI for SMESH component +// File : SMESHGUI_ClippingDlg.h +// Author : Nicolas REJNERI, Open CASCADE S.A.S. +// +#ifndef SMESHGUI_CLIPPINGDLG_H +#define SMESHGUI_CLIPPINGDLG_H + +// SMESH includes +#include "SMESH_SMESHGUI.hxx" -#ifndef DIALOGBOX_CLIPPING_H -#define DIALOGBOX_CLIPPING_H +// SALOME includes +#include -#include +// Qt includes +#include +// VTK includes #include -#include +// STL includes #include -// QT Includes -#include -#include - class QLabel; class QPushButton; -class QTable; class QCheckBox; class QComboBox; -class SALOME_Selection; +class LightApp_SelectionMgr; +class SVTK_Selector; +class SMESHGUI; class SMESH_Actor; - class OrientedPlane; +class SMESHGUI_SpinBox; - -namespace SMESH{ - +namespace SMESH +{ typedef vtkSmartPointer TVTKPlane; typedef std::vector TPlanes; - enum Orientation {XY, YZ, ZX}; - + enum Orientation { XY, YZ, ZX }; }; @@ -64,63 +64,78 @@ namespace SMESH{ // class : SMESHGUI_ClippingDlg // purpose : //================================================================================= -class SMESHGUI_ClippingDlg : public QDialog -{ - Q_OBJECT +class SMESHGUI_EXPORT SMESHGUI_ClippingDlg : public QDialog +{ + Q_OBJECT public: - SMESHGUI_ClippingDlg( QWidget* parent = 0, - const char* name = 0, - bool modal = false, - WFlags fl = 0 ); - - float getDistance() {return (float)SpinBoxDistance->GetValue();} - void setDistance( const float theDistance) {SpinBoxDistance->SetValue(theDistance);} - double getRotation1() {return SpinBoxRot1->GetValue();} - double getRotation2() {return SpinBoxRot2->GetValue();} - void setRotation( const double theRot1, const double theRot2 ); - void Sinchronize(); - - ~SMESHGUI_ClippingDlg(); + SMESHGUI_ClippingDlg( SMESHGUI* ); + ~SMESHGUI_ClippingDlg(); + + double getDistance() const; + void setDistance( const double ); + double getRotation1() const; + double getRotation2() const; + void setRotation( const double, const double ); + void Sinchronize(); + + // used in SMESHGUI::restoreVisualParameters() to avoid + // declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx + static void AddPlane (SMESH_Actor* theActor, + SVTK_ViewWindow* theViewWindow, + SMESH::Orientation theOrientation, + double theDistance, + vtkFloatingPointType theAngle[2]); + + static void GetPlaneParam (SMESH_Actor* theActor, + int thePlaneIndex, + SMESH::Orientation& theOrientation, + double& theDistance, + vtkFloatingPointType* theAngle); + +protected: + void keyPressEvent( QKeyEvent* ); private: + LightApp_SelectionMgr* mySelectionMgr; + SVTK_Selector* mySelector; + SMESHGUI* mySMESHGUI; + SMESH_Actor* myActor; + SMESH::TPlanes myPlanes; + + QComboBox* ComboBoxPlanes; + QPushButton* buttonNew; + QPushButton* buttonDelete; + QLabel* TextLabelOrientation; + QComboBox* ComboBoxOrientation; + QLabel* TextLabelDistance; + SMESHGUI_SpinBox* SpinBoxDistance; + QLabel* TextLabelRot1; + SMESHGUI_SpinBox* SpinBoxRot1; + QLabel* TextLabelRot2; + SMESHGUI_SpinBox* SpinBoxRot2; + QCheckBox* PreviewCheckBox; + QCheckBox* AutoApplyCheckBox; + QPushButton* buttonOk; + QPushButton* buttonCancel; + QPushButton* buttonApply; + QPushButton* buttonHelp; + + bool myIsSelectPlane; + QString myHelpFileName; - SALOME_Selection* mySelection; - SMESH_Actor* myActor; - SMESH::TPlanes myPlanes; - - QComboBox* ComboBoxPlanes; - QPushButton* buttonNew; - QPushButton* buttonDelete; - QLabel* TextLabelOrientation; - QComboBox* ComboBoxOrientation; - QLabel* TextLabelDistance; - SMESHGUI_SpinBox* SpinBoxDistance; - QLabel* TextLabelRot1; - SMESHGUI_SpinBox* SpinBoxRot1; - QLabel* TextLabelRot2; - SMESHGUI_SpinBox* SpinBoxRot2; - QCheckBox* PreviewCheckBox; - QCheckBox* AutoApplyCheckBox; - QPushButton* buttonOk; - QPushButton* buttonCancel; - QPushButton* buttonApply; - - bool myIsSelectPlane; - public slots: - - void onSelectPlane(int theIndex); - void ClickOnNew(); - void ClickOnDelete(); - void onSelectOrientation(int theItem); - void SetCurrentPlaneParam(); - void onSelectionChanged(); - void OnPreviewToggle(bool theIsToggled); - void ClickOnOk(); - void ClickOnCancel(); - void ClickOnApply(); + void onSelectPlane( int ); + void ClickOnNew(); + void ClickOnDelete(); + void onSelectOrientation( int ); + void SetCurrentPlaneParam(); + void onSelectionChanged(); + void OnPreviewToggle( bool ); + void ClickOnOk(); + void ClickOnCancel(); + void ClickOnApply(); + void ClickOnHelp(); }; -#endif // DIALOGBOX_TRANSPARENCYDLG_H - +#endif // SMESHGUI_CLIPPINGDLG_H