Medical Imaging Interaction Toolkit  2022.04.99-194dd5d8
Medical Imaging Interaction Toolkit
mitkContourModelMapper2D.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 _MITK_CONTOURMODEL_MAPPER_H_
14 #define _MITK_CONTOURMODEL_MAPPER_H_
15 
16 #include "mitkCommon.h"
18 
19 #include "mitkBaseRenderer.h"
20 #include "mitkVtkMapper.h"
21 
22 #include "mitkContourModel.h"
23 //#include "mitkContourModelToVtkPolyDataFilter.h"
24 
25 #include <vtkActor.h>
26 #include <vtkPolyData.h>
27 #include <vtkPolyDataMapper.h>
28 #include <vtkProp.h>
29 #include <vtkSmartPointer.h>
30 
31 namespace mitk
32 {
34  {
35  public:
38 
40  itkFactorylessNewMacro(Self);
41  itkCloneMacro(Self);
42 
43  const mitk::ContourModel *GetInput(void);
44 
47  void Update(mitk::BaseRenderer *renderer) override;
48 
49  /*+++ methods of MITK-VTK rendering pipeline +++*/
50  vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
51  /*+++ END methods of MITK-VTK rendering pipeline +++*/
52 
54  {
55  public:
57  vtkSmartPointer<vtkActor> m_Actor;
59  vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
60 
61  // mitk::ContourModelToVtkPolyDataFilter::Pointer m_contourToPolyData;
62 
63  vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
64 
66  itk::TimeStamp m_LastUpdateTime;
67 
69  LocalStorage();
71  ~LocalStorage() override {}
72  };
73 
76 
78  LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
79 
81  static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
82 
83  protected:
85  ~ContourModelMapper2D() override;
86 
87  void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
88 
89  virtual vtkSmartPointer<vtkPolyData> CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour,
90  mitk::BaseRenderer *renderer);
91 
92  virtual void ApplyContourProperties(mitk::BaseRenderer *renderer);
93  };
94 }
95 #endif
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
Base class for mapper specific rendering ressources.
Definition: mitkMapper.h:190
Organizes the rendering process.
#define MITKCONTOURMODEL_EXPORT
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
~LocalStorage() override
Default deconstructor of the local storage.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
mitk::LocalStorageHandler< LocalStorage > m_LSH
The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
vtkSmartPointer< vtkPolyData > m_OutlinePolyData
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63