00001 #ifndef __CSCANNER_H__
00002 #define __CSCANNER_H__
00003
00004 #include "utilityfuncs.h"
00005
00013 class CScanner
00014 {
00015 public:
00016
00017 int direction;
00018
00019 CScanner() { _xRes = 0; _yRes = 0; _aView = 0; _bRaySet = false; direction = 0; }
00020 ~CScanner() { Shutdown(); }
00021
00022 Init();
00023 Shutdown() { delete[] _aView; _aView = 0; }
00024 void SetProjEye(sPoint3f eye);
00025
00026 void ScanVolume();
00027 void GenerateComposite();
00028
00033 void GenerateXRAY();
00034
00040 void GenerateMIP();
00041
00046 void GenerateFirstHit();
00047
00053 bool GetIntersectionPoints(sPoint3f *pBeginCoord, sPoint3f *pEndCoord,
00054 sPoint3f eye, sVector3f ray);
00055 void GetXYIntersectionPoints(sPoint3f eye,sVector3f ray);
00056 void GetYZIntersectionPoints(sPoint3f eye,sVector3f ray);
00057 void GetXZIntersectionPoints(sPoint3f eye,sVector3f ray);
00058
00063 void SampleAlongRay(sPoint3f beginCoord, sPoint3f endCoord,sRGBA * pRGBA);
00064
00071 float SampleXRAYAlongRay(sPoint3f beginCoord, sPoint3f endCoord);
00072
00079 float SampleMIPAlongRay(sPoint3f beginCoord, sPoint3f endCoord);
00080
00086 void SampleFirstHitAlongRay(sPoint3f beginCoord, sPoint3f endCoord, sRGBA *pRGBA);
00087 void SampleFHAlongRay(sPoint3f beginCoord, sPoint3f endCoord, sRGBA *pRGBA);
00088
00093 float GetDiffuseValue(sPoint3f coordinate);
00094 float *GetView() { return (float *)_aView;}
00095
00096 unsigned GetTexWidth() { return (unsigned)_xRes; }
00097 unsigned GetTexHeight(){ return (unsigned)_yRes; }
00098 unsigned long GetTexSize() { return _sizeProjection; }
00099
00100 private:
00101
00102 sPoint3f _eye;
00103 sPoint3f _projEye;
00104 sVector3f _ray;
00105 float _xRes, _yRes;
00106 float _fStepSize, _scanRange;
00107 sPoint3f _range;
00108 sVector3f _xPlane, _yPlain, _zPlain;
00109 CVector3f _aIntersectionPoints[2];
00110
00111 sRGBA * _aView;
00112
00113 short _wProjection, _hProjection;
00114 unsigned long _sizeProjection;
00115 unsigned _iXCount;
00116 GLfloat _yTheta;
00117 GLfloat cos_theta, sin_theta,cos_x_theta, sin_x_theta, sin_alpha, cos_alpha;
00118 bool _bRaySet;
00119 };
00120
00121 #endif