2009-02-17 10:27:49 +05:00
|
|
|
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
|
2004-12-01 15:48:31 +05:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2004-12-01 15:48:31 +05:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// 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.
|
2004-12-01 15:48:31 +05:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// 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.
|
2004-12-01 15:48:31 +05:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// 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
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH includes
|
2008-03-07 12:47:05 +05:00
|
|
|
#include "SMESH_SMESHGUI.hxx"
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SALOME includes
|
|
|
|
#include <SVTK_ViewWindow.h>
|
|
|
|
|
|
|
|
// Qt includes
|
|
|
|
#include <QDialog>
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// VTK includes
|
2004-12-01 15:48:31 +05:00
|
|
|
#include <vtkSmartPointer.h>
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// STL includes
|
2004-12-01 15:48:31 +05:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
class QPushButton;
|
|
|
|
class QCheckBox;
|
|
|
|
class QComboBox;
|
2005-11-03 13:38:17 +05:00
|
|
|
class LightApp_SelectionMgr;
|
2005-06-07 19:22:20 +06:00
|
|
|
class SVTK_Selector;
|
|
|
|
class SMESHGUI;
|
2004-12-01 15:48:31 +05:00
|
|
|
class SMESH_Actor;
|
|
|
|
class OrientedPlane;
|
2009-02-17 10:27:49 +05:00
|
|
|
class SMESHGUI_SpinBox;
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
namespace SMESH
|
|
|
|
{
|
2004-12-01 15:48:31 +05:00
|
|
|
typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
|
|
|
|
typedef std::vector<TVTKPlane> TPlanes;
|
2009-02-17 10:27:49 +05:00
|
|
|
enum Orientation { XY, YZ, ZX };
|
2004-12-01 15:48:31 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// class : SMESHGUI_ClippingDlg
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
2008-03-07 12:47:05 +05:00
|
|
|
class SMESHGUI_EXPORT SMESHGUI_ClippingDlg : public QDialog
|
2005-06-07 19:22:20 +06:00
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
Q_OBJECT
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
public:
|
2009-02-17 10:27:49 +05:00
|
|
|
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,
|
2009-10-01 12:28:20 +06:00
|
|
|
SVTK_ViewWindow* theViewWindow,
|
|
|
|
SMESH::Orientation theOrientation,
|
|
|
|
double theDistance,
|
|
|
|
vtkFloatingPointType theAngle[2]);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
static void GetPlaneParam (SMESH_Actor* theActor,
|
2009-10-01 12:28:20 +06:00
|
|
|
int thePlaneIndex,
|
|
|
|
SMESH::Orientation& theOrientation,
|
|
|
|
double& theDistance,
|
|
|
|
vtkFloatingPointType* theAngle);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void keyPressEvent( QKeyEvent* );
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
private:
|
2009-02-17 10:27:49 +05:00
|
|
|
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;
|
2005-06-07 19:22:20 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
public slots:
|
2009-02-17 10:27:49 +05:00
|
|
|
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();
|
2004-12-01 15:48:31 +05:00
|
|
|
};
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
#endif // SMESHGUI_CLIPPINGDLG_H
|