cross_aln_pane.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
- /*
- * ===========================================================================
- * PRODUCTION $Log: cross_aln_pane.hpp,v $
- * PRODUCTION Revision 1000.1 2004/04/16 17:51:00 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.5
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_WIDGETS_ALN_CROSSALN___CROSS_ALN_PANE__HPP
- #define GUI_WIDGETS_ALN_CROSSALN___CROSS_ALN_PANE__HPP
- /* $Id: cross_aln_pane.hpp,v 1000.1 2004/04/16 17:51:00 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Vlad Lebedev
- *
- * File Description:
- * Panel for the cross alignment view widget
- * (see <gui/widgets/aln_crossaln/cross_aln_widget.hpp>)
- *
- */
- #include "cross_aln_render.hpp"
- #include <gui/gui.hpp>
- #include <gui/opengl.h>
- #include <gui/opengl/glcanvas2d.hpp>
- #include <gui/widgets/aln_crossaln/cross_aln_ds.hpp>
- #include <gui/widgets/aln_crossaln/cross_aln_widget.hpp>
- #include <gui/widgets/seq_graphic/seqgraphic_conf.hpp>
- #include <gui/widgets/gl/mouse_zoom_handler.hpp>
- #include <gui/widgets/fl/tooltip.hpp>
- #include <FL/Fl.H>
- BEGIN_NCBI_SCOPE
- class CCrossAlnPane : public CGlCanvas2d,
- public IMouseZoomHandlerHost, // for zooming with mouse
- public ITooltipClient // for using with "active" CTooltip
- {
- public:
- CCrossAlnPane(int x, int y, int w, int h, const char* label = NULL);
- virtual ~CCrossAlnPane();
- void SetDataSource(CCrossAlnDataSource* ds);
- void Update();
-
- void FitToWindow (void);
- void ZoomToSequence (void);
- void ZoomOnRange (const TSeqRange& range);
- void ZoomOnAlignment();
-
- TSeqRange GetVisibleRange();
-
- void Scroll(TModelUnit x1, TModelUnit y1, TModelUnit x2, TModelUnit y2);
-
- void SetConfig(CRef<CSeqGraphicConfig> config);
- // set/clear selections
- void SelectObject(const CLayoutObject* obj);
- void SelectObject(const CObject* obj);
- void ClearSelection();
- // retrieve the selections from our renderer
- const TConstObjects& GetSelectedObjects(void) const;
-
- // IMouseZoomHandlerHost implementation
- virtual TModelUnit MZHH_GetScale(EScaleType type);
- virtual void MZHH_SetScale(TModelUnit scale, const TModelPoint& point);
- virtual void MZHH_ZoomRect(const TModelRect& rc);
- virtual void MZHH_Scroll(TModelUnit d_x, TModelUnit d_y);
- virtual TVPUnit MZHH_GetVPPosByY(int y) const;
- virtual void MZHH_Redraw(void);
- // IMouseZoomHandlerHost end
-
- // ITooltipClient implementation
- virtual bool TC_NeedTooltip(int x, int y);
- virtual string TC_GetTooltip(int& x, int& y, int& w, int& h);
- // ITooltipClient end
- private:
- CRef<CCrossAlnDataSource> m_DS;
- CRef<CCrossAlnRenderer> m_Renderer;
- CRef<CSeqGraphicConfig> m_ConfigSettings;
-
- CCrossAlnRenderer::TRendererPanel m_HitPanel;
- CGlPane* m_HitPane;
- CMouseZoomHandler m_MouseZoomHandler;
- CGUIEvent m_Event;
- // For Tooltips
- CTooltip m_Tooltip;
- string m_TooltipText;
- // --- Virtual (FLTK)
- virtual void draw();
- virtual int handle(int event);
- // --- Methods
- void x_AdjustScrollBars (void);
- };
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: cross_aln_pane.hpp,v $
- * Revision 1000.1 2004/04/16 17:51:00 gouriano
- * PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.5
- *
- * Revision 1.5 2004/04/16 14:49:02 dicuccio
- * Use TConstObjects for handling object selections
- *
- * Revision 1.4 2004/03/11 17:50:41 dicuccio
- * Updated typedefs: dropped TDimension, TPosition, TIndex, TColor; use TSeqRange
- * instead of TRange
- *
- * Revision 1.3 2004/01/27 16:20:41 lebedev
- * Changed stored selection from CLayoutObject to CObject
- *
- * Revision 1.2 2004/01/16 13:40:39 lebedev
- * Tooltips added
- *
- * Revision 1.1 2003/12/22 13:12:33 lebedev
- * Initial revision
- *
- * ===========================================================================
- */
- #endif /* GUI_WIDGETS_ALN_CROSSALN___CROSS_ALN_PANE__HPP */