vtkPVOrthographicSliceView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
22 #ifndef vtkPVOrthographicSliceView_h
23 #define vtkPVOrthographicSliceView_h
24 
25 #include "vtkPVMultiSliceView.h"
26 
27 class vtkPVOrthographicSliceViewInteractorStyle;
28 
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
40  void Update() override;
41 
42  enum
43  {
44  SAGITTAL_VIEW_RENDERER = vtkPVRenderView::NON_COMPOSITED_RENDERER + 1,
47  };
48 
52  vtkRenderer* GetRenderer(int rendererType = vtkPVRenderView::DEFAULT_RENDERER) override;
53 
54  virtual void ResetCamera();
55  virtual void ResetCamera(double bounds[6]);
56  void SetInteractionMode(int mode) override;
58 
60 
63  void SetSlicePosition(double x, double y, double z);
64  vtkGetVector3Macro(SlicePosition, double);
66 
68 
71  vtkSetVector3Macro(SliceIncrements, double);
73 
75 
78  vtkSetMacro(SliceAnnotationsVisibility, bool);
79  vtkGetMacro(SliceAnnotationsVisibility, bool);
81 
85  void SetCenterAxesVisibility(bool) override {}
86 
87  //*****************************************************************
88  void SetBackgroundTexture(vtkTexture* val) override;
89 
93  void ScaleRendererViewports(const double viewport[4]) override;
94 
95 protected:
97  ~vtkPVOrthographicSliceView() override;
98 
99  void AboutToRenderOnLocalProcess(bool interactive) override;
100  void UpdateCenterAxes() override;
101 
102  //*****************************************************************
103  // Forward to vtkPVOrthographicSliceView instances.
104  void SetCenterOfRotation(double x, double y, double z) override;
105  void SetRotationFactor(double factor) override;
106 
111 
115  void UpdateBackground(vtkRenderer* renderer = nullptr) override;
116 
117  enum
118  {
119  SIDE_VIEW = 0,
120  TOP_VIEW = 1,
121  FRONT_VIEW = 2,
122 
123  YZ_PLANE = SIDE_VIEW,
124  ZX_PLANE = TOP_VIEW,
125  XY_PLANE = FRONT_VIEW,
126 
127  AXIAL_VIEW = TOP_VIEW,
128  CORONAL_VIEW = FRONT_VIEW,
129  SAGITTAL_VIEW = SIDE_VIEW,
130 
131  RIGHT_SIDE_VIEW = SIDE_VIEW
132  };
133 
134  vtkNew<vtkRenderer> Renderers[3];
136  vtkNew<vtkPVCenterAxesActor> SlicePositionAxes2D[3];
138  vtkNew<vtkTextRepresentation> SliceAnnotations[3];
140 
141  double SliceIncrements[3];
142  double SlicePosition[3];
144 
145 private:
147  void operator=(const vtkPVOrthographicSliceView&) = delete;
148 
149  void OnMouseWheelForwardEvent();
150  void OnMouseWheelBackwardEvent();
151  void MoveSlicePosition(vtkRenderer* ren, double position[3]);
152 
153  unsigned long MouseWheelForwardEventId;
154  unsigned long MouseWheelBackwardEventId;
155 
156  friend class vtkPVOrthographicSliceViewInteractorStyle;
157 
158  bool GridAxes3DActorsNeedShallowCopy;
159  unsigned long GridAxes3DActorObserverId;
160  void OnGridAxes3DActorModified();
161 };
162 
163 #endif
static vtkPVMultiSliceView * New()
view with 3 orthographic slice views and 1 3D view.
virtual void SetBackgroundTexture(vtkTexture *val)
Forward to 3D renderer.
virtual void SetRotationFactor(double factor)
Forward to vtkPVInteractorStyle instances.
#define VTKREMOTINGVIEWS_EXPORT
virtual void SetCenterOfRotation(double x, double y, double z)
Forward to vtkPVInteractorStyle instances.
void ResetCamera()
Resets the active camera using collective prop-bounds.
virtual void UpdateCenterAxes()
UpdateCenterAxes().
vtkNew< vtkPVOrthographicSliceViewInteractorStyle > OrthographicInteractorStyle
void AboutToRenderOnLocalProcess(bool interactive) override
Called just before the local process renders.
vtkPVMultiSliceView extends vtkPVRenderView but add meta-data information used by SliceRepresentation...
virtual void UpdateBackground(vtkRenderer *renderer=nullptr)
Updates background color.
virtual void SetInteractionMode(int mode)
Get/Set the interaction mode.
virtual vtkRenderer * GetRenderer(int rendererType=DEFAULT_RENDERER)
Returns the renderer given an int identifying its type.
void Update() override
vtkNew< vtkPVCenterAxesActor > SlicePositionAxes3D
void ScaleRendererViewports(const double viewport[4]) override
Overridden to scale the OrientationWidget appropriately.
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void SetGridAxes3DActor(vtkPVGridAxes3DActor *)
Set the vtkPVGridAxes3DActor to use for the view.
void SetCenterAxesVisibility(bool) override
To avoid confusion, we don&#39;t show the center axes at all in this view.
virtual void SetupInteractor(vtkRenderWindowInteractor *)
Set the interactor.
ParaView extensions for vtkGridAxes3DActor.