ParaView
pqQueryClauseWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqQueryClauseWidget.h
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 pqQueryClauseWidget_h
33 #define pqQueryClauseWidget_h
34 
35 #include "pqComponentsModule.h"
36 #include "vtkSelectionNode.h"
37 #include <QWidget>
38 
39 class pqOutputPort;
41 class vtkSMProxy;
42 
47 class PQCOMPONENTS_EXPORT pqQueryClauseWidget : public QWidget
48 {
49  Q_OBJECT
50  typedef QWidget Superclass;
51 
52 public:
54  {
55  INVALID = 0x0,
56  INDEX = 0x1,
57  GLOBALID = 0x2,
58  THRESHOLD = 0x4,
59  BLOCK = 0x10,
60  AMR_LEVEL = 0x20,
61  AMR_BLOCK = 0x40,
62  PROCESSID = 0x80,
63  QUERY = 0x8,
64  ANY = 0xffff
65  };
66 
67  Q_DECLARE_FLAGS(CriteriaTypes, CriteriaType);
68 
70  {
86  SINGLE_VALUE_MEAN_WITH_TOLERANCE
87  };
88 
89 public:
90  pqQueryClauseWidget(QWidget* parent = 0, Qt::WindowFlags flags = 0);
91  virtual ~pqQueryClauseWidget();
92 
96  void setProducer(pqOutputPort* p) { this->Producer = p; }
97  pqOutputPort* producer() const { return this->Producer; }
98 
104  void setAttributeType(int attrType) { this->AttributeType = attrType; }
105  int attributeType() const { return this->AttributeType; }
106 
112  vtkSMProxy* newSelectionSource();
113 
114 public slots:
122  void initialize()
123  {
124  this->initialize(CriteriaTypes(ANY) ^ PROCESSID ^ AMR_LEVEL ^ AMR_BLOCK ^ BLOCK);
125  }
126 
134  void initialize(CriteriaTypes type_flags, bool qualifier_mode = false);
135 
136 signals:
140  void helpRequested();
141 
142 protected slots:
147  void populateSelectionCondition();
148 
153  void updateValueWidget();
154 
161  void updateDependentClauseWidgets();
162 
166  void showCompositeTree();
167 
168 protected:
173  vtkPVDataSetAttributesInformation* getChosenAttributeInfo() const;
174 
179  void populateSelectionCriteria(CriteriaTypes type = ANY);
180 
184  CriteriaType currentCriteriaType() const;
185 
186  ConditionMode currentConditionType() const;
187 
191  void addSelectionQualifiers(vtkSMProxy*);
192 
196  QString LastQuery;
197 
198 private:
199  Q_DISABLE_COPY(pqQueryClauseWidget)
200  class pqInternals;
201  pqInternals* Internals;
202 };
203 
204 #endif
pqOutputPort is a server manager model item for an output port of any pqPipelineSource item...
Definition: pqOutputPort.h:57
pqQueryClauseWidget is used by pqQueryDialog as the widget allowing the user choose the clauses for t...
pqOutputPort * producer() const
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
void setProducer(pqOutputPort *p)
Set/Get the data producer.
void initialize()
use this slot to initialize the clause GUI after all properties have been set.
void setAttributeType(int attrType)
Set the attribute type.