NCBI C++ ToolKit
cross_panel_ir.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGET_ALN_CROSSALN___CROSS_PANEL_IR__HPP
2 #define GUI_WIDGET_ALN_CROSSALN___CROSS_PANEL_IR__HPP
3 
4 /* $Id: cross_panel_ir.hpp 31688 2014-11-05 17:18:12Z falkrb $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Vlad Lebedev
30  *
31  * Description: A panel that will render a cross alignment panel
32  *
33  */
34 
35 
36 #include <gui/gui.hpp>
37 #include <objmgr/bioseq_handle.hpp>
41 
44 #include <gui/objutils/objects.hpp>
45 
47 
48 
49 
50 
52 {
53 public:
56 
57  CCrossPanelIR();
58  virtual ~CCrossPanelIR(void);
59 
60  /// @name IRenderable implementation
61  /// @{
62  virtual void Render(CGlPane& pane);
63  /// @}
64 
66 
67  void ResetObjectSelection();
68  void GetObjectSelection(TConstObjects& objs) const;
69  void SetObjectSelection(const vector<const objects::CSeq_align*> sel_aligns);
70 
71  void ColorBySegments();
73  CConstRef<objects::CObject_id> GetScoreId() const { cout << "get\n"; return m_ColorScoreId; }
74 
75  void SetLimits(TVPRect rcm1, TModelRect rcv1, TVPRect rcm2, TModelRect rcv2);
76 
77  TModelRect HitTest(CGlPane& pane, int x, int y, bool select = false);
78 
79 private:
80  // coordinate transformation
83 
86 
87  double x_SelectBaseStep(double MinV, double MaxV) const;
88 
89  void x_DrawCrossAlignment(CGlPane& pane);
90  void x_DrawCrossedPanel(CGlPane& pane, const CRgbaColor& color,
91  TModelUnit x_from1, TModelUnit x_to1,
92  TModelUnit x_from2, TModelUnit x_to2);
93 
94  void x_DrawSequence(CGlPane& pane);
95 
96  void x_GetSequence(const objects::CBioseq_Handle& handle,
97  TSeqPos from, TSeqPos to, string& buffer) const;
98 
99  bool x_IsSeqLettersFit1() const;
100  bool x_IsSeqLettersFit2() const;
101 private:
103 
105 
106  CConstRef<objects::CObject_id> m_ColorScoreId; // identifies a score to color by
107 
112 
114 };
115 
116 
118 
119 #endif // GUI_WIDGET_ALN_CROSSALN___CROSS_PANEL_IR__HPP
void SetObjectSelection(const vector< const objects::CSeq_align * > sel_aligns)
virtual ~CCrossPanelIR(void)
double x_SelectBaseStep(double MinV, double MaxV) const
void x_DrawCrossedPanel(CGlPane &pane, const CRgbaColor &color, TModelUnit x_from1, TModelUnit x_to1, TModelUnit x_from2, TModelUnit x_to2)
void GetObjectSelection(TConstObjects &objs) const
void x_DrawCrossAlignment(CGlPane &pane)
CHitMatrixGraph::TElemGlyphSet TElemGlyphSet
void x_GetSequence(const objects::CBioseq_Handle &handle, TSeqPos from, TSeqPos to, string &buffer) const
TModelUnit x_Seq2Lim1(TModelUnit seq)
CConstRef< objects::CObject_id > GetScoreId() const
void SetDataSource(ICrossAlnDataSource *ds)
void ResetObjectSelection()
CConstRef< objects::CObject_id > m_ColorScoreId
CIRef< ICrossAlnDataSource > m_DS
TModelRect m_RCV2
TModelUnit x_Lim2Seq2(TModelUnit lim)
TModelRect m_RCV1
void x_DrawSequence(CGlPane &pane)
void ColorBySegments()
TModelUnit x_Lim2Seq1(TModelUnit lim)
virtual void Render(CGlPane &pane)
CHitMatrixGraph m_Graph
bool x_IsSeqLettersFit1() const
void ColorByScore(CConstRef< objects::CObject_id > score_id)
CHitMatrixGraph::THitGlyphVector THitGlyphVector
TModelRect HitTest(CGlPane &pane, int x, int y, bool select=false)
CGlTextureFont m_Font_Fixed12
TModelUnit x_Seq2Lim2(TModelUnit seq)
bool x_IsSeqLettersFit2() const
void SetLimits(TVPRect rcm1, TModelRect rcv1, TVPRect rcm2, TModelRect rcv2)
class CGlPane
Definition: glpane.hpp:62
CHitMatrixGraph.
vector< CHitGlyph * > THitGlyphVector
CRenderableImpl.
Definition: irenderable.hpp:82
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
IHitMatrixDataSource - abstract Data Source for Hit Matrix Widget.
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
GLdouble TModelUnit
Definition: gltypes.hpp:48
vector< CConstRef< CObject > > TConstObjects
Definition: objects.hpp:64
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
n background color
static pcre_uint8 * buffer
Definition: pcretest.c:1051
Modified on Fri Jul 19 17:09:26 2024 by modify_doxy.py rev. 669887