Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkTubeGraphVtkMapper3D.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef TubeGraphVtkMapper3D_H_HEADER_INCLUDED
18 #define TubeGraphVtkMapper3D_H_HEADER_INCLUDED
19 
20 #include <MitkTubeGraphExports.h>
22 
24 #include "mitkTubeGraph.h"
25 #include "mitkTubeGraphProperty.h"
26 #include "mitkVtkMapper3D.h"
27 
28 #include <vtkActor.h>
29 #include <vtkAppendPolyData.h>
30 #include <vtkAssembly.h>
31 #include <vtkPolyData.h>
32 #include <vtkSmartPointer.h>
33 
34 namespace mitk
35 {
43  {
44  public:
45  /* Typedefs */
48 
50  itkNewMacro(Self);
55  virtual const TubeGraph *GetInput();
56  virtual vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
57 
58  protected:
60  virtual ~TubeGraphVtkMapper3D();
61 
65  virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
66 
76  virtual void GenerateTubeGraphData(mitk::BaseRenderer *renderer);
77 
81  virtual void RenderTubeGraphPropertyInformation(mitk::BaseRenderer *renderer);
82 
87  void GeneratePolyDataForTube(TubeGraphEdge &edge,
88  const TubeGraph::Pointer &graph,
89  const TubeGraphProperty::Pointer &graphProperty,
90  mitk::BaseRenderer *renderer);
91  void GeneratePolyDataForFurcation(TubeGraphVertex &vertex,
92  const TubeGraph::Pointer &graph,
93  mitk::BaseRenderer *renderer);
94  void ClipPolyData(TubeGraphVertex &vertex,
95  const TubeGraph::Pointer &graph,
96  const TubeGraphProperty::Pointer &graphProperty,
97  mitk::BaseRenderer *renderer);
98 
99  private:
100  bool ClipStructures();
101 
102  class LocalStorage : public mitk::Mapper::BaseLocalStorage
103  {
104  public:
105  vtkSmartPointer<vtkAssembly> m_vtkTubeGraphAssembly;
106  std::map<TubeGraph::TubeDescriptorType, vtkSmartPointer<vtkActor>> m_vtkTubesActorMap;
107  std::map<TubeGraph::VertexDescriptorType, vtkSmartPointer<vtkActor>> m_vtkSpheresActorMap;
108 
109  itk::TimeStamp m_lastGenerateDataTime;
110  itk::TimeStamp m_lastRenderDataTime;
111 
112  LocalStorage() { m_vtkTubeGraphAssembly = vtkSmartPointer<vtkAssembly>::New(); }
113  ~LocalStorage() {}
114  };
115 
116  LocalStorageHandler<LocalStorage> m_LSH;
117  };
118 } // namespace
119 
120 #endif
#define MITKTUBEGRAPH_EXPORT
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:200
Base Class for Tube Graphs.
Definition: mitkTubeGraph.h:37
Base Class for Tube Graph Vertices.
Organizes the rendering process.
DataCollection - Class to facilitate loading/accessing structured data.
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:53
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
TubeGraph::EdgeDescriptorType EdgeDescriptorType
boost::graph_traits< GraphType >::edge_descriptor EdgeDescriptorType
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Base Class for Tube Graph Edges.
boost::graph_traits< GraphType >::vertex_descriptor VertexDescriptorType
TubeGraph::VertexDescriptorType VertexDescriptorType
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.