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

Go to the SVN repository for this file.

1 #ifndef GUI_PACKAGES_SNP_BINS_TRACK__GMARK_GLYPH__HPP
2 #define GUI_PACKAGES_SNP_BINS_TRACK__GMARK_GLYPH__HPP
3 
4 /* $Id: gmark_glyph.hpp 35413 2016-05-04 17:51:26Z evgeniev $
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: Dmitry Rudnev
30  *
31  * File Description:
32  * CGeneMarkerGlyph -- Glyph that represents Gene markers encoded similar to SNP bins
33  *
34  */
35 
36 
37 #include <corelib/ncbiobj.hpp>
39 #include <objmgr/scope.hpp>
40 #include <gui/utils/rgba_color.hpp>
45 
47 
49 {
50 ////////////////////////////////////////////
51 // Public Structs/Classes/Typedefs
52 ////////////////////////////////////////////
53 public:
54 
55  typedef list<CRef<objects::NSnpBins::SBin> > TGeneMarkers;
56 
57 
58 //////////////////////////////////////////////
59 // Public Methods
60 //////////////////////////////////////////////
61 public:
62 
63  /// @name Static Methods
64  /// @{
65  static string GenerateGeneMarkerSignature(const string& title,
66  const string& annot_name,
67  TGi gi,
69  const string& trackSubType);
70  /// @}
71 
72  /// @name ctors
73  /// @{
74 
75  CGeneMarkerGlyph(const TGeneMarkers& values,
76  const objects::CSeq_loc& loc,
77  objects::CScope * scope);
78  /// @}
79 
80  /// @name CSeqGlyph virtual methods.
81  /// @{
82  virtual bool NeedTooltip(const TModelPoint& p, ITooltipFormatter& tt, string& t_title) const;
83  virtual void GetTooltip(const TModelPoint& p, ITooltipFormatter& tt, string& t_title) const;
84  virtual void GetHTMLActiveAreas(TAreaVector* p_areas) const;
85  virtual bool OnLeftDblClick(const TModelPoint& p);
86  virtual bool IsClickable() const;
87 
88  virtual TSeqRange GetRange(void) const;
89  ///@}
90 
91  void SetTitle(const string& title);
92  const string& GetTitle() const;
93 
94  void SetAnnotName(const string& name);
95  const string& GetAnnotName() const;
96 
97 
98 //////////////////////////////////////////////
99 // Protected Methods
100 //////////////////////////////////////////////
101 protected:
102  /// @name CSeqGlyph virtual methods.
103  /// @{
104  virtual void x_Draw() const;
105  virtual void x_UpdateBoundingBox();
106  ///@}
107 
108 
109 //////////////////////////////////////////////
110 // Private Methods
111 //////////////////////////////////////////////
112 private:
113  // this creates the Gene marker signatures in m_GeneMarkers. It is labeled 'const'
114  // but modifies the mutable m_GeneMarkers and m_bHasSignatures
115  void x_BuildSignatures() const;
116  string x_GetColorTheme() const;
117 
118 private:
119  string m_Title;
120  string m_AnnotName;
123 
124  mutable bool m_bHasSignatures;
125 
127 };
128 
129 ///////////////////////////////////////////////////////////////////////////////
130 /// CGeneMarkerGlyph inline method implementation.
131 
132 inline
133 void CGeneMarkerGlyph::SetTitle(const string& title)
134 { m_Title = title; }
135 
136 inline
137 const string& CGeneMarkerGlyph::GetTitle() const
138 { return m_Title; }
139 
140 inline
141 void CGeneMarkerGlyph::SetAnnotName(const string& name)
142 { m_AnnotName = name; }
143 
144 inline
145 const string& CGeneMarkerGlyph::GetAnnotName() const
146 { return m_AnnotName; }
147 
148 
150 
151 /* @} */
152 
153 #endif // GUI_PACKAGES_SNP_BINS_TRACK__GMARK_GLYPH__HPP
const string & GetAnnotName() const
const string & GetTitle() const
list< CRef< objects::NSnpBins::SBin > > TGeneMarkers
Definition: gmark_glyph.hpp:55
void SetTitle(const string &title)
CGeneMarkerGlyph inline method implementation.
CRef< objects::CScope > m_Scope
CConstRef< objects::CSeq_loc > m_Location
TGeneMarkers m_GeneMarkers
void SetAnnotName(const string &name)
class CSeqGlyph defines an interface that wraps a rectilinear abstract object.
Definition: seq_glyph.hpp:82
virtual bool IsClickable() const
Query if this glyph is clickable.
Definition: seq_glyph.hpp:195
virtual void x_Draw() const =0
The default renderer for this layout object.
virtual void GetTooltip(const TModelPoint &, ITooltipFormatter &tt, string &t_title) const
Get the tooltip if available.
Definition: seq_glyph.cpp:136
virtual bool NeedTooltip(const TModelPoint &, ITooltipFormatter &, string &) const
Check if need to show tooltip.
Definition: seq_glyph.cpp:130
virtual bool OnLeftDblClick(const TModelPoint &)
Definition: seq_glyph.cpp:76
virtual TSeqRange GetRange(void) const
get the total range of this object.
Definition: seq_glyph.hpp:513
virtual void GetHTMLActiveAreas(TAreaVector *) const
Get html active areas.
Definition: seq_glyph.hpp:148
virtual void x_UpdateBoundingBox()=0
Update the bounding box assuming children's sizes are fixed if any.
vector< CHTMLActiveArea > TAreaVector
Definition: seq_glyph.hpp:84
primitive interface to arrange tabular data in the tooltips
Definition: tooltip.hpp:55
NCBI_XOBJUTIL_EXPORT string GetTitle(const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
Definition: seqtitle.cpp:106
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_SNP_EXPORT
Definition: gui_export.h:540
range(_Ty, _Ty) -> range< _Ty >
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Thu Mar 28 17:10:58 2024 by modify_doxy.py rev. 669887