vtkSMScalarBarWidgetRepresentationProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkSMScalarBarWidgetRepresentationProxy_h
11 #define vtkSMScalarBarWidgetRepresentationProxy_h
12 
13 #include "vtkRemotingViewsModule.h" //needed for exports
15 #include "vtkSMTrace.h" // needed for vtkSMTrace::TraceItem
16 #include "vtkWeakPointer.h" // For Proxies
17 
18 #include <unordered_map> // For Proxies
19 
21 class vtkSMProxy;
23 class vtkSMViewProxy;
24 
27 {
28 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
34 
38  virtual bool UpdateComponentTitle(vtkPVArrayInformation* dataInfo);
39  static bool UpdateComponentTitle(vtkSMProxy* proxy, vtkPVArrayInformation* dataInfo)
40  {
43  return self ? self->UpdateComponentTitle(dataInfo) : false;
44  }
46 
48 
52  virtual bool PlaceInView(vtkSMProxy* view);
53  static bool PlaceInView(vtkSMProxy* proxy, vtkSMProxy* view)
54  {
57  return self ? self->PlaceInView(view) : false;
58  }
60 
62 
67  void AddRange(vtkSMRepresentationProxy* proxy);
68  void AddBlockRange(vtkSMRepresentationProxy* proxy, const std::string& blockSelector);
70 
72 
77  void RemoveRange(vtkSMRepresentationProxy* proxy);
78  void RemoveBlockRange(vtkSMRepresentationProxy* proxy, const std::string& blockSelector);
80 
84  void GetRange(double range[2]);
85 
89  void ClearRange();
90 
91 protected:
94 
99  void CreateVTKObjects() override;
100 
104  void ExecuteEvent(unsigned long event) override;
105 
107 
109 
118  std::unordered_map<vtkSMRepresentationProxy*, vtkWeakPointer<vtkSMRepresentationProxy>> Proxies;
119  std::map<std::pair<vtkSMRepresentationProxy*, std::string>,
123 
124 private:
126 
131  void BeginTrackingPropertiesForTrace();
132  void EndTrackingPropertiesForTrace();
134 
139  void ScalarBarWidgetPosition2ToScalarBarLength();
140  void ScalarBarLengthToScalarBarWidgetPosition2();
141 
142  // Used in StartTrackingPropertiesForTrace/EndTrackingPropertiesForTrace.
143  vtkSMTrace::TraceItem* TraceItem;
144 
146  void operator=(const vtkSMScalarBarWidgetRepresentationProxy&) = delete;
147 };
148 
149 #endif
Proxy for a representations.
is the representation corresponding to a scalar bar or color legend in a Render View.
#define VTKREMOTINGVIEWS_EXPORT
Superclass for all view proxies.
proxy for 3D widgets and their representations in ParaView.
std::map< std::pair< vtkSMRepresentationProxy *, std::string >, vtkWeakPointer< vtkSMRepresentationProxy > > BlockProxies
Storing a list of proxies linked to this scalar bar.
static vtkSMScalarBarWidgetRepresentationProxy * SafeDownCast(vtkObject *o)
void ExecuteEvent(unsigned long event) override
Called every time the user interacts with the widget.
void CreateVTKObjects() override
Overridden from vtkSMProxy to call BeginCreateVTKObjects() and EndCreateVTKObjects().
void PrintSelf(ostream &os, vtkIndent indent) override
static bool UpdateComponentTitle(vtkSMProxy *proxy, vtkPVArrayInformation *dataInfo)
Updates the scalar bar&#39;s component title using the data information to determine component names if p...
static vtkSMNewWidgetRepresentationProxy * New()
std::unordered_map< vtkSMRepresentationProxy *, vtkWeakPointer< vtkSMRepresentationProxy > > Proxies
Storing a list of proxies linked to this scalar bar.
range
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
provides meta data about arrays.
static bool PlaceInView(vtkSMProxy *proxy, vtkSMProxy *view)
Attempt to place the scalar bar in the view based on the placement of other currently shown and visib...