GlobeEngine
VolumeRenderer.h
Go to the documentation of this file.
1 
9 #ifndef GlobeEngine_VolumeRenderer_h
10 #define GlobeEngine_VolumeRenderer_h
11 
12 #include "OpenGL_Includes.h"
13 #include "Camera.h"
14 #include "Cube.h"
15 #include "VolumeComposition.h"
16 #include "SceneStateSet.h"
17 #include <vmmlib/vmmlib.hpp>
18 
19 namespace geFlow {
20 
22  {
23  public:
26 
27  void clear();
28  void create(std::string _shaderpath, vmml::Vector2d _viewport, vmml::Vector3d _scale, vmml::Vector3d _position);
29  void draw(std::shared_ptr<ge::Camera> _cam);
30  void updateCompositions(vmml::Vector2d _viewport
31  , vmml::Vector2d _camViewport);
32 
36 
37  void isEnabled(bool _in);
38  bool isEnabled() const;
39 
40  void selectRayMarchingMethod(int _rayMarching);
41  void setLMIP(float _lmipThreshold);
42  void setStepSize(float _stepsize);
43  void updateTextureSelection(int _directory, int _timestep);
44 
45  void setTransferFunctionTextureData(unsigned char* _tfdata);
47 
48  std::shared_ptr<geFlow::VolumeComposition> getVolumeComposition() const;
49  GLuint getVolumeCompositionHandleForLayer(int _idx, int _timestep) const;
50  int getVolumeCompositionSize() const;
51  void setFramebufferStandardIDs(int _id);
52 
53  private:
54  ge::SceneStateSet sceneState;
55 
56  std::shared_ptr<ge::Cube> volumeBoundCube;
57  std::shared_ptr<ge::Shader> programForCubes;
58  std::shared_ptr<ge::Shader> programForEmissionAbsorption;
59  std::shared_ptr<ge::Shader> programForMaximumIntensityProjection;
60  std::shared_ptr<ge::Shader> programForMean;
61  std::shared_ptr<ge::Shader> programForFirstLocalMaximum;
62 
63  std::shared_ptr<geFlow::VolumeComposition> volumeComposition;
64 
65  std::shared_ptr<ge::Texture1Drgba> transferFunctionTexture;
66 
67  ge::FrameBufferObject frontFacesBuffer;
68  ge::FrameBufferObject backFacesBuffer;
69  ge::FrameBufferObject volumeBuffer;
70 
71  bool rayMarchingActive;
72  };
73 }
74 #endif
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: VolumeRenderer.cpp:56
void setFramebufferStandardIDs(int _id)
Definition: VolumeRenderer.cpp:184
void updateCompositions(vmml::Vector2d _viewport, vmml::Vector2d _camViewport)
Definition: VolumeRenderer.cpp:84
Definition: VolumeRenderer.h:21
Definition: ArrowField.h:16
const ge::FrameBufferObject & getFrontFaceBuffer() const
Definition: VolumeRenderer.cpp:111
void selectRayMarchingMethod(int _rayMarching)
Definition: VolumeRenderer.cpp:131
void clear()
Definition: VolumeRenderer.cpp:14
Definition: FrameBufferObject.h:20
void updateTransferfunction()
Definition: VolumeRenderer.cpp:191
void setTransferFunctionTextureData(unsigned char *_tfdata)
Definition: VolumeRenderer.cpp:164
void create(std::string _shaderpath, vmml::Vector2d _viewport, vmml::Vector3d _scale, vmml::Vector3d _position)
Definition: VolumeRenderer.cpp:18
GLuint getVolumeCompositionHandleForLayer(int _idx, int _timestep) const
Definition: VolumeRenderer.cpp:174
const ge::FrameBufferObject & getVolumeBuffer() const
Definition: VolumeRenderer.cpp:106
const ge::FrameBufferObject & getBackFaceBuffer() const
Definition: VolumeRenderer.cpp:116
VolumeRenderer()
Definition: VolumeRenderer.cpp:5
std::shared_ptr< geFlow::VolumeComposition > getVolumeComposition() const
Definition: VolumeRenderer.cpp:169
int getVolumeCompositionSize() const
Definition: VolumeRenderer.cpp:179
void updateTextureSelection(int _directory, int _timestep)
Definition: VolumeRenderer.cpp:159
void setLMIP(float _lmipThreshold)
Definition: VolumeRenderer.cpp:149
void setStepSize(float _stepsize)
Definition: VolumeRenderer.cpp:154
Definition: SceneStateSet.h:41
bool isEnabled() const
Definition: VolumeRenderer.cpp:126
~VolumeRenderer()
Definition: VolumeRenderer.cpp:10