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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_HIT_MATRIX___HIT_MATRIX_WIDGET__HPP
2 #define GUI_WIDGETS_HIT_MATRIX___HIT_MATRIX_WIDGET__HPP
3 
4 /* $Id: hit_matrix_widget.hpp 46039 2021-01-21 17:33:24Z grichenk $
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: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbiobj.hpp>
36 
38 
43 
45 
46 #include <gui/utils/command.hpp>
47 
48 #include <gui/opengl/gldlist.hpp>
49 
51 
53 
54 
55 class wxFileArtProvider;
56 
58 
59 class CUICommandRegistry;
60 
61 /// Definitions for Hit Matrix Widget commands
62 ///
68 };
69 
70 ////////////////////////////////////////////////////////////////////////////////
71 /// class CHitMatrixWidget
72 
74  public CGlWidgetBase
75 {
76  DECLARE_EVENT_TABLE()
77 public:
78  typedef list<CConstRef<objects::CSeq_id> > TIdRefList;
80 
81  static void RegisterCommands(CUICommandRegistry& cmd_reg, wxFileArtProvider& provider);
82 
83  CHitMatrixWidget(wxWindow* parent,
84  wxWindowID id = wxID_ANY,
85  const wxPoint& pos = wxDefaultPosition,
86  const wxSize& size = wxDefaultSize,
87  long style = wxTAB_TRAVERSAL);
88  virtual ~CHitMatrixWidget();
89 
90  virtual CGlPane& GetPort();
91  virtual const CGlPane& GetPort() const;
92 
93  virtual void SetDataSource(IHitMatrixDataSource* p_ds);
94 
95  virtual IHitMatrixDataSource* GetDS();
96  virtual void SetScaleX(TModelUnit scale_x, const TModelPoint& point);
97 
98  virtual CHitMatrixRenderer& GetRenderer();
99 
100  /// @name Command and Event handlers
101  /// @{
102  void OnContextMenu(wxContextMenuEvent& event);
103 
104  void OnZoomSelection(wxCommandEvent& event);
105  void OnUpdateZoomSelection(wxUpdateUIEvent& event);
106  void OnZoomToHits(wxCommandEvent& event);
107  void OnZoomToSelectedHitElems(wxCommandEvent& event);
108  void OnUpdateZoomToSelectedHitElems(wxUpdateUIEvent& event);
109  void OnSetEqualScale(wxCommandEvent& event);
110 
111  void OnChooseSeq(wxCommandEvent& event);
112  void OnColorByScore(wxCommandEvent& event);
113  void OnDisableColoring(wxCommandEvent& event);
114  void OnUpdateDisableColoring(wxUpdateUIEvent& event);
115  void OnSetupGraphs(wxCommandEvent& event);
116  void OnResetSelection(wxCommandEvent& event);
117 
118  void OnSavePdf(wxCommandEvent& /* evt */);
119  void OnEnableSavePdfCmdUpdate(wxUpdateUIEvent& event);
120 
121  /// @}
122 
123  const TRangeColl& GetSubjectRangeSelection() const;
124  const TRangeColl& GetQueryRangeSelection() const;
125  void SetSubjectRangeSelection(const TRangeColl& segs);
126  void SetQueryRangeSelection(const TRangeColl& segs);
127 
128  void SetQueryVisibleRange(const TSeqRange& range);
129  void SetSubjectVisibleRange(const TSeqRange& range);
130 
131  void ResetObjectSelection();
132  void GetObjectSelection(TConstObjects& objs) const;
133  void SetObjectSelection(const vector<const objects::CSeq_align*> sel_aligns);
134 
135 protected:
136  // CGlWidgetBase overridables
137  virtual void x_CreatePane();
138  virtual CGlWidgetPane* x_GetPane();
139 
140  virtual void x_SetPortLimits();
141  virtual void x_ZoomToHits();
142 
143  virtual void x_Update();
144  virtual void x_UpdatePane();
145 
146  virtual void x_ClearScoreToParamsMap();
147 
148 protected:
150 
152  unique_ptr<CHitMatrixPane> m_MatrixPane;
153 
156 };
157 
158 
160 
161 
162 #endif // GUI_WIDGETS_HIT_MATRIX___HIT_MATRIX_WIDGET__HPP
class CGlPane
Definition: glpane.hpp:62
class CGlWidgetBase
virtual CGlPane & GetPort()=0
implement these 2 functions in derived classes
virtual void x_SetPortLimits(void)=0
updates model limits of the Master CGlPane
virtual void x_CreatePane()=0
factory method creating master pane, called form x_CreateControls()
virtual CGlWidgetPane * x_GetPane()
virtual void x_Update()
Update handlers.
CGlWidgetPane represent a window component residing in CGlWidgetBase client area.
CHitMatrixRenderer - renders Hit Matrix Graph, Rulers, axes, grid, sequence and features graphs.
class CHitMatrixWidget
list< CConstRef< objects::CSeq_id > > TIdRefList
TScoreToParamsMap m_ScoreToParams
unique_ptr< CHitMatrixPane > m_MatrixPane
map< string, CRef< SHitColoringParams > > TScoreToParamsMap
CHitMatrixPane::TRangeColl TRangeColl
CIRef< IHitMatrixDataSource > m_DataSource
CUICommandRegistry is a centralized registry where all application commands should be registered.
Definition: ui_command.hpp:146
IHitMatrixDataSource - abstract Data Source for Hit Matrix Widget.
Definition: map.hpp:338
GUI command routing and handling framework.
GLdouble TModelUnit
Definition: gltypes.hpp:48
vector< CConstRef< CObject > > TConstObjects
Definition: objects.hpp:64
@ eBaseCmdLast
Definition: command.hpp:111
#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_HIT_MATRIX_EXPORT
Definition: gui_export.h:530
EHitMatrixCommands
Definitions for Hit Matrix Widget commands.
@ eCmdSetupGraphs
@ eCmdDisableColoring
@ eCmdChooseSeq
@ eCmdColorByScore
range(_Ty, _Ty) -> range< _Ty >
const struct ncbi::grid::netcache::search::fields::SIZE size
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static static static wxID_ANY
Modified on Mon Jul 22 05:03:26 2024 by modify_doxy.py rev. 669887