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:
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 
63 
71 
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
vtkWidgetRepresentation.h
vtkSeedRepresentation::~vtkSeedRepresentation
~vtkSeedRepresentation()
vtkSeedRepresentation::GetSeedDisplayPosition
virtual void GetSeedDisplayPosition(unsigned int seedNum, double pos[3])
vtkSeedRepresentation::GetNumberOfSeeds
int GetNumberOfSeeds()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:54
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
vtkInteractionWidgetsModule.h
vtkSeedRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkSeedRepresentation::GetSeedWorldPosition
virtual void GetSeedWorldPosition(unsigned int seedNum, double pos[3])
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkSeedRepresentation::SetSeedDisplayPosition
virtual void SetSeedDisplayPosition(unsigned int seedNum, double pos[3])
vtkSeedRepresentation::GetHandleRepresentation
vtkHandleRepresentation * GetHandleRepresentation()
Definition: vtkSeedRepresentation.h:79
vtkSeedRepresentation::Handles
vtkHandleList * Handles
Definition: vtkSeedRepresentation.h:128
vtkSeedRepresentation::vtkSeedRepresentation
vtkSeedRepresentation()
vtkgl::num
GLuint GLuint num
Definition: vtkgl.h:16907
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSeedRepresentation::HandleRepresentation
vtkHandleRepresentation * HandleRepresentation
Definition: vtkSeedRepresentation.h:127
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkSeedRepresentation::CreateHandle
virtual int CreateHandle(double e[2])
vtkSeedRepresentation::New
static vtkSeedRepresentation * New()
vtkSeedRepresentation::ActiveHandle
int ActiveHandle
Definition: vtkSeedRepresentation.h:134
vtkSeedRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkSeedRepresentation::GetHandleRepresentation
vtkHandleRepresentation * GetHandleRepresentation(unsigned int num)
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkSeedRepresentation::GetActiveHandle
virtual int GetActiveHandle()
vtkSeedRepresentation::RemoveHandle
virtual void RemoveHandle(int n)
vtkSeedRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkSeedRepresentation
represent the vtkSeedWidget
Definition: vtkSeedRepresentation.h:41
vtkSeedRepresentation::RemoveLastHandle
virtual void RemoveLastHandle()
vtkSeedRepresentation::SetHandleRepresentation
void SetHandleRepresentation(vtkHandleRepresentation *handle)
vtkSeedRepresentation::RemoveActiveHandle
virtual void RemoveActiveHandle()
vtkSeedRepresentation::Tolerance
int Tolerance
Definition: vtkSeedRepresentation.h:131