Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkGLMapper.cpp
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 #include "mitkGLMapper.h"
18 #include "mitkGL.h"
19 
21 {
22 }
23 
25 {
26 }
27 
29 {
30  bool visible = true;
31 
32  GetDataNode()->GetVisibility(visible, renderer, "visible");
33 
34  if (!visible)
35  return;
36 
37  // the if-condition ensures that Paint(renderer) is only called once, otherwise it will be called four times
38  // it does not mean that OpenGL renders only an opaque scene
40  Paint(renderer);
41 }
42 
44 {
45  return false;
46 }
47 
49 {
50  float rgba[4] = {1.0f, 1.0f, 1.0f, 1.0f};
51  // check for color prop and use it for rendering if it exists
52  GetDataNode()->GetColor(rgba, renderer, "color");
53  // check for opacity prop and use it for rendering if it exists
54  GetDataNode()->GetOpacity(rgba[3], renderer, "opacity");
55 
56  glColor4fv(rgba);
57 }
virtual ~GLMapper()
Organizes the rendering process.
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override
Checks visibility and calls the paint method.
virtual void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor=NULL) override
Apply color and opacity properties read from the PropertyList. The actor is not used in the GLMappers...
GLMapper()
Returns whether this mapper allows picking in the renderwindow virtual bool IsPickable() const { retu...
virtual bool IsVtkBased() const override
Returns whether this is a vtk-based mapper.