vtkSMArrayListDomain.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
65 #ifndef vtkSMArrayListDomain_h
66 #define vtkSMArrayListDomain_h
67 
68 #include "vtkRemotingServerManagerModule.h" //needed for exports
69 #include "vtkSMStringListDomain.h"
70 
73 class vtkSMProxyProperty;
74 class vtkSMSourceProxy;
76 
77 class vtkSMArrayListDomainInternals;
78 
79 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSMArrayListDomain : public vtkSMStringListDomain
80 {
81 public:
82  static vtkSMArrayListDomain* New();
84  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
92  void Update(vtkSMProperty* prop) override;
93 
98  int IsArrayPartial(unsigned int idx);
99 
107  int GetFieldAssociation(unsigned int idx);
108 
126  int GetDomainAssociation(unsigned int idx);
127 
129 
133  vtkGetMacro(AttributeType, int);
135 
146  int SetDefaultValues(vtkSMProperty*, bool use_unchecked_values) override;
147 
148  // This enum represents the possible strategies associated
149  // with a given InformationKey :
150  // NEED_KEY means that if the array will be in the domain only if
151  // it does contains the given information key in its information.
152  // REJECT_KEY means that if the array will be in the domain only if
153  // it does NOT contains the given information key in its information.
155  {
157  REJECT_KEY
158  };
159 
161 
167  virtual unsigned int AddInformationKey(const char* location, const char* name, int strategy);
168  virtual unsigned int AddInformationKey(const char* location, const char* name)
169  {
170  return this->AddInformationKey(location, name, vtkSMArrayListDomain::NEED_KEY);
171  }
173 
177  unsigned int RemoveInformationKey(const char* location, const char* name);
178 
182  unsigned int GetNumberOfInformationKeys();
183 
187  void RemoveAllInformationKeys();
188 
190 
193  const char* GetInformationKeyLocation(unsigned int);
194  const char* GetInformationKeyName(unsigned int);
195  int GetInformationKeyStrategy(unsigned int);
197 
202  static std::string CreateMangledName(vtkPVArrayInformation* arrayInfo, int component);
203 
205 
209  static std::string ArrayNameFromMangledName(const char* name);
210  static int ComponentIndexFromMangledName(vtkPVArrayInformation* info, const char* name);
212 
213 protected:
215  ~vtkSMArrayListDomain() override;
216 
221  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
222 
228  virtual vtkPVDataInformation* GetExtraDataInformation() { return nullptr; }
229 
235  virtual bool IsFilteredArray(vtkPVDataInformation* info, int association, const char* arrayName);
236 
238 
241  vtkSetMacro(AttributeType, int);
242  int AttributeType;
244 
246 
250  vtkGetStringMacro(InputDomainName);
251  vtkSetStringMacro(InputDomainName);
253 
254  char* InputDomainName;
255 
256  // Currently, used by vtkSMRepresentedArrayListDomain to avoid picking just an
257  // arbitrary array for scalar coloring. Need to rethink how this should be
258  // done cleanly.
260 
261 private:
263  void operator=(const vtkSMArrayListDomain&) = delete;
264 
265  friend class vtkSMArrayListDomainInternals;
266  vtkSMArrayListDomainInternals* ALDInternals;
267 };
268 
269 #endif
vtkSMStringListDomain::SetDefaultValues
int SetDefaultValues(vtkSMProperty *, bool use_unchecked_values) override
A vtkSMProperty is often defined with a default value in the XML itself.
vtkSMArrayListDomain::InputDomainName
char * InputDomainName
Definition: vtkSMArrayListDomain.h:251
vtkSMStringListDomain::Update
void Update(vtkSMProperty *) override
Update self checking the "unchecked" values of all required properties.
vtkSMArrayListDomain::PickFirstAvailableArrayByDefault
bool PickFirstAvailableArrayByDefault
Definition: vtkSMArrayListDomain.h:259
vtkSMArrayListDomain::GetExtraDataInformation
virtual vtkPVDataInformation * GetExtraDataInformation()
HACK: Provides a temporary mechanism for subclasses to provide an "additional" vtkPVDataInformation i...
Definition: vtkSMArrayListDomain.h:228
vtkSMProperty
superclass for all SM properties
Definition: vtkSMProperty.h:144
vtkSMArrayListDomain
list of arrays obtained from input
Definition: vtkSMArrayListDomain.h:79
vtkSMInputArrayDomain
domain to ensure that input has required types of arrays.
Definition: vtkSMInputArrayDomain.h:67
vtkPVDataSetAttributesInformation
List of array info.
Definition: vtkPVDataSetAttributesInformation.h:24
vtkSMArrayListDomain::InformationKeyStrategy
InformationKeyStrategy
Definition: vtkSMArrayListDomain.h:154
vtkSMSourceProxy
proxy for a VTK source on a server
Definition: vtkSMSourceProxy.h:37
vtkIndent
vtkSMArrayListDomain::NEED_KEY
@ NEED_KEY
Definition: vtkSMArrayListDomain.h:156
vtkSMStringListDomain::ReadXMLAttributes
int ReadXMLAttributes(vtkSMProperty *prop, vtkPVXMLElement *element) override
Set the appropriate ivars from the xml element.
vtkSMStringListDomain.h
name
name
vtkSMStringListDomain::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkPVDataInformation
provides meta data about a vtkDataObject subclass.
Definition: vtkPVDataInformation.h:42
vtkPVXMLElement
Definition: vtkPVXMLElement.h:23
vtkPVArrayInformation
provides meta data about arrays.
Definition: vtkPVArrayInformation.h:30
vtkSMStringListDomain
list of strings
Definition: vtkSMStringListDomain.h:32
vtkSMArrayListDomain::AddInformationKey
virtual unsigned int AddInformationKey(const char *location, const char *name)
Adds a new InformationKey to the domain.
Definition: vtkSMArrayListDomain.h:168
location
location
vtkSMProxyProperty
property representing pointer(s) to vtkObject(s)
Definition: vtkSMProxyProperty.h:57
vtkSMStringListDomain::New
static vtkSMStringListDomain * New()
vtkSMArrayListDomain::AttributeType
int AttributeType
Set to an attribute type defined in vtkDataSetAttributes.
Definition: vtkSMArrayListDomain.h:241