VTK  9.5.20251121
vtkParallelopipedRepresentation.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
21
22#ifndef vtkParallelopipedRepresentation_h
23#define vtkParallelopipedRepresentation_h
24
25#include "vtkInteractionWidgetsModule.h" // For export macro
27#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkActor;
31class vtkPlane;
32class vtkPoints;
33class vtkPolyData;
35class vtkProperty;
36class vtkCellArray;
37class vtkTransform;
41class vtkParallelopipedTopology;
42
43class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkParallelopipedRepresentation
45{
46public:
51
53
57 void PrintSelf(ostream& os, vtkIndent indent) override;
59
63 void GetActors(vtkPropCollection* pc) override;
64
66
80 virtual void PlaceWidget(double corners[8][3]);
81 void PlaceWidget(double bounds[6]) override;
83
85
90 vtkSetMacro(InteractionState, int);
92
100
105
109 double* GetBounds() VTK_SIZEHINT(6) override;
110
112
118 vtkGetObjectMacro(HandleProperty, vtkProperty);
122
125
127
131 void HandlesOn();
134
136
140 vtkGetObjectMacro(FaceProperty, vtkProperty);
143
145
149 vtkGetObjectMacro(OutlineProperty, vtkProperty);
152
157 void BuildRepresentation() override;
158
160
164 int RenderOverlay(vtkViewport* viewport) override;
165 int RenderOpaqueGeometry(vtkViewport* viewport) override;
167
172 int ComputeInteractionState(int X, int Y, int modify = 0) override;
173
174 // Manage the state of the widget
192
193 // Methods to manipulate the piped.
194 virtual void Translate(double translation[3]);
195 virtual void Translate(int X, int Y);
196 virtual void Scale(int X, int Y);
197
202 virtual void PositionHandles();
203
205
211 vtkSetMacro(MinimumThickness, double);
212 vtkGetMacro(MinimumThickness, double);
214
215protected:
218
222 void TranslatePoint(int n, const double motionVector[3]);
223
228 void SetHandleHighlight(int handleIdx, vtkProperty* property);
229
231
238
239 // Node can be a value within [0,7]. This will create a chair one one of
240 // the handle corners. '0 < InitialChairDepth < 1' value dictates the starting
241 // depth of the cavity.
242 void UpdateChairAtNode(int node);
243
244 // Removes any existing chairs.
246
247 // Convenience method to get just the planes that define the parallelopiped.
248 // If we aren't in chair mode, this will be the same as GetBoundingPlanes().
249 // If we are in chair mode, this will be the first 6 planes from amongst
250 // those returned by "GetBoundingPlanes".
251 // All planes have their normals pointing inwards.
253
254 // Convenience method to edefine a plane passing through 3 points.
255 void DefinePlane(vtkPlane*, double p[3][3]);
256
257 // Convenience method to edefine a plane passing through 3 pointIds of the
258 // parallelopiped. The point Ids must like in the range [0,15], ie the
259 // 15 points comprising the parallelopiped and the chair (also modelled
260 // as a parallelopiped)
262
270
272
273 // Cache the axis index used for face aligned resize.
275
280
281 // When a chair is carved out for the first time, this is the initial
282 // depth of the chair
284
293 vtkParallelopipedTopology* Topology;
296
297private:
299 void operator=(const vtkParallelopipedRepresentation&) = delete;
300};
301
302VTK_ABI_NAMESPACE_END
303#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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:108
int ComputeInteractionState(int X, int Y, int modify=0) override
Given and x-y display coordinate, compute the interaction state of the widget.
vtkHandleRepresentation * GetHandleRepresentation(int index)
void HandlesOff()
Turns the visibility of the handles on/off.
void BuildRepresentation() override
This actually constructs the geometry of the widget from the various data parameters.
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 HandlesOn()
Turns the visibility of the handles on/off.
virtual void SetSelectedHandleProperty(vtkProperty *)
Set/Get the handle properties.
void GetPolyData(vtkPolyData *pd)
The parallelopiped polydata.
void HighlightAllFaces()
Highlight face defined by the supplied ptids with the specified property.
virtual void SetHoveredHandleProperty(vtkProperty *)
Set/Get the handle properties.
virtual void PositionHandles()
Synchronize the parallelopiped handle positions with the Polygonal datastructure.
void ReleaseGraphicsResources(vtkWindow *w) override
Methods required by vtkProp superclass.
int RenderOverlay(vtkViewport *viewport) override
Methods required by vtkProp superclass.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
virtual void Translate(int X, int Y)
virtual void Translate(double translation[3])
static vtkParallelopipedRepresentation * New()
Instantiate the class.
virtual void SetHandleProperty(vtkProperty *)
Set/Get the handle properties.
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 SetHandleRepresentation(vtkHandleRepresentation *handle)
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:141
represent and manipulate 3D points
Definition vtkPoints.h:139
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
an ordered list of Props
represent surface properties of a geometric object
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkIdType
Definition vtkType.h:367
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO