VTK
vtkOrientedGlyphContourRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOrientedGlyphContourRepresentation.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 =========================================================================*/
30 #ifndef __vtkOrientedGlyphContourRepresentation_h
31 #define __vtkOrientedGlyphContourRepresentation_h
32 
34 
35 class vtkProperty;
36 class vtkActor;
37 class vtkPolyDataMapper;
38 class vtkPolyData;
39 class vtkGlyph3D;
40 class vtkPoints;
41 
43 {
44 public:
47 
49 
51  void PrintSelf(ostream& os, vtkIndent indent);
53 
55 
58  void SetCursorShape(vtkPolyData *cursorShape);
59  vtkPolyData *GetCursorShape();
61 
63 
66  void SetActiveCursorShape(vtkPolyData *activeShape);
67  vtkPolyData *GetActiveCursorShape();
69 
71 
73  vtkGetObjectMacro(Property,vtkProperty);
75 
77 
79  vtkGetObjectMacro(ActiveProperty,vtkProperty);
81 
83 
84  vtkGetObjectMacro(LinesProperty,vtkProperty);
86 
88 
91  virtual void SetRenderer(vtkRenderer *ren);
92  virtual void BuildRepresentation();
93  virtual void StartWidgetInteraction(double eventPos[2]);
94  virtual void WidgetInteraction(double eventPos[2]);
95  virtual int ComputeInteractionState(int X, int Y, int modified=0);
97 
99 
100  virtual void GetActors(vtkPropCollection *);
101  virtual void ReleaseGraphicsResources(vtkWindow *);
102  virtual int RenderOverlay(vtkViewport *viewport);
103  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
104  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
105  virtual int HasTranslucentPolygonalGeometry();
107 
110 
112 
116  vtkSetMacro( AlwaysOnTop, int );
117  vtkGetMacro( AlwaysOnTop, int );
118  vtkBooleanMacro( AlwaysOnTop, int );
120 
123  void SetLineColor(double r, double g, double b);
124 
127  virtual void SetShowSelectedNodes(int);
128 
130  virtual double *GetBounds();
131 
132 protected:
135 
136  // Render the cursor
149 
156  void CreateSelectedNodesRepresentation();
157 
161 
162  // Support picking
163  double LastPickPosition[3];
164  double LastEventPosition[2];
165 
166  // Methods to manipulate the cursor
167  void Translate(double eventPos[2]);
168  void Scale(double eventPos[2]);
169  void ShiftContour(double eventPos[2]);
170  void ScaleContour(double eventPos[2]);
171 
172  void ComputeCentroid(double* ioCentroid);
173 
174  // Properties used to control the appearance of selected objects and
175  // the manipulator in general.
179  void CreateDefaultProperties();
180 
181 
182  // Distance between where the mouse event happens and where the
183  // widget is focused - maintain this distance during interaction.
184  double InteractionOffset[2];
185 
187 
188  virtual void BuildLines();
189 
190 private:
192  void operator=(const vtkOrientedGlyphContourRepresentation&); //Not implemented
193 };
194 
195 #endif