Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkOrthogonalImageModel.h

00001 /*=========================================================================
00002 
00003   Program:   3DMed
00004   Date:      $Date: 2014-02-25 18:30:00 +0800 $
00005   Version:   $Version: 4.6.0 $
00006   Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences
00007 
00008 =========================================================================*/
00009 
00010 #ifndef __mitkOrthogonalImageModel_h
00011 #define __mitkOrthogonalImageModel_h
00012 
00013 #include "mitkDataModel.h"
00014 #include "mitkImageModel.h"
00015 
00018 class MITK_VISUALIZATION_API mitkOrthogonalImageModel : public mitkDataModel
00019 {
00020 public:
00021     MITK_TYPE(mitkOrthogonalImageModel, mitkDataModel)
00022 
00023     virtual void PrintSelf(ostream &os);
00024 
00028     mitkOrthogonalImageModel();
00029 
00033     mitkOrthogonalImageModel(mitkVolume* vol);
00034 
00038     void CleanUp();
00039 
00044     void SetData(mitkVolume *data);
00045 
00050     mitkVolume* GetData(void);
00051 
00058     virtual int Render(mitkScene *scene);
00059 
00064     virtual bool IsOpaque() { return 0; }
00065 
00066     void SetOpaque(bool o) { m_FlagOpaque =o; }
00067 
00068     void SetColor(float r, float g, float b, float a = 1.0f);
00069 
00070     void SetColor(int r, int g, int b, int a = 255);
00071 
00072     void SetCurrentPosition(float xy, float yz, float xz);
00073     void GetCurrentPosition(float p[3]);
00074     void SetXYPlanePos(float pos);
00075     void SetYZPlanePos(float pos);
00076     void SetXZPlanePos(float pos);
00077 
00078     void SetCurrentSlice(int xy, int yz, int xz);
00079     void GetCurrentSlice(int s[3]);
00080     void SetXYPlaneSlice(int s);
00081     void SetYZPlaneSlice(int s);
00082     void SetXZPlaneSlice(int s);
00083 
00084     void SetBoundingboxFlag(bool f) { m_FlagShowBoundingBox = f; }
00085 
00086     void SetShowFrameFlag(bool f) { m_FlagShowFrame = f; }
00087 
00088     void ShowXYPlane(bool f) { m_FlagShowXY = f; }
00089 
00090     void ShowYZPlane(bool f) { m_FlagShowYZ = f; }
00091 
00092     void ShowXZPlane(bool f) { m_FlagShowXZ = f; }
00093 
00094     void SetWindowWidthAndCenter(unsigned int plane, float w, float c);
00095 
00096     void AdjustWidthCenter(unsigned int plane, int viewWidth, int viewHeight, float deltX, float deltY);
00097 
00098 protected:
00099     virtual ~mitkOrthogonalImageModel();
00100     virtual float* _getBounds();
00101     
00102     // Initialize.
00103     void _init();
00104     void _initOpenGL();
00105     void _initTexAttributes();              //for all planes
00106     bool _loadTexture(unsigned int plane);  //for a modified plane (plane = 0: X-Y; 1: Y-Z; 2: Z-X)
00107     void _setDummyTexture();                //for all planes 
00108 
00109     // Attributes for textures
00110     struct TexAttrib 
00111     {
00112         float           Spacings[3];
00113         int             Incs[3];
00114         int             TexImageWidth;
00115         int             TexImageHeight;
00116         int             DummyTexWidth;
00117         int             DummyTexHeight;
00118         int             TotalSlice;
00119         float           WindowCenter;
00120         float           WindowWidth;
00121         unsigned int    TexId;  
00122     };
00123 
00124     mitkVolume*         m_Data;
00125     vector<TexAttrib>   m_TexAttrib;
00126     
00127     float               m_BoxColor[4];
00128     float               m_AxialSurfaceColor[4];
00129     float               m_SagittalSurfaceColor[4];
00130     float               m_CoronalSurfaceColor[4];
00131     float               m_LineWidth;
00132     
00133     int                 m_CurrentSlice[3];
00134     float               m_CurrentPosition[3];
00135     int                 m_CurrentTex[3];
00136 
00137     bool                m_FlagShowBoundingBox;
00138     bool                m_FlagShowXY;
00139     bool                m_FlagShowYZ;
00140     bool                m_FlagShowXZ;
00141     bool                m_FlagShowFrame;
00142     bool                m_NeedSetDummyTexture;
00143     bool                m_FlagOpaque;
00144 
00145 private:
00146     mitkOrthogonalImageModel(const mitkOrthogonalImageModel&);
00147     void operator = (const mitkOrthogonalImageModel&);
00148 
00149 };
00150 
00151 #ifdef MITK_DLL_EXPORT
00152 #define DEFINED_mitkOrthogonalImageModel
00153 #include "mitkTemplateExport.h"
00154 #endif      // MITK_DLL_EXPORT
00155 
00156 #endif

Generated on Tue Feb 25 15:00:37 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3