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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___GRAPH_OVERLAY__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___GRAPH_OVERLAY__HPP
3 
4 /*
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  * Author: Andrei Shkeda
30  *
31  */
32 
33  /**
34  * File Description:
35  */
36 
37 
44 
45 
46 class wxEvtHandler;
47 
49 
50 ///////////////////////////////////////////////////////////////////////////////
51 /// CGraphOverlay container of the graph_tracks that are dispalyed in overlay mode
52 
54  public CTrackContainer,
55  public ILegendHost,
56  public IDroppable
57 {
58  friend class CGraphOverlayFactory;
59 
60 public:
61  enum ELayout {
63  eStacked
64  };
65  typedef float TDataType;
67 
68  virtual void OnTrackSettings(int order);
69  virtual void GetHTMLActiveAreas(TAreaVector* p_areas) const;
70  /// Close a track.
71  /// Hide the given track, but track is not removed.
72  //virtual void CloseTrack(int order);
73  //virtual void x_ShowTrack(CLayoutTrack* track, bool on);
74 
75  void UpdateTrackParams(const string& annot_name);
76 
77  /// @name TrackContainer public methods.
78  /// @{
79  virtual const CTrackTypeInfo& GetTypeInfo() const;
80  /// @}
81 
82  virtual CRef<CSeqGlyph> HitTest(const TModelPoint& p);
83 
84  /// @name data ILegendHost pure virtual methods.
85  /// @{
86  virtual void LH_OnItemDblClick(const string& source_name);
87  virtual void LH_OnItemRightClick(const string& source_name);
88  /// @}
89 
90  virtual bool IsOverlay() const;
91 
92  /// @name IDroppable virtual methods overloading.
93  /// @{
94  virtual bool CanDrop(CRef<CLayoutTrack>& track);
95  virtual bool Drop(CRef<CLayoutTrack>& track);
96  /// @}
97 
98  void UpdateSource(CTempTrackProxy* self_proxy = 0);
99  void MoveTrackOut(int track_id);
100 
101 protected:
102 
103  virtual void x_LoadSettings(const string& /*preset_style*/,
104  const TKeyValuePairs& settings);
105  virtual void x_SaveSettings(const string& preset_style);
106 
107  void x_UpdateContainerParams(CHistParams& params);
108 
109  virtual void x_RenderContent() const;
110  virtual void x_UpdateBoundingBox();
111  virtual void x_OnLayoutChanged();
112  virtual void x_OnAllJobsFinished();
113 
114  void x_UpdateTrackSettings(const string& source_name);
115 
116  /// The unique name - combination of subtracks annots -
117  /// is used to access the track setting in registry
118  string m_Source;
119 
120  void x_UpdateLegend();
121 private:
124  ELayout m_Layout = eOverlay;
127 
128  /// CLayoutTrack required track type info.
130 };
131 
132 ///////////////////////////////////////////////////////////////////////////////
133 /// CTrackContainerFactory
134 ///
136  public CObject,
137  public ILayoutTrackFactory,
138  public ITrackConfigurable,
139  public IExtension
140 {
141 public:
143 
144  /// create a layout track based on the input objects and extra parameters.
145  virtual TTrackMap CreateTracks(
146  SConstScopedObject& object,
147  ISGDataSourceContext* ds_context,
148  CRenderingContext* r_cntx,
149  const SExtraParams& params = SExtraParams(),
150  const TAnnotMetaDataList& src_annots = TAnnotMetaDataList()) const;
151 
152  virtual bool UnderstandLevel() const
153  { return true; }
154 
155  virtual bool NeedBackgroundInit() const
156  { return false; }
157 
158  virtual const CTrackTypeInfo& GetThisTypeInfo() const
159  { return GetTypeInfo(); }
160 
161  static const CTrackTypeInfo& GetTypeInfo()
162  { return CGraphOverlay::m_TypeInfo; }
163 
164  /// @name ITrackConfigurable public methods.
165  /// @{
167  GetSettings(const string& profile,
168  const TKeyValuePairs& settings,
169  const CTempTrackProxy* track_proxy) const;
170  /// @}
171 
172  /// @name IExtension interface implementation
173  /// @{
174  virtual string GetExtensionIdentifier() const;
175  virtual string GetExtensionLabel() const;
176  /// @}
177 
178 };
179 
180 
181 inline
183 {
184  return true;
185 }
186 
187 
189 
190 #endif // GUI_WIDGETS_SEQ_GRAPHIC___GRAPH_OVERLAY__HPP
CFeaturePanelDS.
virtual void x_UpdateBoundingBox()
Update the bounding box assuming children's sizes are fixed if any.
virtual CRef< CSeqGlyph > HitTest(const TModelPoint &p)
Hit testing.
virtual void x_RenderContent() const
The content rendering must be implemented in the derived layout tracks.
CTrackContainerFactory.
virtual const CTrackTypeInfo & GetThisTypeInfo() const
virtual bool UnderstandLevel() const
Have any concept of level.
static const CTrackTypeInfo & GetTypeInfo()
virtual bool NeedBackgroundInit() const
Background track initialization.
CGraphOverlay container of the graph_tracks that are dispalyed in overlay mode.
CRef< CSimpleLayout > m_StackedLayout
virtual bool IsOverlay() const
static CTrackTypeInfo m_TypeInfo
CLayoutTrack required track type info.
CRef< CHistogramGlyph > m_Grid
string m_Source
The unique name - combination of subtracks annots - is used to access the track setting in registry.
CRef< COverlayLayout > m_OverlayLayout
CLayoutGroup m_Legend
File Description:
CLayoutGroup is a container of CSeqGlyphs (layout objects).
virtual void x_SaveSettings(const string &preset_style)
save the track settings to a profile string.
virtual void x_LoadSettings(const string &preset_style, const TKeyValuePairs &settings)
load the track settings.
void x_OnLayoutChanged()
update the layout.
CObject –.
Definition: ncbiobj.hpp:180
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
vector< CHTMLActiveArea > TAreaVector
Definition: seq_glyph.hpp:84
File Description:
CTrackContainer - a track container in the form of layout track.
virtual bool IsOverlay() const
virtual void GetHTMLActiveAreas(TAreaVector *p_areas) const
Get html active areas.
virtual const CTrackTypeInfo & GetTypeInfo() const
ILayoutTrackFactory::TAnnotMetaDataList TAnnotMetaDataList
virtual void x_OnAllJobsFinished()
actions to take on all job finished.
virtual void OnTrackSettings(int order)
CTrackTypeInfo - holds description of a layout track type.
IDroppable The interface for tracks that support drag&drop.
virtual bool Drop(CRef< CLayoutTrack > &track)=0
virtual bool CanDrop(CRef< CLayoutTrack > &track)=0
IExtension IExtension interface represents an abstract pluggable component.
Definition: extension.hpp:57
ILayoutTrackFactory.
virtual void LH_OnItemDblClick(const string &source_name)=0
notifies the host about changes of the track.
virtual void LH_OnItemRightClick(const string &source_name)=0
notifies the host about changes of the track.
ISGDSManager is seqgraphic data source manage that serves as an data source context.
ITrackConfigurable interface for tracks that are configurable.
#define NULL
Definition: ncbistd.hpp:225
#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 NcbiEmptyString
Definition: ncbistr.hpp:122
#define NCBI_GUIWIDGETS_SEQGRAPHIC_EXPORT
Definition: gui_export.h:536
const CharType(& source)[N]
Definition: pointer.h:1149
extra parameter for initializing a track.
Modified on Sat Mar 02 10:55:35 2024 by modify_doxy.py rev. 669887