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 #include "vtkSMSourceProxy.h"
30 
32 class vtkPVXMLElement;
33 class vtkSMProperty;
34 class vtkSMProxyLocator;
35 
36 struct vtkSMDomainInternals;
37 
39 {
40 public:
41  static vtkSMDomain* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
49  {
50  NOT_APPLICABLE = -1,
51  NOT_IN_DOMAIN = 0,
52  IN_DOMAIN = 1,
53  };
54 
65  virtual int IsInDomain(vtkSMProperty* vtkNotUsed(property)) { return IN_DOMAIN; }
66 
72  virtual void Update(vtkSMProperty* requestingProperty);
73 
77  virtual void SetAnimationValue(vtkSMProperty*, int vtkNotUsed(index), double vtkNotUsed(value)) {}
78 
92  virtual int SetDefaultValues(vtkSMProperty*, bool vtkNotUsed(use_unchecked_values)) { return 0; };
93 
95 
100  vtkGetStringMacro(XMLName);
102 
104 
110  vtkGetMacro(IsOptional, bool);
112 
116  vtkSMProperty* GetProperty();
117 
119 
123  virtual vtkPVDataInformation* GetInputDataInformation(
124  const char* function, unsigned int index = 0);
125  virtual vtkPVDataInformation* GetInputDataSetInformation(
126  const char* function, unsigned int index = 0);
127  virtual vtkPVDataInformation* GetInputSubsetDataInformation(
128  unsigned int compositeIndex, const char* function, unsigned int index = 0);
129  virtual vtkPVDataInformation* GetInputSubsetDataInformation(
130  const char* selector, const char* assemblyName, const char* function, unsigned int index = 0);
132 
138  virtual unsigned int GetNumberOfInputConnections(const char* function);
139 
145  vtkSMProperty* GetRequiredProperty(const char* function);
146 
147 protected:
148  vtkSMDomain();
149  ~vtkSMDomain() override;
150 
152 
159  void SaveState(vtkPVXMLElement* parent, const char* uid);
160  virtual void ChildSaveState(vtkPVXMLElement* domainElement);
162 
175  virtual int LoadState(
176  vtkPVXMLElement* vtkNotUsed(domainElement), vtkSMProxyLocator* vtkNotUsed(loader))
177  {
178  return 1;
179  }
180 
185  virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* elem);
186 
187  friend class vtkSMProperty;
188 
192  void RemoveRequiredProperty(vtkSMProperty* prop);
193 
202  void AddRequiredProperty(vtkSMProperty* prop, const char* function);
203 
205 
211  vtkSetMacro(IsOptional, bool);
213 
215 
220  vtkSetStringMacro(XMLName);
222 
227  void DomainModified();
228  void InvokeModified() { this->DomainModified(); }
229 
233  unsigned int GetNumberOfRequiredProperties();
234 
239  void SetProperty(vtkSMProperty*);
240 
268  {
269  vtkSMDomain* Self;
270 
271  public:
274  };
275 
276  char* XMLName;
278  vtkSMDomainInternals* Internals;
279 
280 private:
281  vtkSMDomain(const vtkSMDomain&) = delete;
282  void operator=(const vtkSMDomain&) = delete;
283 
289  vtkSMSourceProxy* GetProxy(const char* function, unsigned int index, int& port);
290 
292  unsigned int DeferDomainModifiedEventsCount;
293  bool PendingDomainModifiedEvents;
294 };
295 
296 #endif
superclass for any server manager classes that are related to a session
bool IsOptional
Definition: vtkSMDomain.h:277
provides meta data about a vtkDataObject subclass.
#define VTKREMOTINGSERVERMANAGER_EXPORT
IsInDomainReturnCodes
Return values for IsInDomain calls.
Definition: vtkSMDomain.h:48
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:77
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:92
void InvokeModified()
Definition: vtkSMDomain.h:228
represents the possible values a property can have
Definition: vtkSMDomain.h:38
virtual int IsInDomain(vtkSMProperty *vtkNotUsed(property))
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
Definition: vtkSMDomain.h:65
vtkSMDomainInternals * Internals
Definition: vtkSMDomain.h:278
proxy for a VTK source on a server
helper to defer firing of vtkCommand::DomainModifiedEvent.
Definition: vtkSMDomain.h:267
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:276
#define vtkSMDomain
virtual int LoadState(vtkPVXMLElement *vtkNotUsed(domainElement), vtkSMProxyLocator *vtkNotUsed(loader))
Load the state of the domain from the XML.
Definition: vtkSMDomain.h:175
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
index
static vtkSMSessionObject * New()