VTK
vtkAbstractPolygonalHandleRepresentation3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAbstractPolygonalHandleRepresentation3D.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 =========================================================================*/
33 #ifndef __vtkAbstractPolygonalHandleRepresentation3D_h
34 #define __vtkAbstractPolygonalHandleRepresentation3D_h
35 
37 
38 class vtkProperty;
39 class vtkPolyDataMapper;
40 class vtkCellPicker;
43 class vtkMatrix4x4;
44 class vtkPolyData;
46 class vtkActor;
47 class vtkFollower;
48 class vtkVectorText;
49 
52 {
53 public:
54 
56 
58  void PrintSelf(ostream& os, vtkIndent indent);
60 
62 
63  virtual void SetWorldPosition(double p[3]);
64  virtual void SetDisplayPosition(double p[3]);
66 
68 
69  void SetHandle( vtkPolyData * );
70  vtkPolyData * GetHandle();
72 
74 
75  void SetProperty(vtkProperty*);
76  void SetSelectedProperty(vtkProperty*);
77  vtkGetObjectMacro(Property,vtkProperty);
78  vtkGetObjectMacro(SelectedProperty,vtkProperty);
80 
83  virtual vtkAbstractTransform * GetTransform();
84 
86 
88  virtual void BuildRepresentation();
89  virtual void StartWidgetInteraction(double eventPos[2]);
90  virtual void WidgetInteraction(double eventPos[2]);
91  virtual int ComputeInteractionState(int X, int Y, int modify=0);
93 
95 
96  virtual void ShallowCopy(vtkProp *prop);
97  virtual void DeepCopy(vtkProp *prop);
98  virtual void GetActors(vtkPropCollection *);
99  virtual void ReleaseGraphicsResources(vtkWindow *);
100  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
101  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
102  virtual int HasTranslucentPolygonalGeometry();
103  virtual double *GetBounds();
105 
107 
109  vtkSetMacro( LabelVisibility, int );
110  vtkGetMacro( LabelVisibility, int );
111  vtkBooleanMacro( LabelVisibility, int );
112  virtual void SetLabelText( const char * label );
113  virtual char * GetLabelText();
115 
117 
118  virtual void SetLabelTextScale( double scale[3] );
119  void SetLabelTextScale(double x, double y, double z)
120  {
121  double scale[3] = {x, y, z};
122  this->SetLabelTextScale(scale);
123  }
124  virtual double * GetLabelTextScale();
126 
128 
129  vtkGetObjectMacro( LabelTextActor, vtkFollower );
131 
135  virtual void SetUniformScale( double scale );
136 
138 
139  vtkSetMacro( HandleVisibility, int );
140  vtkGetMacro( HandleVisibility, int );
141  vtkBooleanMacro( HandleVisibility, int );
143 
144  void Highlight(int highlight);
145 protected:
148 
155  double LastPickPosition[3];
156  double LastEventPosition[2];
163 
164 
165  // Methods to manipulate the cursor
166  virtual void Translate(double *p1, double *p2);
167  virtual void Scale(double *p1, double *p2, double eventPos[2]);
168  virtual void MoveFocus(double *p1, double *p2);
169 
170  void CreateDefaultProperties();
171 
172  // Given a motion vector defined by p1 --> p2 (p1 and p2 are in
173  // world coordinates), the new display position of the handle center is
174  // populated into requestedDisplayPos. This is again only a request for the
175  // new display position. It is up to the point placer to deduce the
176  // appropriate world co-ordinates that this display position will map into.
177  // The placer may even disallow such a movement.
178  virtual void MoveFocusRequest(
179  double *p1, double *p2, double requestedDisplayPos[3] );
180 
181  int DetermineConstraintAxis(int constraint, double *x, double *startPickPos);
182 
190  virtual void UpdateHandle();
191 
193  virtual void UpdateLabel();
194 
195  // Handle the label.
201 
202 private:
204  void operator=(const vtkAbstractPolygonalHandleRepresentation3D&); //Not implemented
205 };
206 
207 #endif
208 
209