vtkSMProxyProperty.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
48 #ifndef vtkSMProxyProperty_h
49 #define vtkSMProxyProperty_h
50 
51 #include "vtkRemotingServerManagerModule.h" //needed for exports
52 #include "vtkSMProperty.h"
53 
54 class vtkSMProxy;
55 class vtkSMStateLocator;
56 
58 {
59 public:
61 
67  static void EnableProxyCreation();
68  static void DisableProxyCreation();
69  static bool CanCreateProxy();
71 
72  static vtkSMProxyProperty* New();
74  void PrintSelf(ostream& os, vtkIndent indent) override;
75 
77 
81  virtual void AddProxy(vtkSMProxy* proxy);
82  virtual void SetProxy(unsigned int idx, vtkSMProxy* proxy);
83  virtual void RemoveProxy(vtkSMProxy* proxy);
84  virtual void RemoveAllProxies();
86 
90  virtual void SetProxies(unsigned int numElements, vtkSMProxy* proxies[]);
91 
95  bool IsProxyAdded(vtkSMProxy* proxy);
96 
98 
109  virtual void AddUncheckedProxy(vtkSMProxy* proxy);
110  virtual void SetUncheckedProxy(unsigned int idx, vtkSMProxy* proxy);
112 
116  virtual void RemoveAllUncheckedProxies();
117  void ClearUncheckedElements() override { this->RemoveAllUncheckedProxies(); }
118 
122  unsigned int GetNumberOfProxies();
123 
127  unsigned int GetNumberOfUncheckedProxies();
128 
130 
133  void SetNumberOfProxies(unsigned int count);
134  void SetNumberOfUncheckedProxies(unsigned int count);
136 
140  vtkSMProxy* GetProxy(unsigned int idx);
141 
145  vtkSMProxy* GetUncheckedProxy(unsigned int idx);
146 
155  void Copy(vtkSMProperty* src) override;
156 
160  void UpdateAllInputs() override;
161 
162  bool IsValueDefault() override;
163 
170  void ResetToXMLDefaults() override;
171 
172 protected:
174  ~vtkSMProxyProperty() override;
175 
179  void WriteTo(vtkSMMessage* msg) override;
180 
184  void ReadFrom(const vtkSMMessage* msg, int msg_offset, vtkSMProxyLocator*) override;
185 
186  friend class vtkSMProxy;
187 
192  int ReadXMLAttributes(vtkSMProxy* parent, vtkPVXMLElement* element) override;
193 
197  void SaveStateValues(vtkPVXMLElement* propertyElement) override;
198 
205  virtual vtkPVXMLElement* AddProxyElementState(vtkPVXMLElement* prop, unsigned int idx);
209  int LoadState(vtkPVXMLElement* element, vtkSMProxyLocator* loader) override;
210 
215  void OnUpdateDataEvent() { this->UpdateDomains(); }
216 
217  // Static flag used to know if the locator should be used to create proxy
218  // or if the session should be used to find only the existing ones
219  static bool CreateProxyAllowed;
220 
222  friend class vtkPPInternals;
224 
225 private:
226  vtkSMProxyProperty(const vtkSMProxyProperty&) = delete;
227  void operator=(const vtkSMProxyProperty&) = delete;
228 };
229 
230 #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 overridden by concrete class in order to save the real property data...
void ClearUncheckedElements() override
Use this method to clear unchecked values set of this property.
virtual void WriteTo(vtkSMMessage *msg)
Let the property write its content into the stream.
vtkPPInternals * PPInternals
property representing pointer(s) to vtkObject(s)
#define VTKREMOTINGSERVERMANAGER_EXPORT
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 dependent 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:140
is used to locate proxies referred to in state xmls while loading state files.
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Class used to retrieve a given message state based on its GlobalID.
virtual void UpdateAllInputs()
Update all proxies referred by this property (if any).