Medical Imaging Interaction Toolkit  2022.04.99-2e1e005b
Medical Imaging Interaction Toolkit
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef TubeGraphVtkMapper3D_H_HEADER_INCLUDED
14 #define TubeGraphVtkMapper3D_H_HEADER_INCLUDED
15 
16 #include <MitkTubeGraphExports.h>
18 
20 #include "mitkTubeGraph.h"
21 #include "mitkTubeGraphProperty.h"
22 #include "mitkVtkMapper.h"
23 
24 #include <vtkActor.h>
25 #include <vtkAppendPolyData.h>
26 #include <vtkAssembly.h>
27 #include <vtkPolyData.h>
28 #include <vtkSmartPointer.h>
29 
30 namespace mitk
31 {
39  {
40  public:
41  /* Typedefs */
44 
46  itkNewMacro(Self);
51  virtual const TubeGraph *GetInput();
52  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
53 
54  protected:
56  ~TubeGraphVtkMapper3D() override;
57 
61  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
62 
72  virtual void GenerateTubeGraphData(mitk::BaseRenderer *renderer);
73 
77  virtual void RenderTubeGraphPropertyInformation(mitk::BaseRenderer *renderer);
78 
83  void GeneratePolyDataForTube(TubeGraphEdge &edge,
84  const TubeGraph::Pointer &graph,
85  const TubeGraphProperty::Pointer &graphProperty,
86  mitk::BaseRenderer *renderer);
87  void GeneratePolyDataForFurcation(TubeGraphVertex &vertex,
88  const TubeGraph::Pointer &graph,
89  mitk::BaseRenderer *renderer);
90  void ClipPolyData(TubeGraphVertex &vertex,
91  const TubeGraph::Pointer &graph,
92  const TubeGraphProperty::Pointer &graphProperty,
93  mitk::BaseRenderer *renderer);
94 
95  private:
96  bool ClipStructures();
97 
98  class LocalStorage : public mitk::Mapper::BaseLocalStorage
99  {
100  public:
101  vtkSmartPointer<vtkAssembly> m_vtkTubeGraphAssembly;
102  std::map<TubeGraph::TubeDescriptorType, vtkSmartPointer<vtkActor>> m_vtkTubesActorMap;
103  std::map<TubeGraph::VertexDescriptorType, vtkSmartPointer<vtkActor>> m_vtkSpheresActorMap;
104 
105  itk::TimeStamp m_lastGenerateDataTime;
106  itk::TimeStamp m_lastRenderDataTime;
107 
108  LocalStorage() { m_vtkTubeGraphAssembly = vtkSmartPointer<vtkAssembly>::New(); }
109  ~LocalStorage() override {}
110  };
111 
113  };
114 } // namespace
115 
116 #endif
#define MITKTUBEGRAPH_EXPORT
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:190
Base Class for Tube Graphs.
Definition: mitkTubeGraph.h:43
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:48
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
TubeGraph::EdgeDescriptorType EdgeDescriptorType
boost::graph_traits< GraphType >::edge_descriptor EdgeDescriptorType
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
Base Class for Tube Graph Edges.
boost::graph_traits< GraphType >::vertex_descriptor VertexDescriptorType
TubeGraph::VertexDescriptorType VertexDescriptorType