1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : VisuGUI_SetupPlot2dDlg.h
24 // Author : Vadim SANDLER
27 #ifndef VISUGUI_SetupPlot2dDlg_H
28 #define VISUGUI_SetupPlot2dDlg_H
30 #include "Plot2d_Curve.h"
32 #include <SALOMEDSClient_SObject.hxx>
37 //=================================================================================
38 // class : VisuGUI_SetupPlot2dDlg
39 // purpose : Dialog box for setup Plot2d view
40 //=================================================================================
47 class SalomeApp_IntSpinBox;
49 class VisuGUI_ItemContainer;
52 class VisuGUI_SetupPlot2dDlg : public QDialog
57 VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* parent = 0 );
58 ~VisuGUI_SetupPlot2dDlg();
60 void getCurves( QList<Plot2d_Curve*>& container );
61 void getCurvesSource( int& horIndex, QList<int>& verIndexes, QList<int>& ver2Indexes, QList<int>& zIndexes );
62 bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
65 void keyPressEvent( QKeyEvent* e );
68 void onHBtnToggled( bool );
69 void onVBtnToggled( bool );
70 void onV2BtnToggled( bool );
72 void enableControls();
77 QPushButton* myCancelBtn;
78 QPushButton* myHelpBtn;
79 QList<VisuGUI_ItemContainer*> myItems;
81 _PTR(SObject) myObject;
84 class VisuGUI_ItemContainer : public QObject
89 VisuGUI_ItemContainer( QObject* parent = 0 );
91 void createWidgets( QWidget* parentWidget, const QStringList& );
92 void enableWidgets( bool enable );
94 void setHorizontalOn( bool on );
95 bool isHorizontalOn() const;
96 void setVerticalOn( bool on );
97 bool isVerticalOn() const;
98 void setVertical2On( bool on );
99 bool isVertical2On() const;
100 bool isAutoAssign() const;
101 void setAutoAssign( bool on );
102 void setLine( const int line, const int width );
104 int getLineWidth() const;
105 void setMarker( const int marker );
106 int getMarker() const;
107 void setColor( const QColor& color );
108 QColor getColor() const;
109 int assigned() const;
116 void horToggled( bool );
117 void verToggled( bool );
118 void ver2Toggled( bool );
121 void onAutoChanged();
122 //void onColorChanged();
123 void onHVToggled( bool );
129 QToolButton* myV2Btn;
132 QCheckBox* myAutoCheck;
133 QComboBox* myLineCombo;
134 SalomeApp_IntSpinBox* myLineSpin;
135 QComboBox* myMarkerCombo, *myAssigned;
136 QtxColorButton* myColorBtn;
139 #endif // VISUGUI_SetupPlot2dDlg_H