vtkSMProxyInternals.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMProxyInternals.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 #ifndef vtkSMProxyInternals_h
17 #define vtkSMProxyInternals_h
18 
19 #include "vtkClientServerStream.h"
20 #include "vtkSMProperty.h"
21 #include "vtkSMPropertyGroup.h"
22 #include "vtkSMProxy.h"
23 #include "vtkSMProxyLink.h"
24 #include "vtkSmartPointer.h"
25 #include "vtkWeakPointer.h"
26 
27 #include <map>
28 #include <string>
29 #include <vector>
30 
31 //---------------------------------------------------------------------------
32 // Internal data structure for storing object IDs, server IDs and
33 // properties. Each property has associated attributes:
34 // * ModifiedFlag : has the property been modified since last update (push)
35 // * DoUpdate : should the property be updated (pushed) during UpdateVTKObjects
36 // * ObserverTag : the tag returned by AddObserver(). Used to remove the
37 // observer.
39 {
40  struct PropertyInfo
41  {
43  {
44  this->ModifiedFlag = 0;
45  this->ObserverTag = 0;
46  };
49  unsigned int ObserverTag;
50  };
51  // Note that the name of the property is the map key. That is the
52  // only place where name is stored
53  typedef std::map<std::string, PropertyInfo> PropertyInfoMap;
54  PropertyInfoMap Properties;
55 
56  // This vector keeps track of the order in which properties
57  // were added for the Property iterator
58  std::vector<std::string> PropertyNamesInOrder;
59 
60  std::vector<vtkSmartPointer<vtkSMPropertyGroup> > PropertyGroups;
61 
62  std::vector<int> ServerIDs;
63 
64  typedef std::map<std::string, vtkSmartPointer<vtkSMProxy> > ProxyMap;
65  ProxyMap SubProxies;
66 
68  {
70  : Property(prop)
71  , Proxy(prox){};
74  };
75  std::vector<ConnectionInfo> Consumers;
76  std::vector<ConnectionInfo> Producers;
77 
79  {
80  std::string SubProxyName;
81  std::string PropertyName;
82  };
83 
84  // Map for exposed properties. The key is the exposed property name,
85  // value is a ExposedPropertyInfo object which indicates the subproxy name
86  // and the property name in that subproxy.
87  typedef std::map<std::string, ExposedPropertyInfo> ExposedPropertyInfoMap;
88  ExposedPropertyInfoMap ExposedProperties;
89 
90  // Vector of vtkSMProxyLink for shared properties among subproxies.
91  typedef std::vector<vtkSmartPointer<vtkSMProxyLink> > SubProxyLinksType;
92  SubProxyLinksType SubProxyLinks;
93 
94  // Annotation map
95  typedef std::map<std::string, std::string> AnnotationMap;
96  AnnotationMap Annotations;
98 
99  // Setup default values
100  vtkSMProxyInternals() { this->EnableAnnotationPush = true; }
101 };
102 
103 #endif
104 
105 // 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:152
PropertyInfoMap Properties
std::vector< int > ServerIDs
ExposedPropertyInfoMap ExposedProperties
std::map< std::string, std::string > AnnotationMap
ConnectionInfo(vtkSMProperty *prop, vtkSMProxy *prox)