Filter Library Camera Interface Physics

ControlHistogramCtrl.h

00001 /*
00002  * ControlHistogram.h - a histogram control.
00003  *
00004  * This file is part of the Camera Imaging Library.
00005  * Computer Aided Measurement Environment for Realtime Atomic imaging (Camera)
00006  *
00007  * Copyright (C) 2006, Leiden Probe Microscopy.
00008  * Copyright (C) 2006, Universiteit Leiden.
00009  *
00010  * Authors: Martin J. Moene
00011  *
00012  * $Id: ControlHistogramCtrl.h 427 2006-11-14 14:31:01Z moene $
00013  */
00014 
00015 #ifndef _CIL_CONTROLHISTOGRAMCTRL_H
00016 #define _CIL_CONTROLHISTOGRAMCTRL_H
00017 
00018 #if _MSC_VER > 1000
00019 #pragma once
00020 #endif // _MSC_VER > 1000
00021 
00022 #include <cfl/ScanBaseBuffer.h>                 // for ValueType
00023 #include <cil/ImageHistogramCalculator.h>       // for class ImageHistogramCalculator<>
00024 
00025 /* -----------------------------------------------------------------------
00026 ** class declarations
00027 ** -----------------------------------------------------------------------
00028  */
00029 
00030 /**
00031  * \addtogroup cfl_controlhistogram Histogram Control
00032  * \brief histogram control.
00033  *
00034  * @{
00035  */
00036 
00037 DECLARE_CLASS( CHistogramCtrl );            // declare various types for class
00038 
00039 /**
00040  * class CHistogramCtrl is a control to display a bar histogram.
00041  */
00042 class CHistogramCtrl : public CStatic
00043 {
00044    DECLARE_DYNAMIC( CHistogramCtrl )
00045 
00046    /**
00047     * this type.
00048     */
00049    typedef CHistogramCtrl Self;
00050 
00051 public:
00052    /**
00053     * the value type.
00054     */
00055    typedef double ValueType;
00056 
00057    /**
00058     * the histogram type.
00059     */
00060    typedef cil::ImageHistogramCalculator< ValueType > HistogramType;
00061 
00062 
00063    ///
00064    /// \name Construction
00065    /// @{
00066 
00067    /**
00068     * destructor.
00069     */
00070    ~CHistogramCtrl();
00071 
00072    /**
00073     * (default) constructor.
00074     */
00075    CHistogramCtrl();
00076 
00077    /// @}
00078    /// \name Operators
00079    /// @{
00080 
00081    /// @}
00082    /// \name Predicates
00083    /// @{
00084 
00085    /// @}
00086    /// \name Accessors
00087    /// @{
00088 
00089    /**
00090     * the number of bins.
00091     */
00092    int GetNumberOfBins() const;
00093 
00094    /**
00095     * the maximum count.
00096     */
00097    int GetMaximumCount() const;
00098 
00099    /// @}
00100    /// \name Mutators
00101    /// @{
00102 
00103    /**
00104     * set the histogram.
00105     */
00106    void SetHistogram( const HistogramType& histogram );
00107 
00108    /**
00109     * enable or disable autoscaling; Note: currently always autoscaling.
00110     */
00111    void SetAutoscale( bool autoscale );
00112 
00113    /**
00114     * set the full scale; Note: not implemented.
00115     */
00116    void SetFullscale( bool fullscale );
00117 
00118    /**
00119     * enable the horizontal cursor.
00120     */
00121    void EnableHorizontalCursor( bool enable );
00122 
00123    /**
00124     * set the horizontal cursor.
00125     */
00126    void SetHorizontalCursor( int percentage );
00127 
00128    /**
00129     * enable the vertical cursor.
00130     */
00131    void EnableVerticalCursor( bool enable );
00132 
00133    /**
00134     * set the vertical cursor 1.
00135     */
00136    void SetVerticalCursor1( int percentage );
00137 
00138    /**
00139     * set the vertical cursor 2.
00140     */
00141    void SetVerticalCursor2( int percentage );
00142 
00143    /**
00144     * set cursor color.
00145     */
00146    void SetCursorColor( COLORREF color );
00147 
00148    /**
00149     * set bin color.
00150     */
00151    void SetBinColor( COLORREF color );
00152 
00153    /**
00154     * set background color.
00155     */
00156    void SetBgColor( COLORREF bgcolor );
00157 
00158    /// @}
00159 
00160    // ClassWizard generated virtual function overrides
00161    //{{AFX_VIRTUAL(CHistogramCtrl)
00162 public:
00163    virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00164 protected:
00165    virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00166    virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
00167    virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00168    //}}AFX_VIRTUAL
00169 
00170 protected:
00171    /*
00172     * message map functions:
00173     */
00174    //{{AFX_MSG(CHistogramCtrl)
00175    afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00176    afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
00177    afx_msg void OnPaint();
00178 //    afx_msg void OnTimer(UINT nIDEvent);
00179    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00180    afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
00181    //}}AFX_MSG
00182 
00183    DECLARE_MESSAGE_MAP()
00184 
00185 protected:
00186    /**
00187     * copy-assignment constructor.
00188     */
00189    CHistogramCtrl( const Self& rhs );
00190 
00191    /**
00192     * assignment operator.
00193     */
00194    Self& operator= ( const Self& rhs );
00195 
00196 protected:
00197    /*
00198     * the histogram.
00199     */
00200    HistogramType m_histogram;
00201 
00202    /*
00203     * autoscale flag.
00204     */
00205    bool m_autoscale;
00206 
00207    /*
00208     * full scale value.
00209     */
00210    double m_fullscale;
00211 
00212    /*
00213     * horizontal cursor enable state.
00214     */
00215    bool m_horCursorOn;
00216 
00217    /*
00218     * vertical cursor enable state.
00219     */
00220    bool m_verCursorOn;
00221 
00222    /*
00223     * horizontal cursor.
00224     */
00225    int m_horCursor;
00226 
00227    /*
00228     * vertical cursor 1.
00229     */
00230    int m_verCursor1;
00231 
00232    /*
00233     * vertical cursor 2.
00234     */
00235    int m_verCursor2;
00236 
00237    /*
00238     * the cursor color.
00239     */
00240    COLORREF m_cursorColor;
00241 
00242    /*
00243     * the bar color.
00244     */
00245    COLORREF m_binColor;
00246 
00247    /*
00248     * the background color.
00249     */
00250    COLORREF m_bgColor;
00251 };
00252 
00253 //{{AFX_INSERT_LOCATION}}
00254 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00255 
00256 /// @} cfl_controlhistogram
00257 
00258 #endif // _CIL_CONTROLHISTOGRAMCTRL_H
00259 
00260 /*
00261  * end of file
00262  */

Camera Filter Library documentation © 2004-2007 by Leiden Probe Microscopy