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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___LAYOUT_TRACK_IMPL__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___LAYOUT_TRACK_IMPL__HPP
3 
4 /* $Id: layout_track_impl.hpp 42438 2019-02-26 15:46:24Z shkeda $
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 #include <corelib/ncbistr.hpp>
39 #include <corelib/ncbimtx.hpp>
40 
41 #include <gui/gui_export.h>
42 #include <gui/opengl/gltypes.hpp>
44 
48 #include <gui/utils/track_info.hpp>
49 
51 
52 
54 
55 ///////////////////////////////////////////////////////////////////////////////
56 /// CLayoutTrack - the abstract base class for various tracks.
57 /// interfaces and the basic common functionalities. The common functionalities
58 /// include:
59 /// - handling user interactions such as collapsing/expanding, closing,
60 /// - generating layout according to applied layout policy,
61 /// - managing the life cycle of layout objects and layouts,
62 ///
63 /// The main goal for the default implementation of layout track is to minimize
64 /// the work in the derived classes such that the sub classes only need to load
65 /// the data, create the layout objects, and render the layout objects.
66 
68  public CSeqGlyph
69 {
70 public:
71  typedef vector< CConstRef<CSeqGlyph> > TLayObjVector;
72  typedef unsigned TTrackAttrFlags;
73  typedef list< CRef<CLayoutTrack> > TLayoutTracks;
75 
76  enum FTrackAttr {
77  fMovable = 1 << 0,
78  fCollapsible = 1 << 1, ///< can be collpased and expanded.
79  fFrameVisible = 1 << 2, ///< track frame will be rendered when triggered.
80  fShowTitle = 1 << 3,
81  fShowAlways = 1 << 4, ///< always be rendered even for an empty track.
82  fFullTrack = 1 << 5, ///< track occupying the full horizontal screen.
83  fNavigable = 1 << 6, ///< Track has navigation controls
84  fShowIcons = 1 << 7, ///< Track has control icons at the bottom
85  fDefaultAttr = fMovable | fCollapsible | fFrameVisible |
86  fShowTitle | fFullTrack | fShowAlways
87  };
88 
90 
91  virtual ~CLayoutTrack();
92 
93  virtual const CTrackTypeInfo& GetTypeInfo() const = 0;
94 
95  /// set track profile and load settings.
96  /// It is up to a track to interprate the content of the profile.
97  /// For example, a profile can be the name of a preset
98  /// settings style for a track. A profile can also be
99  /// a list of settings, such as "a_color:red,b_size:10",
100  /// or the conbination of both. Example of profile setting:
101  /// 1) TrackProfile = Default, the Default is a preset style name
102  /// 2) TrackProfile = a_color:red,b_size:10
103  /// 3) TrackProfile = preset:Default,a_color:red,b_size:10
104  /// Note: if both preset style and concrete settings present in
105  /// the profile string, do use 'preset' key before the preset style
106  /// name.
107  void LoadProfile(const string& profile_str);
108  void SaveProfile();
109  void SetProfile(const string& preset_style);
110  const string& GetProfile() const;
111 
112  /// set comments.
113  virtual void SetComments(const string& /*comment_str*/) {};
114  virtual void SetHighlights(const string& /*hl_str*/) {};
115 
116  /// get a more meaningful title.
117  /// This allows a concrete track to compose a more meaningful
118  /// title in a more complex way.
119  virtual string GetFullTitle() const;
120 
121  /// get the track title.
122  string GetTitle() const;
123 
124  const TTrackErrorStatus& GetErrorStatus() const;
125  void SetErrorStatus(const TTrackErrorStatus& ErrorStatus);
126  bool isInErrorStatus() const;
127 
128  // true if the track is based on a remote file derived annotation
129  bool isRmtBased() const;
130 
131  bool isRemotePath() const;
132 
133  /// @name track-specific methods
134  /// @{
135  bool IsOn() const;
136  bool IsExpanded() const;
137  bool IsMovable() const;
138  bool IsCollapsible() const;
139  /// set the flag only.
140  void SetShow(bool shown);
141  void SetExpanded(bool f);
142  void SetShowFrame(bool show);
143  void MoveTo(TModelUnit y);
144  void SetTrackAttr(TTrackAttrFlags flags);
145  void SetTitle(const string& label, const string& default_title = NcbiEmptyString);
146  void SetIsBlast(bool isBlast);
147  void SetHost(ILayoutTrackHost* host);
148  void SetOrder(int order);
149  int GetOrder() const;
150  void SetId(const string& id);
151  const string& GetId() const;
152 
153  /// close this track.
154  void CloseMe();
155  void ShowMe();
156  /// Collapse or expand the track.
157  void Expand(bool expand);
158  /// @}
159 
160 
161  /// @name CSeqGlyph interface implementation
162  /// @{
163  virtual bool OnLeftDown(const TModelPoint& p);
164  virtual bool OnLeftDblClick(const TModelPoint& p);
165  virtual bool NeedTooltip(const TModelPoint& p, ITooltipFormatter& tt, string& t_title) const;
166  virtual void GetTooltip(const TModelPoint& p, ITooltipFormatter& tt, string& t_title) const;
167  /// @}
168 
169  /// Initialize the HTML active area for a track.
170  /// @return retrun the newly added HTML active area for this track
171  /// if further initializatin is required.
172  virtual CHTMLActiveArea* InitHTMLActiveArea(TAreaVector* p_areas) const;
173 
174  void MouseOut();
175  bool OnMotion(const TModelPoint& pt);
176 
177  bool GetShowTitle() const;
178  void SetShowTitle(bool flag);
179  void SetConfig(CRef<CSeqGraphicConfig> conf);
180  int GetIndent() const;
181  void SetIndent(int indent);
182  void SetMsg(const string& msg);
183 
184  void SetParentTrack(CLayoutTrack* parent);
185  CLayoutTrack* GetParentTrack();
186  const CLayoutTrack* GetParentTrack() const;
187 
188 protected:
189  /// Icon id used in layout track.
190  /// A derived track can extend the icon ids to accomodate
191  /// any track-specific icons. The eIcon_MaxTrackIconID can be
192  /// considered as the maximum icon id value defined in this
193  /// base class. In other words, it is safe to use any id
194  /// value > eIcon_MaxTrackIconID in the derived class.
195  enum EIconID {
196  eIcon_Close = 0, ///< close icon
197  eIcon_Expand, ///< expand/collapse icon
198  eIcon_Content, ///< icon id for setting content
199  eIcon_Layout, ///< icon id for setting layout style
200  eIcon_Settings, ///< icon id for track settings
201  eIcon_Help, ///< icon id for track help
202  eIcon_MaxTrackIconID = 100 ///< the maximual icon ID defined in this class.
203  };
204 
205  typedef int TIconID; ///< use int as TIconID instead of EIconID.
206  typedef string TIconAlias; ///< the icon alias used as a key
207 
208  /// A help struct for storing information about a icon.
209  struct SIconInfo {
211  : m_Id(-1)
212  , m_Tooltip("")
213  , m_Enabled(true)
214  , m_Shown(true)
215  {};
216  SIconInfo(TIconID id, const string& tt, bool enabled,
217  const TIconAlias& icon_1, const TIconAlias& icon_2 = "",
218  const TIconAlias& icon1_lite = "")
219  : m_Id(id)
220  , m_Tooltip(tt)
221  , m_Icon1(icon_1)
222  , m_Icon2(icon_2)
223  , m_Icon1_lite(icon1_lite)
224  , m_Enabled(enabled)
225  , m_Shown(true)
226  {};
227 
228  TIconID m_Id; ///< must be unique within the context
229  string m_Tooltip;
230  TIconAlias m_Icon1; ///< icon alias for state #1
231  /// icon alias for state #2, optional.
232  /// This is used only for those buttons that have two states and
233  /// need different visual presentation for each state, e.g. expand
234  /// and collapse button.
236  /// lighter version of icon1 (less opaque)
238  bool m_Enabled;
239  bool m_Shown;
240  };
241 
242  typedef vector<SIconInfo> TIcons;
243 
244 
245  virtual void x_Draw() const;
246  virtual void x_UpdateBoundingBox();
247 
248  /// Collapse or expand the track.
249  /// @param expand true to expand the track, false to collapse it.
250  virtual void x_Expand(bool expand);
251 
252  /// Need to preserve title space and show the title.
253  /// Many factors may determine if a title will be rendered.
254  virtual bool x_ShowTitle() const;
255 
256  /// Get title bar height including margin.
257  TModelUnit x_GetTBHeight() const;
258 
259  /// Method for getting global configuration from rendering context.
260  CConstRef<CSeqGraphicConfig> x_GetGlobalConfig() const;
261  void x_OnLayoutChanged();
262 
263  /// load the track settings.
264  /// By default, it does nothing.
265  /// @param preset_style a preset setting style name
266  /// @param settings a list of track-specific setting in a form of
267  /// key-value pair.
268  virtual void x_LoadSettings(const string& preset_style,
269  const TKeyValuePairs& settings);
270  /// save the track settings to a profile string.
271  virtual void x_SaveSettings(const string& preset_style);
272 
273  /// The content rendering must be implemented in the derived layout tracks.
274  virtual void x_RenderContent() const = 0;
275  virtual bool x_Empty() const = 0;
276  virtual void x_ClearContent() {};
277 
278  /// Get title bar rectange exclude top margin.
279  /// The tracks may need to override this method if the title bar is
280  /// not standard one which is on the top.
281  virtual void x_GetTBRect(TModelRect& rc) const;
282 
283  /// Method for rendering the job loading or layout generating progress.
284  virtual void x_RenderProgressBar() const;
285 
286  /// Method for rendering the track title bar.
287  virtual void x_RenderTitleBar() const;
288 
289  /// Histogram configuration (linear, log, etc) is also on the title bar but
290  /// multiple track types can have histograms, so we use virtual functinons
291  virtual string x_GetHistMsg() const { return ""; }
292 
293  /// Render track icons.
294  /// If a derived track need to render icons differetly,
295  /// then it has to override this method.
296  /// If lite_version is true, and the lite version icon is provided,
297  /// the lite version icon will be rendered, instead.
298  virtual void x_RenderIcon(TIconID id, bool highlighted,
299  bool lite_version = false) const;
300 
301  /// Mouse left-click event handler on an icon.
302  /// In this class, only clicks on close and expand icons are handled.
303  /// Any other icons are very likely track-specific, so they need to
304  /// be handled in the derived tracks.
305  virtual void x_OnIconClicked(TIconID id);
306 
307  /// Get current status for a given button.
308  /// @return 0 if in its first state or only one state, otherwise, 1.
309  virtual int x_GetIconState(TIconID id) const;
310 
311 
312  /// register track icons.
313  void x_RegisterIcon(const SIconInfo& icon);
314 
315  /// deregister an icon if already registered.
316  void x_DeregisterIcon(TIconID id);
317 
318  /// Enable/disable an existing icon.
319  void x_EnableIcon(TIconID id, bool enabled);
320 
321  /// Show/hide an existing icon.
322  void x_ShowIcon(TIconID id, bool shown);
323 
324  /// hit any icon?.
325  /// @return the icon index if yes, otherwise -1
326  int x_HitIconTest(const TModelPoint& p) const;
327 
328  /// hit the title bar?.
329  bool x_HitTitleBar(const TModelPoint& p) const;
330 
331  void x_SetStatus(const string& msg, int progress);
332  void x_SetStartStatus();
333  void x_SetFinishStatus();
334 
335  /// register images for the common icons.
336  /// The common icons include close button, expand/collapse button,
337  /// content button, layout policy button, and setting button.
338  static void RegisterCommonIconImages();
339 
340  /// Indicates whether the track is NCBI track
341  bool x_IsNCBITrack() const;
342 
343 public: // for the sake of CSixFramesTransTrack
344  /// register the image for an icon.
345  /// The image is used for generating texture for rendering purpose.
346  /// @param key the icon alias used for accessing the icon/icon texture.
347  /// No two identical keys can be registered application-wise.
348  /// @param img_file the image file with full path
349  static void RegisterIconImage(
350  const TIconAlias& key, const string& img_file);
351 
352 protected:
353  /// initialize OpenGL ttexture objects for icons.
354  /// Will check if we indeed need to reinitialize OpenGL texture objects.
355  /// We need to do this for the very first time, or when the texture objects
356  /// become invalid somehow.
357  /// @return false if fails to initialize icon textures
358  static bool InitIconTextures();
359 
360 private:
361  /// Method for rendering the track frame including the icons.
362  void x_RenderFrame() const;
363 
364  TModelRect x_GetIconRect(int idx) const;
365 
366  /// get icon index in the registed icons using its id.
367  int x_GetIconIdxById(TIconID id) const;
368 
369  /// prohibited copy constructor and assignment operator.
372 
373 protected:
374  int m_Order; ///< track order number
375  string m_Id; ///< track identifier
376  bool m_On; ///< is this track shown
377  bool m_ShowFrame; ///< need to draw frame, not title
378  bool m_Expanded; ///< is this track in expanded state
379 
380  TIcons m_Icons; ///< registered icon info
381  int m_HighlightedIcon; ///< the highlighted icon index
382 
383  TTrackAttrFlags m_Attrs; ///< various track attributes
384  ILayoutTrackHost* m_LTHost; ///< Top level host owning the tracks.
385  string m_Title; ///< track title
386  bool m_isBlast{false}; ///< true if the track is known to be generated and uploaded by BLAST
387  string m_DefaultTitle; ///< Default track title
388  string m_Msg; ///< special message need to show on title bar
389  int m_Progress; ///< any job progress index (0 - 100)
390  int m_IndentLevel; ///< track hierachy indentation level.
392 
393  CRef<CSeqGraphicConfig> m_gConfig; ///< global configuration.
394  string m_Profile = "Default"; ///< track setting profile
395 
396 private:
397  CLayoutTrack* m_ParentTrack = nullptr; ///< parent track (might differ from parent)
399  static TTexMap sm_IconMap; ///< only intialized once app-wise
400  static CFastMutex sm_Mutex; ///< mutex guarding the icon texture map
401 
402  // check that the track pointer is not corrupted
403 // bool // x_Validate(const string& sCodeLocation) const;
404 };
405 
406 ///////////////////////////////////////////////////////////////////////////////
407 /// IDroppable
408 /// The interface for tracks that support drag&drop
409 ///
411 {
412 public:
413  virtual ~IDroppable() {}
414  virtual bool CanDrop(CRef<CLayoutTrack>& track) = 0;
415  virtual bool Drop(CRef<CLayoutTrack>& track) = 0;
416 };
417 
418 
419 
420 ///////////////////////////////////////////////////////////////////////////////
421 /// CLayoutTrack inline method implmentation
422 ///
423 inline
424 void CLayoutTrack::SetProfile(const string& preset_style)
425 {
426  // x_Validate("SetProfile");
427  m_Profile = preset_style;
428 }
429 
430 inline
431 const string& CLayoutTrack::GetProfile() const
432 {
433  // x_Validate("GetProfile");
434  return m_Profile;
435 }
436 
437 inline /* virtual */
439 {
440  // x_Validate("GetFullTitle");
441  return m_Title.empty() ? m_DefaultTitle : m_Title;
442 }
443 
444 inline
446 {
447  // x_Validate("GetTitle");
448  return m_Title.empty() ? m_DefaultTitle : m_Title;
449 }
450 
451 inline
452 bool CLayoutTrack::IsOn() const
453 {
454  // x_Validate("IsOn");
455  return m_On;
456 }
457 
458 inline
460 {
461  // x_Validate("IsExpanded");
462  return m_Expanded;
463 }
464 
465 inline
467 {
468  // x_Validate("IsMovable");
469  return m_Attrs & fMovable;
470 }
471 
472 inline
474 {
475  // x_Validate("IsCollapsible");
476  return m_Attrs & fCollapsible;
477 }
478 
479 inline
480 void CLayoutTrack::SetShow(bool shown)
481 {
482  // x_Validate("SetShow");
483  m_On = shown;
484 }
485 
486 inline
488 {
489  // x_Validate("SetExpanded");
490  m_Expanded = f;
491 }
492 
493 inline
495 {
496  // x_Validate("SetShowFrame");
497  m_ShowFrame = show;
498 }
499 
500 inline
502 {
503  // x_Validate("SetHost");
504  m_LTHost = host;
505 }
506 
507 inline
509 {
510  // x_Validate("GetOrder");
511  return m_Order;
512 }
513 
514 inline
515 void CLayoutTrack::SetOrder(int order)
516 {
517  // x_Validate("SetOrder");
518  m_Order = order;
519 }
520 
521 inline
522 void CLayoutTrack::SetId(const string& id)
523 {
524  // x_Validate("SetId");
525  m_Id = id;
526 }
527 
528 inline
529 const string& CLayoutTrack::GetId() const
530 {
531  // x_Validate("GetId");
532  return m_Id;
533 }
534 
535 inline
537 {
538  // x_Validate("GetErrorStatus");
539  return m_ErrorStatus;
540 }
541 
542 
543 inline
545 {
546  // x_Validate("SetErrorStatus");
547  m_ErrorStatus = ErrorStatus;
548 }
549 
550 inline
552 {
553  // x_Validate("isInErrorStatus");
555 }
556 
557 
558 inline
560 {
561  // x_Validate("MoveTo");
562  SetTop(GetTop() + y);
563 }
564 
565 inline
566 void CLayoutTrack::SetTitle(const string& label, const string& default_title)
567 {
568  // x_Validate("SetTitle");
569  m_Title = label;
570  m_DefaultTitle = default_title;
571 }
572 
573 inline
574 void CLayoutTrack::SetIsBlast(bool isBlast)
575 {
576  // x_Validate("SetTitle");
577  m_isBlast = isBlast;
578 }
579 
580 inline
581 void CLayoutTrack::Expand(bool expand)
582 {
583  // x_Validate("Expand");
584  x_Expand(expand);
585 }
586 
587 inline
589 {
590  // x_Validate("x_GetGlobalConfig");
591  return m_gConfig;
592 }
593 
594 inline
596 {
597  // x_Validate("GetShowTitle");
598  return m_Attrs & fShowTitle;
599 }
600 
601 inline
603 {
604  // x_Validate("SetShowTitle");
605  m_Attrs = (m_Attrs & ~fShowTitle) | (flag ? fShowTitle : 0x0);
606 }
607 
608 inline
610 {
611  // x_Validate("SetConfig");
612  m_gConfig = conf;
613 }
614 
615 inline
617 {
618  // x_Validate("GetIndent");
619  return m_IndentLevel;
620 }
621 
622 inline
624 {
625  // x_Validate("SetIndent");
627 }
628 
629 inline
630 void CLayoutTrack::SetMsg(const string& msg)
631 {
632  // x_Validate("SetMsg");
633  m_Msg = msg;
634 }
635 
636 inline
638 {
639  // x_Validate("SetParentTrack");
640  m_ParentTrack = parent;
641 }
642 
643 inline
645 {
646  // x_Validate("GetParentTrack");
647  return m_ParentTrack;
648 }
649 
650 inline
652 {
653  // x_Validate("GetParentTrack const");
654  return m_ParentTrack;
655 }
656 
657 inline
658 void CLayoutTrack::x_SetStatus(const string& msg, int progress)
659 {
660  // x_Validate("x_SetStatus");
661  m_Msg = msg;
662  m_Progress = progress;
663 }
664 
665 inline
667 {
668  // x_Validate("");
669  m_Msg = ", Loading.....";
670  m_Progress = 0;
671 }
672 
673 inline
675 {
676  // x_Validate("x_SetStartStatus");
677  m_Msg = "";
678  m_Progress = 100;
679 }
680 
681 inline
683 {
684  // x_Validate("x_IsNCBITrack");
685  if (NStr::StartsWith(m_Id, 'R') || NStr::StartsWith(m_Id, 'U') || isRemotePath())
686  return false;
687 
688  return true;
689 }
690 
692 
693 #endif // GUI_WIDGETS_SEQ_GRAPHIC___LAYOUT_TRACK_IMPL__HPP
#define true
Definition: bool.h:35
CFastMutex –.
Definition: ncbimtx.hpp:667
File Description:
bool IsCollapsible() const
int m_IndentLevel
track hierachy indentation level.
void SetShowTitle(bool flag)
bool m_Expanded
is this track in expanded state
void SetTitle(const string &label, const string &default_title=NcbiEmptyString)
bool isRemotePath() const
void SetErrorStatus(const TTrackErrorStatus &ErrorStatus)
EIconID
Icon id used in layout track.
@ eIcon_Content
icon id for setting content
@ eIcon_Expand
expand/collapse icon
@ eIcon_Settings
icon id for track settings
@ eIcon_Layout
icon id for setting layout style
@ eIcon_Help
icon id for track help
virtual void x_RenderContent() const =0
The content rendering must be implemented in the derived layout tracks.
vector< SIconInfo > TIcons
void SetShowFrame(bool show)
bool GetShowTitle() const
void SetIndent(int indent)
void SetId(const string &id)
ILayoutTrackHost * m_LTHost
Top level host owning the tracks.
virtual void SetComments(const string &)
set comments.
virtual void x_Expand(bool expand)
Collapse or expand the track.
string m_Msg
special message need to show on title bar
string m_Title
track title
const TTrackErrorStatus & GetErrorStatus() const
static CFastMutex sm_Mutex
mutex guarding the icon texture map
bool m_ShowFrame
need to draw frame, not title
void MoveTo(TModelUnit y)
int m_Order
track order number
bool m_On
is this track shown
CLayoutTrack * GetParentTrack()
string GetTitle() const
get the track title.
int GetIndent() const
TTrackAttrFlags m_Attrs
various track attributes
const string & GetId() const
list< CRef< CLayoutTrack > > TLayoutTracks
void SetConfig(CRef< CSeqGraphicConfig > conf)
virtual string x_GetHistMsg() const
Histogram configuration (linear, log, etc) is also on the title bar but multiple track types can have...
bool isInErrorStatus() const
void SetShow(bool shown)
set the flag only.
virtual void x_ClearContent()
map< TIconAlias, CIRef< I3DTexture > > TTexMap
bool IsExpanded() const
TIcons m_Icons
registered icon info
virtual bool x_Empty() const =0
int GetOrder() const
map< string, string > TKeyValuePairs
string m_DefaultTitle
Default track title.
@ fCollapsible
can be collpased and expanded.
CLayoutTrack & operator=(const CLayoutTrack &)
string TIconAlias
the icon alias used as a key
void SetIsBlast(bool isBlast)
const string & GetProfile() const
void x_SetStatus(const string &msg, int progress)
unsigned TTrackAttrFlags
void SetParentTrack(CLayoutTrack *parent)
bool IsMovable() const
TTrackErrorStatus m_ErrorStatus
void SetMsg(const string &msg)
CLayoutTrack(const CLayoutTrack &)
prohibited copy constructor and assignment operator.
int m_HighlightedIcon
the highlighted icon index
CConstRef< CSeqGraphicConfig > x_GetGlobalConfig() const
Method for getting global configuration from rendering context.
vector< CConstRef< CSeqGlyph > > TLayObjVector
void SetProfile(const string &preset_style)
CLayoutTrack inline method implmentation.
int m_Progress
any job progress index (0 - 100)
static TTexMap sm_IconMap
only intialized once app-wise
bool IsOn() const
void Expand(bool expand)
Collapse or expand the track.
bool x_IsNCBITrack() const
Indicates whether the track is NCBI track.
CRef< CSeqGraphicConfig > m_gConfig
global configuration.
void SetExpanded(bool f)
CLayoutTrack * m_ParentTrack
parent track (might differ from parent)
virtual const CTrackTypeInfo & GetTypeInfo() const =0
int TIconID
use int as TIconID instead of EIconID.
virtual void SetHighlights(const string &)
string m_Id
track identifier
bool m_isBlast
true if the track is known to be generated and uploaded by BLAST
virtual string GetFullTitle() const
get a more meaningful title.
void SetOrder(int order)
string m_Profile
track setting profile
void SetHost(ILayoutTrackHost *host)
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
class CSeqGlyph defines an interface that wraps a rectilinear abstract object.
Definition: seq_glyph.hpp:82
virtual void x_OnLayoutChanged()
update the layout.
Definition: seq_glyph.cpp:353
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 TModelUnit GetTop() const
Definition: seq_glyph.hpp:599
virtual bool OnLeftDown(const TModelPoint &)
Definition: seq_glyph.cpp:64
virtual void SetTop(TModelUnit b)
Definition: seq_glyph.hpp:658
virtual void x_UpdateBoundingBox()=0
Update the bounding box assuming children's sizes are fixed if any.
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 ~IDroppable()
virtual bool CanDrop(CRef< CLayoutTrack > &track)=0
ILayoutTrackHost An interface used for handling GUI-related events, such as layout change event that ...
primitive interface to arrange tabular data in the tooltips
Definition: tooltip.hpp:55
The NCBI C++ standard methods for dealing with std::string.
static uch flags
GLdouble TModelUnit
Definition: gltypes.hpp:48
TErrorSeverity m_ErrorSeverity
Definition: track_info.hpp:97
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
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 NcbiEmptyString
Definition: ncbistr.hpp:122
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5412
#define NCBI_GUIWIDGETS_SEQGRAPHIC_EXPORT
Definition: gui_export.h:536
static const char label[]
Defines to provide correct exporting from DLLs in Windows.
const struct ncbi::grid::netcache::search::fields::KEY key
Multi-threading – mutexes; rw-locks; semaphore.
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
string indent(" ")
A help struct for storing information about a icon.
TIconAlias m_Icon1_lite
lighter version of icon1 (less opaque)
TIconID m_Id
must be unique within the context
TIconAlias m_Icon1
icon alias for state #1
SIconInfo(TIconID id, const string &tt, bool enabled, const TIconAlias &icon_1, const TIconAlias &icon_2="", const TIconAlias &icon1_lite="")
TIconAlias m_Icon2
icon alias for state #2, optional.
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Sat Mar 02 10:54:06 2024 by modify_doxy.py rev. 669887