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 
67 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSMInputArrayDomain : public vtkSMDomain
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
vtkDataObject::POINT
POINT
vtkDataObject::CELL
CELL
vtkSMDomain::ReadXMLAttributes
virtual int ReadXMLAttributes(vtkSMProperty *prop, vtkPVXMLElement *elem)
Set the appropriate ivars from the xml element.
FIELD
#define FIELD
vtkDataObject::POINT_THEN_CELL
POINT_THEN_CELL
vtkSMInputArrayDomain::AttributeTypes
AttributeTypes
Definition: vtkSMInputArrayDomain.h:109
vtkDataObject::NUMBER_OF_ATTRIBUTE_TYPES
NUMBER_OF_ATTRIBUTE_TYPES
vtkSMDomain::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkSMProperty
superclass for all SM properties
Definition: vtkSMProperty.h:144
vtkSMInputArrayDomain
domain to ensure that input has required types of arrays.
Definition: vtkSMInputArrayDomain.h:67
vtkPVDataSetAttributesInformation
List of array info.
Definition: vtkPVDataSetAttributesInformation.h:24
vtkSMInputArrayDomain::AcceptableNumbersOfComponents
std::vector< int > AcceptableNumbersOfComponents
Definition: vtkSMInputArrayDomain.h:179
vtkSMSourceProxy
proxy for a VTK source on a server
Definition: vtkSMSourceProxy.h:37
vtkDataObject::VERTEX
VERTEX
vtkIndent
vtkSMDomain
represents the possible values a property can have
Definition: vtkSMDomain.h:37
vtkSMInputArrayDomain::DataType
std::string DataType
Definition: vtkSMInputArrayDomain.h:180
vtkSMDomain::New
static vtkSMDomain * New()
vtkDataObject::ROW
ROW
vtkSMInputArrayDomain::AttributeType
int AttributeType
Definition: vtkSMInputArrayDomain.h:178
vtkDataObject::FIELD
FIELD
vtkPVXMLElement
Definition: vtkPVXMLElement.h:23
vtkPVArrayInformation
provides meta data about arrays.
Definition: vtkPVArrayInformation.h:30
vtkDataObject::EDGE
EDGE
vtkDataObject.h
vtkSMDomain::IsInDomain
virtual int IsInDomain(vtkSMProperty *vtkNotUsed(property))
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
Definition: vtkSMDomain.h:64
vtkSMDomain.h