rawVolModelRenderer.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EVOLVE_RAW_VOL_MODEL_RENDERER_H
00019 #define EVOLVE_RAW_VOL_MODEL_RENDERER_H
00020
00021 #include "rawVolModel.h"
00022 #include "sliceClipping.h"
00023 #include "glslShaders.h"
00024
00025
00026 namespace eVolve
00027 {
00028
00029 class RawVolumeModelRenderer
00030 {
00031 public:
00032 RawVolumeModelRenderer( const std::string& filename,
00033 const uint32_t precision = 1 );
00034
00035 bool loadHeader( const float brightness, const float alpha )
00036 {
00037 return _rawModel.loadHeader( brightness, alpha );
00038 }
00039
00040 const VolumeScaling& getVolumeScaling() const
00041 {
00042 return _rawModel.getVolumeScaling();
00043 }
00044
00045 void glewSetContext( GLEWContext* context )
00046 {
00047 _glewContext = context;
00048 _rawModel.glewSetContext( context );
00049 }
00050
00051
00052 bool render( const eq::Range& range,
00053 const eq::Matrix4d& modelviewM,
00054 const eq::Matrix3d& modelviewITM,
00055 const eq::Matrix4f& invRotationM );
00056
00057 void setPrecision( const uint32_t precision ){ _precision = precision; }
00058 void setOrtho( const uint32_t ortho ) { _ortho = ortho; }
00059
00060 GLEWContext* glewGetContext() { return _glewContext; }
00061 bool loadShaders();
00062
00063 private:
00064 void _putVolumeDataToShader( const VolumeInfo& volumeInfo,
00065 const double sliceDistance,
00066 const eq::Matrix4f& invRotationM );
00067
00068 RawVolumeModel _rawModel;
00069 SliceClipper _sliceClipper;
00070 uint32_t _precision;
00071 GLSLShaders _shaders;
00072
00073 GLEWContext* _glewContext;
00074
00075 bool _ortho;
00076
00077 };
00078
00079 }
00080 #endif // EVOLVE_RAW_VOL_MODEL_RENDERER_H
00081