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 
25 class VTKREMOTINGVIEWS_EXPORT vtkSMScalarBarWidgetRepresentationProxy
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 
66  void AddRange(vtkSMRepresentationProxy* proxy);
67 
73  void RemoveRange(vtkSMRepresentationProxy* proxy);
74 
78  void GetRange(double range[2]);
79 
83  void ClearRange();
84 
85 protected:
88 
93  void CreateVTKObjects() override;
94 
98  void ExecuteEvent(unsigned long event) override;
99 
101 
103 
112  std::unordered_map<vtkSMRepresentationProxy*, vtkWeakPointer<vtkSMRepresentationProxy>> Proxies;
114 
115 private:
117 
122  void BeginTrackingPropertiesForTrace();
123  void EndTrackingPropertiesForTrace();
125 
130  void ScalarBarWidgetPosition2ToScalarBarLength();
131  void ScalarBarLengthToScalarBarWidgetPosition2();
132 
133  // Used in StartTrackingPropertiesForTrace/EndTrackingPropertiesForTrace.
134  vtkSMTrace::TraceItem* TraceItem;
135 
137  void operator=(const vtkSMScalarBarWidgetRepresentationProxy&) = delete;
138 };
139 
140 #endif
vtkSMScalarBarWidgetRepresentationProxy::SafeDownCast
static vtkSMScalarBarWidgetRepresentationProxy * SafeDownCast(vtkObject *o)
vtkSMNewWidgetRepresentationProxy::ExecuteEvent
void ExecuteEvent(unsigned long event) override
Called every time the user interacts with the widget.
vtkSMScalarBarWidgetRepresentationProxy::Proxies
std::unordered_map< vtkSMRepresentationProxy *, vtkWeakPointer< vtkSMRepresentationProxy > > Proxies
Storing a list of proxies linked to this scalar bar.
Definition: vtkSMScalarBarWidgetRepresentationProxy.h:112
vtkSMRepresentationProxy
Proxy for a representations.
Definition: vtkSMRepresentationProxy.h:76
vtkSMScalarBarWidgetRepresentationProxy::ActorProxy
vtkSMProxy * ActorProxy
Definition: vtkSMScalarBarWidgetRepresentationProxy.h:100
vtkSMScalarBarWidgetRepresentationProxy::PlaceInView
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...
Definition: vtkSMScalarBarWidgetRepresentationProxy.h:53
vtkSMNewWidgetRepresentationProxy
proxy for 3D widgets and their representations in ParaView.
Definition: vtkSMNewWidgetRepresentationProxy.h:25
vtkSMProxy
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
vtkSMNewWidgetRepresentationProxy::New
static vtkSMNewWidgetRepresentationProxy * New()
vtkSMTrace::TraceItem
Definition: vtkSMTrace.h:201
vtkIndent
vtkWeakPointer.h
vtkSMViewProxy
Superclass for all view proxies.
Definition: vtkSMViewProxy.h:42
vtkPVArrayInformation
provides meta data about arrays.
Definition: vtkPVArrayInformation.h:30
vtkSMNewWidgetRepresentationProxy::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkSMNewWidgetRepresentationProxy::CreateVTKObjects
void CreateVTKObjects() override
Overridden from vtkSMProxy to call BeginCreateVTKObjects() and EndCreateVTKObjects().
vtkSMTrace.h
vtkSMScalarBarWidgetRepresentationProxy
is the representation corresponding to a scalar bar or color legend in a Render View.
Definition: vtkSMScalarBarWidgetRepresentationProxy.h:25
vtkSMScalarBarWidgetRepresentationProxy::UpdateComponentTitle
static bool UpdateComponentTitle(vtkSMProxy *proxy, vtkPVArrayInformation *dataInfo)
Updates the scalar bar's component title using the data information to determine component names if p...
Definition: vtkSMScalarBarWidgetRepresentationProxy.h:39
vtkSMNewWidgetRepresentationProxy.h