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 =========================================================================*/
56 #ifndef vtkSMInputArrayDomain_h
57 #define vtkSMInputArrayDomain_h
58 
59 #include "vtkDataObject.h" // needed for vtkDataObject::AttributeTypes
60 #include "vtkRemotingServerManagerModule.h" //needed for exports
61 #include "vtkSMDomain.h"
62 
63 #include <vector> // Needed for vector
64 
65 // Needed to get around some header defining ANY as a macro
66 #ifdef ANY
67 #undef ANY
68 #endif
69 
72 class vtkSMSourceProxy;
73 
74 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSMInputArrayDomain : public vtkSMDomain
75 {
76 public:
77  static vtkSMInputArrayDomain* New();
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
87  int IsInDomain(vtkSMProperty* property) override;
88 
93  int IsInDomain(vtkSMSourceProxy* proxy, unsigned int outputport = 0);
94 
96 
100  vtkGetMacro(AttributeType, int);
101  const char* GetAttributeTypeAsString();
103 
108  std::vector<int> GetAcceptableNumbersOfComponents() const;
109 
113  static void SetAutomaticPropertyConversion(bool);
114  static bool GetAutomaticPropertyConversion();
115 
117  {
121  ANY_EXCEPT_FIELD = vtkDataObject::POINT_THEN_CELL,
126  NUMBER_OF_ATTRIBUTE_TYPES = ANY + 1,
127  };
128 
141  static bool IsAttributeTypeAcceptable(
142  int required_type, int attribute_type, int* acceptable_as_type = NULL);
143 
150  int IsArrayAcceptable(vtkPVArrayInformation* arrayInfo);
151 
152 protected:
154  ~vtkSMInputArrayDomain() override;
155 
156  vtkSetMacro(AttributeType, int);
157  void SetAttributeType(const char* type);
158 
163  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
164 
169  bool IsAttributeTypeAcceptable(int attributeType);
170 
175  bool HasAcceptableArray(vtkPVDataSetAttributesInformation* attrInfo);
176 
179 
180 private:
181  static bool AutomaticPropertyConversion;
183  void operator=(const vtkSMInputArrayDomain&) = delete;
184 };
185 
186 #endif
#define FIELD
virtual int IsInDomain(vtkSMProperty *property)=0
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
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.
proxy for a VTK source on a server
Data array information like type.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
static vtkSMSessionObject * New()