vtkSMInputArrayDomain.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
49 #ifndef vtkSMInputArrayDomain_h
50 #define vtkSMInputArrayDomain_h
51 
52 #include "vtkDataObject.h" // needed for vtkDataObject::AttributeTypes
53 #include "vtkRemotingServerManagerModule.h" //needed for exports
54 #include "vtkSMDomain.h"
55 
56 #include <vector> // Needed for vector
57 
58 // Needed to get around some header defining ANY as a macro
59 #ifdef ANY
60 #undef ANY
61 #endif
62 
65 class vtkSMSourceProxy;
66 
68 {
69 public:
70  static vtkSMInputArrayDomain* New();
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
80  int IsInDomain(vtkSMProperty* property) override;
81 
86  int IsInDomain(vtkSMSourceProxy* proxy, unsigned int outputport = 0);
87 
89 
93  vtkGetMacro(AttributeType, int);
94  const char* GetAttributeTypeAsString();
96 
101  std::vector<int> GetAcceptableNumbersOfComponents() const;
102 
106  static void SetAutomaticPropertyConversion(bool);
107  static bool GetAutomaticPropertyConversion();
108 
110  {
114  ANY_EXCEPT_FIELD = vtkDataObject::POINT_THEN_CELL,
119  NUMBER_OF_ATTRIBUTE_TYPES = ANY + 1,
120  };
121 
134  static bool IsAttributeTypeAcceptable(
135  int required_type, int attribute_type, int* acceptable_as_type = nullptr);
136 
143  int IsArrayAcceptable(vtkPVArrayInformation* arrayInfo);
144 
151  static vtkSMInputArrayDomain* FindApplicableDomain(vtkSMProperty* property);
152 
153 protected:
155  ~vtkSMInputArrayDomain() override;
156 
157  vtkSetMacro(AttributeType, int);
158  void SetAttributeType(const char* type);
159 
164  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
165 
170  bool IsAttributeTypeAcceptable(int attributeType);
171 
176  bool HasAcceptableArray(vtkPVDataSetAttributesInformation* attrInfo);
177 
180  std::string DataType;
181 
182 private:
183  static bool AutomaticPropertyConversion;
185  void operator=(const vtkSMInputArrayDomain&) = delete;
186 };
187 
188 #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:37
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:64
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.