VTK
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=========================================================================*/
34#ifndef vtkParallelopipedRepresentation_h
35#define vtkParallelopipedRepresentation_h
36
37#include "vtkInteractionWidgetsModule.h" // For export macro
39
40class vtkActor;
41class vtkPlane;
42class vtkPoints;
43class vtkPolyData;
45class vtkProperty;
46class vtkCellArray;
47class vtkTransform;
51class vtkParallelopipedTopology;
52
53class VTKINTERACTIONWIDGETS_EXPORT vtkParallelopipedRepresentation
55{
56public:
61
63
67 void PrintSelf(ostream& os, vtkIndent indent);
69
73 virtual void GetActors(vtkPropCollection *pc);
74
76
90 virtual void PlaceWidget(double corners[8][3]);
91 virtual void PlaceWidget(double bounds[6]);
93
95
100 vtkSetMacro(InteractionState,int);
102
110
115
119 virtual double *GetBounds();
120
122
128 vtkGetObjectMacro(HandleProperty, vtkProperty );
129 vtkGetObjectMacro(HoveredHandleProperty, vtkProperty );
130 vtkGetObjectMacro(SelectedHandleProperty, vtkProperty );
132
135
137
141 void HandlesOn();
144
146
150 vtkGetObjectMacro(FaceProperty,vtkProperty);
151 vtkGetObjectMacro(SelectedFaceProperty,vtkProperty);
153
155
159 vtkGetObjectMacro(OutlineProperty,vtkProperty);
160 vtkGetObjectMacro(SelectedOutlineProperty,vtkProperty);
162
167 virtual void BuildRepresentation();
168
170
174 virtual int RenderOverlay(vtkViewport *viewport);
175 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
177
182 virtual int ComputeInteractionState(int X, int Y, int modify=0);
183
184 // Manage the state of the widget
186 {
187 Outside = 0,
200 RotatingParallelopiped
201 };
202
203 // Methods to manipulate the piped.
204 virtual void Translate( double translation[3] );
205 virtual void Translate( int X, int Y );
206 virtual void Scale( int X, int Y );
207
212 virtual void PositionHandles();
213
215
221 vtkSetMacro( MinimumThickness, double );
222 vtkGetMacro( MinimumThickness, double );
224
225protected:
228
232 void TranslatePoint( int n, const double motionVector[3] );
233
238 void SetHandleHighlight( int handleIdx, vtkProperty *property );
239
241
248
249 // Node can be a value within [0,7]. This will create a chair one one of
250 // the handle corners. '0 < InitialChairDepth < 1' value dicates the starting
251 // depth of the cavity.
252 void UpdateChairAtNode( int node );
253
254 // Removes any existing chairs.
256
257 // Convenience method to get just the planes that define the parallelopiped.
258 // If we aren't in chair mode, this will be the same as GetBoundingPlanes().
259 // If we are in chair mode, this will be the first 6 planes from amongst
260 // those returned by "GetBoundingPlanes".
261 // All planes have their normals pointing inwards.
263
264 // Convenience method to edefine a plane passing through 3 points.
265 void DefinePlane( vtkPlane *, double p[3][3]);
266
267 // Convenience method to edefine a plane passing through 3 pointIds of the
268 // parallelopiped. The point Ids must like in the range [0,15], ie the
269 // 15 points comprising the parallelopiped and the chair (also modelled
270 // as a parallelopiped)
272
280
281 double LastEventPosition[2];
282
283 // Cache the axis index used for face aligned resize.
285
290
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&) VTK_DELETE_FUNCTION;
311};
312
313#endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
object to represent cell connectivity
Definition: vtkCellArray.h:51
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:40
Default representation for vtkParallelopipedWidget.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
Given and x-y display coordinate, compute the interaction state of the widget.
vtkHandleRepresentation * GetHandleRepresentation(int index)
virtual double * GetBounds()
The parallelopiped polydata.
void GetParallelopipedBoundingPlanes(vtkPlaneCollection *pc)
void TranslatePoint(int n, const double motionVector[3])
Translate the nth PtId (0 <= n <= 15) by the specified amount.
vtkClosedSurfacePointPlacer * ChairPointPlacer
void HandlesOn()
Turns the visibility of the handles on/off.
virtual void SetSelectedHandleProperty(vtkProperty *)
virtual void BuildRepresentation()
This actually constructs the geometry of the widget from the various data parameters.
void GetPolyData(vtkPolyData *pd)
The parallelopiped polydata.
virtual void SetHoveredHandleProperty(vtkProperty *)
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.
virtual void SetHandleProperty(vtkProperty *)
Set/Get the handle properties.
virtual int RenderOverlay(vtkViewport *viewport)
virtual void Scale(int X, int Y)
void DefinePlane(vtkPlane *, vtkIdType, vtkIdType, vtkIdType)
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetFaceHighlight(vtkCellArray *face, vtkProperty *)
Highlight face defined by the supplied ptids with the specified property.
virtual void PlaceWidget(double bounds[6])
void GetBoundingPlanes(vtkPlaneCollection *pc)
Get the bounding planes of the object.
void SetHandleRepresentation(vtkHandleRepresentation *handle)
virtual void GetActors(vtkPropCollection *pc)
Methods to satisfy the superclass.
void SetHandleHighlight(int handleIdx, vtkProperty *property)
Set the highlight state of a handle.
void DefinePlane(vtkPlane *, double p[3][3])
virtual void ReleaseGraphicsResources(vtkWindow *w)
Methods required by vtkProp superclass.
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:38
represent and manipulate 3D points
Definition: vtkPoints.h:40
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
a list of Props
represent surface properties of a geometric object
Definition: vtkProperty.h:65
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
abstract specification for Viewports
Definition: vtkViewport.h:48
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ translation
Definition: vtkX3D.h:232
@ index
Definition: vtkX3D.h:246
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287