vtkSMProxyListDomain.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
25 #ifndef vtkSMProxyListDomain_h
26 #define vtkSMProxyListDomain_h
27 
28 #include "vtkRemotingServerManagerModule.h" //needed for exports
29 #include "vtkSMDomain.h"
30 
31 #include <string> // for std::string
32 #include <utility> // for std::pair
33 #include <vector> // for std::vector
34 
35 class vtkSMProperty;
36 class vtkSMProxy;
37 class vtkSMProxyListDomainInternals;
39 
41 {
42 public:
43  static vtkSMProxyListDomain* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  struct ProxyType
51  {
52  std::string GroupName;
53  std::string ProxyName;
54  ProxyType() = default;
55  ProxyType(const std::string& group, const std::string& name)
56  : GroupName(group)
57  , ProxyName(name)
58  {
59  }
60  };
61 
65  const std::vector<ProxyType>& GetProxyTypes() const;
66 
70  unsigned int GetNumberOfProxyTypes();
71 
75  const char* GetProxyGroup(unsigned int index);
76 
80  const char* GetProxyName(unsigned int index);
81 
86  const char* GetProxyName(vtkSMProxy* proxy);
87 
91  vtkSMProxy* GetProxyWithName(const char* pname);
92 
96  int IsInDomain(vtkSMProperty* property) override;
97 
101  void AddProxy(vtkSMProxy*);
102 
106  bool HasProxy(vtkSMProxy*);
107 
111  unsigned int GetNumberOfProxies();
112 
116  vtkSMProxy* GetProxy(unsigned int index);
117 
121  vtkSMProxy* FindProxy(const char* xmlgroup, const char* xmlname);
122 
127  int RemoveProxy(vtkSMProxy* proxy);
128 
133  int RemoveProxy(unsigned int index);
134 
140  void CreateProxies(vtkSMSessionProxyManager* pxm);
141 
151  int SetDefaultValues(vtkSMProperty* prop, bool use_unchecked_values) override;
152 
154 
157  vtkSetMacro(DefaultIndex, unsigned int);
158  vtkGetMacro(DefaultIndex, unsigned int);
160 
165  void SetLogName(const char* prefix);
166 
167 protected:
169  ~vtkSMProxyListDomain() override;
170 
175  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
176 
180  void AddProxy(const char* group, const char* name);
181 
185  void ChildSaveState(vtkPVXMLElement* propertyElement) override;
186 
187  // Load the state of the domain from the XML.
188  int LoadState(vtkPVXMLElement* domainElement, vtkSMProxyLocator* loader) override;
189 
190  friend class vtkSMProxyProperty;
191  void SetProxies(vtkSMProxy** proxies, unsigned int count);
192 
193  unsigned int DefaultIndex = 0;
194 
195 private:
197  void operator=(const vtkSMProxyListDomain&) = delete;
198 
199  vtkSMProxyListDomainInternals* Internals;
200 };
201 
202 #endif
virtual void SetProxies(unsigned int numElements, vtkSMProxy *proxies[])
Sets the value of the property to the list of proxies specified.
property representing pointer(s) to vtkObject(s)
#define VTKREMOTINGSERVERMANAGER_EXPORT
superclass for all SM properties
name
represents the possible values a property can have
Definition: vtkSMDomain.h:37
void PrintSelf(ostream &os, vtkIndent indent) override
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
is used to locate proxies referred to in state xmls while loading state files.
union of proxies.
ProxyType(const std::string &group, const std::string &name)
static vtkSMDomain * New()
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
index
Used to identify a proxy type.