vtkSIProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkSIProxy_h
11 #define vtkSIProxy_h
12 
13 #include "vtkRemotingServerManagerModule.h" //needed for exports
14 #include "vtkSIObject.h"
15 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
16 
17 class vtkAlgorithmOutput;
18 class vtkSIProperty;
19 class vtkPVXMLElement;
21 
23 {
24 public:
25  static vtkSIProxy* New();
26  vtkTypeMacro(vtkSIProxy, vtkSIObject);
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
35  void AboutToDelete() override;
36 
40  void Push(vtkSMMessage* msg) override;
41 
45  void Pull(vtkSMMessage* msg) override;
46 
48 
54  vtkObjectBase* GetVTKObject();
55  void SetVTKObject(vtkObjectBase*);
57 
61  vtkSIProperty* GetSIProperty(const char* name);
62 
64 
67  vtkGetStringMacro(VTKClassName);
69 
71 
76  vtkGetStringMacro(XMLName);
78 
80 
85  vtkGetStringMacro(XMLGroup);
87 
92  bool IsNullProxy() { return (VTKClassName == nullptr); };
93 
95 
100  virtual void AddInput(int input_port, vtkAlgorithmOutput* connection, const char* method);
101  virtual void CleanInputs(const char* method);
103 
108  virtual void UpdatePipelineInformation() {}
109 
113  virtual void RecreateVTKObjects();
114 
119  virtual bool ExtendDefinition(const char* xml);
120 
124  const char* GetLogNameOrDefault();
125 
126 protected:
127  vtkSIProxy();
128  ~vtkSIProxy() override;
129 
134  virtual vtkObjectBase* NewVTKObject(const char* className);
135 
139  vtkSIProxy* GetSubSIProxy(const char* name);
140 
142 
145  unsigned int GetNumberOfSubSIProxys();
146  vtkSIProxy* GetSubSIProxy(unsigned int cc);
148 
152  vtkSIProxyDefinitionManager* GetProxyDefinitionManager();
153 
161  virtual bool CreateVTKObjects();
162 
166  virtual void DeleteVTKObjects();
167 
174  virtual void OnCreateVTKObjects();
175 
180  bool InitializeAndCreateVTKObjects(vtkSMMessage* message);
181 
183 
186  virtual bool ReadXMLAttributes(vtkPVXMLElement* element);
187  virtual bool ReadXMLProperty(vtkPVXMLElement* property_element);
188  virtual bool ReadXMLSubProxy(vtkPVXMLElement* subproxy_element);
190 
194  void AddSIProperty(const char* name, vtkSIProperty*);
195 
196  vtkSetStringMacro(VTKClassName);
197  vtkSetStringMacro(XMLGroup);
198  vtkSetStringMacro(XMLName);
199  vtkSetStringMacro(XMLSubProxyName);
200  vtkSetStringMacro(PostPush);
201  vtkSetStringMacro(PostCreation);
202  vtkGetStringMacro(LogName);
203 
204  void SetLogName(const char* name);
205 
207  char* XMLGroup;
208  char* XMLName;
210  char* PostPush;
213 
216 
217 private:
218  vtkSIProxy(const vtkSIProxy&) = delete;
219  void operator=(const vtkSIProxy&) = delete;
220 
221  class vtkInternals;
222  vtkInternals* Internals;
223 
224  char* LogName;
225  std::string DefaultLogName;
226 };
227 
228 #endif
virtual void UpdatePipelineInformation()
Triggers UpdateInformation() on vtkObject if possible.
Definition: vtkSIProxy.h:108
char * VTKClassName
Definition: vtkSIProxy.h:206
virtual void Push(vtkSMMessage *msg)
Push a new state to the underneath implementation The provided implementation just store the message ...
char * XMLSubProxyName
Definition: vtkSIProxy.h:209
#define VTKREMOTINGSERVERMANAGER_EXPORT
bool IsNullProxy()
Return true if that Proxy is supposed to have NO vtk class, which means its a NullProxy.
Definition: vtkSIProxy.h:92
bool ObjectsCreated
Definition: vtkSIProxy.h:215
static vtkSIObject * New()
int NumberOfInputPorts
Definition: vtkSIProxy.h:212
name
vtkSIProxy is the server-implementation for a vtkSMProxy that helps the vtkSMProxy with managing/upda...
Definition: vtkSIProxy.h:22
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
virtual void AboutToDelete()
This method is called before the deletion of the SIObject.
Definition: vtkSIObject.h:34
virtual void Pull(vtkSMMessage *msg)
Pull the current state of the underneath implementation The provided implementation update the given ...
char * PostPush
Definition: vtkSIProxy.h:210
char * PostCreation
Definition: vtkSIProxy.h:211
Object that is managed by vtkPVSessionCore which wrap concrete class such as the vtk ones...
Definition: vtkSIObject.h:21
vtkSmartPointer< vtkObjectBase > VTKObject
Definition: vtkSIProxy.h:214
object responsible for managing XML proxies definitions
Basic ServerImplementation property used to call a method with no argument on a VTK object...
Definition: vtkSIProperty.h:24
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
char * XMLGroup
Definition: vtkSIProxy.h:207
char * XMLName
Definition: vtkSIProxy.h:208
void PrintSelf(ostream &os, vtkIndent indent) override