fw4spl
Helpers.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWRENDERVTK_VTK_HELPERS_HPP__
8 #define __FWRENDERVTK_VTK_HELPERS_HPP__
9 
10 #include <vtkType.h>
11 #include <vtkSmartPointer.h>
12 
13 #include "fwRenderVTK/config.hpp"
14 
15 class vtkProp;
16 class vtkPoints;
17 class vtkRenderer;
18 class vtkAbstractPropPicker;
19 class vtkRenderWindow;
20 
21 #ifndef ANDROID
22 
23 #if VTK_MAJOR_VERSION < 7
24 #include <vtkShaderProgram2.h>
25 #include <vtkShader2.h>
26 #include <vtkShader2Collection.h>
27 #else
28 #include <vtkShaderProgram.h>
29 #include <vtkShader.h>
30 #endif // VTK_MAJOR_VERSION < 7
31 
32 #endif // ANDROID
33 
34 namespace fwRenderVTK
35 {
36 namespace vtk
37 {
38 
39 FWRENDERVTK_API vtkIdType getNearestPointId(vtkPoints* pts, vtkRenderer* renderer);
40 FWRENDERVTK_API vtkProp* getNearestPickedProp(vtkAbstractPropPicker* picker, vtkRenderer* renderer);
41 FWRENDERVTK_API bool getNearestPickedPosition(vtkAbstractPropPicker* picker, vtkRenderer* renderer,
42  double* position);
43 
44 #ifndef ANDROID
45 #if VTK_MAJOR_VERSION < 7
46 FWRENDERVTK_API vtkSmartPointer<vtkShaderProgram2> buildShader(vtkRenderWindow* pWindow,
47  const char* pcVertexShader,
48  const char* pcFragmentShader );
49 
50 FWRENDERVTK_API vtkSmartPointer<vtkShaderProgram2> buildShaderFromFile( vtkRenderWindow* pWindow,
51  const char* pcVertexName,
52  const char* pcFragmentName );
53 #else
54 FWRENDERVTK_API vtkSmartPointer<vtkShaderProgram> buildShader(vtkRenderWindow* pWindow,
55  const char* pcVertexShader,
56  const char* pcFragmentShader );
57 
58 FWRENDERVTK_API vtkSmartPointer<vtkShaderProgram> buildShaderFromFile( vtkRenderWindow* pWindow,
59  const char* pcVertexName,
60  const char* pcFragmentName );
61 #endif // VTK_MAJOR_VERSION < 7
62 #endif
63 
64 } //vtk
65 } //fwRenderVTK
66 
67 #endif //__FWRENDERVTK_VTK_HELPERS_HPP__
68 
The namespace fwRenderVTK contains classes for rendering with VTK.