]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI_SetupPlot2dDlg.h
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/visu.git] / src / VISUGUI / VisuGUI_SetupPlot2dDlg.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  File   : VisuGUI_SetupPlot2dDlg.h
21 //  Author : Vadim SANDLER
22 //  Module : SALOME
23
24 #ifndef VISUGUI_SetupPlot2dDlg_H
25 #define VISUGUI_SetupPlot2dDlg_H
26
27 #include "Plot2d_Curve.h"
28
29 #include <SALOMEDSClient_SObject.hxx>
30
31 #include <qdialog.h>
32 #include <qptrlist.h>
33
34 //=================================================================================
35 // class    : VisuGUI_SetupPlot2dDlg
36 // purpose  : Dialog box for setup Plot2d view
37 //=================================================================================
38
39 class QScrollView;
40 class QPushButton;
41 class QLabel;
42 class QCheckBox;
43 class QComboBox;
44 class QSpinBox;
45 class QToolButton;
46 class VisuGUI_ItemContainer;
47
48 class VisuGUI_SetupPlot2dDlg : public QDialog
49
50   Q_OBJECT
51
52 public:
53   VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* parent = 0 );
54   ~VisuGUI_SetupPlot2dDlg();
55
56   void getCurves( QPtrList<Plot2d_Curve>& container );
57   void getCurvesSource( int& horIndex, QValueList<int>& verIndexes, QValueList<int>& zIndexes );
58   bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
59
60 private:
61   void keyPressEvent( QKeyEvent* e );
62
63 private slots:
64   void onHBtnToggled( bool );
65   void onVBtnToggled( bool );
66   void onHelp();
67   void enableControls();
68
69 private:
70   QScrollView*                myView;
71   QPushButton*                myOkBtn;
72   QPushButton*                myCancelBtn;
73   QPushButton*                myHelpBtn;
74   QPtrList<VisuGUI_ItemContainer> myItems;
75
76   _PTR(SObject)               myObject;
77 };
78
79 class VisuGUI_ItemContainer : public QObject
80 {
81   Q_OBJECT
82
83 public:
84   VisuGUI_ItemContainer( QObject* parent = 0, const char* name = 0 );
85   
86   void   createWidgets( QWidget* parentWidget, const QStringList& );
87   void   enableWidgets( bool enable );
88
89   void   setHorizontalOn( bool on );
90   bool   isHorizontalOn() const;
91   void   setVerticalOn( bool on );
92   bool   isVerticalOn() const;
93   bool   isAutoAssign() const;
94   void   setAutoAssign( bool on );
95   void   setLine( const int line, const int width );
96   int    getLine() const;
97   int    getLineWidth() const;
98   void   setMarker( const int marker );
99   int    getMarker() const;
100   void   setColor( const QColor& color );
101   QColor getColor() const;
102   int    assigned() const;
103
104 protected:
105   void   updateState();
106
107 signals:
108   void   autoClicked();
109   void   horToggled( bool );
110   void   verToggled( bool );
111
112 public slots:
113   void   onAutoChanged();
114   void   onColorChanged();
115   void   onHVToggled( bool );
116
117 public:
118   bool                  myEnabled;
119   QToolButton*          myHBtn;
120   QToolButton*          myVBtn;
121   QLabel*               myTitleLab;
122   QLabel*               myUnitLab;
123   QCheckBox*            myAutoCheck;
124   QComboBox*            myLineCombo;
125   QSpinBox*             myLineSpin;
126   QComboBox*            myMarkerCombo, *myAssigned;
127   QToolButton*          myColorBtn;
128 };
129
130 #endif // VISUGUI_SetupPlot2dDlg_H
131