vtkSMInputArrayDomain.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
52 #ifndef vtkSMInputArrayDomain_h
53 #define vtkSMInputArrayDomain_h
54 
55 #include "vtkDataObject.h" // needed for vtkDataObject::AttributeTypes
56 #include "vtkRemotingServerManagerModule.h" //needed for exports
57 #include "vtkSMDomain.h"
58 
59 #include <vector> // Needed for vector
60 
61 // Needed to get around some header defining ANY as a macro
62 #ifdef ANY
63 #undef ANY
64 #endif
65 
68 class vtkSMSourceProxy;
69 
71 {
72 public:
73  static vtkSMInputArrayDomain* New();
75  void PrintSelf(ostream& os, vtkIndent indent) override;
76 
83  int IsInDomain(vtkSMProperty* property) override;
84 
89  int IsInDomain(vtkSMSourceProxy* proxy, unsigned int outputport = 0);
90 
92 
96  vtkGetMacro(AttributeType, int);
97  const char* GetAttributeTypeAsString();
99 
104  std::vector<int> GetAcceptableNumbersOfComponents() const;
105 
107 
112  static void SetAutomaticPropertyConversion(bool);
113  static bool GetAutomaticPropertyConversion();
115 
120  bool GetAutoConvertProperties();
121 
123  {
127  ANY_EXCEPT_FIELD = vtkDataObject::POINT_THEN_CELL,
132  NUMBER_OF_ATTRIBUTE_TYPES = ANY + 1,
133  };
134 
136 
148  static bool IsAttributeTypeAcceptable(
149  int required_type, int attribute_type, int* acceptable_as_type = nullptr);
150 
151  static bool IsAttributeTypeAcceptable(
152  int required_type, int attribute_type, int* acceptable_as_type, bool autoconvert);
154 
161  int IsArrayAcceptable(vtkPVArrayInformation* arrayInfo);
162 
169  static vtkSMInputArrayDomain* FindApplicableDomain(vtkSMProperty* property);
170 
171 protected:
173  ~vtkSMInputArrayDomain() override;
174 
175  vtkSetMacro(AttributeType, int);
176  void SetAttributeType(const char* type);
177 
182  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
183 
188  bool IsAttributeTypeAcceptable(int attributeType);
189 
194  bool HasAcceptableArray(vtkPVDataSetAttributesInformation* attrInfo);
195 
198  std::string DataType;
199 
200 private:
202  void operator=(const vtkSMInputArrayDomain&) = delete;
203  bool AutoConvertProperties = false;
204 };
205 
206 #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:38
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:65
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.