Medical Imaging Interaction Toolkit  2023.12.00
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 mitkTubeGraphVtkMapper3D_h
14 #define mitkTubeGraphVtkMapper3D_h
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 
112  LocalStorageHandler<LocalStorage> m_LSH;
113  };
114 } // namespace
115 
116 #endif
mitk::TubeGraphVtkMapper3D::EdgeDescriptorType
TubeGraph::EdgeDescriptorType EdgeDescriptorType
Definition: mitkTubeGraphVtkMapper3D.h:42
mitkTubeGraph.h
mitkLocalStorageHandler.h
mitk::TubeGraphVertex
Base Class for Tube Graph Vertices.
Definition: mitkTubeGraphVertex.h:25
vtkSmartPointer< vtkAssembly >
MITKTUBEGRAPH_EXPORT
#define MITKTUBEGRAPH_EXPORT
Definition: MitkTubeGraphExports.h:15
mitk::TubeGraph
Base Class for Tube Graphs.
Definition: mitkTubeGraph.h:43
itk::SmartPointer< Self >
mitk::TubeGraphVtkMapper3D
Definition: mitkTubeGraphVtkMapper3D.h:38
mitk::TubeGraphVtkMapper3D::VertexDescriptorType
TubeGraph::VertexDescriptorType VertexDescriptorType
Definition: mitkTubeGraphVtkMapper3D.h:43
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::TubeGraphEdge
Base Class for Tube Graph Edges.
Definition: mitkTubeGraphEdge.h:27
mitk::UndirectedGraph< TubeGraphVertex, TubeGraphEdge >::EdgeDescriptorType
boost::graph_traits< GraphType >::edge_descriptor EdgeDescriptorType
Definition: mitkUndirectedGraph.h:69
mitk::Mapper
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
mitk::VtkMapper
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:47
mitkTubeGraphProperty.h
mitk::Mapper::BaseLocalStorage
Base class for mapper specific rendering resources.
Definition: mitkMapper.h:190
mitkVtkMapper.h
mitkCircularProfileTubeElement.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::BaseRenderer
Definition: mitkBaseRenderer.h:56
MitkTubeGraphExports.h
mitk::UndirectedGraph< TubeGraphVertex, TubeGraphEdge >::VertexDescriptorType
boost::graph_traits< GraphType >::vertex_descriptor VertexDescriptorType
Definition: mitkUndirectedGraph.h:68