GlobeEngine
VolumeComposition.h
Go to the documentation of this file.
1 
9 #ifndef GlobeEngine_VolumeComposition_h
10 #define GlobeEngine_VolumeComposition_h
11 
12 #include "OpenGL_Includes.h"
13 #include "Composition.h"
14 #include "Texture.h"
15 #include "Cube.h"
16 #include <vmmlib/vmmlib.hpp>
17 
18 namespace geFlow {
19 
21  {
22  public:
25 
26  void enableUIFbo();
27  void disableUIFbo();
28  bool isUIFboactive();
29  //void setTexture(std::string _path);
30 
31  bool cmpf(float A, float B, float epsilon = 0.005f);
32  std::vector<std::vector<std::vector<long>>> getHistogramData();
33  std::vector<std::vector<float>> getMinimumHistValue();
34  std::vector<std::vector<float>> getMaximumHistValue();
35  void setLMIPThreshold(float _lmipThreshold);
36 
37  std::vector<std::vector<std::shared_ptr<ge::Texture3Df>>> getTextures();
38 
39 
40  void setTransferFunction(std::shared_ptr<ge::Texture1Drgba> _transferFunctionTexture);
41 
42  GLuint getHandle() const;
43 
44  void loadVolumeDataFromFileList(std::vector<std::vector<std::string>> _fileList, vmml::Vector3s _dim);
45 
46  void setBoundingBox(std::shared_ptr<ge::Cube> _boundingBox);
47  void updateTextureHandle(int _variable, int _timeStep);
48 
49  // set rendering parameters
50  void setSliceNumber(int _sliceNumber);
51  void setStepSize(float _stepSize);
52  void addTimestepVolume(vmml::Vector3s _dim,
53  float* _data, vmml::Vector2f _minmax = nullptr);
54 
55  protected:
56  void drawFrame(std::shared_ptr<ge::Camera> _cam);
57  void generateHistogram(vmml::Vector2f _minmax, int _sumDim, const float* _data);
58  private:
59  bool fboUIActive;
60 
61  std::shared_ptr<ge::Cube> boundingBox;
62  std::vector<std::vector<std::shared_ptr<ge::Texture3Df>>> volumeTextures;
63 
64  // rendering parameters
65  float sliceNumber = 0.0;
66  float stepSize = 0.01;
67 
68  int mode = 0;
69 
70  float lmipThreshold = 0.0;
71 
72  std::vector<std::vector<std::vector<long>>> histograms;
73  std::vector<std::vector<float>> minimumHistValue;
74  std::vector<std::vector<float>> maximumHistValue;
75  };
76 }
77 #endif
void generateHistogram(vmml::Vector2f _minmax, int _sumDim, const float *_data)
Definition: VolumeComposition.cpp:46
void setBoundingBox(std::shared_ptr< ge::Cube > _boundingBox)
Definition: VolumeComposition.cpp:36
std::vector< std::vector< std::shared_ptr< ge::Texture3Df > > > getTextures()
Definition: VolumeComposition.cpp:214
void addTimestepVolume(vmml::Vector3s _dim, float *_data, vmml::Vector2f _minmax=nullptr)
Definition: VolumeComposition.cpp:88
Definition: ArrowField.h:16
std::vector< std::vector< float > > getMinimumHistValue()
Definition: VolumeComposition.cpp:237
void setTransferFunction(std::shared_ptr< ge::Texture1Drgba > _transferFunctionTexture)
Definition: VolumeComposition.cpp:16
VolumeComposition()
Definition: VolumeComposition.cpp:6
~VolumeComposition()
Definition: VolumeComposition.cpp:11
void setLMIPThreshold(float _lmipThreshold)
Definition: VolumeComposition.cpp:245
void setSliceNumber(int _sliceNumber)
std::vector< std::vector< float > > getMaximumHistValue()
Definition: VolumeComposition.cpp:241
void enableUIFbo()
Definition: VolumeComposition.cpp:219
void updateTextureHandle(int _variable, int _timeStep)
Definition: VolumeComposition.cpp:205
std::vector< std::vector< std::vector< long > > > getHistogramData()
Definition: VolumeComposition.cpp:233
void drawFrame(std::shared_ptr< ge::Camera > _cam)
Definition: VolumeComposition.cpp:21
Definition: Composition.h:23
bool isUIFboactive()
Definition: VolumeComposition.cpp:225
void loadVolumeDataFromFileList(std::vector< std::vector< std::string >> _fileList, vmml::Vector3s _dim)
Definition: VolumeComposition.cpp:102
Definition: VolumeComposition.h:20
void disableUIFbo()
Definition: VolumeComposition.cpp:222
GLuint getHandle() const
bool cmpf(float A, float B, float epsilon=0.005f)
Definition: VolumeComposition.cpp:229
void setStepSize(float _stepSize)
Definition: VolumeComposition.cpp:41