vtkSMProxyInternals.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 
4 #ifndef vtkSMProxyInternals_h
5 #define vtkSMProxyInternals_h
6 
7 #include "vtkSMProperty.h" // for vtkSMProperty
8 #include "vtkSMPropertyGroup.h" // for vtkSMPropertyGroup
9 #include "vtkSMProxy.h" // for vtkSMProxy
10 #include "vtkSMProxyLink.h" // for vtkSMProxyLink
11 #include "vtkSmartPointer.h" // for vtkSmartPointer
12 #include "vtkWeakPointer.h" // for vtkWeakPointer
13 
14 #include <map> // for std::map
15 #include <string> // for std::string
16 #include <vector> // for std::vector
17 
18 //---------------------------------------------------------------------------
19 // Internal data structure for storing object IDs, server IDs and
20 // properties. Each property has associated attributes:
21 // * ModifiedFlag : has the property been modified since last update (push)
22 // * DoUpdate : should the property be updated (pushed) during UpdateVTKObjects
23 // * ObserverTag : the tag returned by AddObserver(). Used to remove the
24 // observer.
26 {
27  struct PropertyInfo
28  {
30  {
31  this->ModifiedFlag = 0;
32  this->ObserverTag = 0;
33  };
36  unsigned int ObserverTag;
37  };
38  // Note that the name of the property is the map key. That is the
39  // only place where name is stored
40  typedef std::map<std::string, PropertyInfo> PropertyInfoMap;
41  PropertyInfoMap Properties;
42 
43  // This vector keeps track of the order in which properties
44  // were added for the Property iterator
45  std::vector<std::string> PropertyNamesInOrder;
46 
47  std::vector<vtkSmartPointer<vtkSMPropertyGroup>> PropertyGroups;
48 
49  std::vector<int> ServerIDs;
50 
51  typedef std::map<std::string, vtkSmartPointer<vtkSMProxy>> ProxyMap;
52  ProxyMap SubProxies;
53 
55  {
57  : Property(prop)
58  , Proxy(prox){};
61  };
62  std::vector<ConnectionInfo> Consumers;
63  std::vector<ConnectionInfo> Producers;
64 
66  {
67  std::string SubProxyName;
68  std::string PropertyName;
69  };
70 
71  // Map for exposed properties. The key is the exposed property name,
72  // value is a ExposedPropertyInfo object which indicates the subproxy name
73  // and the property name in that subproxy.
74  typedef std::map<std::string, ExposedPropertyInfo> ExposedPropertyInfoMap;
75  ExposedPropertyInfoMap ExposedProperties;
76 
77  // Vector of vtkSMProxyLink for shared properties among subproxies.
78  typedef std::vector<vtkSmartPointer<vtkSMProxyLink>> SubProxyLinksType;
79  SubProxyLinksType SubProxyLinks;
80 
81  // Annotation map
82  typedef std::map<std::string, std::string> AnnotationMap;
83  AnnotationMap Annotations;
85 
86  // Setup default values
87  vtkSMProxyInternals() { this->EnableAnnotationPush = true; }
88 };
89 
90 #endif
91 
92 // VTK-HeaderTest-Exclude: vtkSMProxyInternals.h
std::map< std::string, ExposedPropertyInfo > ExposedPropertyInfoMap
vtkSmartPointer< vtkSMProperty > Property
std::vector< ConnectionInfo > Producers
std::vector< vtkSmartPointer< vtkSMProxyLink > > SubProxyLinksType
vtkWeakPointer< vtkSMProxy > Proxy
superclass for all SM properties
std::map< std::string, vtkSmartPointer< vtkSMProxy > > ProxyMap
std::vector< std::string > PropertyNamesInOrder
vtkWeakPointer< vtkSMProperty > Property
std::vector< vtkSmartPointer< vtkSMPropertyGroup > > PropertyGroups
SubProxyLinksType SubProxyLinks
std::map< std::string, PropertyInfo > PropertyInfoMap
std::vector< ConnectionInfo > Consumers
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
PropertyInfoMap Properties
std::vector< int > ServerIDs
ExposedPropertyInfoMap ExposedProperties
std::map< std::string, std::string > AnnotationMap
ConnectionInfo(vtkSMProperty *prop, vtkSMProxy *prox)