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 =========================================================================*/
30 #ifndef __vtkSeedRepresentation_h
31 #define __vtkSeedRepresentation_h
32 
34 
35 class vtkHandleList;
37 
38 
40 {
41 public:
43  static vtkSeedRepresentation *New();
44 
46 
48  void PrintSelf(ostream& os, vtkIndent indent);
50 
52 
55  virtual void GetSeedWorldPosition( unsigned int seedNum, double pos[3] );
56  virtual void SetSeedDisplayPosition( unsigned int seedNum, double pos[3] );
57  virtual void GetSeedDisplayPosition( unsigned int seedNum, double pos[3] );
59 
61  int GetNumberOfSeeds();
62 
69  void SetHandleRepresentation( vtkHandleRepresentation *handle );
70 
74  vtkHandleRepresentation *GetHandleRepresentation( unsigned int num );
75 
77 
79  {
80  return this->HandleRepresentation;
81  };
83 
85 
88  vtkSetClampMacro( Tolerance, int, 1, 100 );
89  vtkGetMacro( Tolerance, int );
91 
92 //BTX -- used to communicate about the state of the representation
93  enum
94  {
95  Outside = 0,
96  NearSeed
97  };
98 //ETX
99 
101 
103  virtual int GetActiveHandle();
104  // Returns the id of the seed created, -1 on failure. e is the display position.
105  virtual int CreateHandle( double e[2] );
106  // Delete last handle created
107  virtual void RemoveLastHandle();
108  // Delete the currently active handle
109  virtual void RemoveActiveHandle();
111 
113  virtual void RemoveHandle( int n );
114 
116 
117  virtual void BuildRepresentation();
118  virtual int ComputeInteractionState( int X, int Y, int modify = 0 );
120 
121 protected:
124 
125  // The handle and the rep used to close the handles
127  vtkHandleList *Handles;
128 
129  // Selection tolerance for the handles
131 
132  // The active seed (handle) based on the last ComputeInteractionState()
134 
135 private:
136  vtkSeedRepresentation(const vtkSeedRepresentation&); //Not implemented
137  void operator=(const vtkSeedRepresentation&); //Not implemented
138 };
139 
140 #endif
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkHandleRepresentation * GetHandleRepresentation()
#define VTK_WIDGETS_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
vtkHandleRepresentation * HandleRepresentation
represent the vtkSeedWidget