pqColorAnnotationsWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqColorAnnotationsWidget.cxx
5 
6  Copyright (c) 2005,2006 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 pqColorAnnotationsWidget_h
33 #define pqColorAnnotationsWidget_h
34 
36 
37 #include "pqAnnotationsModel.h" // for pqAnnotationsModel::ColumnRoles
38 
39 #include <QWidget>
40 
41 class QItemSelection;
42 class QModelIndex;
43 
44 class vtkSMProxy;
45 
50 {
51  Q_OBJECT;
52  typedef QWidget Superclass;
53 
54 public:
55  pqColorAnnotationsWidget(QWidget* parent = 0);
56  ~pqColorAnnotationsWidget() override;
57 
58  void setLookupTableProxy(vtkSMProxy* proxy);
59 
61 
66  QList<QVariant> annotations() const;
67  void setAnnotations(const QList<QVariant>&);
69 
71 
75  QList<QVariant> indexedColors() const;
76  void setIndexedColors(const QList<QVariant>&);
78 
80 
83  QList<QVariant> indexedOpacities() const;
84  void setIndexedOpacities(const QList<QVariant>&);
86 
88 
91  QList<QVariant> visibilities() const;
92  void setVisibilities(const QList<QVariant>&);
94 
96 
99  QVariant opacityMapping() const;
100  void setOpacityMapping(const QVariant&);
102 
106  void applyPreset(const char* presetName);
107 
112  void indexedLookupStateUpdated(bool indexed);
113 
117  bool addActiveAnnotations(bool force);
118 
123  QModelIndex currentIndex();
124 
128  QModelIndexList selectedIndexes();
129 
133  void setAnnotationsModel(pqAnnotationsModel* model);
134 
138  void setSupportsReorder(bool reorder);
139 
143  void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
144 
149  void allowsUserDefinedValues(bool allow);
150 
157  void allowsRegexpMatching(bool allow);
158 
163  void enablePresets(bool enable);
164 
168  void supportsVisibilityCheck(bool val);
169 
173  void supportsOpacityMapping(bool val);
174 
178  void setColumnVisibility(pqAnnotationsModel::ColumnRoles col, bool visible);
179 
181 
184  const char* currentPresetName();
185  void setCurrentPresetName(const char* name);
187 
191  QString currentAnnotationValue();
192 
196  QStringList selectedAnnotations();
197  void setSelectedAnnotations(const QStringList& annotations);
198 
202  bool presetLoadAnnotations();
203 
207  QRegularExpression presetRegularExpression();
208 
209 Q_SIGNALS:
213  void annotationsChanged();
214 
218  void indexedColorsChanged();
219 
223  void indexedOpacitiesChanged();
224 
228  void visibilitiesChanged();
229 
233  void opacityMappingChanged();
234 
238  void presetChanged(const QString& name);
239 
243  void selectionChanged(const QItemSelection&, const QItemSelection&);
244 
245 protected:
249  bool addActiveAnnotationsFromVisibleSources(bool force);
250 
251 private Q_SLOTS:
253 
257  void addAnnotation();
258  void removeAnnotation();
259  void addActiveAnnotations();
260  void addActiveAnnotationsFromVisibleSources();
261  void removeAllAnnotations();
263 
264  void onPresetApplied(const QString& presetName);
265 
271  void onDataChanged(const QModelIndex& topleft, const QModelIndex& btmright);
272 
278  void onDoubleClicked(const QModelIndex& idx);
279 
285  void onHeaderDoubleClicked(int section);
286 
290  void customMenuRequested(QPoint pos);
291 
295  void execGlobalOpacityDialog();
296 
300  void choosePreset(const char* presetName = nullptr);
301 
305  void saveAsNewPreset();
306  void saveAsPreset(const char* name, bool removeAnnotations, bool allowOverride);
307 
312  void updateOpacityColumnState();
313 
317  void editPastLastRow();
318 
319 private:
320  Q_DISABLE_COPY(pqColorAnnotationsWidget)
321 
322  class pqInternals;
323  pqInternals* Internals;
324 };
325 
326 #endif
order
#define PQAPPLICATIONCOMPONENTS_EXPORT
name
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
pqColorAnnotationsWidget is used to edit annotations and colors