Drake Designer
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
vtkFrameWidgetRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 
5 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6 All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 // .NAME vtkFrameWidgetRepresentation - An orthonormal frame representation
15 // .SECTION Description
16 // An orthonormal frame representation for use with the vtkFrameWidget
17 
18 // .SECTION See Also
19 // vtkFrameWidget vtkFrameWidget
20 
21 
22 #ifndef __vtkFrameWidgetRepresentation_h
23 #define __vtkFrameWidgetRepresentation_h
24 
25 #include "vtkWidgetRepresentation.h"
26 
27 #include <vtkDRCFiltersModule.h>
28 
29 class vtkTransform;
30 class vtkDataSet;
31 
32 class VTKDRCFILTERS_EXPORT vtkFrameWidgetRepresentation : public vtkWidgetRepresentation
33 {
34 public:
35  // Description:
36  // Instantiate the class.
37  static vtkFrameWidgetRepresentation *New();
38 
39  // Description:
40  // Standard methods for the class.
41  vtkTypeMacro(vtkFrameWidgetRepresentation,vtkWidgetRepresentation);
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
44  // Description:
45  // Return the transform describing the frame. Changes to this transform
46  // will be reflected in the rendered axes.
47  vtkTransform* GetTransform();
48 
49  // Description:
50  // Set the transform describing the frame. Note that this method does not
51  // copy the transform, rather it increments the transforms reference count
52  // and uses it directly. As a side effect of using the transform directly
53  // it will set PostMultiply to true on the transform. This method calls
54  // vtkProp3D::SetUserTransform(t) on its internal vtkAxesActor.
55  virtual void SetTransform(vtkTransform* t);
56 
57  // Description:
58  // These are methods that satisfy vtkWidgetRepresentation's API.
59  virtual void BuildRepresentation();
60  virtual int ComputeInteractionState(int X, int Y, int modify=0);
61  virtual void StartWidgetInteraction(double e[2]);
62  virtual void WidgetInteraction(double e[2]);
63 
64  virtual void OnMouseHover(double e[2]);
65  virtual void HighlightOff();
66  virtual void HighlightActor(vtkDataSet* dataset);
67 
68  virtual double *GetBounds();
69 
70  virtual void GetActors(vtkPropCollection* propCollection);
71 
72  void SetTranslateAxisEnabled(int axisId, bool enabled);
73  void SetRotateAxisEnabled(int axisId, bool enabled);
74 
75  // Description:
76  // Methods supporting, and required by, the rendering process.
77  virtual void ReleaseGraphicsResources(vtkWindow*);
78  virtual int RenderOpaqueGeometry(vtkViewport*);
79  virtual int RenderOverlay(vtkViewport*);
80  virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
81  virtual int HasTranslucentPolygonalGeometry();
82 
83  // Description:
84  // The interaction state may be set from a widget (e.g., vtkBoxWidget2) or
85  // other object. This controls how the interaction with the widget
86  // proceeds. Normally this method is used as part of a handshaking
87  // process with the widget: First ComputeInteractionState() is invoked that
88  // returns a state based on geometric considerations (i.e., cursor near a
89  // widget feature), then based on events, the widget may modify this
90  // further.
91  void SetInteractionState(int state);
92 
93  // Description:
94  // Set the size of the axes in world coordinates.
95  vtkSetMacro(WorldSize, double);
96  vtkGetMacro(WorldSize, double);
97 
98 
99  // Description:
100  // Use a tube filter instead of only drawing lines.
101  vtkBooleanMacro(UseTubeFilter, bool);
102  vtkSetMacro(UseTubeFilter, bool);
103  vtkGetMacro(UseTubeFilter, bool);
104 
105  enum {Outside=0,Translating,TranslatingInPlane,Rotating};
106 
107 protected:
110 
114  double WorldSize;
115  double LastEventPosition[2];
116  double InteractionStartWorldPoint[3];
117 
118 
119 
120  virtual void Translate(double e[2]);
121  virtual void TranslateInPlane(double e[2]);
122  virtual void Rotate(double e[2]);
123 
124 private:
125 
126  class vtkInternal;
127  vtkInternal* Internal;
128 
130  void operator=(const vtkFrameWidgetRepresentation&); //Not implemented
131 };
132 
133 #endif
float t
Definition: edl_shade.glsl:80
#define VTKDRCFILTERS_EXPORT