ParaView
pqSMAdaptor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqSMAdaptor.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 
33 #ifndef _pqSMAdaptor_h
34 #define _pqSMAdaptor_h
35 
36 class vtkSMProperty;
37 class vtkSMProxy;
38 class vtkObject;
39 
40 #include "pqCoreModule.h"
41 #include "pqSMProxy.h"
42 #include "vtkVariant.h"
43 #include <QList>
44 #include <QPair>
45 #include <QVariant>
46 
47 Q_DECLARE_METATYPE(QList<QList<QVariant> >)
48 
49 class PQCORE_EXPORT pqSMAdaptor
51 {
52 protected:
53  // class not instantiated
54  pqSMAdaptor();
55  ~pqSMAdaptor();
56 
57 private:
58  static const int metaId;
59 
60 public:
61 
64  {
76  SIL,
77  };
78 
80  {
82  UNCHECKED
83  };
84 
86  static PropertyType getPropertyType(vtkSMProperty* Property);
87 
90  static pqSMProxy getProxyProperty(vtkSMProperty* Property,
91  PropertyValueType Type = CHECKED);
92 
95  static void addProxyProperty(vtkSMProperty* Property,
96  pqSMProxy Value);
97  static void removeProxyProperty(vtkSMProperty* Property,
98  pqSMProxy Value);
99  static void setProxyProperty(vtkSMProperty* Property,
100  pqSMProxy Value);
101  static void setUncheckedProxyProperty(vtkSMProperty* Property,
102  pqSMProxy Value);
103  static void addInputProperty(vtkSMProperty* Property,
104  pqSMProxy Value, int opport);
105  static void setInputProperty(vtkSMProperty* Property,
106  pqSMProxy Value, int opport);
107 
110  static QList<pqSMProxy> getProxyListProperty(vtkSMProperty* Property);
113  static void setProxyListProperty(vtkSMProperty* Property,
114  QList<pqSMProxy> Value);
115 
117  static QList<pqSMProxy> getProxyPropertyDomain(vtkSMProperty* Property);
118 
119 
121  static QList<QList<QVariant> > getSelectionProperty(vtkSMProperty* Property,
122  PropertyValueType Type = CHECKED);
124  static QList<QVariant> getSelectionProperty(vtkSMProperty* Property,
125  unsigned int Index,
126  PropertyValueType Type = CHECKED);
128  static void setSelectionProperty(vtkSMProperty* Property,
129  QList<QList<QVariant> > Value,
130  PropertyValueType Type = CHECKED);
131 
135  static void setSelectionProperty(vtkSMProperty* Property,
136  QList<QVariant> Value,
137  PropertyValueType Type = CHECKED);
138 
140  static QList<QVariant> getSelectionPropertyDomain(vtkSMProperty* Property);
141 
143  static QVariant getEnumerationProperty(vtkSMProperty* Property,
144  PropertyValueType Type = CHECKED);
146  static void setEnumerationProperty(vtkSMProperty* Property,
147  QVariant Value,
148  PropertyValueType Type = CHECKED);
150  static QList<QVariant> getEnumerationPropertyDomain(vtkSMProperty* Property);
151 
153  static QVariant getElementProperty(vtkSMProperty* Property,
154  PropertyValueType Type = CHECKED);
156  static void setElementProperty(vtkSMProperty* Property,
157  QVariant Value,
158  PropertyValueType Type = CHECKED);
160  static QList<QVariant> getElementPropertyDomain(vtkSMProperty* Property);
161 
163  static QList<QVariant> getMultipleElementProperty(vtkSMProperty* Property,
164  PropertyValueType Type = CHECKED);
166  static void setMultipleElementProperty(vtkSMProperty* Property,
167  QList<QVariant> Value,
168  PropertyValueType Type = CHECKED);
171  static QList<QList<QVariant> > getMultipleElementPropertyDomain(vtkSMProperty* Property);
172 
175  static QVariant getMultipleElementProperty(vtkSMProperty* Property,
176  unsigned int Index,
177  PropertyValueType Type = CHECKED);
180  static void setMultipleElementProperty(vtkSMProperty* Property,
181  unsigned int Index,
182  QVariant Value,
183  PropertyValueType Type = CHECKED);
184 
187  static QList<QVariant> getMultipleElementPropertyDomain(vtkSMProperty* Property,
188  unsigned int Index);
189 
191  static QStringList getFileListProperty(vtkSMProperty* Property,
192  PropertyValueType Type = CHECKED);
194  static void setFileListProperty(vtkSMProperty* Property,
195  QStringList Value,
196  PropertyValueType Type = CHECKED);
197 
198  // get/set the field selection
199  static QStringList getFieldSelection(vtkSMProperty *Property,
200  PropertyValueType Type = CHECKED);
201  static void setFieldSelection(vtkSMProperty *Property,
202  const QStringList &Value,
203  PropertyValueType Type = CHECKED);
204 
206  static QString getFieldSelectionMode(vtkSMProperty* prop,
207  PropertyValueType Type = CHECKED);
208  static void setFieldSelectionMode(vtkSMProperty* Property,
209  const QString& Value,
210  PropertyValueType Type = CHECKED);
211  static QList<QString> getFieldSelectionModeDomain(vtkSMProperty*);
212 
214  static QString getFieldSelectionScalar(vtkSMProperty* Property,
215  PropertyValueType Type = CHECKED);
216  static void setFieldSelectionScalar(vtkSMProperty* Property,
217  const QString& Value,
218  PropertyValueType Type = CHECKED);
219  static QList<QString> getFieldSelectionScalarDomain(vtkSMProperty*);
220  static QList<QPair<QString, bool> > getFieldSelectionScalarDomainWithPartialArrays(vtkSMProperty*);
221 
222 
226  static QList<QString> getDomainTypes(vtkSMProperty* property);
227 
229  static void clearUncheckedProperties(vtkSMProperty *property);
230 
232  static QVariant convertToQVariant(const vtkVariant &variant);
233 };
234 
235 #endif // !_pqSMAdaptor_h
236 
Translates server manager events into Qt-compatible slots and signals.
Definition: pqSMAdaptor.h:50
PropertyType
enumeration for types of properties this class handles
Definition: pqSMAdaptor.h:63
vtkSmartPointer< vtkSMProxy > pqSMProxy
make pqSMProxy synonymous to a smart pointer of a vtkSMProxy
Definition: pqSMProxy.h:42