fw4spl
MarkedSphereHandleRepresentation.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWRENDERVTK_VTK_MARKEDSPHEREHANDLEREPRESENTATION_HPP__
8 #define __FWRENDERVTK_VTK_MARKEDSPHEREHANDLEREPRESENTATION_HPP__
9 #ifndef ANDROID
10 
11 #include "vtkHandleRepresentation.h"
12 #include "vtkSphereHandleRepresentation.h"
13 #include "vtkCylinderSource.h" // Needed for delegation to sphere
14 
15 class vtkProperty;
16 class vtkFollower;
17 class vtkCleanPolyData;
18 
19 #include "fwRenderVTK/config.hpp"
20 
21 namespace fwRenderVTK
22 {
23 
24 namespace vtk
25 {
26 
27 class FWRENDERVTK_CLASS_API MarkedSphereHandleRepresentation :
28  public vtkSphereHandleRepresentation
29 {
30 public:
31  // Description:
32  // Instantiate this class.
33  FWRENDERVTK_API static MarkedSphereHandleRepresentation* New();
34 
35  // Description:
36  // Standard methods for instances of this class.
37  vtkTypeMacro(MarkedSphereHandleRepresentation, vtkHandleRepresentation);
38  FWRENDERVTK_API void PrintSelf(ostream& os, vtkIndent indent) override;
39 
40  FWRENDERVTK_API virtual void SetWorldPosition(double p[3]) override;
41 
42  // Description:
43  // Set/Get the handle properties when unselected and selected.
44  FWRENDERVTK_API void SetMarkerProperty(vtkProperty*);
45  FWRENDERVTK_API vtkGetObjectMacro(MarkerProperty, vtkProperty);
46 
47  // Description:
48  // Methods to make this class properly act like a vtkWidgetRepresentation.
49  FWRENDERVTK_API virtual void BuildRepresentation() override;
50  FWRENDERVTK_API virtual void GetActors(vtkPropCollection*) override;
51  FWRENDERVTK_API virtual void ReleaseGraphicsResources(vtkWindow*) override;
52  FWRENDERVTK_API virtual int RenderOpaqueGeometry(vtkViewport* viewport) override;
53  FWRENDERVTK_API virtual int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
54  FWRENDERVTK_API virtual int HasTranslucentPolygonalGeometry() override;
55 
56 protected:
59 
60  // the cursor3D
61  vtkFollower* Follower;
62  vtkCleanPolyData* CleanPolyData;
63  vtkPolyDataMapper* MarkerMapper;
64  vtkCylinderSource* Marker;
65 
66  double MarkerRadiusFactor;
67 
68  // Properties used to control the appearance of selected objects and
69  // the manipulator in general.
70  vtkProperty* MarkerProperty;
71  void CreateDefaultProperties();
72 
73 private:
75  void operator=(const MarkedSphereHandleRepresentation&); //Not implemented
76 };
77 
78 } // namespace vtk
79 
80 } // namespace fwRenderVTK
81 
82 #endif //ANDROID
83 #endif //__FWRENDERVTK_VTK_MARKEDSPHEREHANDLEREPRESENTATION_HPP__
The namespace fwRenderVTK contains classes for rendering with VTK.