PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusToolAxesActor.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef __vtkPlusToolAxesActor_h
8 #define __vtkPlusToolAxesActor_h
9 
10 // Local includes
11 #include "vtkPlusRenderingExport.h"
12 
13 // PlusLib includes
14 #include <PlusConfigure.h>
15 
16 // VTK includes
17 #include <vtkSetGet.h>
18 #include <vtkProp3D.h>
19 
20 class vtkActor;
21 class vtkCaptionActor2D;
22 class vtkConeSource;
23 class vtkLineSource;
24 class vtkPropCollection;
25 class vtkTubeFilter;
26 
33 class vtkPlusRenderingExport vtkPlusToolAxesActor : public vtkProp3D
34 {
35 public:
36  static vtkPlusToolAxesActor* New();
37  vtkTypeMacro(vtkPlusToolAxesActor, vtkProp3D);
38  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
39 
45  virtual void GetActors(vtkPropCollection*);
46 
48  virtual int RenderOpaqueGeometry(vtkViewport* viewport);
50  virtual int RenderTranslucentPolygonalGeometry(vtkViewport* viewport);
52  virtual int RenderOverlay(vtkViewport* viewport);
53 
55  virtual int HasTranslucentPolygonalGeometry();
56 
62  void ReleaseGraphicsResources(vtkWindow*);
63 
68  void GetBounds(double bounds[6]);
73  double* GetBounds();
74 
76  vtkMTimeType GetMTime();
77 
84  vtkMTimeType GetRedrawMTime();
85 
90  void SetName(const std::string& name);
91 
93  void SetShaftLength(double shaftLength);
95  vtkGetMacro(ShaftLength, double);
96 
98  vtkSetMacro(ShowLabels, bool);
99  vtkBooleanMacro(ShowLabels, bool);
101  vtkGetMacro(ShowLabels, bool);
102 
104  vtkSetMacro(ShowName, bool);
105  vtkBooleanMacro(ShowName, bool);
107  vtkGetMacro(ShowName, bool);
108 
109 protected:
114  class AxisInfo
115  {
116  public:
117  AxisInfo();
118  virtual ~AxisInfo();
119  void ReleaseGraphicsResources(vtkWindow* win);
120 
121  vtkActor* ArrowShaftActor;
122  vtkLineSource* ArrowShaftLineSource;
123  vtkTubeFilter* TubeFilter;
124  vtkConeSource* ArrowTipConeSource;
125  vtkCaptionActor2D* LabelActor;
126  double AxisShaftStart[3];
127  double AxisShaftEnd[3];
128 
129  void UpdateActor();
130  };
131 
132 protected:
135 
136  void UpdateProps();
137 
138  void ExtendMaxBounds(vtkActor* actor, double* bounds);
139 
140 protected:
141  AxisInfo Axes[3];
142 
143  vtkCaptionActor2D* NameLabelActor;
144 
145  double ShaftLength;
147  bool ShowName;
148 
149 private:
150  vtkPlusToolAxesActor(const vtkPlusToolAxesActor&); // Not implemented.
151  void operator=(const vtkPlusToolAxesActor&); // Not implemented.
152 };
153 
154 #endif
155 
Actor for displaying coordinate system axes.
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
vtkCaptionActor2D * NameLabelActor
Stores rendering objects for each axis.