vtkSIProxy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSIProxy.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 =========================================================================*/
22 #ifndef vtkSIProxy_h
23 #define vtkSIProxy_h
24 
25 #include "vtkRemotingServerManagerModule.h" //needed for exports
26 #include "vtkSIObject.h"
27 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
28 
29 class vtkAlgorithmOutput;
30 class vtkSIProperty;
31 class vtkPVXMLElement;
33 
35 {
36 public:
37  static vtkSIProxy* New();
38  vtkTypeMacro(vtkSIProxy, vtkSIObject);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
47  void AboutToDelete() override;
48 
52  void Push(vtkSMMessage* msg) override;
53 
57  void Pull(vtkSMMessage* msg) override;
58 
60 
66  vtkObjectBase* GetVTKObject();
67  void SetVTKObject(vtkObjectBase*);
69 
73  vtkSIProperty* GetSIProperty(const char* name);
74 
76 
79  vtkGetStringMacro(VTKClassName);
81 
83 
88  vtkGetStringMacro(XMLName);
90 
92 
97  vtkGetStringMacro(XMLGroup);
99 
104  bool IsNullProxy() { return (VTKClassName == nullptr); };
105 
107 
112  virtual void AddInput(int input_port, vtkAlgorithmOutput* connection, const char* method);
113  virtual void CleanInputs(const char* method);
115 
120  virtual void UpdatePipelineInformation() {}
121 
125  virtual void RecreateVTKObjects();
126 
131  virtual bool ExtendDefinition(const char* xml);
132 
136  const char* GetLogNameOrDefault();
137 
138 protected:
139  vtkSIProxy();
140  ~vtkSIProxy() override;
141 
146  virtual vtkObjectBase* NewVTKObject(const char* className);
147 
151  vtkSIProxy* GetSubSIProxy(const char* name);
152 
154 
157  unsigned int GetNumberOfSubSIProxys();
158  vtkSIProxy* GetSubSIProxy(unsigned int cc);
160 
164  vtkSIProxyDefinitionManager* GetProxyDefinitionManager();
165 
173  virtual bool CreateVTKObjects();
174 
178  virtual void DeleteVTKObjects();
179 
186  virtual void OnCreateVTKObjects();
187 
192  bool InitializeAndCreateVTKObjects(vtkSMMessage* message);
193 
195 
198  virtual bool ReadXMLAttributes(vtkPVXMLElement* element);
199  virtual bool ReadXMLProperty(vtkPVXMLElement* property_element);
200  virtual bool ReadXMLSubProxy(vtkPVXMLElement* subproxy_element);
202 
206  void AddSIProperty(const char* name, vtkSIProperty*);
207 
208  vtkSetStringMacro(VTKClassName);
209  vtkSetStringMacro(XMLGroup);
210  vtkSetStringMacro(XMLName);
211  vtkSetStringMacro(XMLSubProxyName);
212  vtkSetStringMacro(PostPush);
213  vtkSetStringMacro(PostCreation);
214  vtkGetStringMacro(LogName);
215 
216  void SetLogName(const char* name);
217 
219  char* XMLGroup;
220  char* XMLName;
222  char* PostPush;
225 
228 
229 private:
230  vtkSIProxy(const vtkSIProxy&) = delete;
231  void operator=(const vtkSIProxy&) = delete;
232 
233  class vtkInternals;
234  vtkInternals* Internals;
235 
236  char* LogName;
237  std::string DefaultLogName;
238 };
239 
240 #endif
virtual void UpdatePipelineInformation()
Triggers UpdateInformation() on vtkObject if possible.
Definition: vtkSIProxy.h:120
char * VTKClassName
Definition: vtkSIProxy.h:218
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:221
#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:104
bool ObjectsCreated
Definition: vtkSIProxy.h:227
static vtkSIObject * New()
int NumberOfInputPorts
Definition: vtkSIProxy.h:224
name
vtkSIProxy is the server-implementation for a vtkSMProxy that helps the vtkSMProxy with managing/upda...
Definition: vtkSIProxy.h:34
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:46
virtual void Pull(vtkSMMessage *msg)
Pull the current state of the underneath implementation The provided implementation update the given ...
char * PostPush
Definition: vtkSIProxy.h:222
char * PostCreation
Definition: vtkSIProxy.h:223
Object that is managed by vtkPVSessionCore which wrap concrete class such as the vtk ones...
Definition: vtkSIObject.h:33
vtkSmartPointer< vtkObjectBase > VTKObject
Definition: vtkSIProxy.h:226
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:36
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
char * XMLGroup
Definition: vtkSIProxy.h:219
char * XMLName
Definition: vtkSIProxy.h:220
void PrintSelf(ostream &os, vtkIndent indent) override