VTK  9.2.20230606
vtkCellCentersPointPlacer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCellCentersPointPlacer.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 =========================================================================*/
41 #ifndef vtkCellCentersPointPlacer_h
42 #define vtkCellCentersPointPlacer_h
43 
44 #include "vtkInteractionWidgetsModule.h" // For export macro
45 #include "vtkPointPlacer.h"
46 
47 VTK_ABI_NAMESPACE_BEGIN
48 class vtkRenderer;
49 class vtkPropCollection;
50 class vtkProp;
51 class vtkCellPicker;
52 
53 class VTKINTERACTIONWIDGETS_EXPORT vtkCellCentersPointPlacer : public vtkPointPlacer
54 {
55 public:
60 
62 
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
69  // Description:
70  // Add an actor (that represents a terrain in a rendered scene) to the
71  // list. Only props in this list are considered by the PointPlacer
72  virtual void AddProp(vtkProp*);
73  virtual void RemoveViewProp(vtkProp* prop);
74  virtual void RemoveAllProps();
77 
87  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
88 
95  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
96  double worldPos[3], double worldOrient[9]) override;
97 
102  int ValidateWorldPosition(double worldPos[3]) override;
103 
107  int ValidateDisplayPosition(vtkRenderer*, double displayPos[2]) override;
108 
113  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
114 
116 
119  vtkGetObjectMacro(CellPicker, vtkCellPicker);
121 
123 
129  vtkSetMacro(Mode, int);
130  vtkGetMacro(Mode, int);
132 
133  enum
134  {
135  ParametricCenter = 0,
137  None
138  };
139 
140 protected:
143 
144  // The props that represents the terrain data (one or more) in a rendered
145  // scene
148  int Mode;
149 
150 private:
152  void operator=(const vtkCellCentersPointPlacer&) = delete;
153 };
154 
155 VTK_ABI_NAMESPACE_END
156 #endif
Snaps points at the center of a cell.
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double refWorldPos[3], double worldPos[3], double worldOrient[9]) override
Given a renderer, a display position, and a reference world position, compute the new world position ...
int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override
Given a world position and a world orientation, validate it according to the constraints of the place...
virtual void RemoveViewProp(vtkProp *prop)
static vtkCellCentersPointPlacer * New()
Instantiate this class.
virtual void RemoveAllProps()
int ValidateDisplayPosition(vtkRenderer *, double displayPos[2]) override
Given a display position, check the validity of this position.
virtual void AddProp(vtkProp *)
int ValidateWorldPosition(double worldPos[3]) override
Given a world position check the validity of this position according to the constraints of the placer...
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override
Given a renderer and a display position in pixel coordinates, compute the world position and orientat...
~vtkCellCentersPointPlacer() override
ray-cast cell picker for all kinds of Prop3Ds
a simple class to control print indentation
Definition: vtkIndent.h:120
Abstract interface to translate 2D display positions to world coordinates.
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:77
abstract specification for renderers
Definition: vtkRenderer.h:183