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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___CDS_GLYPH__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___CDS_GLYPH__HPP
3 
4 /* $Id: cds_glyph.hpp 40489 2018-02-26 20:36:05Z 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: Liangshou Wu
30  *
31  * File Description:
32  */
33 
36 
38 
39 class CCdsConfig;
40 
41 ///////////////////////////////////////////////////////////////////////////////
42 ///
43 
45 {
46 public:
47  /// @name ctors.
48  /// @{
49  CCdsGlyph(const objects::CMappedFeat& feat);
50  CCdsGlyph(const objects::CMappedFeat& feat, const objects::CSeq_loc& loc);
51  /// @}
52 
53  void SetCdsConfig(CCdsConfig* config);
54 
55 protected:
56  virtual void x_Draw() const;
57  virtual void x_UpdateBoundingBox();
58 
59 private:
60  void x_DrawProtSeqWithMapping(TModelUnit trans_y,
61  TModelUnit gen_y, TModelUnit prot_y) const;
62  void x_DrawProjectedProtSeq(TModelUnit trans_y,
63  TModelUnit gen_y, TModelUnit prot_y) const;
64 
65  void x_PutCodon(const string& codon_str, TSeqPos pos,
66  TModelUnit y, bool neg, bool append) const;
67 
68  bool x_WillFit() const;
69 
70 protected:
72 };
73 
75 {
76 public:
77  CCdsConfig() : m_Dirty(false) {}
78 
79  /// @name colors.
80  /// @{
81  CRgbaColor m_bgProtProd; ///< protein product background color.
82  CRgbaColor m_fgProtProd; ///< protein product frorground color.
83  CRgbaColor m_LabelProtProd;///< protein product label color.
84  CRgbaColor m_SeqProt; ///< sequence color.
85  CRgbaColor m_SeqProtMismatch; ///< mismatched sequence color.
86  CRgbaColor m_SeqProtTrans; ///< translated sequence color.
87  /// @}
88 
89  /// @name fonts.
90  /// @{
93  /// @}
94 
95  mutable bool m_Dirty; ///< dirty flag indicating any setting changed
96 };
97 
98 ///////////////////////////////////////////////////////////////////////////////
99 /// CCdsGlyph inline methods
100 
101 inline
103 {
105 }
106 
107 
109 
110 /* @} */
111 
112 #endif // GUI_WIDGETS_SEQ_GRAPHIC___CDS_GLYPH__HPP
CRgbaColor m_SeqProtMismatch
mismatched sequence color.
Definition: cds_glyph.hpp:85
bool m_Dirty
dirty flag indicating any setting changed
Definition: cds_glyph.hpp:95
CGlTextureFont m_ProdFont
Definition: cds_glyph.hpp:91
CRgbaColor m_LabelProtProd
protein product label color.
Definition: cds_glyph.hpp:83
CRgbaColor m_SeqProtTrans
translated sequence color.
Definition: cds_glyph.hpp:86
CRgbaColor m_fgProtProd
protein product frorground color.
Definition: cds_glyph.hpp:82
CRgbaColor m_SeqProt
sequence color.
Definition: cds_glyph.hpp:84
CRgbaColor m_bgProtProd
protein product background color.
Definition: cds_glyph.hpp:81
CGlTextureFont m_TransFont
Definition: cds_glyph.hpp:92
CRef< CCdsConfig > m_CdsConfig
Definition: cds_glyph.hpp:71
void SetCdsConfig(CCdsConfig *config)
CCdsGlyph inline methods.
Definition: cds_glyph.hpp:102
CCdsGlyph(const objects::CMappedFeat &feat, const objects::CSeq_loc &loc)
CCdsGlyph(const objects::CMappedFeat &feat)
virtual void x_Draw() const
The default renderer for this layout object.
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
CObject –.
Definition: ncbiobj.hpp:180
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
#define false
Definition: bool.h:36
static void DLIST_NAME() append(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
Definition: dlist.tmpl.h:78
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
GLdouble TModelUnit
Definition: gltypes.hpp:48
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#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_SEQGRAPHIC_EXPORT
Definition: gui_export.h:536
Modified on Tue Apr 30 06:41:03 2024 by modify_doxy.py rev. 669887