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 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
35 
36 class vtkHandleList;
38 
39 
41 {
42 public:
44  static vtkSeedRepresentation *New();
45 
47 
49  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
56  virtual void GetSeedWorldPosition( unsigned int seedNum, double pos[3] );
57  virtual void SetSeedDisplayPosition( unsigned int seedNum, double pos[3] );
58  virtual void GetSeedDisplayPosition( unsigned int seedNum, double pos[3] );
60 
62  int GetNumberOfSeeds();
63 
70  void SetHandleRepresentation( vtkHandleRepresentation *handle );
71 
75  vtkHandleRepresentation *GetHandleRepresentation( unsigned int num );
76 
78 
80  {
81  return this->HandleRepresentation;
82  };
84 
86 
89  vtkSetClampMacro( Tolerance, int, 1, 100 );
90  vtkGetMacro( Tolerance, int );
92 
93 //BTX -- used to communicate about the state of the representation
94  enum
95  {
96  Outside = 0,
97  NearSeed
98  };
99 //ETX
100 
102 
104  virtual int GetActiveHandle();
105  // Returns the id of the seed created, -1 on failure. e is the display position.
106  virtual int CreateHandle( double e[2] );
107  // Delete last handle created
108  virtual void RemoveLastHandle();
109  // Delete the currently active handle
110  virtual void RemoveActiveHandle();
112 
114  virtual void RemoveHandle( int n );
115 
117 
118  virtual void BuildRepresentation();
119  virtual int ComputeInteractionState( int X, int Y, int modify = 0 );
121 
122 protected:
125 
126  // The handle and the rep used to close the handles
128  vtkHandleList *Handles;
129 
130  // Selection tolerance for the handles
132 
133  // The active seed (handle) based on the last ComputeInteractionState()
135 
136 private:
137  vtkSeedRepresentation(const vtkSeedRepresentation&); //Not implemented
138  void operator=(const vtkSeedRepresentation&); //Not implemented
139 };
140 
141 #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
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkHandleRepresentation * GetHandleRepresentation()
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
vtkHandleRepresentation * HandleRepresentation
represent the vtkSeedWidget