Salome HOME
b591984d66ec0f3079da2ab8e1d044f81ea9c5fc
[modules/paravis.git] / src / Plugins / TableReader / ParaViewPlugin / pqCustomXYChartDisplayPanel.h
1 // Copyright (C) 2010-2016  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __pqCustomXYChartDisplayPanel_h
21 #define __pqCustomXYChartDisplayPanel_h
22
23 #include "pqDisplayPanel.h"
24
25 class pqRepresentation;
26 class pqDataInformationModel;
27 class QModelIndex;
28
29 /// Editor widget for XY chart displays.
30 class pqCustomXYChartDisplayPanel : public pqDisplayPanel
31 {
32   Q_OBJECT
33 public:
34   pqCustomXYChartDisplayPanel(pqRepresentation* display, QWidget* parent=0);
35   virtual ~pqCustomXYChartDisplayPanel();
36
37 public slots:
38   /// Reloads the series list from the display.
39   void reloadSeries();
40
41 protected slots:
42   /// Slot to listen to clicks for changing color.
43   void activateItem(const QModelIndex &index);
44
45   void updateOptionsWidgets();
46
47   void setCurrentSeriesColor(const QColor &color);
48
49   void setCurrentSeriesThickness(int thickness);
50
51   void setCurrentSeriesStyle(int listIndex);
52
53   void setCurrentSeriesAxes(int listIndex);
54
55   void setCurrentSeriesMarkerStyle(int listIndex);
56
57   void useArrayIndexToggled(bool);
58
59   void useDataArrayToggled(bool);
60
61   /// Unit controls
62   void autoSelectToggled(bool checked);
63   void ignoreUnitsToggled(bool checked);
64
65   /// Reset state of the controls relative to units
66   void resetUnitsControls();
67
68   /// Update view options
69   void updateViewOptions();
70
71 private:
72   pqCustomXYChartDisplayPanel(const pqCustomXYChartDisplayPanel&); // Not implemented.
73   void operator=(const pqCustomXYChartDisplayPanel&); // Not implemented.
74
75   /// Set the display whose properties this editor is editing.
76   /// This call will raise an error if the display is not
77   /// an XYChartRepresentation proxy.
78   void setDisplay(pqRepresentation* display);
79
80   /// Disable/enable elements of the dialog based on the chart type.
81   void changeDialog(pqRepresentation* display);
82   
83   Qt::CheckState getEnabledState() const;
84
85   class pqInternal;
86   pqInternal* Internal;
87
88   pqDataInformationModel* Model;
89 };
90
91 #endif