Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkAnnotationRulerRepresentation3D.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLAnnotationDisplayableManagerHelper,v $
10  Date: $Date: Aug 4, 2010 10:44:52 AM $
11  Version: $Revision: 1.0 $
12 
13  =========================================================================auto=*/
14 
15 #ifndef __vtkAnnotationRulerRepresentation3D_h
16 #define __vtkAnnotationRulerRepresentation3D_h
17 
18 // Annotations includes
19 #include "vtkSlicerAnnotationsModuleVTKWidgetsExport.h"
20 
21 // VTK includes
22 #include <vtkDistanceRepresentation3D.h>
23 
25 class VTK_SLICER_ANNOTATIONS_MODULE_VTKWIDGETS_EXPORT
27  : public vtkDistanceRepresentation3D
28 {
29 public:
30 
32  vtkTypeMacro(vtkAnnotationRulerRepresentation3D, vtkDistanceRepresentation3D);
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
35  void SetDistance(double distance);
36 
37  // Description:
38  // Get the line actor property
39  vtkProperty *GetLineProperty() override;
40 
41  // Description:
42  // Set/Get position of the label title. 0 is at the start of the
43  // line whereas 1 is at the end.
44  //vtkSetMacro(LabelPosition, double);
45  void SetLabelPosition(double labelPosition);
46 
47  // Description:
48  // Set/Get the maximum number of ticks in ruler mode
49  vtkSetMacro(MaxTicks, int);
50  vtkGetMacro(MaxTicks, int);
51 
52  // Description:
53  // Change the polydata displayed as tick markers
54  void UpdateGlyphPolyData(vtkPolyData *polyData);
55 
56  // Required by the rendering process, check if the glyph and label actors
57  // have translucency and return true if so. Fixes a bug when the label
58  // was set to a non 1 opacity but was not being rendered.
59  int HasTranslucentPolygonalGeometry() override;
60 
61 protected:
62 
65 
66  void BuildRepresentation() override;
67 
68  // Internal use: set the label actor's position from current world point 1
69  // and 2 positions and label position factor
70  void UpdateLabelActorPosition();
71 
72 
73 private:
74 
76  void operator=(const vtkAnnotationRulerRepresentation3D&) = delete;
77 
78  double m_Distance;
79 
80  // Maximum number of ticks on the 3d ruler
81  int MaxTicks;
82 
83 };
84 
85 #endif /* __vtkAnnotationRulerRepresentation3D_h */