VTK  9.2.6
vtkParallelopipedRepresentation.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkParallelopipedRepresentation.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=========================================================================*/
31#ifndef vtkParallelopipedRepresentation_h
32#define vtkParallelopipedRepresentation_h
33
34#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
35#include "vtkInteractionWidgetsModule.h" // For export macro
37
38class vtkActor;
39class vtkPlane;
40class vtkPoints;
41class vtkPolyData;
43class vtkProperty;
44class vtkCellArray;
45class vtkTransform;
49class vtkParallelopipedTopology;
50
51class VTKINTERACTIONWIDGETS_EXPORT vtkParallelopipedRepresentation : public vtkWidgetRepresentation
52{
53public:
58
60
64 void PrintSelf(ostream& os, vtkIndent indent) override;
66
70 void GetActors(vtkPropCollection* pc) override;
71
73
87 virtual void PlaceWidget(double corners[8][3]);
88 void PlaceWidget(double bounds[6]) override;
90
92
97 vtkSetMacro(InteractionState, int);
99
107
112
116 double* GetBounds() VTK_SIZEHINT(6) override;
117
119
122 virtual void SetHandleProperty(vtkProperty*);
123 virtual void SetHoveredHandleProperty(vtkProperty*);
124 virtual void SetSelectedHandleProperty(vtkProperty*);
125 vtkGetObjectMacro(HandleProperty, vtkProperty);
126 vtkGetObjectMacro(HoveredHandleProperty, vtkProperty);
127 vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
129
130 void SetHandleRepresentation(vtkHandleRepresentation* handle);
131 vtkHandleRepresentation* GetHandleRepresentation(int index);
132
134
138 void HandlesOn();
139 void HandlesOff();
141
143
147 vtkGetObjectMacro(FaceProperty, vtkProperty);
148 vtkGetObjectMacro(SelectedFaceProperty, vtkProperty);
150
152
156 vtkGetObjectMacro(OutlineProperty, vtkProperty);
157 vtkGetObjectMacro(SelectedOutlineProperty, vtkProperty);
159
164 void BuildRepresentation() override;
165
167
170 void ReleaseGraphicsResources(vtkWindow* w) override;
171 int RenderOverlay(vtkViewport* viewport) override;
172 int RenderOpaqueGeometry(vtkViewport* viewport) override;
174
179 int ComputeInteractionState(int X, int Y, int modify = 0) override;
180
181 // Manage the state of the widget
183 {
184 Outside = 0,
197 RotatingParallelopiped
198 };
199#if !defined(VTK_LEGACY_REMOVE)
200 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
202#endif
203
204 // Methods to manipulate the piped.
205 virtual void Translate(double translation[3]);
206 virtual void Translate(int X, int Y);
207 virtual void Scale(int X, int Y);
208
213 virtual void PositionHandles();
214
216
222 vtkSetMacro(MinimumThickness, double);
223 vtkGetMacro(MinimumThickness, double);
225
226protected:
229
233 void TranslatePoint(int n, const double motionVector[3]);
234
239 void SetHandleHighlight(int handleIdx, vtkProperty* property);
240
242
249
250 // Node can be a value within [0,7]. This will create a chair one one of
251 // the handle corners. '0 < InitialChairDepth < 1' value dicates the starting
252 // depth of the cavity.
253 void UpdateChairAtNode(int node);
254
255 // Removes any existing chairs.
257
258 // Convenience method to get just the planes that define the parallelopiped.
259 // If we aren't in chair mode, this will be the same as GetBoundingPlanes().
260 // If we are in chair mode, this will be the first 6 planes from amongst
261 // those returned by "GetBoundingPlanes".
262 // All planes have their normals pointing inwards.
264
265 // Convenience method to edefine a plane passing through 3 points.
266 void DefinePlane(vtkPlane*, double p[3][3]);
267
268 // Convenience method to edefine a plane passing through 3 pointIds of the
269 // parallelopiped. The point Ids must like in the range [0,15], ie the
270 // 15 points comprising the parallelopiped and the chair (also modelled
271 // as a parallelopiped)
273
281
282 double LastEventPosition[2];
283
284 // Cache the axis index used for face aligned resize.
286
291
292 // When a chair is carved out for the first time, this is the initial
293 // depth of the chair
295
304 vtkParallelopipedTopology* Topology;
307
308private:
310 void operator=(const vtkParallelopipedRepresentation&) = delete;
311};
312
313#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
object to represent cell connectivity
PointPlacer to constrain validity within a set of convex planes.
abstract class for representing widget handles
a simple class to control print indentation
Definition vtkIndent.h:34
Default representation for vtkParallelopipedWidget.
void GetParallelopipedBoundingPlanes(vtkPlaneCollection *pc)
void PlaceWidget(double bounds[6]) override
Place the widget in the scene.
void TranslatePoint(int n, const double motionVector[3])
Translate the nth PtId (0 <= n <= 15) by the specified amount.
double * GetBounds() override
The parallelopiped polydata.
void GetPolyData(vtkPolyData *pd)
The parallelopiped polydata.
void HighlightAllFaces()
Highlight face defined by the supplied ptids with the specified property.
virtual void PositionHandles()
Synchronize the parallelopiped handle positions with the Polygonal datastructure.
virtual void Translate(int X, int Y)
virtual void Translate(double translation[3])
static vtkParallelopipedRepresentation * New()
Instantiate the class.
void GetActors(vtkPropCollection *pc) override
Methods to satisfy the superclass.
virtual void Scale(int X, int Y)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
void DefinePlane(vtkPlane *, vtkIdType, vtkIdType, vtkIdType)
void SetFaceHighlight(vtkCellArray *face, vtkProperty *)
Highlight face defined by the supplied ptids with the specified property.
void GetBoundingPlanes(vtkPlaneCollection *pc)
Get the bounding planes of the object.
void UnHighlightAllFaces()
Highlight face defined by the supplied ptids with the specified property.
void SetHandleHighlight(int handleIdx, vtkProperty *property)
Set the highlight state of a handle.
void DefinePlane(vtkPlane *, double p[3][3])
virtual void PlaceWidget(double corners[8][3])
Place the widget in the scene.
maintain a list of planes
perform various plane computations
Definition vtkPlane.h:34
represent and manipulate 3D points
Definition vtkPoints.h:34
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
an ordered list of Props
represent surface properties of a geometric object
Definition vtkProperty.h:62
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:50
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
#define VTK_DEPRECATED_IN_9_2_0(reason)
int vtkIdType
Definition vtkType.h:332
#define VTK_SIZEHINT(...)