Medical Imaging Interaction Toolkit  2022.04.99-194dd5d8
Medical Imaging Interaction Toolkit
mitkContourModelGLMapper2DBase.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_ContourModelGLMapper2DBase_H_
14 #define MITK_ContourModelGLMapper2DBase_H_
15 
16 #include "mitkCommon.h"
17 #include "mitkMapper.h"
18 #include "mitkTextAnnotation2D.h"
20 #include <vtkSmartPointer.h>
21 
22 class vtkContext2D;
23 class vtkOpenGLContextDevice2D;
24 class vtkPen;
25 
26 namespace mitk
27 {
28  class BaseRenderer;
29  class ContourModel;
30 
38  {
39  public:
41 
42  void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor * actor = nullptr) override;
43 
44  protected:
46 
48 
49  ~ContourModelGLMapper2DBase() override;
50 
51  void DrawContour(mitk::ContourModel *contour, mitk::BaseRenderer *renderer);
52 
53  void WriteTextWithAnnotation(
54  TextAnnotationPointerType textAnnotation, const char *text, float rgb[3], Point2D pt2d, mitk::BaseRenderer *);
55 
56  virtual void InternalDrawContour(mitk::ContourModel *renderingContour, mitk::BaseRenderer *renderer);
57 
58  TextAnnotationPointerType m_PointNumbersAnnotation;
59  TextAnnotationPointerType m_ControlPointNumbersAnnotation;
60 
61  typedef std::vector<BaseRenderer *> RendererListType;
62  RendererListType m_RendererList;
63 
64  private:
65  struct LocalStorage
66  {
67  vtkSmartPointer<vtkOpenGLContextDevice2D> Device;
68  vtkSmartPointer<vtkContext2D> Context;
69  };
70 
71  LocalStorageHandler<LocalStorage> m_LocalStorageHandler;
72  };
73 
74 } // namespace mitk
75 
76 #endif
TextAnnotationPointerType m_PointNumbersAnnotation
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
std::vector< BaseRenderer * > RendererListType
Organizes the rendering process.
#define MITKCONTOURMODEL_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:46
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
TextAnnotation2D::Pointer TextAnnotationPointerType
Base class for OpenGL based 2D mappers. Provides functionality to draw a contour. ...
TextAnnotationPointerType m_ControlPointNumbersAnnotation