vtkSIProxyProperty.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkSIProxyProperty_h
14 #define vtkSIProxyProperty_h
15 
16 #include "vtkRemotingServerManagerModule.h" //needed for exports
17 #include "vtkSIProperty.h"
18 
20 {
21 public:
22  static vtkSIProxyProperty* New();
24  void PrintSelf(ostream& os, vtkIndent indent) override;
25 
27 
32  vtkGetStringMacro(CleanCommand);
34 
36 
42  vtkGetStringMacro(RemoveCommand);
44 
45  // When set to true, the property will push a nullptr i.e. 0 when there are no
46  // proxies in the property. Not used when CleanCommand or RemoveCommand is
47  // set. Default is false.
48  vtkGetMacro(NullOnEmpty, bool);
49 
50 protected:
52  ~vtkSIProxyProperty() override;
53 
57  bool Push(vtkSMMessage*, int) override;
58 
62  bool ReadXMLAttributes(vtkSIProxy* proxyhelper, vtkPVXMLElement* element) override;
63 
65 
70  vtkSetStringMacro(CleanCommand);
71  char* CleanCommand;
73 
75 
81  vtkSetStringMacro(RemoveCommand);
82  char* RemoveCommand;
84 
85  // When set to true, the property will push a nullptr i.e. 0 when there are no
86  // proxies in the property. Not used when CleanCommand or RemoveCommand is
87  // set. Default is false.
88  vtkSetMacro(NullOnEmpty, bool);
89  bool NullOnEmpty;
90 
91  enum TypeArg
92  {
93  VTK,
95  SIProxy
96  };
97 
98  // Proxy type: VTK (default), SMProxy, Kernel,
99  // In the XML we expect argument_type="VTK" (default value if not set)
100  // argument_type="SMProxy"
101  // argument_type="SIProxy"
103 
104  // Base on the ArgumentType will return either the VTK object or the SMProxy object
105  vtkObjectBase* GetObjectBase(vtkTypeUInt32 globalId);
106 
107  // Allow to detect if a nullptr argument is really meant to be nullptr
108  bool IsValidNull(vtkTypeUInt32 globalId);
109 
110 private:
111  vtkSIProxyProperty(const vtkSIProxyProperty&) = delete;
112  void operator=(const vtkSIProxyProperty&) = delete;
113  class InternalCache;
114  InternalCache* Cache;
115 
116  class vtkObjectCache;
117  vtkObjectCache* ObjectCache;
118 
119  bool SkipValidCheck;
120 };
121 
122 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkSIProperty * New()
#define VTKREMOTINGSERVERMANAGER_EXPORT
ServerSide Property use to set Object array as method argument.
virtual bool Push(vtkSMMessage *, int)
Push a new state to the underneath implementation.
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...
char * RemoveCommand
Remove command is the command called to remove the VTK object on the server-side. ...
virtual bool ReadXMLAttributes(vtkSIProxy *proxyhelper, vtkPVXMLElement *element)
Parse the xml for the property.
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 * CleanCommand
Command that can be used to remove inputs.