vtkSMDomain.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
23 #ifndef vtkSMDomain_h
24 #define vtkSMDomain_h
25 
26 #include "vtkClientServerID.h" // needed for saving animation in batch script
27 #include "vtkRemotingServerManagerModule.h" //needed for exports
28 #include "vtkSMSessionObject.h"
29 
31 class vtkPVXMLElement;
32 class vtkSMProperty;
33 class vtkSMProxyLocator;
34 
35 struct vtkSMDomainInternals;
36 
38 {
39 public:
40  static vtkSMDomain* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
48  {
49  NOT_APPLICABLE = -1,
50  NOT_IN_DOMAIN = 0,
51  IN_DOMAIN = 1,
52  };
53 
64  virtual int IsInDomain(vtkSMProperty* vtkNotUsed(property)) { return IN_DOMAIN; }
65 
71  virtual void Update(vtkSMProperty* requestingProperty);
72 
76  virtual void SetAnimationValue(vtkSMProperty*, int vtkNotUsed(index), double vtkNotUsed(value)) {}
77 
91  virtual int SetDefaultValues(vtkSMProperty*, bool vtkNotUsed(use_unchecked_values)) { return 0; };
92 
94 
99  vtkGetStringMacro(XMLName);
101 
103 
109  vtkGetMacro(IsOptional, bool);
111 
115  vtkSMProperty* GetProperty();
116 
118 
122  virtual vtkPVDataInformation* GetInputDataInformation(
123  const char* function, unsigned int index = 0);
124  virtual vtkPVDataInformation* GetInputSubsetDataInformation(
125  unsigned int compositeIndex, const char* function, unsigned int index = 0);
126  virtual vtkPVDataInformation* GetInputSubsetDataInformation(
127  const char* selector, const char* assemblyName, const char* function, unsigned int index = 0);
129 
135  virtual unsigned int GetNumberOfInputConnections(const char* function);
136 
142  vtkSMProperty* GetRequiredProperty(const char* function);
143 
144 protected:
145  vtkSMDomain();
146  ~vtkSMDomain() override;
147 
149 
156  void SaveState(vtkPVXMLElement* parent, const char* uid);
157  virtual void ChildSaveState(vtkPVXMLElement* domainElement);
159 
172  virtual int LoadState(
173  vtkPVXMLElement* vtkNotUsed(domainElement), vtkSMProxyLocator* vtkNotUsed(loader))
174  {
175  return 1;
176  }
177 
182  virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* elem);
183 
184  friend class vtkSMProperty;
185 
189  void RemoveRequiredProperty(vtkSMProperty* prop);
190 
199  void AddRequiredProperty(vtkSMProperty* prop, const char* function);
200 
202 
208  vtkSetMacro(IsOptional, bool);
210 
212 
217  vtkSetStringMacro(XMLName);
219 
224  void DomainModified();
225  void InvokeModified() { this->DomainModified(); }
226 
230  unsigned int GetNumberOfRequiredProperties();
231 
236  void SetProperty(vtkSMProperty*);
237 
265  {
266  vtkSMDomain* Self;
267 
268  public:
271  };
272 
273  char* XMLName;
275  vtkSMDomainInternals* Internals;
276 
277 private:
278  vtkSMDomain(const vtkSMDomain&) = delete;
279  void operator=(const vtkSMDomain&) = delete;
280 
282  unsigned int DeferDomainModifiedEventsCount;
283  bool PendingDomainModifiedEvents;
284 };
285 
286 #endif
superclass for any server manager classes that are related to a session
bool IsOptional
Definition: vtkSMDomain.h:274
provides meta data about a vtkDataObject subclass.
#define VTKREMOTINGSERVERMANAGER_EXPORT
IsInDomainReturnCodes
Return values for IsInDomain calls.
Definition: vtkSMDomain.h:47
virtual void SetAnimationValue(vtkSMProperty *, int vtkNotUsed(index), double vtkNotUsed(value))
Set the value of an element of a property from the animation editor.
Definition: vtkSMDomain.h:76
superclass for all SM properties
virtual void Update()
virtual int SetDefaultValues(vtkSMProperty *, bool vtkNotUsed(use_unchecked_values))
A vtkSMProperty is often defined with a default value in the XML itself.
Definition: vtkSMDomain.h:91
void InvokeModified()
Definition: vtkSMDomain.h:225
represents the possible values a property can have
Definition: vtkSMDomain.h:37
virtual int IsInDomain(vtkSMProperty *vtkNotUsed(property))
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
Definition: vtkSMDomain.h:64
vtkSMDomainInternals * Internals
Definition: vtkSMDomain.h:275
helper to defer firing of vtkCommand::DomainModifiedEvent.
Definition: vtkSMDomain.h:264
is used to locate proxies referred to in state xmls while loading state files.
void PrintSelf(ostream &os, vtkIndent indent) override
char * XMLName
Definition: vtkSMDomain.h:273
#define vtkSMDomain
virtual int LoadState(vtkPVXMLElement *vtkNotUsed(domainElement), vtkSMProxyLocator *vtkNotUsed(loader))
Load the state of the domain from the XML.
Definition: vtkSMDomain.h:172
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
index
static vtkSMSessionObject * New()