/usr/include/vtk-5.8/vtkBiDimensionalWidget.h is in libvtk5-dev 5.8.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkBiDimensionalWidget.h,v
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkBiDimensionalWidget - measure the bi-dimensional lengths of an object
// .SECTION Description
// The vtkBiDimensionalWidget is used to measure the bi-dimensional length of
// an object. The bi-dimensional measure is defined by two finite,
// orthogonal lines that intersect within the finite extent of both lines.
// The lengths of these two lines gives the bi-dimensional measure. Each line
// is defined by two handle widgets at the end points of each line.
//
// The orthognal constraint on the two lines limits how the four end points
// can be positioned. The first two points can be placed arbitrarily to
// define the first line (similar to vtkDistanceWidget). The placement of the
// third point is limited by the finite extent of the first line. As the
// third point is placed, the fourth point is placed on the opposite side of
// the first line. Once the third point is placed, the second line is defined
// since the fourth point is defined at the same time, but the fourth point
// can be moved along the second line (i.e., maintaining the orthogonal
// relationship between the two lines). Onced defined, any of the four points
// can be moved along their constraint lines. Also, each line can be translated
// along the other line (in an orthogonal direction), and the whole
// bi-dimensional widget can be rotated about its center point (see the description
// of the event bindings). Finally, selecting the point where the two orthogonal
// axes intersect, the entire widget can be translated in any direction.
//
// Placement of any point results in a special PlacePointEvent invocation so
// that special operations may be performed to reposition the point. Motion
// of any point, moving the lines, or rotating the widget cause
// InteractionEvents to be invoked. Note that the widget has two fundamental
// modes: a define mode (when initially placing the points) and a manipulate
// mode (after the points are placed). Line translation and rotation are only
// possible in manipulate mode.
//
// To use this widget, specify an instance of vtkBiDimensionalWidget and a
// representation (e.g., vtkBiDimensionalRepresentation2D). The widget is
// implemented using four instances of vtkHandleWidget which are used to
// position the end points of the two intersecting lines. The representations
// for these handle widgets are provided by the vtkBiDimensionalRepresentation
// class.
//
// .SECTION Event Bindings
// By default, the widget responds to the following VTK events (i.e., it
// watches the vtkRenderWindowInteractor for these events):
// <pre>
// LeftButtonPressEvent - define a point or manipulate a handle, line,
// perform rotation or translate the widget.
// MouseMoveEvent - position the points, move a line, rotate or translate the widget
// LeftButtonReleaseEvent - release the selected handle and end interaction
// </pre>
//
// Note that the event bindings described above can be changed using this
// class's vtkWidgetEventTranslator. This class translates VTK events
// into the vtkBiDimensionalWidget's widget events:
// <pre>
// vtkWidgetEvent::AddPoint -- (In Define mode:) Add one point; depending on the
// state it may the first, second, third or fourth
// point added. (In Manipulate mode:) If near a handle,
// select the handle. Or if near a line, select the line.
// vtkWidgetEvent::Move -- (In Define mode:) Position the second, third or fourth
// point. (In Manipulate mode:) Move the handle, line or widget.
// vtkWidgetEvent::EndSelect -- the manipulation process has completed.
// </pre>
//
// This widget invokes the following VTK events on itself (which observers
// can listen for):
// <pre>
// vtkCommand::StartInteractionEvent (beginning to interact)
// vtkCommand::EndInteractionEvent (completing interaction)
// vtkCommand::InteractionEvent (moving a handle, line or performing rotation)
// vtkCommand::PlacePointEvent (after a point is positioned;
// call data includes handle id (0,1,2,4))
// </pre>
// .SECTION See Also
// vtkHandleWidget vtkDistanceWidget
#ifndef __vtkBiDimensionalWidget_h
#define __vtkBiDimensionalWidget_h
#include "vtkAbstractWidget.h"
class vtkBiDimensionalRepresentation;
class vtkHandleWidget;
class vtkBiDimensionalWidgetCallback;
class VTK_WIDGETS_EXPORT vtkBiDimensionalWidget : public vtkAbstractWidget
{
public:
// Description:
// Instantiate this class.
static vtkBiDimensionalWidget *New();
// Description:
// Standard methods for a VTK class.
vtkTypeMacro(vtkBiDimensionalWidget,vtkAbstractWidget);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// The method for activiating and deactiviating this widget. This method
// must be overridden because it is a composite widget and does more than
// its superclasses' vtkAbstractWidget::SetEnabled() method.
virtual void SetEnabled(int);
// Description:
// Specify an instance of vtkWidgetRepresentation used to represent this
// widget in the scene. Note that the representation is a subclass of vtkProp
// so it can be added to the renderer independent of the widget.
void SetRepresentation(vtkBiDimensionalRepresentation *r)
{this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
// Description:
// Return the representation as a vtkBiDimensionalRepresentation.
vtkBiDimensionalRepresentation *GetBiDimensionalRepresentation()
{return reinterpret_cast<vtkBiDimensionalRepresentation*>(this->WidgetRep);}
// Description:
// Create the default widget representation if one is not set.
void CreateDefaultRepresentation();
// Description:
// A flag indicates whether the bi-dimensional measure is valid. The widget
// becomes valid after two of the four points are placed.
int IsMeasureValid();
//BTX
// Description:
// Events.
enum
{
EndWidgetSelectEvent = 10050
};
//ETX
// Description:
// Methods to change the whether the widget responds to interaction.
// Overridden to pass the state to component widgets.
virtual void SetProcessEvents(int);
// Description:
// Enum defining the state of the widget. By default the widget is in Start mode,
// and expects to be interactively placed. While placing the points the widget
// transitions to Define state. Once placed, the widget enters the Manipulate state.
//BTX
enum {Start=0,Define,Manipulate};
//ETX
// Description:
// Set the state of the widget. If the state is set to "Manipulate" then it
// is assumed that the widget and its representation will be initialized
// programmatically and is not interactively placed. Initially the widget
// state is set to "Start" which means nothing will appear and the user
// must interactively place the widget with repeated mouse selections. Set
// the state to "Start" if you want interactive placement. Generally state
// changes must be followed by a Render() for things to visually take
// effect.
virtual void SetWidgetStateToStart();
virtual void SetWidgetStateToManipulate();
// Description:
// Return the current widget state.
virtual int GetWidgetState()
{return this->WidgetState;}
protected:
vtkBiDimensionalWidget();
~vtkBiDimensionalWidget();
// The state of the widget
int WidgetState;
int CurrentHandle;
int HandleLine1Selected;
int HandleLine2Selected;
int Line1InnerSelected;
int Line1OuterSelected;
int Line2InnerSelected;
int Line2OuterSelected;
int CenterSelected;
// Callback interface to capture events when
// placing the widget.
static void AddPointAction(vtkAbstractWidget*);
static void MoveAction(vtkAbstractWidget*);
static void EndSelectAction(vtkAbstractWidget*);
// The positioning handle widgets
vtkHandleWidget *Point1Widget;
vtkHandleWidget *Point2Widget;
vtkHandleWidget *Point3Widget;
vtkHandleWidget *Point4Widget;
vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback1;
vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback2;
vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback3;
vtkBiDimensionalWidgetCallback *BiDimensionalWidgetCallback4;
// Methods invoked when the handles at the
// end points of the widget are manipulated
void StartBiDimensionalInteraction();
virtual void EndBiDimensionalInteraction();
//BTX
friend class vtkBiDimensionalWidgetCallback;
//ETX
private:
vtkBiDimensionalWidget(const vtkBiDimensionalWidget&); //Not implemented
void operator=(const vtkBiDimensionalWidget&); //Not implemented
};
#endif
|