ParaView
vtkSMInputArrayDomain.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMInputArrayDomain.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
56 #ifndef vtkSMInputArrayDomain_h
57 #define vtkSMInputArrayDomain_h
58 
59 #include "vtkDataObject.h" // needed for vtkDataObject::AttributeTypes
60 #include "vtkPVServerManagerCoreModule.h" //needed for exports
61 #include "vtkSMDomain.h"
62 
63 #include <vector> // Needed for vector
64 
65 // Needed to get around some header defining ANY as a macro
66 #ifdef ANY
67 #undef ANY
68 #endif
69 
72 class vtkSMSourceProxy;
73 
74 class VTKPVSERVERMANAGERCORE_EXPORT vtkSMInputArrayDomain : public vtkSMDomain
75 {
76 public:
77  static vtkSMInputArrayDomain* New();
79  void PrintSelf(ostream& os, vtkIndent indent);
80 
87  virtual int IsInDomain(vtkSMProperty* property);
88 
93  int IsInDomain(vtkSMSourceProxy* proxy, unsigned int outputport = 0);
94 
96 
100  vtkGetMacro(AttributeType, int);
101  const char* GetAttributeTypeAsString();
103 
108  VTK_LEGACY(int GetNumberOfComponents());
109 
114  std::vector<int> GetAcceptableNumbersOfComponents() const;
115 
119  static void SetAutomaticPropertyConversion(bool);
120  static bool GetAutomaticPropertyConversion();
121 
123  {
124  POINT = vtkDataObject::POINT,
125  CELL = vtkDataObject::CELL,
126  FIELD = vtkDataObject::FIELD,
127  ANY_EXCEPT_FIELD = vtkDataObject::POINT_THEN_CELL,
128  VERTEX = vtkDataObject::VERTEX,
129  EDGE = vtkDataObject::EDGE,
130  ROW = vtkDataObject::ROW,
131  ANY = vtkDataObject::NUMBER_OF_ATTRIBUTE_TYPES,
132  NUMBER_OF_ATTRIBUTE_TYPES = ANY + 1,
133  };
134 
147  static bool IsAttributeTypeAcceptable(
148  int required_type, int attribute_type, int* acceptable_as_type = NULL);
149 
162  VTK_LEGACY(static bool IsArrayAcceptable(
163  int required_number_of_components, vtkPVArrayInformation* arrayInfo));
164 
171  int IsArrayAcceptable(vtkPVArrayInformation* arrayInfo);
172 
173 protected:
176 
181  VTK_LEGACY(void SetNumberOfComponents(int));
182 
183  vtkSetMacro(AttributeType, int);
184  void SetAttributeType(const char* type);
185 
190  virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element);
191 
196  bool IsAttributeTypeAcceptable(int attributeType);
197 
202  bool HasAcceptableArray(vtkPVDataSetAttributesInformation* attrInfo);
203 
206 
207 private:
208  static bool AutomaticPropertyConversion;
209  vtkSMInputArrayDomain(const vtkSMInputArrayDomain&) VTK_DELETE_FUNCTION;
210  void operator=(const vtkSMInputArrayDomain&) VTK_DELETE_FUNCTION;
211 };
212 
213 #endif
virtual int IsInDomain(vtkSMProperty *property)=0
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
std::vector< int > AcceptableNumbersOfComponents
superclass for all SM properties
domain to ensure that input has required types of arrays.
represents the possible values a property can have
Definition: vtkSMDomain.h:48
virtual int ReadXMLAttributes(vtkSMProperty *prop, vtkPVXMLElement *elem)
Set the appropriate ivars from the xml element.
proxy for a VTK source on a server
Data array information like type.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkSMSessionObject * New()