vtkSMDomain.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMDomain.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 =========================================================================*/
35 #ifndef vtkSMDomain_h
36 #define vtkSMDomain_h
37 
38 #include "vtkClientServerID.h" // needed for saving animation in batch script
39 #include "vtkRemotingServerManagerModule.h" //needed for exports
40 #include "vtkSMSessionObject.h"
41 
43 class vtkPVXMLElement;
44 class vtkSMProperty;
45 class vtkSMProxyLocator;
46 
47 struct vtkSMDomainInternals;
48 
50 {
51 public:
52  static vtkSMDomain* New();
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
60  {
61  NOT_APPLICABLE = -1,
62  NOT_IN_DOMAIN = 0,
63  IN_DOMAIN = 1,
64  };
65 
76  virtual int IsInDomain(vtkSMProperty* vtkNotUsed(property)) { return IN_DOMAIN; }
77 
83  virtual void Update(vtkSMProperty* requestingProperty);
84 
88  virtual void SetAnimationValue(vtkSMProperty*, int vtkNotUsed(index), double vtkNotUsed(value)) {}
89 
103  virtual int SetDefaultValues(vtkSMProperty*, bool vtkNotUsed(use_unchecked_values)) { return 0; };
104 
106 
111  vtkGetStringMacro(XMLName);
113 
115 
121  vtkGetMacro(IsOptional, bool);
123 
127  vtkSMProperty* GetProperty();
128 
130 
134  virtual vtkPVDataInformation* GetInputDataInformation(
135  const char* function, unsigned int index = 0);
136  virtual vtkPVDataInformation* GetInputSubsetDataInformation(
137  unsigned int compositeIndex, const char* function, unsigned int index = 0);
139 
145  virtual unsigned int GetNumberOfInputConnections(const char* function);
146 
152  vtkSMProperty* GetRequiredProperty(const char* function);
153 
154 protected:
155  vtkSMDomain();
156  ~vtkSMDomain() override;
157 
159 
166  void SaveState(vtkPVXMLElement* parent, const char* uid);
167  virtual void ChildSaveState(vtkPVXMLElement* domainElement);
169 
182  virtual int LoadState(
183  vtkPVXMLElement* vtkNotUsed(domainElement), vtkSMProxyLocator* vtkNotUsed(loader))
184  {
185  return 1;
186  }
187 
192  virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* elem);
193 
194  friend class vtkSMProperty;
195 
199  void RemoveRequiredProperty(vtkSMProperty* prop);
200 
209  void AddRequiredProperty(vtkSMProperty* prop, const char* function);
210 
212 
218  vtkSetMacro(IsOptional, bool);
220 
222 
227  vtkSetStringMacro(XMLName);
229 
234  void DomainModified();
235  void InvokeModified() { this->DomainModified(); }
236 
240  unsigned int GetNumberOfRequiredProperties();
241 
246  void SetProperty(vtkSMProperty*);
247 
275  {
276  vtkSMDomain* Self;
277 
278  public:
281  };
282 
283  char* XMLName;
285  vtkSMDomainInternals* Internals;
286 
287 private:
288  vtkSMDomain(const vtkSMDomain&) = delete;
289  void operator=(const vtkSMDomain&) = delete;
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:284
provides meta data about a vtkDataObject subclass.
#define VTKREMOTINGSERVERMANAGER_EXPORT
IsInDomainReturnCodes
Return values for IsInDomain calls.
Definition: vtkSMDomain.h:59
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:88
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:103
void InvokeModified()
Definition: vtkSMDomain.h:235
represents the possible values a property can have
Definition: vtkSMDomain.h:49
virtual int IsInDomain(vtkSMProperty *vtkNotUsed(property))
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
Definition: vtkSMDomain.h:76
vtkSMDomainInternals * Internals
Definition: vtkSMDomain.h:285
helper to defer firing of vtkCommand::DomainModifiedEvent.
Definition: vtkSMDomain.h:274
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:283
#define vtkSMDomain
virtual int LoadState(vtkPVXMLElement *vtkNotUsed(domainElement), vtkSMProxyLocator *vtkNotUsed(loader))
Load the state of the domain from the XML.
Definition: vtkSMDomain.h:182
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
index
static vtkSMSessionObject * New()