vtkSMInputArrayDomain.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
54 #ifndef vtkSMInputArrayDomain_h
55 #define vtkSMInputArrayDomain_h
56 
57 #include "vtkDataObject.h" // needed for vtkDataObject::AttributeTypes
58 #include "vtkRemotingServerManagerModule.h" //needed for exports
59 #include "vtkSMDomain.h"
60 
61 #include <vector> // Needed for vector
62 
63 // Needed to get around some header defining ANY as a macro
64 #ifdef ANY
65 #undef ANY
66 #endif
67 
70 class vtkSMSourceProxy;
71 
72 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSMInputArrayDomain : public vtkSMDomain
73 {
74 public:
75  static vtkSMInputArrayDomain* New();
77  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
85  int IsInDomain(vtkSMProperty* property) override;
86 
91  int IsInDomain(vtkSMSourceProxy* proxy, unsigned int outputport = 0);
92 
94 
98  vtkGetMacro(AttributeType, int);
99  const char* GetAttributeTypeAsString();
101 
106  std::vector<int> GetAcceptableNumbersOfComponents() const;
107 
109 
114  static void SetAutomaticPropertyConversion(bool);
115  static bool GetAutomaticPropertyConversion();
117 
122  bool GetAutoConvertProperties();
123 
125  {
129  ANY_EXCEPT_FIELD = vtkDataObject::POINT_THEN_CELL,
133  SIDE = vtkDataObject::SIDE,
135  NUMBER_OF_ATTRIBUTE_TYPES = ANY + 1,
136  };
137 
139 
151  static bool IsAttributeTypeAcceptable(
152  int required_type, int attribute_type, int* acceptable_as_type = nullptr);
153 
154  static bool IsAttributeTypeAcceptable(
155  int required_type, int attribute_type, int* acceptable_as_type, bool autoconvert);
157 
164  int IsArrayAcceptable(vtkPVArrayInformation* arrayInfo);
165 
172  static vtkSMInputArrayDomain* FindApplicableDomain(vtkSMProperty* property);
173 
174 protected:
176  ~vtkSMInputArrayDomain() override;
177 
178  vtkSetMacro(AttributeType, int);
179  void SetAttributeType(const char* type);
180 
185  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
186 
191  bool IsAttributeTypeAcceptable(int attributeType);
192 
197  bool HasAcceptableArray(vtkPVDataSetAttributesInformation* attrInfo);
198 
201  std::string DataType;
202 
203 private:
205  void operator=(const vtkSMInputArrayDomain&) = delete;
206  bool AutoConvertProperties = false;
207 };
208 
209 #endif
#define FIELD
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.