]> SALOME platform Git repositories - modules/geom.git/blob - src/CurveCreator/CurveCreator_Widget.h
Salome HOME
CurveCreator implementation
[modules/geom.git] / src / CurveCreator / CurveCreator_Widget.h
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // File:        CurveCreator_Widget.h
24 // Created:     Mon Jul  01 12:49:21 2013
25 // Author:      Sergey KHROMOV
26 //
27
28 #ifndef _CurveCreator_Widget_HeaderFile
29 #define _CurveCreator_Widget_HeaderFile
30
31
32 #include <QWidget>
33 #include <CurveCreator_CurveEditor.hxx>
34
35 class CurveCreator_Curve;
36 class QGroupBox;
37 class QButtonGroup;
38 class QComboBox;
39 class QCheckBox;
40 class QPushButton;
41 class QLabel;
42 class QListWidget;
43 class QListWidgetItem;
44 class CurveCreator_EditPntsWidget;
45 class CurveCreator_EditPntDlg;
46 class CurveCreator_UndoOptsDlg;
47
48
49 class CurveCreator_Widget : public QWidget
50 {
51   Q_OBJECT
52
53 public:
54
55   CurveCreator_Widget(QWidget* parent,
56                       CurveCreator_Curve *theCurve,
57                       Qt::WindowFlags fl = 0);
58
59 private:
60
61   void init();
62
63   void initSections();
64
65   void addSectionItem(const CurveCreator::Type theType, const bool isClosed);
66
67   void updateSectionItem(const int theRow, const CurveCreator::Type theType,
68                          const bool isClosed);
69
70   void sectionMove(const int theShift);
71
72   void initPoints(const int theSectionIndex);
73
74   int getCurrentSectionIndex();
75
76   void updateUndoRedo();
77
78   void updateUndoRedoButtons();
79
80   void setTabOrder();
81
82 private slots:
83
84   void undoOptionsChanged();
85
86   void sectionAddOrModify();
87
88   void addModifChanged(int theId);
89
90   void changeSecSelection();
91
92   void sectionRemove();
93
94   void sectionJoin();
95
96   void sectionJoinAll();
97
98   void sectionClear();
99
100   void sectionUp();
101
102   void sectionDown();
103
104   void onNumberOfItemsChanged(QListWidget *theListWidget);
105
106   void changePntsSelection();
107
108   void editPnt(QListWidgetItem *theItem);
109
110   void pntsAdd();
111
112   void pntsInsert();
113
114   void pntsRemove();
115
116   void undo();
117
118   void redo();
119
120 signals:
121
122   void numberOfItemsChanged(QListWidget *theListWidget);
123
124 protected:
125
126   CurveCreator_CurveEditor     myEditor;
127   CurveCreator::Dimension      myDimension;
128   // Undo/redo widgets
129   QLabel                      *myEnabledUndoLbl;
130   QLabel                      *myBufSizeUndoLbl;
131   QPushButton                 *myUndoBtn;
132   QPushButton                 *myRedoBtn;
133   QPushButton                 *myUndoOptsBtn;
134   CurveCreator_UndoOptsDlg    *myUndoOptsDlg;
135   // Sections widgets
136   QGroupBox                   *myAddSecGrp;
137   QButtonGroup                *mySecBtnGrp;
138   QComboBox                   *mySecTypeCmbBox;
139   QCheckBox                   *mySecCloseChkBox;
140   QPushButton                 *mySecAddModifBtn;
141   QPushButton                 *mySecRmBtn;
142   QPushButton                 *mySecJoinBtn;
143   QPushButton                 *mySecJoinAllBtn;
144   QPushButton                 *mySecClearBtn;
145   QPushButton                 *mySecUpBtn;
146   QPushButton                 *mySecDownBtn;
147   QListWidget                 *mySecList;
148   CurveCreator_EditPntsWidget *myEditSecPnts;
149   // Points widgets
150   QGroupBox                   *myPntsGrp;
151   QListWidget                 *myPntsList;
152   CurveCreator_EditPntDlg     *myPntEditDlg;
153   CurveCreator_EditPntsWidget *myEditPnts;
154   QPushButton                 *myAddPntsBtn;
155   QPushButton                 *myInsertPntsBtn;
156   QPushButton                 *myRmPntsBtn;
157
158 };
159
160 #endif