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

mitkLight.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 
00011 #ifndef __mitkLight_h
00012 #define __mitkLight_h
00013 
00014 #include "mitkObject.h"
00015 #include "mitkVisualizationIncludes.h"
00016 
00023 class MITK_VISUALIZATION_API mitkLight : public mitkObject
00024 {
00025 public:
00026     MITK_TYPE(mitkLight,mitkObject)
00027 
00028     virtual void PrintSelf(ostream& os);
00029 
00030     mitkLight();    
00031     
00032     void SetColor(float r, float g, float b)  { m_Color[0] = r; m_Color[1] = g; m_Color[2] = b; m_Modified = true; }
00033     void SetColor(float color[3])  { m_Color[0] = color[0]; m_Color[1] = color[1]; m_Color[2] = color[2]; m_Modified = true; }
00034     void GetColor(float &r, float &g, float &b)  { r = m_Color[0]; g = m_Color[1]; b = m_Color[2]; } 
00035     void GetColor(float color[3])  { color[0] = m_Color[0]; color[1] = m_Color[1]; color[2] = m_Color[2]; } 
00036     float* GetColor() { return m_Color;}
00037 
00038     
00039     void SetPosition(float x, float y, float z) { m_Position[0] = x; m_Position[1] = y; m_Position[2] = z; m_Modified = true; }
00040     void SetPosition(float position[3]) { m_Position[0] = position[0]; m_Position[1] = position[1]; m_Position[2] = position[2]; m_Modified = true; }
00041     void GetPosition(float &x, float &y, float &z) { x = m_Position[0]; y = m_Position[1]; z = m_Position[2]; }
00042     void GetPosition(float position[3]) { position[0] = m_Position[0]; position[1] = m_Position[1]; position[2] = m_Position[2]; }
00043     float* GetPosition()  { return m_Position;}
00044   
00045 
00046     
00047     void  SetIntensity(float intensity) { m_Intensity = intensity; m_Modified = true; }
00048     float GetIntensity(void)  { return m_Intensity; }
00049 
00050     
00051     void SetSwitch(bool isOn)  { m_Switch = isOn; m_Modified = true; }
00052     void TurnOn()  { this->SetSwitch(true); }
00053     void TurnOff() { this->SetSwitch(false); }
00054     bool IsOn() { return m_Switch; }    
00055     
00056     
00057     void SetPositional(bool isPositional) { m_Positional = isPositional; m_Modified = true; }
00058     void SetPositionalOn()  { this->SetPositional(true); }
00059     void SetPositionalOff() { this->SetPositional(false); }
00060     bool IsPositional() { return m_Positional; }
00061     
00062     
00063     void  SetExponent(float exponent) { m_Exponent = exponent; m_Modified = true; }
00064     float GetExponent()  { return m_Exponent; }
00065     
00066     
00067     void  SetConeAngle(float angle) { m_ConeAngle = angle; m_Modified = true; }
00068     float GetConeAngle()  { return m_ConeAngle; }
00069     
00070     
00071     void SetAttenuationValues(float val1, float val2, float val3)  { m_AttenuationValues[0] = val1; m_AttenuationValues[1] = val2; m_AttenuationValues[2] = val3; m_Modified = true; } 
00072     void SetAttenuationValues(float val[3])  { m_AttenuationValues[0] = val[0]; m_AttenuationValues[1] = val[1]; m_AttenuationValues[2] = val[2]; m_Modified = true; }
00073     void GetAttenuationValues(float &val1, float &val2, float &val3) { val1 = m_AttenuationValues[0]; val2 = m_AttenuationValues[1]; val3 = m_AttenuationValues[2]; } 
00074     void GetAttenuationValues(float val[3]) { val[0] = m_AttenuationValues[0]; val[1] = m_AttenuationValues[1]; val[2] = m_AttenuationValues[2]; } 
00075     float* GetAttenuationValues() { return m_AttenuationValues; }   
00076 
00077     
00078     void SetFocalPoint(float x, float y, float z)  { m_FocalPoint[0] = x; m_FocalPoint[1] = y; m_FocalPoint[2] = z; m_Modified = true; } 
00079     void SetFocalPoint(float focalPoint[3])  { m_FocalPoint[0] = focalPoint[0]; m_FocalPoint[1] = focalPoint[1]; m_FocalPoint[2] = focalPoint[2]; m_Modified = true; }
00080     void GetFocalPoint(float &x, float &y, float &z) { x = m_FocalPoint[0]; y = m_FocalPoint[1]; z = m_FocalPoint[2];} 
00081     void GetFocalPoint(float facalPoint[3]) { facalPoint[0] = m_FocalPoint[0]; facalPoint[1] = m_FocalPoint[1]; facalPoint[2] = m_FocalPoint[2];} 
00082     float* GetFocalPoint() { return m_FocalPoint;}  
00083 
00084     bool IsModified() { return m_Modified; }
00085 
00086     void Render(int lightIndex);
00087     
00088 protected:  
00089     float m_Position[3];
00090     float m_Intensity;
00091     float m_Color[3];
00092     float m_Exponent;
00093     float m_ConeAngle;
00094     float m_AttenuationValues[3];   
00095     float m_FocalPoint[3];
00096     bool  m_Switch;
00097     bool  m_Positional;
00098     bool  m_Modified;
00099 
00100     virtual ~mitkLight();   
00101     
00102 private:
00103     mitkLight(const mitkLight&);
00104     void operator=(const mitkLight&);
00105 };
00106 
00107 
00108 //#define DEFINED_mitkLight
00109  
00110 
00111 
00112 #endif
00113 

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