ParaView
vtkPVOrthographicSliceView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVOrthographicSliceView.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 =========================================================================*/
34 #ifndef vtkPVOrthographicSliceView_h
35 #define vtkPVOrthographicSliceView_h
36 
37 #include "vtkPVMultiSliceView.h"
38 
39 class vtkPVOrthographicSliceViewInteractorStyle;
40 
41 class VTKPVCLIENTSERVERCORERENDERING_EXPORT vtkPVOrthographicSliceView : public vtkPVMultiSliceView
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
53  virtual void Initialize(unsigned int id);
54 
59  virtual void Update();
60 
61  enum
62  {
63  SAGITTAL_VIEW_RENDERER = vtkPVRenderView::NON_COMPOSITED_RENDERER + 1,
66  };
67 
71  virtual vtkRenderer* GetRenderer(int rendererType = vtkPVRenderView::DEFAULT_RENDERER);
72 
73  virtual void ResetCamera();
74  virtual void ResetCamera(double bounds[6]);
75  virtual void SetInteractionMode(int mode);
76  virtual void SetupInteractor(vtkRenderWindowInteractor*);
77 
79 
82  void SetSlicePosition(double x, double y, double z);
83  vtkGetVector3Macro(SlicePosition, double);
85 
87 
90  vtkSetVector3Macro(SliceIncrements, double);
92 
94 
97  vtkSetMacro(SliceAnnotationsVisibility, bool);
98  vtkGetMacro(SliceAnnotationsVisibility, bool);
100 
104  virtual void SetCenterAxesVisibility(bool) {}
105 
106  //*****************************************************************
107  virtual void SetBackground(double r, double g, double b);
108  virtual void SetBackground2(double r, double g, double b);
109  virtual void SetBackgroundTexture(vtkTexture* val);
110  virtual void SetGradientBackground(int val);
111  virtual void SetTexturedBackground(int val);
112 
113 protected:
116 
117  virtual void AboutToRenderOnLocalProcess(bool interactive);
118  virtual void UpdateCenterAxes();
119 
120  //*****************************************************************
121  // Forward to vtkPVOrthographicSliceView instances.
122  virtual void SetCenterOfRotation(double x, double y, double z);
123  virtual void SetRotationFactor(double factor);
124 
129 
130  enum
131  {
132  SIDE_VIEW = 0,
133  TOP_VIEW = 1,
134  FRONT_VIEW = 2,
135 
136  YZ_PLANE = SIDE_VIEW,
137  ZX_PLANE = TOP_VIEW,
138  XY_PLANE = FRONT_VIEW,
139 
140  AXIAL_VIEW = TOP_VIEW,
141  CORONAL_VIEW = FRONT_VIEW,
142  SAGITTAL_VIEW = SIDE_VIEW,
143 
144  RIGHT_SIDE_VIEW = SIDE_VIEW
145  };
146 
147  vtkNew<vtkRenderer> Renderers[3];
148  vtkNew<vtkPVOrthographicSliceViewInteractorStyle> OrthographicInteractorStyle;
149  vtkNew<vtkPVCenterAxesActor> SlicePositionAxes2D[3];
150  vtkNew<vtkPVCenterAxesActor> SlicePositionAxes3D;
151  vtkNew<vtkTextRepresentation> SliceAnnotations[3];
152  vtkSmartPointer<vtkPVGridAxes3DActor> GridAxes3DActors[3];
153 
154  double SliceIncrements[3];
155  double SlicePosition[3];
157 
158 private:
159  vtkPVOrthographicSliceView(const vtkPVOrthographicSliceView&) VTK_DELETE_FUNCTION;
160  void operator=(const vtkPVOrthographicSliceView&) VTK_DELETE_FUNCTION;
161 
162  void OnMouseWheelForwardEvent();
163  void OnMouseWheelBackwardEvent();
164  void MoveSlicePosition(vtkRenderer* ren, double position[3]);
165 
166  unsigned long MouseWheelForwardEventId;
167  unsigned long MouseWheelBackwardEventId;
168 
169  friend class vtkPVOrthographicSliceViewInteractorStyle;
170 
171  bool GridAxes3DActorsNeedShallowCopy;
172  unsigned long GridAxes3DActorObserverId;
173  void OnGridAxes3DActorModified();
174 };
175 
176 #endif
static vtkPVMultiSliceView * New()
virtual void SetBackgroundTexture(vtkTexture *val)
virtual void SetRotationFactor(double factor)
void PrintSelf(ostream &os, vtkIndent indent)
virtual void Update()
Overridden to synchronize information among processes whenever data changes.
virtual void SetCenterOfRotation(double x, double y, double z)
void ResetCamera()
Resets the active camera using collective prop-bounds.
virtual void UpdateCenterAxes()
UpdateCenterAxes().
vtkNew< vtkPVOrthographicSliceViewInteractorStyle > OrthographicInteractorStyle
virtual void Initialize(unsigned int id)
Initialize the view with an identifier.
virtual void SetCenterAxesVisibility(bool)
To avoid confusion, we don&#39;t show the center axes at all in this view.
vtkPVMultiSliceView extends vtkPVRenderView but add meta-data informations used by SliceRepresentatio...
virtual void SetBackground(double r, double g, double b)
virtual void SetGradientBackground(int val)
virtual void AboutToRenderOnLocalProcess(bool interactive)
Called just before the local process renders.
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.
vtkNew< vtkPVCenterAxesActor > SlicePositionAxes3D
virtual void SetTexturedBackground(int val)
virtual void SetGridAxes3DActor(vtkPVGridAxes3DActor *)
Set the vtkPVGridAxes3DActor to use for the view.
virtual void SetupInteractor(vtkRenderWindowInteractor *)
Set the interactor.
ParaView extensions for vtkGridAxes3DActor.
virtual void SetBackground2(double r, double g, double b)