ParaView
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 "vtkPVServerImplementationCoreModule.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 
34 class VTKPVSERVERIMPLEMENTATIONCORE_EXPORT vtkSIProxy : public vtkSIObject
35 {
36 public:
37  static vtkSIProxy* New();
38  vtkTypeMacro(vtkSIProxy, vtkSIObject);
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
47  virtual void AboutToDelete();
48 
52  virtual void Push(vtkSMMessage* msg);
53 
57  virtual void Pull(vtkSMMessage* msg);
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 == NULL); };
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 
127 protected:
128  vtkSIProxy();
129  ~vtkSIProxy();
130 
134  vtkSIProxy* GetSubSIProxy(const char* name);
135 
137 
140  unsigned int GetNumberOfSubSIProxys();
141  vtkSIProxy* GetSubSIProxy(unsigned int cc);
143 
147  vtkSIProxyDefinitionManager* GetProxyDefinitionManager();
148 
156  virtual bool CreateVTKObjects();
157 
161  void DeleteVTKObjects();
162 
169  virtual void OnCreateVTKObjects();
170 
175  bool InitializeAndCreateVTKObjects(vtkSMMessage* message);
176 
178 
181  virtual bool ReadXMLAttributes(vtkPVXMLElement* element);
182  virtual bool ReadXMLProperty(vtkPVXMLElement* property_element);
183  virtual bool ReadXMLSubProxy(vtkPVXMLElement* subproxy_element);
185 
189  void AddSIProperty(const char* name, vtkSIProperty*);
190 
191  vtkSetStringMacro(VTKClassName);
192  vtkSetStringMacro(XMLGroup);
193  vtkSetStringMacro(XMLName);
194  vtkSetStringMacro(XMLSubProxyName);
195  vtkSetStringMacro(PostPush);
196  vtkSetStringMacro(PostCreation);
197 
198  char* VTKClassName;
199  char* XMLGroup;
200  char* XMLName;
202  char* PostPush;
205 
206  vtkSmartPointer<vtkObjectBase> VTKObject;
208 
209 private:
210  vtkSIProxy(const vtkSIProxy&) VTK_DELETE_FUNCTION;
211  void operator=(const vtkSIProxy&) VTK_DELETE_FUNCTION;
212 
213  class vtkInternals;
214  vtkInternals* Internals;
215 };
216 
217 #endif
virtual void UpdatePipelineInformation()
Triggers UpdateInformation() on vtkObject if possible.
Definition: vtkSIProxy.h:120
char * VTKClassName
Definition: vtkSIProxy.h:196
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:201
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:207
static vtkSIObject * New()
int NumberOfInputPorts
Definition: vtkSIProxy.h:204
void PrintSelf(ostream &os, vtkIndent indent)
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:202
char * PostCreation
Definition: vtkSIProxy.h:203
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:206
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:199
char * XMLName
Definition: vtkSIProxy.h:200