features_panel_ir.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:8k
- /*
- * ===========================================================================
- * PRODUCTION $Log: features_panel_ir.hpp,v $
- * PRODUCTION Revision 1000.2 2004/06/01 19:53:18 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.14
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_WIDGET_SEQ_GRAPHICS___FEATURES_PANEL_IR__HPP
- #define GUI_WIDGET_SEQ_GRAPHICS___FEATURES_PANEL_IR__HPP
- /* $Id: features_panel_ir.hpp,v 1000.2 2004/06/01 19:53:18 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
- *
- */
- #include <gui/gui.hpp>
- #include <objmgr/bioseq_handle.hpp>
- #include <gui/widgets/gl/irenderable.hpp>
- #include <gui/widgets/gl/ipolicy.hpp>
- #include <gui/widgets/seq_graphic/ilayoutpolicy.hpp>
- #include <gui/opengl/glbitmapfont.hpp>
- #include <gui/objutils/feature.hpp>
- #include <gui/objutils/alignment.hpp>
- #include <gui/objutils/graph.hpp>
- #include <gui/objutils/comment.hpp>
- #include <gui/objutils/prot_product.hpp>
- #include <gui/objutils/utils.hpp>
- #include <gui/objutils/feat_label.hpp>
- #include <gui/objutils/label.hpp>
- #include <gui/widgets/seq_graphic/seqgraphic_conf.hpp>
- #include <objmgr/util/feature.hpp>
- #include <objects/seq/Seq_annot.hpp>
- BEGIN_NCBI_SCOPE
- class NCBI_GUIWIDGETS_SEQGRAPHIC_EXPORT CFeaturesPanelIR : public IRenderable
- {
- public:
-
- CFeaturesPanelIR();
- virtual ~CFeaturesPanelIR(void);
- // IRenderable interfaces
- TVPRect GetVPRect();
- TModelRect GetModelRect();
- void Render(CGlPane& pane);
- void SetHandle(const objects::CBioseq_Handle& handle);
- void SetConfig(CSeqGraphicConfig* config);
-
- void SetRenderPolicy(IPolicy* policy);
- void SetLayoutPolicy(ILayoutPolicy* policy);
-
- void SetSelectedObjects(TConstObjects* objs);
-
- TModelUnit GetHeight(CGlPane& pane);
- const CLayoutObject* HitTest(CGlPane& pane, int x, int y);
- void GetTooltip(const CLayoutObject* obj, string* title) const;
-
- // For CGI mode
- void GetHTMLActiveAreas(CGlPane& pane, IPolicy::TAreaVector* p_areas);
- protected:
- objects::CBioseq_Handle m_Handle;
- CRef<CSeqGraphicConfig> m_ConfigSettings;
- CRef<IPolicy> m_RenderPolicy;
- CRef<ILayoutPolicy> m_LayoutPolicy;
-
- TModelUnit m_RowCount;
- TModelPoint m_LastClick;
-
- bool x_IsObjectSelected(const CLayoutObject* obj) const;
- // Our layout. The rendering code will draw whatever objects are there.
- // It's up to the panel to fill it with layoutable objects.
- CLayout m_PackedObjects;
-
- private:
-
- // Simple grids
- void x_DrawXGrid (CGlPane& pane) const;
- TConstObjects* m_SelectedObjects;
- // main iterator.
- const CLayoutObject* x_MainObjectIterator(CGlPane& pane,
- IPolicy::EObj_IterMode mode);
-
- // is it enougth space to sequence letters?
- bool x_IsSeqLettersFit(CGlPane& pane) const;
- void x_DecomposeToLeaves(const CLayoutFeat* feat,
- vector<CLayoutFeat::TFeatList>& leaves);
- void x_DecomposeToLeaves(const CLayoutFeat* feat,
- vector<CLayoutFeat::TFeatList>& leaves,
- CLayoutFeat::TFeatList& this_leaf);
- };
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: features_panel_ir.hpp,v $
- * Revision 1000.2 2004/06/01 19:53:18 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.14
- *
- * Revision 1.14 2004/05/14 15:57:13 lebedev
- * Optional argument to specify the type of title/tooltip added
- *
- * Revision 1.13 2004/05/03 12:46:32 dicuccio
- * gui/utils ->gui/objutils where needed
- *
- * Revision 1.12 2004/04/16 14:34:59 dicuccio
- * Use TConstObjects instead of TObjSelection
- *
- * Revision 1.11 2004/03/31 16:09:01 lebedev
- * Methods to get HTML active areas added.
- *
- * Revision 1.10 2004/03/30 13:58:39 lebedev
- * Use elements colors from configuration instead of setting colors directly.
- *
- * Revision 1.9 2004/03/23 12:33:57 lebedev
- * Made sequence and histograms bars a layout objects in the object panel.
- * Made segment map a number of layout objects. Get rid of fixed size rows in the object panel.
- *
- * Revision 1.8 2004/03/11 17:23:38 dicuccio
- * Use TSeqRange instead of TRange. Deprecated TIndex / TPosition / TDimension
- *
- * Revision 1.7 2004/02/24 14:46:26 lebedev
- * Better implementation of main rendering loop. Code clean-up.
- *
- * Revision 1.6 2004/02/13 18:08:27 lebedev
- * Make use of new LayoutPolicy interface
- *
- * Revision 1.5 2004/01/27 16:13:06 lebedev
- * Changed stored selection from CLayoutObject to CObject
- *
- * Revision 1.4 2004/01/16 18:45:20 dicuccio
- * Minor code reformatting
- *
- * Revision 1.3 2004/01/16 13:37:57 lebedev
- * Tooltips added
- *
- * Revision 1.2 2003/12/30 14:55:00 dicuccio
- * Standardized export specifiers
- *
- * Revision 1.1 2003/12/22 12:52:41 lebedev
- * New files added
- *
- * Revision 1.15 2003/12/16 18:54:09 lebedev
- * Introduced Rendering Policies for feature panels
- *
- * Revision 1.14 2003/12/09 12:32:19 lebedev
- * Trim gene names in overview mode to fit in columns. Option to show feature names in detailed mode
- *
- * Revision 1.13 2003/11/13 19:08:04 lebedev
- * Objects selection reorganized
- *
- * Revision 1.12 2003/11/10 18:47:02 ucko
- * Adjust for const-correctness.
- *
- * Revision 1.11 2003/11/10 18:34:26 ucko
- * Properly capitalize Seq_annot.hpp
- *
- * Revision 1.10 2003/11/10 17:01:21 lebedev
- * Display of SeqGraphs and named SeqAnnots added
- *
- * Revision 1.9 2003/11/04 12:40:07 lebedev
- * Ruler bar added
- *
- * Revision 1.8 2003/10/30 13:22:07 lebedev
- * Display of master sequence under selected CDSs and Proteins added
- *
- * Revision 1.7 2003/10/29 23:39:16 yazhuk
- * Added export macro
- *
- * Revision 1.6 2003/10/28 19:04:09 dicuccio
- * Code clean-up. Changed storage of CBioseq_Handle from const pointer to value.
- * Changed SFeatByName to use no scope internally.
- *
- * Revision 1.5 2003/10/28 15:27:56 lebedev
- * Removed unused file
- *
- * Revision 1.4 2003/10/22 18:29:08 lebedev
- * Zoom that follows mouse added
- *
- * Revision 1.3 2003/10/21 12:59:44 lebedev
- * Rendering of alignments changed
- *
- * Revision 1.2 2003/10/20 16:31:02 lebedev
- * Offset IRenderable panels to bypass OpenGL matrices precision loss on
- * big sequences.
- *
- * Revision 1.1 2003/10/09 16:25:40 lebedev
- * Initial revision
- *
- * ===========================================================================
- */
- #endif // GUI_WIDGET_SEQ_GRAPHICS___FEATURES_PANEL_IR__HPP