VTK
vtkSeedRepresentation.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSeedRepresentation.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=========================================================================*/
31#ifndef vtkSeedRepresentation_h
32#define vtkSeedRepresentation_h
33
34#include "vtkInteractionWidgetsModule.h" // For export macro
36
37class vtkHandleList;
39
40
41class VTKINTERACTIONWIDGETS_EXPORT vtkSeedRepresentation : public vtkWidgetRepresentation
42{
43public:
48
50
54 void PrintSelf(ostream& os, vtkIndent indent);
56
58
64 virtual void GetSeedWorldPosition( unsigned int seedNum, double pos[3] );
65 virtual void SetSeedDisplayPosition( unsigned int seedNum, double pos[3] );
66 virtual void GetSeedDisplayPosition( unsigned int seedNum, double pos[3] );
68
73
83
90
92
96 {
97 return this->HandleRepresentation;
98 };
100
102
107 vtkSetClampMacro( Tolerance, int, 1, 100 );
108 vtkGetMacro( Tolerance, int );
110
111 // Used to communicate about the state of the representation
112 enum
113 {
114 Outside = 0,
115 NearSeed
116 };
117
119
123 virtual int GetActiveHandle();
124 // Returns the id of the seed created, -1 on failure. e is the display position.
125 virtual int CreateHandle( double e[2] );
126 // Delete last handle created
127 virtual void RemoveLastHandle();
128 // Delete the currently active handle
129 virtual void RemoveActiveHandle();
131
135 virtual void RemoveHandle( int n );
136
138
141 virtual void BuildRepresentation();
142 virtual int ComputeInteractionState( int X, int Y, int modify = 0 );
144
145protected:
148
149 // The handle and the rep used to close the handles
151 vtkHandleList *Handles;
152
153 // Selection tolerance for the handles
155
156 // The active seed (handle) based on the last ComputeInteractionState()
158
159private:
160 vtkSeedRepresentation(const vtkSeedRepresentation&) VTK_DELETE_FUNCTION;
161 void operator=(const vtkSeedRepresentation&) VTK_DELETE_FUNCTION;
162};
163
164#endif
abstract class for representing widget handles
a simple class to control print indentation
Definition: vtkIndent.h:40
represent the vtkSeedWidget
virtual int CreateHandle(double e[2])
int GetNumberOfSeeds()
Return the number of seeds (or handles) that have been created.
virtual void BuildRepresentation()
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void GetSeedWorldPosition(unsigned int seedNum, double pos[3])
Methods to Set/Get the coordinates of seed points defining this representation.
virtual int GetActiveHandle()
These are methods specific to vtkSeedRepresentation and which are invoked from vtkSeedWidget.
vtkHandleRepresentation * HandleRepresentation
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void RemoveLastHandle()
virtual void RemoveHandle(int n)
Remove the nth handle.
vtkHandleRepresentation * GetHandleRepresentation()
Returns the model HandleRepresentation.
void SetHandleRepresentation(vtkHandleRepresentation *handle)
This method is used to specify the type of handle representation to use for the internal vtkHandleWid...
vtkHandleRepresentation * GetHandleRepresentation(unsigned int num)
Get the handle representations used for a particular seed.
virtual void RemoveActiveHandle()
virtual void SetSeedDisplayPosition(unsigned int seedNum, double pos[3])
virtual int ComputeInteractionState(int X, int Y, int modify=0)
virtual void GetSeedDisplayPosition(unsigned int seedNum, double pos[3])
static vtkSeedRepresentation * New()
Instantiate class.
abstract class defines interface between the widget and widget representation classes