VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
35 
36 class vtkProperty;
37 class vtkActor;
38 class vtkPolyDataMapper;
39 class vtkPolyData;
40 class vtkGlyph3D;
41 class vtkPoints;
42 
43 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation : public vtkContourRepresentation
44 {
45 public:
48 
50 
52  void PrintSelf(ostream& os, vtkIndent indent);
54 
56 
59  void SetCursorShape(vtkPolyData *cursorShape);
60  vtkPolyData *GetCursorShape();
62 
64 
67  void SetActiveCursorShape(vtkPolyData *activeShape);
68  vtkPolyData *GetActiveCursorShape();
70 
72 
74  vtkGetObjectMacro(Property,vtkProperty);
76 
78 
80  vtkGetObjectMacro(ActiveProperty,vtkProperty);
82 
84 
85  vtkGetObjectMacro(LinesProperty,vtkProperty);
87 
89 
92  virtual void SetRenderer(vtkRenderer *ren);
93  virtual void BuildRepresentation();
94  virtual void StartWidgetInteraction(double eventPos[2]);
95  virtual void WidgetInteraction(double eventPos[2]);
96  virtual int ComputeInteractionState(int X, int Y, int modified=0);
98 
100 
101  virtual void GetActors(vtkPropCollection *);
102  virtual void ReleaseGraphicsResources(vtkWindow *);
103  virtual int RenderOverlay(vtkViewport *viewport);
104  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
105  virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
106  virtual int HasTranslucentPolygonalGeometry();
108 
111 
113 
117  vtkSetMacro( AlwaysOnTop, int );
118  vtkGetMacro( AlwaysOnTop, int );
119  vtkBooleanMacro( AlwaysOnTop, int );
121 
124  void SetLineColor(double r, double g, double b);
125 
128  virtual void SetShowSelectedNodes(int);
129 
131  virtual double *GetBounds();
132 
133 protected:
136 
137  // Render the cursor
138  vtkActor *Actor;
139  vtkPolyDataMapper *Mapper;
141  vtkActor *ActiveActor;
142  vtkPolyDataMapper *ActiveMapper;
147  vtkPoints *FocalPoint;
149  vtkPoints *ActiveFocalPoint;
150 
154  vtkPolyDataMapper *SelectedNodesMapper;
157  void CreateSelectedNodesRepresentation();
158 
160  vtkPolyDataMapper *LinesMapper;
161  vtkActor *LinesActor;
162 
163  // Support picking
164  double LastPickPosition[3];
165  double LastEventPosition[2];
166 
167  // Methods to manipulate the cursor
168  void Translate(double eventPos[2]);
169  void Scale(double eventPos[2]);
170  void ShiftContour(double eventPos[2]);
171  void ScaleContour(double eventPos[2]);
172 
173  void ComputeCentroid(double* ioCentroid);
174 
175  // Properties used to control the appearance of selected objects and
176  // the manipulator in general.
177  vtkProperty *Property;
178  vtkProperty *ActiveProperty;
179  vtkProperty *LinesProperty;
180  void CreateDefaultProperties();
181 
182 
183  // Distance between where the mouse event happens and where the
184  // widget is focused - maintain this distance during interaction.
185  double InteractionOffset[2];
186 
188 
189  virtual void BuildLines();
190 
191 private:
193  void operator=(const vtkOrientedGlyphContourRepresentation&); //Not implemented
194 };
195 
196 #endif
void PrintSelf(ostream &os, vtkIndent indent)
virtual void WidgetInteraction(double e[2])=0
Default representation for the contour widget.
virtual vtkPolyData * GetContourRepresentationAsPolyData()=0
virtual void SetRenderer(vtkRenderer *ren)
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:82
represent the vtkContourWidget
virtual int RenderOpaqueGeometry(vtkViewport *viewport)=0
virtual void StartWidgetInteraction(double e[2])=0
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport)=0
virtual int RenderOverlay(vtkViewport *viewport)=0
virtual void BuildLines()=0
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:110
virtual void SetShowSelectedNodes(int)
virtual void GetActors(vtkPropCollection *)
virtual int HasTranslucentPolygonalGeometry()=0
virtual int ComputeInteractionState(int X, int Y, int modified=0)=0
virtual void BuildRepresentation()=0
virtual void ReleaseGraphicsResources(vtkWindow *w)=0