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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___ALL_OTHER_FEATURES_TRACK__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___ALL_OTHER_FEATURES_TRACK__HPP
3 
4 /* $Id: all_other_features_track.hpp 42431 2019-02-22 16:04:19Z katargir $
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: Liangshou Wu
30  *
31  */
32 
33  /**
34  * File Description:
35  */
36 
37 
39 
41 
42 ///////////////////////////////////////////////////////////////////////////////
43 /// CAllOtherFeaturesTrack - a track container in the form of layout track.
44 /// Compared to CGlyphContainer, this class assume its children must be one
45 /// type of CLayoutTracks. So it has knowledge about the child tracks
46 /// to turn them on or off. The purpose of CAllOtherFeaturesTrack is that it forms a
47 /// group of tracks to make them behave like a single track: movable,
48 /// collapsible, and closible. The track container may be resposible of
49 /// creating/initializing the contained tracks. The reason of inhereting
50 /// from CDataTrack is because a container track may need to initialize
51 /// its child tracks asynchronously. Potentially, a container track
52 /// may delegate its child tracks to load data for performance purpose.
53 
55  : public CTrackContainer
56 {
58 
59 public:
61  typedef list<TFeatSubtype> TSubtypeList;
62 
63  CAllOtherFeaturesTrack(CRenderingContext* r_cntx, CFeaturePanelDS* ds, const set<string>& usedFeatureSubkeys);
64  virtual ~CAllOtherFeaturesTrack();
65 
66  /// override method in CTrackContainer.
67  virtual bool NoSubtrackEver() const;
68 
69  /// @name CLayoutTrack public methods.
70  /// @{
71  virtual const CTrackTypeInfo& GetTypeInfo() const;
72  virtual string GetFullTitle() const;
73  /// @}
74 
75  void SetProxy(CTrackProxy* proxy);
76 
77  virtual void ReinitNASubtracks(TAnnotMetaDataList& annots, bool makeContainersVisible);
78 
79 protected:
80  virtual void x_OnAllJobsFinished();
81  virtual void x_ReinitSubtracks();
82 
83 private:
84  /// prohibited copy constructor and assignment operator.
87 
88  void x_ReinitFeatureTrack(CTempTrackProxy* t_proxy);
89 
90 private:
91  /// track proxy for all other features track.
94 
95  /// CLayoutTrack required track type info.
97 };
98 
99 ///////////////////////////////////////////////////////////////////////////////
100 /// CAllOtherFeaturesTrackFactory
101 ///
103  public CObject,
104  public ILayoutTrackFactory,
105  public ITrackConfigurable,
106  public IExtension
107 {
108 public:
110 
111  /// create a layout track based on the input objects and extra parameters.
112  virtual TTrackMap CreateTracks(
113  SConstScopedObject& object,
114  ISGDataSourceContext* ds_context,
115  CRenderingContext* r_cntx,
116  const SExtraParams& params = SExtraParams(),
117  const TAnnotMetaDataList& src_annots = TAnnotMetaDataList()) const;
118 
119  virtual bool UnderstandLevel() const
120  { return true; }
121 
122  virtual bool NeedBackgroundInit() const
123  { return false; }
124 
125  virtual const CTrackTypeInfo& GetThisTypeInfo() const
126  { return GetTypeInfo(); }
127 
128  static const CTrackTypeInfo& GetTypeInfo()
130 
131  /// @name ITrackConfigurable interface implementation
132  /// @{
134  GetSettings(const string& profile,
135  const TKeyValuePairs& settings,
136  const CTempTrackProxy* track_proxy) const;
137  /// @}
138 
139  /// @name IExtension interface implementation
140  /// @{
141  virtual string GetExtensionIdentifier() const;
142  virtual string GetExtensionLabel() const;
143  /// @}
144 };
145 
146 
147 ///////////////////////////////////////////////////////////////////////////////
148 /// CAllOtherFeaturesTrack inline methods
149 
150 inline
152 { m_ThisProxy.Reset(proxy); }
153 
154 
156 
157 #endif // GUI_WIDGETS_SEQ_GRAPHIC___ALL_OTHER_FEATURES_TRACK__HPP
CAllOtherFeaturesTrackFactory.
virtual bool UnderstandLevel() const
Have any concept of level.
static const CTrackTypeInfo & GetTypeInfo()
virtual bool NeedBackgroundInit() const
Background track initialization.
virtual const CTrackTypeInfo & GetThisTypeInfo() const
static CTrackTypeInfo m_TypeInfo
CLayoutTrack required track type info.
CWeakRef< CTrackProxy > m_ThisProxy
track proxy for all other features track.
void SetProxy(CTrackProxy *proxy)
CAllOtherFeaturesTrack inline methods.
CAllOtherFeaturesTrack & operator=(const CAllOtherFeaturesTrack &)
CAllOtherFeaturesTrack(const CAllOtherFeaturesTrack &)
prohibited copy constructor and assignment operator.
list< TFeatSubtype > TSubtypeList
CSeqGraphicConfig::TFeatSubtype TFeatSubtype
CFeaturePanelDS.
virtual string GetFullTitle() const
get a more meaningful title.
CObject –.
Definition: ncbiobj.hpp:180
CRef –.
Definition: ncbiobj.hpp:618
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
int TFeatSubtype
we use int instead of CSeqFeatData::ESubtype for two reasons:
File Description:
CTrackContainer - a track container in the form of layout track.
virtual bool NoSubtrackEver() const
Will have no subtrack for ever.
virtual const CTrackTypeInfo & GetTypeInfo() const
ILayoutTrackFactory::TAnnotMetaDataList TAnnotMetaDataList
virtual void x_ReinitSubtracks()
reinitialize all subtracks if necessary.
virtual void x_OnAllJobsFinished()
actions to take on all job finished.
virtual void ReinitNASubtracks(TAnnotMetaDataList &, bool)
CTrackProxy data structure contains information about the position of a track in its parent scope,...
CTrackTypeInfo - holds description of a layout track type.
IExtension IExtension interface represents an abstract pluggable component.
Definition: extension.hpp:57
ILayoutTrackFactory.
ISGDSManager is seqgraphic data source manage that serves as an data source context.
ITrackConfigurable interface for tracks that are configurable.
Definition: map.hpp:338
void Reset(void)
Reset the containing pointer to null.
Definition: ncbiobj.hpp:2722
#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 Jul 23 17:50:50 2024 by modify_doxy.py rev. 669887