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 
19 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSIProxyProperty : public vtkSIProperty
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
vtkSIProxyProperty::TypeArg
TypeArg
Definition: vtkSIProxyProperty.h:91
vtkSIProxyProperty
Definition: vtkSIProxyProperty.h:19
vtkSIProperty::New
static vtkSIProperty * New()
vtkSIProxyProperty::RemoveCommand
char * RemoveCommand
Remove command is the command called to remove the VTK object on the server-side.
Definition: vtkSIProxyProperty.h:81
vtkSIProxy
Definition: vtkSIProxy.h:22
vtkSIProxyProperty::CleanCommand
char * CleanCommand
Command that can be used to remove inputs.
Definition: vtkSIProxyProperty.h:70
vtkSIProperty::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkObjectBase
vtkIndent
vtkSIProperty::ReadXMLAttributes
virtual bool ReadXMLAttributes(vtkSIProxy *proxyhelper, vtkPVXMLElement *element)
Parse the xml for the property.
vtkSMMessage
vtkSIProperty.h
vtkPVXMLElement
Definition: vtkPVXMLElement.h:23
vtkSIProxyProperty::VTK
@ VTK
Definition: vtkSIProxyProperty.h:93
vtkSIProxyProperty::ArgumentType
TypeArg ArgumentType
Definition: vtkSIProxyProperty.h:102
vtkSIProperty
Definition: vtkSIProperty.h:24
vtkSIProxyProperty::SMProxy
@ SMProxy
Definition: vtkSIProxyProperty.h:94
vtkSIProxyProperty::NullOnEmpty
bool NullOnEmpty
Definition: vtkSIProxyProperty.h:88
vtkSIProperty::Push
virtual bool Push(vtkSMMessage *, int)
Push a new state to the underneath implementation.