vtkSMLink.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMLink.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 =========================================================================*/
24 #ifndef vtkSMLink_h
25 #define vtkSMLink_h
26 
27 #include "vtkRemotingServerManagerModule.h" //needed for exports
28 #include "vtkSMMessageMinimal.h" // Needed
29 #include "vtkSMRemoteObject.h"
30 
31 class vtkCommand;
32 class vtkPVXMLElement;
33 class vtkSMProxy;
34 class vtkSMProxyLocator;
35 
37 {
38 public:
39  vtkTypeMacro(vtkSMLink, vtkSMRemoteObject);
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43  {
44  NONE = 0,
45  INPUT = 1,
46  OUTPUT = 2
47  };
48 
50 
54  vtkSetMacro(PropagateUpdateVTKObjects, int);
55  vtkGetMacro(PropagateUpdateVTKObjects, int);
56  vtkBooleanMacro(PropagateUpdateVTKObjects, int);
58 
60 
64  vtkSetMacro(Enabled, bool);
65  vtkGetMacro(Enabled, bool);
67 
71  virtual void RemoveAllLinks() = 0;
72 
79  const vtkSMMessage* GetFullState() override;
80 
88  void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator) override;
89 
93  virtual void UpdateState() = 0;
94 
98  virtual unsigned int GetNumberOfLinkedObjects() = 0;
99 
104  virtual int GetLinkedObjectDirection(int index) = 0;
105 
109  virtual vtkSMProxy* GetLinkedProxy(int index) = 0;
110 
111 protected:
112  vtkSMLink();
113  ~vtkSMLink() override;
114 
119  void PushStateToSession();
120 
125  virtual void UpdateVTKObjects(vtkSMProxy* proxy) = 0;
126 
132  virtual void PropertyModified(vtkSMProxy* proxy, const char* pname) = 0;
133 
139  virtual void UpdateProperty(vtkSMProxy* caller, const char* pname) = 0;
140 
144  void ObserveProxyUpdates(vtkSMProxy* proxy);
145 
149  virtual void SaveXMLState(const char* linkname, vtkPVXMLElement* parent) = 0;
150 
154  virtual int LoadXMLState(vtkPVXMLElement* linkElement, vtkSMProxyLocator* locator) = 0;
155 
156  friend class vtkSMLinkObserver;
157  friend class vtkSMStateLoader;
159 
161  // Set by default. In a link P1->P2, if this flag is set, when ever Proxy with P1
162  // is updated i.e. UpdateVTKObjects() is called, this class calls
163  // UpdateVTKObjects on Proxy with P2.
165 
166  bool Enabled;
167 
168  // Cached version of State
170 
171 private:
172  vtkSMLink(const vtkSMLink&) = delete;
173  void operator=(const vtkSMLink&) = delete;
174 };
175 
176 #endif
virtual void LoadState(const vtkSMMessage *msg, vtkSMProxyLocator *locator)
This method is used to initialise the object to the given state If the definitionOnly Flag is set to ...
#define VTKREMOTINGSERVERMANAGER_EXPORT
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
const int NONE
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
virtual const vtkSMMessage * GetFullState()
This method return the full object state that can be used to create that object from scratch...
is used to locate proxies referred to in state xmls while loading state files.
Utility class to load state from XML.
baseclass for all proxy-objects that have counter parts on server as well as client processes...
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
void PrintSelf(ostream &os, vtkIndent indent) override