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 =========================================================================*/
61 #ifndef vtkSMInputArrayDomain_h
62 #define vtkSMInputArrayDomain_h
63 
64 #include "vtkDataObject.h" // needed for vtkDataObject::AttributeTypes
65 #include "vtkRemotingServerManagerModule.h" //needed for exports
66 #include "vtkSMDomain.h"
67 
68 #include <vector> // Needed for vector
69 
70 // Needed to get around some header defining ANY as a macro
71 #ifdef ANY
72 #undef ANY
73 #endif
74 
77 class vtkSMSourceProxy;
78 
80 {
81 public:
82  static vtkSMInputArrayDomain* New();
84  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
92  int IsInDomain(vtkSMProperty* property) override;
93 
98  int IsInDomain(vtkSMSourceProxy* proxy, unsigned int outputport = 0);
99 
101 
105  vtkGetMacro(AttributeType, int);
106  const char* GetAttributeTypeAsString();
108 
113  std::vector<int> GetAcceptableNumbersOfComponents() const;
114 
118  static void SetAutomaticPropertyConversion(bool);
119  static bool GetAutomaticPropertyConversion();
120 
122  {
126  ANY_EXCEPT_FIELD = vtkDataObject::POINT_THEN_CELL,
131  NUMBER_OF_ATTRIBUTE_TYPES = ANY + 1,
132  };
133 
146  static bool IsAttributeTypeAcceptable(
147  int required_type, int attribute_type, int* acceptable_as_type = nullptr);
148 
155  int IsArrayAcceptable(vtkPVArrayInformation* arrayInfo);
156 
163  static vtkSMInputArrayDomain* FindApplicableDomain(vtkSMProperty* property);
164 
165 protected:
167  ~vtkSMInputArrayDomain() override;
168 
169  vtkSetMacro(AttributeType, int);
170  void SetAttributeType(const char* type);
171 
176  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
177 
182  bool IsAttributeTypeAcceptable(int attributeType);
183 
188  bool HasAcceptableArray(vtkPVDataSetAttributesInformation* attrInfo);
189 
192  std::string DataType;
193 
194 private:
195  static bool AutomaticPropertyConversion;
197  void operator=(const vtkSMInputArrayDomain&) = delete;
198 };
199 
200 #endif
#define FIELD
#define VTKREMOTINGSERVERMANAGER_EXPORT
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:49
void PrintSelf(ostream &os, vtkIndent indent) override
virtual int ReadXMLAttributes(vtkSMProperty *prop, vtkPVXMLElement *elem)
Set the appropriate ivars from the xml element.
virtual int IsInDomain(vtkSMProperty *vtkNotUsed(property))
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
Definition: vtkSMDomain.h:76
proxy for a VTK source on a server
provides meta data about arrays.
static vtkSMDomain * New()
This is used by vtkPVXMLParser to represent an XML document starting at the root element.