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;
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;
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;
76 
77  // Vector of vtkSMProxyLink for shared properties among subproxies.
78  typedef std::vector<vtkSmartPointer<vtkSMProxyLink>> SubProxyLinksType;
80 
81  // Annotation map
82  typedef std::map<std::string, std::string> AnnotationMap;
85 
86  // Setup default values
87  vtkSMProxyInternals() { this->EnableAnnotationPush = true; }
88 };
89 
90 #endif
91 
92 // VTK-HeaderTest-Exclude: vtkSMProxyInternals.h
vtkSMProxyInternals::Consumers
std::vector< ConnectionInfo > Consumers
Definition: vtkSMProxyInternals.h:62
vtkSMProxyInternals::ProxyMap
std::map< std::string, vtkSmartPointer< vtkSMProxy > > ProxyMap
Definition: vtkSMProxyInternals.h:51
vtkSMProxyInternals::ExposedPropertyInfo
Definition: vtkSMProxyInternals.h:65
vtkSMProxyInternals::ExposedProperties
ExposedPropertyInfoMap ExposedProperties
Definition: vtkSMProxyInternals.h:75
vtkSMProxyInternals::Properties
PropertyInfoMap Properties
Definition: vtkSMProxyInternals.h:41
vtkSMProxyInternals::vtkSMProxyInternals
vtkSMProxyInternals()
Definition: vtkSMProxyInternals.h:87
vtkSMProxyInternals::ConnectionInfo::ConnectionInfo
ConnectionInfo(vtkSMProperty *prop, vtkSMProxy *prox)
Definition: vtkSMProxyInternals.h:56
vtkSmartPointer< vtkSMProperty >
vtkSMProperty.h
vtkSMProxyInternals::ExposedPropertyInfo::SubProxyName
std::string SubProxyName
Definition: vtkSMProxyInternals.h:67
vtkSMProxyInternals::SubProxies
ProxyMap SubProxies
Definition: vtkSMProxyInternals.h:52
vtkSMProxyInternals::Annotations
AnnotationMap Annotations
Definition: vtkSMProxyInternals.h:83
vtkSMPropertyGroup.h
vtkSMProxyInternals::PropertyGroups
std::vector< vtkSmartPointer< vtkSMPropertyGroup > > PropertyGroups
Definition: vtkSMProxyInternals.h:47
vtkSMProperty
superclass for all SM properties
Definition: vtkSMProperty.h:144
vtkSMProxyInternals::PropertyInfoMap
std::map< std::string, PropertyInfo > PropertyInfoMap
Definition: vtkSMProxyInternals.h:40
vtkSMProxy
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
vtkSMProxyInternals::SubProxyLinksType
std::vector< vtkSmartPointer< vtkSMProxyLink > > SubProxyLinksType
Definition: vtkSMProxyInternals.h:78
vtkSMProxyInternals::PropertyInfo
Definition: vtkSMProxyInternals.h:27
vtkSMProxyInternals::PropertyInfo::ObserverTag
unsigned int ObserverTag
Definition: vtkSMProxyInternals.h:36
vtkSMProxyInternals::SubProxyLinks
SubProxyLinksType SubProxyLinks
Definition: vtkSMProxyInternals.h:79
vtkSMProxyInternals::PropertyNamesInOrder
std::vector< std::string > PropertyNamesInOrder
Definition: vtkSMProxyInternals.h:45
vtkSMProxyInternals::PropertyInfo::PropertyInfo
PropertyInfo()
Definition: vtkSMProxyInternals.h:29
vtkSMProxyInternals
Definition: vtkSMProxyInternals.h:25
vtkSMProxyInternals::AnnotationMap
std::map< std::string, std::string > AnnotationMap
Definition: vtkSMProxyInternals.h:82
vtkSMProxyInternals::ExposedPropertyInfo::PropertyName
std::string PropertyName
Definition: vtkSMProxyInternals.h:68
vtkSmartPointer.h
vtkSMProxyInternals::ExposedPropertyInfoMap
std::map< std::string, ExposedPropertyInfo > ExposedPropertyInfoMap
Definition: vtkSMProxyInternals.h:74
vtkWeakPointer.h
vtkSMProxyInternals::Producers
std::vector< ConnectionInfo > Producers
Definition: vtkSMProxyInternals.h:63
vtkSMProxy.h
vtkSMProxyInternals::ConnectionInfo::Property
vtkWeakPointer< vtkSMProperty > Property
Definition: vtkSMProxyInternals.h:58
vtkSMProxyInternals::ConnectionInfo
Definition: vtkSMProxyInternals.h:54
vtkSMProxyInternals::PropertyInfo::Property
vtkSmartPointer< vtkSMProperty > Property
Definition: vtkSMProxyInternals.h:33
vtkSMProxyInternals::EnableAnnotationPush
bool EnableAnnotationPush
Definition: vtkSMProxyInternals.h:84
vtkSMProxyInternals::PropertyInfo::ModifiedFlag
int ModifiedFlag
Definition: vtkSMProxyInternals.h:35
vtkSMProxyInternals::ConnectionInfo::Proxy
vtkWeakPointer< vtkSMProxy > Proxy
Definition: vtkSMProxyInternals.h:60
vtkSMProxyInternals::ServerIDs
std::vector< int > ServerIDs
Definition: vtkSMProxyInternals.h:49
vtkWeakPointer< vtkSMProperty >