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 
133  virtual vtkPVDataInformation* GetInputDataInformation(
134  const char* function, unsigned int index = 0);
135 
141  virtual unsigned int GetNumberOfInputConnections(const char* function);
142 
143 protected:
144  vtkSMDomain();
145  ~vtkSMDomain() override;
146 
148 
155  void SaveState(vtkPVXMLElement* parent, const char* uid);
156  virtual void ChildSaveState(vtkPVXMLElement* domainElement);
158 
171  virtual int LoadState(
172  vtkPVXMLElement* vtkNotUsed(domainElement), vtkSMProxyLocator* vtkNotUsed(loader))
173  {
174  return 1;
175  }
176 
181  virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* elem);
182 
183  friend class vtkSMProperty;
184 
190  vtkSMProperty* GetRequiredProperty(const char* function);
191 
195  void RemoveRequiredProperty(vtkSMProperty* prop);
196 
205  void AddRequiredProperty(vtkSMProperty* prop, const char* function);
206 
208 
214  vtkSetMacro(IsOptional, bool);
216 
218 
223  vtkSetStringMacro(XMLName);
225 
230  void DomainModified();
231  void InvokeModified() { this->DomainModified(); }
232 
236  unsigned int GetNumberOfRequiredProperties();
237 
242  void SetProperty(vtkSMProperty*);
243 
271  {
272  vtkSMDomain* Self;
273 
274  public:
277  };
278 
279  char* XMLName;
281  vtkSMDomainInternals* Internals;
282 
283 private:
284  vtkSMDomain(const vtkSMDomain&) = delete;
285  void operator=(const vtkSMDomain&) = delete;
286 
288  unsigned int DeferDomainModifiedEventsCount;
289  bool PendingDomainModifiedEvents;
290 };
291 
292 #endif
superclass for any server manager classes that are related to a session
bool IsOptional
Definition: vtkSMDomain.h:280
Light object for holding data information.
#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:231
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:281
helper to defer firing of vtkCommand::DomainModifiedEvent.
Definition: vtkSMDomain.h:270
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:279
#define vtkSMDomain
virtual int LoadState(vtkPVXMLElement *vtkNotUsed(domainElement), vtkSMProxyLocator *vtkNotUsed(loader))
Load the state of the domain from the XML.
Definition: vtkSMDomain.h:171
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
index
static vtkSMSessionObject * New()