VTK  9.3.1
vtkImageActorPointPlacer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkImageActorPointPlacer_h
18 #define vtkImageActorPointPlacer_h
19 
20 #include "vtkInteractionWidgetsModule.h" // For export macro
21 #include "vtkPointPlacer.h"
22 
23 VTK_ABI_NAMESPACE_BEGIN
25 class vtkImageActor;
26 class vtkRenderer;
27 
28 class VTKINTERACTIONWIDGETS_EXPORT vtkImageActorPointPlacer : public vtkPointPlacer
29 {
30 public:
34  static vtkImageActorPointPlacer* New();
35 
37 
41  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
53  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
54 
60  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[2],
61  double worldPos[3], double worldOrient[9]) override;
62 
69  int ValidateWorldPosition(double worldPos[3]) override;
70 
75  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
76 
83  int UpdateWorldPosition(vtkRenderer* ren, double worldPos[3], double worldOrient[9]) override;
84 
93  int UpdateInternalState() override;
94 
96 
102  void SetImageActor(vtkImageActor*);
103  vtkGetObjectMacro(ImageActor, vtkImageActor);
105 
107 
113  vtkSetVector6Macro(Bounds, double);
114  vtkGetVector6Macro(Bounds, double);
116 
121  void SetWorldTolerance(double tol) override;
122 
123 protected:
125  ~vtkImageActorPointPlacer() override;
126 
127  // The reference image actor. Must be configured before this placer
128  // is used.
130 
131  // The internal placer.
133 
134  // Used to keep track of whether the bounds of the
135  // input image have changed
136  double SavedBounds[6];
137 
138  // See the SetBounds method
139  double Bounds[6];
140 
141 private:
143  void operator=(const vtkImageActorPointPlacer&) = delete;
144 };
145 
146 VTK_ABI_NAMESPACE_END
147 #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:61
a placer that constrains a handle to a finite plane
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:37
a simple class to control print indentation
Definition: vtkIndent.h:28
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.