]> SALOME platform Git repositories - modules/kernel.git/blob - src/Plot2d/Plot2d_SetupPlot2dDlg.h
Salome HOME
Initialisation de la base KERNEL avec la version operationnelle de KERNEL_SRC issue...
[modules/kernel.git] / src / Plot2d / Plot2d_SetupPlot2dDlg.h
1 //  File      : Plot2d_SetupPlot2dDlg.h
2 //  Created   : Wed Jun 27 16:38:42 2001
3 //  Author    : Vadim SANDLER
4 //  Project   : SALOME
5 //  Module    : SALOMEGUI
6 //  Copyright : Open CASCADE
7 //  $Header$
8
9 #ifndef Plot2d_SetupPlot2dDlg_H
10 #define Plot2d_SetupPlot2dDlg_H
11
12 #include <qdialog.h>
13 #include <qlist.h>
14
15 #include <SALOMEconfig.h>
16 #include CORBA_SERVER_HEADER(SALOMEDS)
17 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
18
19 //=================================================================================
20 // class    : Plot2d_SetupPlot2dDlg
21 // purpose  : Dialog box for setup Plot2d view
22 //=================================================================================
23
24 class QScrollView;
25 class QPushButton;
26 class QLabel;
27 class QCheckBox;
28 class QComboBox;
29 class QSpinBox;
30 class QToolButton;
31 class Plot2d_ItemContainer;
32 class Plot2d_CurveContainer;
33
34 class Plot2d_SetupPlot2dDlg : public QDialog
35
36   Q_OBJECT
37
38 public:
39   Plot2d_SetupPlot2dDlg( SALOMEDS::SObject_var object, QWidget* parent = 0 );
40   ~Plot2d_SetupPlot2dDlg();
41
42   void getCurves( Plot2d_CurveContainer& container );
43   void getCurvesSource( int& horIndex, QValueList<int>& verIndexes );
44   bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
45
46 private slots:
47   void onHBtnToggled( bool );
48   void onVBtnToggled( bool );
49   void enableControls();
50
51 private:
52   QScrollView*                myView;
53   QPushButton*                myOkBtn;
54   QPushButton*                myCancelBtn;
55   QList<Plot2d_ItemContainer> myItems;
56
57   SALOMEDS::SObject_var       myObject;
58 };
59
60 class Plot2d_ItemContainer : public QObject
61 {
62   Q_OBJECT
63
64 public:
65   Plot2d_ItemContainer( QObject* parent = 0, const char* name = 0 );
66   
67   void   createWidgets( QWidget* parentWidget );
68   void   enableWidgets( bool enable );
69
70   void   setHorizontalOn( bool on );
71   bool   isHorizontalOn() const;
72   void   setVerticalOn( bool on );
73   bool   isVerticalOn() const;
74   bool   isAutoAssign() const;
75   void   setAutoAssign( bool on );
76   void   setLine( const int line, const int width );
77   int    getLine() const;
78   int    getLineWidth() const;
79   void   setMarker( const int marker );
80   int    getMarker() const;
81   void   setColor( const QColor& color );
82   QColor getColor() const;
83
84 protected:
85   void   updateState();
86
87 signals:
88   void   autoClicked();
89   void   horToggled( bool );
90   void   verToggled( bool );
91
92 public slots:
93   void   onAutoChanged();
94   void   onColorChanged();
95   void   onHVToggled( bool );
96
97 public:
98   bool                  myEnabled;
99   QToolButton*          myHBtn;
100   QToolButton*          myVBtn;
101   QLabel*               myTitleLab;
102   QLabel*               myUnitLab;
103   QCheckBox*            myAutoCheck;
104   QComboBox*            myLineCombo;
105   QSpinBox*             myLineSpin;
106   QComboBox*            myMarkerCombo;
107   QToolButton*          myColorBtn;
108 };
109
110 #endif // Plot2d_SetupPlot2dDlg_H
111