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  // Used to communicate about the state of the representation
94  enum
95  {
96  Outside = 0,
97  NearSeed
98  };
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
#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