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 
82 
85  void GetRange(double range[2], int component);
86  void GetRange(double range[2]) { this->GetRange(range, -1); }
88 
92  void ClearRange();
93 
94 protected:
97 
102  void CreateVTKObjects() override;
103 
107  void ExecuteEvent(unsigned long event) override;
108 
110 
112 
121  std::unordered_map<vtkSMRepresentationProxy*, vtkWeakPointer<vtkSMRepresentationProxy>> Proxies;
122  std::map<std::pair<vtkSMRepresentationProxy*, std::string>,
126 
127 private:
129 
134  void BeginTrackingPropertiesForTrace();
135  void EndTrackingPropertiesForTrace();
137 
142  void ScalarBarWidgetPosition2ToScalarBarLength();
143  void ScalarBarLengthToScalarBarWidgetPosition2();
144 
145  // Used in StartTrackingPropertiesForTrace/EndTrackingPropertiesForTrace.
146  vtkSMTrace::TraceItem* TraceItem;
147 
149  void operator=(const vtkSMScalarBarWidgetRepresentationProxy&) = delete;
150 };
151 
152 #endif
Proxy for a representations.
is the representation corresponding to a scalar bar or color legend in a Render View.
component
void GetRange(double range[2])
Get the current range of the scalar bar.
#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...