1 // Copyright (C) 2007-2013 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>
34 #include <VISU_Table_i.hh>
39 //=================================================================================
40 // class : VisuGUI_SetupPlot2dDlg
41 // purpose : Dialog box for setup Plot2d view
42 //=================================================================================
49 class SalomeApp_IntSpinBox;
51 class VisuGUI_ItemContainer;
54 class VisuGUI_SetupPlot2dDlg : public QDialog
59 VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, VISU::Table_i* table ,QWidget* parent = 0 );
60 ~VisuGUI_SetupPlot2dDlg();
62 void getCurves( QList<Plot2d_Curve*>& container );
63 void getCurvesSource( int& horIndex, QList<int>& verIndexes, QList<int>& ver2Indexes, QList<int>& zIndexes );
64 bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
65 int idx(const int i) const {return myIdxMap[i];}
68 void keyPressEvent( QKeyEvent* e );
71 void onHBtnToggled( bool );
72 void onVBtnToggled( bool );
73 void onV2BtnToggled( bool );
75 void enableControls();
80 QPushButton* myCancelBtn;
81 QPushButton* myHelpBtn;
82 QList<VisuGUI_ItemContainer*> myItems;
83 QMap<int,int> myIdxMap;
85 _PTR(SObject) myObject;
86 VISU::Table_i* myTable;
89 class VisuGUI_ItemContainer : public QObject
94 VisuGUI_ItemContainer( QObject* parent = 0 );
96 void createWidgets( QWidget* parentWidget, const QStringList& );
97 void enableWidgets( bool enable );
99 void setHorizontalOn( bool on );
100 bool isHorizontalOn() const;
101 void setVerticalOn( bool on );
102 bool isVerticalOn() const;
103 void setVertical2On( bool on );
104 bool isVertical2On() const;
105 bool isAutoAssign() const;
106 void setAutoAssign( bool on );
107 void setLine( const int line, const int width );
109 int getLineWidth() const;
110 void setMarker( const int marker );
111 int getMarker() const;
112 void setColor( const QColor& color );
113 QColor getColor() const;
114 int assigned() const;
121 void horToggled( bool );
122 void verToggled( bool );
123 void ver2Toggled( bool );
126 void onAutoChanged();
127 //void onColorChanged();
128 void onHVToggled( bool );
134 QToolButton* myV2Btn;
138 QCheckBox* myAutoCheck;
139 QComboBox* myLineCombo;
140 SalomeApp_IntSpinBox* myLineSpin;
141 QComboBox* myMarkerCombo, *myAssigned;
142 QtxColorButton* myColorBtn;
145 #endif // VISUGUI_SetupPlot2dDlg_H