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

mitkTF2DRGBAClassifier.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 __mitkTF2DRGBAClassifier_h
00011 #define __mitkTF2DRGBAClassifier_h
00012 
00013 #include "mitkObject.h"
00014 #include "mitkVisualizationIncludes.h"
00015 
00025 class MITK_VISUALIZATION_API mitkTF2DRGBAClassifier : public mitkObject  
00026 {
00027 public:
00028     MITK_TYPE(mitkTF2DRGBAClassifier, mitkObject)
00029 
00030     mitkTF2DRGBAClassifier();
00031     
00037     void SetLeft( int left );
00038 
00044     void SetRight( int right );
00045 
00051     void SetBottom( int bottom );
00052 
00058     void SetTop( int top );
00059 
00067     void SetCenter( int centerX, int centerY );
00068 
00074     void Move(int deltaX,int deltaY);   
00075 
00080     void SetMaxOpacity( float MaxOpacity );
00081 
00086     void SetMinOpacity( float MinOpacity );
00087 
00094     void SetColor( float r, float g, float b );
00095 
00101     int GetLeft() const
00102     {
00103         return m_left;  
00104     }
00105 
00111     int GetRight() const
00112     {
00113         return m_right;
00114     }
00115 
00121     int GetBottom() const
00122     {
00123         return m_bottom;
00124     }
00125 
00131     int GetTop() const
00132     {
00133         return m_top;
00134     }
00135 
00143     void GetCenter( int& centerX, int& centerY ) const
00144     {
00145         centerX = m_centerX;
00146         centerY = m_centerY;
00147     }
00148 
00153     float GetMaxOpacity() const
00154     {
00155         return m_MaxOpacity;
00156     }
00157 
00162     float GetMinOpacity() const
00163     {
00164         return m_MinOpacity;
00165     }
00166 
00171     const float* GetColor() const
00172     {
00173         return m_Color;
00174     }
00175 
00182     void GetColor( float& r, float& g, float& b ) const
00183     {
00184         r = m_Color[0]; g = m_Color[1];  b = m_Color[2];
00185     }
00186 
00192     bool IsModified()
00193     {
00194         return m_UserNeedUpdate;
00195     }
00196 
00200     void SetUnmodified()
00201     {
00202         m_UserNeedUpdate = false;
00203     }   
00204 
00210     float * GetCurve();
00211 
00216     void Update();
00217 
00218 protected:
00219     virtual ~mitkTF2DRGBAClassifier();
00220     // called to update curve values according to parameters
00221     void    UpdateCurve();              
00222     // done by subclasses, performing actual calculation
00223     virtual void _updateCurve() = 0;    
00224 
00225     //set true when any of the boundaries or center point changed
00226     bool    m_CurveNeedUpdate;          
00227     // set true when color/opacity changed or curve value updated
00228     bool    m_UserNeedUpdate;           
00229 
00230     // parameters controlling the curve values
00231     int m_left, m_right, m_top, m_bottom, m_centerX, m_centerY; 
00232     
00233     // maximal Opacity
00234     float   m_MaxOpacity;               
00235     // minimal Opacity
00236     float   m_MinOpacity;               
00237 
00238     // Color of this Classifier
00239     float   m_Color[3]; 
00240     
00241 
00242     // Curve values of this classifier, in range 0~1, 
00243     // defining the shape of the classifier
00244     float   *m_Curve;               
00245 
00246 
00247 private:
00248     mitkTF2DRGBAClassifier(const mitkTF2DRGBAClassifier&);
00249     void operator = (const mitkTF2DRGBAClassifier&);
00250 
00251 };
00252 
00253  
00254 //#define DEFINED_mitkTF2DRGBAClassifier
00255  
00256 
00257 
00258 #endif
00259 

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