ParaView
pqCustomViewButtonDialog.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqCustomViewButtonDialog.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 #ifndef pqCustomViewDialog_h
33 #define pqCustomViewDialog_h
34 // .NAME pqCustomViewDialog - Dialog for configuring custom view buttons.
35 //
36 // .SECTION Description
37 // Provides the machinery for associating the current camera configuration
38 // to a custom view button, and importing or exporting all of the custom view
39 // button configurations.
40 //
41 // .SECTION See Also
42 // pqCameraDialog
43 //
44 // .SECTION Thanks
45 // This class was contributed by SciberQuest Inc.
46 
47 #include <QDialog>
48 #include <QLineEdit>
49 #include <QList>
50 #include <QString>
51 #include <QStringList>
52 
53 class pqCustomViewButtonDialogUI;
55 
56 class pqCustomViewButtonDialog : public QDialog
57 {
58  Q_OBJECT
59 
60 public:
61  // Description:
62  // Create and initialize the dialog.
63  pqCustomViewButtonDialog(QWidget* parent, Qt::WindowFlags f, QStringList& toolTips,
64  QStringList& configurations, QString& currentConfig);
65 
67 
68  // Description:
69  // Constant variable that contains the default name for the tool tips.
70  const static QString DEFAULT_TOOLTIP;
71 
72  // Description:
73  // Set/get a list of tool tips, one for each button.
74  void setToolTips(QStringList& toolTips);
75  QStringList getToolTips();
76 
77  // Description:
78  // Set/get a list of camera configurations, one for each buttton.
79  void setConfigurations(QStringList& configs);
80  QStringList getConfigurations();
81 
82  // Descrition:
83  // Set/get the current camera configuration.
84  void setCurrentConfiguration(QString& config);
85  QString getCurrentConfiguration();
86 
87 private slots:
88  void importConfigurations();
89  void exportConfigurations();
90  void clearAll();
91 
92  void assignCurrentView(int id);
93  void assignCurrentView0() { this->assignCurrentView(0); }
94  void assignCurrentView1() { this->assignCurrentView(1); }
95  void assignCurrentView2() { this->assignCurrentView(2); }
96  void assignCurrentView3() { this->assignCurrentView(3); }
97 
98 private:
100 
101  int NButtons;
102 
103  QList<QLineEdit*> ToolTips;
104  QStringList Configurations;
105  QString CurrentConfiguration;
106 
107  pqCustomViewButtonDialogUI* ui;
108 };
109 #endif
void setConfigurations(QStringList &configs)
void setCurrentConfiguration(QString &config)
void setToolTips(QStringList &toolTips)
QString getCurrentConfiguration()
A reader for XML camera configuration.
QStringList getToolTips()
QStringList getConfigurations()
static const QString DEFAULT_TOOLTIP