VTK  9.2.6
vtkImageActorPointPlacer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageActorPointPlacer.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
29 #ifndef vtkImageActorPointPlacer_h
30 #define vtkImageActorPointPlacer_h
31 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
33 #include "vtkPointPlacer.h"
34 
36 class vtkImageActor;
37 class vtkRenderer;
38 
39 class VTKINTERACTIONWIDGETS_EXPORT vtkImageActorPointPlacer : public vtkPointPlacer
40 {
41 public:
45  static vtkImageActorPointPlacer* New();
46 
48 
52  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
64  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
65 
71  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[2],
72  double worldPos[3], double worldOrient[9]) override;
73 
80  int ValidateWorldPosition(double worldPos[3]) override;
81 
86  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
87 
94  int UpdateWorldPosition(vtkRenderer* ren, double worldPos[3], double worldOrient[9]) override;
95 
104  int UpdateInternalState() override;
105 
107 
113  void SetImageActor(vtkImageActor*);
114  vtkGetObjectMacro(ImageActor, vtkImageActor);
116 
118 
124  vtkSetVector6Macro(Bounds, double);
125  vtkGetVector6Macro(Bounds, double);
127 
132  void SetWorldTolerance(double tol) override;
133 
134 protected:
136  ~vtkImageActorPointPlacer() override;
137 
138  // The reference image actor. Must be configured before this placer
139  // is used.
141 
142  // The internal placer.
144 
145  // Used to keep track of whether the bounds of the
146  // input image have changed
147  double SavedBounds[6];
148 
149  // See the SetBounds method
150  double Bounds[6];
151 
152 private:
154  void operator=(const vtkImageActorPointPlacer&) = delete;
155 };
156 
157 #endif
virtual int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9])
Given a renderer and a display position in pixel coordinates, compute the world position and orientat...
Converts 2D display positions to world positions such that they lie on an ImageActor.
abstract specification for renderers
Definition: vtkRenderer.h:72
a placer that constrains a handle to a finite plane
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:48
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkBoundedPlanePointPlacer * Placer
Abstract interface to translate 2D display positions to world coordinates.
virtual int UpdateWorldPosition(vtkRenderer *ren, double worldPos[3], double worldOrient[9])
Given a current renderer, world position and orientation, update them according to the constraints of...
virtual void SetWorldTolerance(double)
Set/get the tolerance used when performing computations in world coordinates.
virtual int ValidateWorldPosition(double worldPos[3])
Given a world position check the validity of this position according to the constraints of the placer...
static vtkPointPlacer * New()
Instantiate this class.
virtual int UpdateInternalState()
Called by the representation to give the placer a chance to update itself.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.