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);
127 
133  virtual unsigned int GetNumberOfInputConnections(const char* function);
134 
140  vtkSMProperty* GetRequiredProperty(const char* function);
141 
142 protected:
143  vtkSMDomain();
144  ~vtkSMDomain() override;
145 
147 
154  void SaveState(vtkPVXMLElement* parent, const char* uid);
155  virtual void ChildSaveState(vtkPVXMLElement* domainElement);
157 
170  virtual int LoadState(
171  vtkPVXMLElement* vtkNotUsed(domainElement), vtkSMProxyLocator* vtkNotUsed(loader))
172  {
173  return 1;
174  }
175 
180  virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* elem);
181 
182  friend class vtkSMProperty;
183 
187  void RemoveRequiredProperty(vtkSMProperty* prop);
188 
197  void AddRequiredProperty(vtkSMProperty* prop, const char* function);
198 
200 
206  vtkSetMacro(IsOptional, bool);
208 
210 
215  vtkSetStringMacro(XMLName);
217 
222  void DomainModified();
223  void InvokeModified() { this->DomainModified(); }
224 
228  unsigned int GetNumberOfRequiredProperties();
229 
234  void SetProperty(vtkSMProperty*);
235 
263  {
264  vtkSMDomain* Self;
265 
266  public:
269  };
270 
271  char* XMLName;
273  vtkSMDomainInternals* Internals;
274 
275 private:
276  vtkSMDomain(const vtkSMDomain&) = delete;
277  void operator=(const vtkSMDomain&) = delete;
278 
280  unsigned int DeferDomainModifiedEventsCount;
281  bool PendingDomainModifiedEvents;
282 };
283 
284 #endif
superclass for any server manager classes that are related to a session
bool IsOptional
Definition: vtkSMDomain.h:272
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:223
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:273
helper to defer firing of vtkCommand::DomainModifiedEvent.
Definition: vtkSMDomain.h:262
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:271
#define vtkSMDomain
virtual int LoadState(vtkPVXMLElement *vtkNotUsed(domainElement), vtkSMProxyLocator *vtkNotUsed(loader))
Load the state of the domain from the XML.
Definition: vtkSMDomain.h:170
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
index
static vtkSMSessionObject * New()