Salome HOME
01d35fdea6e20d5fd9f028f192e96599b19bb518
[modules/visu.git] / src / VISUGUI / VisuGUI_CutSegmentDlg.h
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  File   : VisuGUI_CutSegmentDlg.h
21 //  Author : Oleg UVAROV
22 //  Module : VISU
23 //
24 #ifndef VISUGUI_CUTSEGMENTDLG_H
25 #define VISUGUI_CUTSEGMENTDLG_H
26
27 #include "VisuGUI_CutPlanesDlg.h"
28
29 #include <QCheckBox>
30 #include <QList>
31
32 class QTabWidget;
33
34 class SalomeApp_Module;
35 class VisuGUI_InputPane;
36 class SalomeApp_DoubleSpinBox;
37
38 namespace VISU
39 {
40   class CutSegment_i;
41 }
42
43 class VisuGUI_CutSegmentDlg: public VisuGUI_ScalarBarBaseDlg
44 {
45   Q_OBJECT
46
47 public:
48   VisuGUI_CutSegmentDlg (SalomeApp_Module* theModule);
49   ~VisuGUI_CutSegmentDlg();
50
51   virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
52                                   bool theInit );
53
54   virtual int  storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
55
56   bool isGenerateTable() { return myCreateTable->isChecked(); }
57   bool isGenerateCurves() { return myCreateTable->isChecked() && myCurvesCheck->isChecked(); }
58
59 protected:
60   virtual QString GetContextHelpFilePath();
61  
62 protected slots:
63   void accept();
64   void reject();
65
66 private slots:
67   void onPreviewCheck(bool thePreview);
68   void onAllCurvesInvertedCheck(bool theInvert);
69   void onPointModified();
70
71 private:
72   void createPlanes();
73   void deletePlanes();
74   void updateGlyphs(bool update);
75   void updatePoints(bool update);
76
77   QCheckBox* myCreateTable;
78   QCheckBox* myCurvesCheck;
79
80   bool hasInit;
81
82   QList<SalomeApp_DoubleSpinBox*> myPoint1;
83   QList<SalomeApp_DoubleSpinBox*> myPoint2;
84
85   SALOME::GenericObjPtr<VISU::CutSegment_i> myCutSegment;
86
87   QTabWidget*            myTabBox;
88   VisuGUI_InputPane*     myInputPane;
89
90   SALOME_Actor* myPreviewActor;
91   SALOME_Actor* myPreviewActorGlyphs;
92   SALOME_Actor* myPreviewActorPoints;
93   QCheckBox* myPreviewCheck;
94   QCheckBox* myAllCurvesInvertedCheck;
95   QCheckBox* myUseAbsoluteLengthCheck;
96
97   SALOME::GenericObjPtr<VISU::CutSegment_i> myPrsCopy;
98 };
99
100 #endif // VISUGUI_CUTSEGMENTDLG_H