vtkSMArrayListDomain.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMArrayListDomain.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 =========================================================================*/
70 #ifndef vtkSMArrayListDomain_h
71 #define vtkSMArrayListDomain_h
72 
73 #include "vtkRemotingServerManagerModule.h" //needed for exports
74 #include "vtkSMStringListDomain.h"
75 #include "vtkStdString.h" // needed for vtkStdString.
76 
79 class vtkSMProxyProperty;
80 class vtkSMSourceProxy;
82 
83 class vtkSMArrayListDomainInternals;
84 
85 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSMArrayListDomain : public vtkSMStringListDomain
86 {
87 public:
88  static vtkSMArrayListDomain* New();
90  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
98  void Update(vtkSMProperty* prop) override;
99 
104  int IsArrayPartial(unsigned int idx);
105 
113  int GetFieldAssociation(unsigned int idx);
114 
132  int GetDomainAssociation(unsigned int idx);
133 
135 
139  vtkGetMacro(AttributeType, int);
141 
143 
146  vtkGetStringMacro(NoneString);
148 
159  int SetDefaultValues(vtkSMProperty*, bool use_unchecked_values) override;
160 
161  // This enum represents the possible strategies associated
162  // with a given InformationKey :
163  // NEED_KEY means that if the array will be in the domain only if
164  // it does contains the given information key in its information.
165  // REJECT_KEY means that if the array will be in the domain only if
166  // it does NOT contains the given information key in its information.
168  {
170  REJECT_KEY
171  };
172 
174 
180  virtual unsigned int AddInformationKey(const char* location, const char* name, int strategy);
181  virtual unsigned int AddInformationKey(const char* location, const char* name)
182  {
183  return this->AddInformationKey(location, name, vtkSMArrayListDomain::NEED_KEY);
184  }
186 
190  unsigned int RemoveInformationKey(const char* location, const char* name);
191 
195  unsigned int GetNumberOfInformationKeys();
196 
200  void RemoveAllInformationKeys();
201 
203 
206  const char* GetInformationKeyLocation(unsigned int);
207  const char* GetInformationKeyName(unsigned int);
208  int GetInformationKeyStrategy(unsigned int);
210 
215  static vtkStdString CreateMangledName(vtkPVArrayInformation* arrayInfo, int component);
216 
218 
222  static vtkStdString ArrayNameFromMangledName(const char* name);
223  static int ComponentIndexFromMangledName(vtkPVArrayInformation* info, const char* name);
225 
226 protected:
228  ~vtkSMArrayListDomain() override;
229 
234  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
235 
241  virtual vtkPVDataInformation* GetExtraDataInformation() { return NULL; }
242 
248  virtual bool IsFilteredArray(vtkPVDataInformation* info, int association, const char* arrayName);
249 
251 
254  vtkSetMacro(AttributeType, int);
255  int AttributeType;
257 
259 
263  vtkGetStringMacro(InputDomainName);
264  vtkSetStringMacro(InputDomainName);
266 
267  vtkSetStringMacro(NoneString);
268 
269  char* InputDomainName;
270  char* NoneString;
271 
272  // Currently, used by vtkSMRepresentedArrayListDomain to avoid picking just an
273  // arbitrary array for scalar coloring. Need to rethink how this should be
274  // done cleanly.
276 
277 private:
279  void operator=(const vtkSMArrayListDomain&) = delete;
280 
281  friend class vtkSMArrayListDomainInternals;
282  vtkSMArrayListDomainInternals* ALDInternals;
283 };
284 
285 #endif
location
property representing pointer(s) to vtkObject(s)
virtual vtkPVDataInformation * GetExtraDataInformation()
HACK: Provides a temporary mechanism for subclasses to provide an "additional" vtkPVDataInformation i...
Light object for holding data information.
void PrintSelf(ostream &os, vtkIndent indent) override
superclass for all SM properties
int AttributeType
Set to an attribute type defined in vtkDataSetAttributes.
domain to ensure that input has required types of arrays.
name
int ReadXMLAttributes(vtkSMProperty *prop, vtkPVXMLElement *element) override
Set the appropriate ivars from the xml element.
virtual unsigned int AddInformationKey(const char *location, const char *name)
Adds a new InformationKey to the domain.
void Update(vtkSMProperty *) override
Update self checking the "unchecked" values of all required properties.
proxy for a VTK source on a server
Data array information like type.
static vtkSMStringListDomain * New()
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
list of arrays obtained from input
int SetDefaultValues(vtkSMProperty *, bool use_unchecked_values) override
A vtkSMProperty is often defined with a default value in the XML itself.