VTK  9.0.20201019
vtkAngleRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAngleRepresentation.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 vtkAngleRepresentation_h
31 #define vtkAngleRepresentation_h
32 
33 #include "vtkInteractionWidgetsModule.h" // For export macro
35 
37 
38 class VTKINTERACTIONWIDGETS_EXPORT vtkAngleRepresentation : public vtkWidgetRepresentation
39 {
40 public:
42 
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
53  virtual double GetAngle() = 0;
54 
56 
61  virtual void GetPoint1WorldPosition(double pos[3]) = 0;
62  virtual void GetCenterWorldPosition(double pos[3]) = 0;
63  virtual void GetPoint2WorldPosition(double pos[3]) = 0;
64  virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
65  virtual void SetCenterDisplayPosition(double pos[3]) = 0;
66  virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
67  virtual void GetPoint1DisplayPosition(double pos[3]) = 0;
68  virtual void GetCenterDisplayPosition(double pos[3]) = 0;
69  virtual void GetPoint2DisplayPosition(double pos[3]) = 0;
71 
73 
83  void SetHandleRepresentation(vtkHandleRepresentation* handle);
84  void InstantiateHandleRepresentation();
86 
88 
91  vtkGetObjectMacro(Point1Representation, vtkHandleRepresentation);
92  vtkGetObjectMacro(CenterRepresentation, vtkHandleRepresentation);
93  vtkGetObjectMacro(Point2Representation, vtkHandleRepresentation);
95 
97 
102  vtkSetClampMacro(Tolerance, int, 1, 100);
103  vtkGetMacro(Tolerance, int);
105 
107 
112  vtkSetStringMacro(LabelFormat);
113  vtkGetStringMacro(LabelFormat);
115 
117 
121  vtkSetMacro(Ray1Visibility, vtkTypeBool);
122  vtkGetMacro(Ray1Visibility, vtkTypeBool);
123  vtkBooleanMacro(Ray1Visibility, vtkTypeBool);
124  vtkSetMacro(Ray2Visibility, vtkTypeBool);
125  vtkGetMacro(Ray2Visibility, vtkTypeBool);
126  vtkBooleanMacro(Ray2Visibility, vtkTypeBool);
127  vtkSetMacro(ArcVisibility, vtkTypeBool);
128  vtkGetMacro(ArcVisibility, vtkTypeBool);
129  vtkBooleanMacro(ArcVisibility, vtkTypeBool);
131 
132  // Used to communicate about the state of the representation
133  enum
134  {
135  Outside = 0,
138  NearP2
139  };
140 
142 
145  void BuildRepresentation() override;
146  int ComputeInteractionState(int X, int Y, int modify = 0) override;
147  void StartWidgetInteraction(double e[2]) override;
148  virtual void CenterWidgetInteraction(double e[2]);
149  void WidgetInteraction(double e[2]) override;
151 
152 protected:
154  ~vtkAngleRepresentation() override;
155 
156  // The handle and the rep used to close the handles
161 
162  // Selection tolerance for the handles
164 
165  // Visibility of the various pieces of the representation
169 
170  // Format for the label
171  char* LabelFormat;
172 
173 private:
175  void operator=(const vtkAngleRepresentation&) = delete;
176 };
177 
178 #endif
vtkAngleRepresentation::ArcVisibility
vtkTypeBool ArcVisibility
Definition: vtkAngleRepresentation.h:168
vtkWidgetRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
Definition: vtkWidgetRepresentation.h:135
vtkWidgetRepresentation.h
vtkAngleRepresentation::CenterRepresentation
vtkHandleRepresentation * CenterRepresentation
Definition: vtkAngleRepresentation.h:159
vtkAngleRepresentation::NearCenter
Definition: vtkAngleRepresentation.h:137
vtkAngleRepresentation::NearP1
Definition: vtkAngleRepresentation.h:136
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:59
vtkAngleRepresentation::Point1Representation
vtkHandleRepresentation * Point1Representation
Definition: vtkAngleRepresentation.h:158
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:55
vtkAngleRepresentation::Point2Representation
vtkHandleRepresentation * Point2Representation
Definition: vtkAngleRepresentation.h:160
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkAngleRepresentation::Ray2Visibility
vtkTypeBool Ray2Visibility
Definition: vtkAngleRepresentation.h:167
vtkWidgetRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
Definition: vtkWidgetRepresentation.h:136
vtkAngleRepresentation::Tolerance
int Tolerance
Definition: vtkAngleRepresentation.h:163
vtkAngleRepresentation::LabelFormat
char * LabelFormat
Definition: vtkAngleRepresentation.h:171
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkAngleRepresentation::Ray1Visibility
vtkTypeBool Ray1Visibility
Definition: vtkAngleRepresentation.h:166
vtkAngleRepresentation::HandleRepresentation
vtkHandleRepresentation * HandleRepresentation
Definition: vtkAngleRepresentation.h:157
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkAngleRepresentation
represent the vtkAngleWidget
Definition: vtkAngleRepresentation.h:38
vtkWidgetRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.