ParaView
vtkSMProxyProperty.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMProxyProperty.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 =========================================================================*/
63 #ifndef vtkSMProxyProperty_h
64 #define vtkSMProxyProperty_h
65 
66 #include "vtkPVServerManagerCoreModule.h" //needed for exports
67 #include "vtkSMProperty.h"
68 
69 class vtkSMProxy;
70 class vtkSMStateLocator;
71 
72 class VTKPVSERVERMANAGERCORE_EXPORT vtkSMProxyProperty : public vtkSMProperty
73 {
74 public:
76 
82  static void EnableProxyCreation();
83  static void DisableProxyCreation();
84  static bool CanCreateProxy();
86 
87  static vtkSMProxyProperty* New();
89  void PrintSelf(ostream& os, vtkIndent indent);
90 
92 
96  virtual void AddProxy(vtkSMProxy* proxy);
97  virtual void SetProxy(unsigned int idx, vtkSMProxy* proxy);
98  virtual void RemoveProxy(vtkSMProxy* proxy);
99  virtual void RemoveAllProxies();
101 
105  virtual void SetProxies(unsigned int numElements, vtkSMProxy* proxies[]);
106 
110  bool IsProxyAdded(vtkSMProxy* proxy);
111 
113 
124  virtual void AddUncheckedProxy(vtkSMProxy* proxy);
125  virtual void SetUncheckedProxy(unsigned int idx, vtkSMProxy* proxy);
127 
131  virtual void RemoveAllUncheckedProxies();
132  virtual void ClearUncheckedElements() { this->RemoveAllUncheckedProxies(); }
133 
137  unsigned int GetNumberOfProxies();
138 
142  unsigned int GetNumberOfUncheckedProxies();
143 
145 
148  void SetNumberOfProxies(unsigned int count);
149  void SetNumberOfUncheckedProxies(unsigned int count);
151 
155  vtkSMProxy* GetProxy(unsigned int idx);
156 
160  vtkSMProxy* GetUncheckedProxy(unsigned int idx);
161 
165  virtual void Copy(vtkSMProperty* src);
166 
168 
171  vtkGetMacro(SkipDependency, bool);
173 
177  virtual void UpdateAllInputs();
178 
179  virtual bool IsValueDefault();
180 
187  virtual void ResetToXMLDefaults();
188 
189 protected:
192 
196  virtual void WriteTo(vtkSMMessage* msg);
197 
201  virtual void ReadFrom(const vtkSMMessage* msg, int msg_offset, vtkSMProxyLocator*);
202 
203  friend class vtkSMProxy;
204 
209  virtual int ReadXMLAttributes(vtkSMProxy* parent, vtkPVXMLElement* element);
210 
214  virtual void SaveStateValues(vtkPVXMLElement* propertyElement);
215 
222  virtual vtkPVXMLElement* AddProxyElementState(vtkPVXMLElement* prop, unsigned int idx);
226  virtual int LoadState(vtkPVXMLElement* element, vtkSMProxyLocator* loader);
227 
232  void OnUpdateDataEvent() { this->UpdateDomains(); }
233 
234  // Static flag used to know if the locator should be used to create proxy
235  // or if the session should be used to find only the existing ones
236  static bool CreateProxyAllowed;
237 
239 
241  friend class vtkPPInternals;
243 
244 private:
245  vtkSMProxyProperty(const vtkSMProxyProperty&) VTK_DELETE_FUNCTION;
246  void operator=(const vtkSMProxyProperty&) VTK_DELETE_FUNCTION;
247 };
248 
249 #endif
virtual int ReadXMLAttributes(vtkSMProxy *parent, vtkPVXMLElement *element)
Set the appropriate ivars from the xml element.
virtual void SaveStateValues(vtkPVXMLElement *propertyElement)
This method must be overiden by concrete class in order to save the real property data...
virtual void WriteTo(vtkSMMessage *msg)
Let the property write its content into the stream.
vtkPPInternals * PPInternals
property representing pointer(s) to vtkObject(s)
superclass for all SM properties
virtual void Copy(vtkSMProperty *src)
Copy all property values.
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
static bool CreateProxyAllowed
static vtkSMProperty * New()
void UpdateDomains()
Calls Update() on all domains contained by the property as well as all dependant domains.
void OnUpdateDataEvent()
Called when a producer fires the vtkCommand::UpdateDataEvent.
This class is used by vtkSMProxyProperty to keep track of the proxies.
virtual void ReadFrom(const vtkSMMessage *, int vtkNotUsed(message_offset), vtkSMProxyLocator *)
Let the property read and set its content from the stream.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
virtual void ClearUncheckedElements()
Use this method to clear unchecked values set of this property.
is used to locate proxies referred to in state xmls while loading state files.
void PrintSelf(ostream &os, vtkIndent indent)
virtual void ResetToXMLDefaults()
For properties that support specifying defaults in XML configuration, this method will reset the prop...
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
virtual int LoadState(vtkPVXMLElement *element, vtkSMProxyLocator *loader)
Updates state from an XML element.
virtual bool IsValueDefault()
Returns true if the property's value is different from the default value.
Class used to retreive a given message state based on its GlobalID.
virtual void UpdateAllInputs()
Update all proxies referred by this property (if any).