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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___SEQGRAPHIC_PANE__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___SEQGRAPHIC_PANE__HPP
3 
4 /* $Id: seqgraphic_pane.hpp 47374 2023-02-23 00:42:16Z 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: Vlad Lebedev, Liangshou Wu
30  *
31  * File Description:
32  * Pane for the Graphic Sequence Widget
33  * (see <gui/widgets/seq_graphic/seqgraphic_widget.hpp>)
34  *
35  */
36 
40 
41 #include <gui/gui.hpp>
42 #include <gui/opengl.h>
43 
48 //#include <gui/widgets/gl/tooltip_handler.hpp>
53 
54 #include <objmgr/seq_vector.hpp>
55 
57 
58 
59 class CSeqGraphicWidget;
60 
61 class CCachedTipHandle : public CObject
62 {
63 public:
64  CCachedTipHandle (const string& t_name, objects::CScope& scope)
65  : m_ParentTrackName(t_name)
66  {
67  m_ObjIndex.Clear(&scope);
68  }
69 
70  void Add(CObject& obj) {
71  m_ObjIndex.Add(NULL, obj);
72  }
73 
74  const string& GetParentTrackName() const { return m_ParentTrackName; }
75  bool HasMatches(const CObject& object, objects::CScope& scope) const
76  { return m_ObjIndex.HasMatches(object, scope); }
77 
78 private:
81 };
82 
83 
84 /// Help class to manage markers.
85 /// It is intended to manage (rename/remove) marker easier.
86 class CMarker : public CObject
87 {
88 public:
90 
92  { m_Handler.Render(pane, option); }
93 
94  void SetLabel(const string& label)
96 
97  const string& GetLabel() const
98  { return m_Handler.GetLabel(); }
99 
100  void SetPos(TModelUnit pos)
101  { m_Handler.SetPos(pos); }
102 
103  TSeqPos GetPos() const
104  { return m_Handler.GetPos(); }
105 
107  { m_Handler.SetExtendedPos(pos); }
108 
110  { m_Handler.SetRange(range); }
111 
113  { return m_Handler.GetExtendedPos(); }
114 
115  void SetColor(const CRgbaColor& color)
116  { m_Handler.SetColor(color); }
117 
118  const CRgbaColor& GetColor() const
119  { return m_Handler.GetColor(); }
120 
121  void SetRemoved(bool f)
122  { m_Deleted = f; }
123 
124  bool IsRemoved() const
125  { return m_Deleted; }
126 
128  { return m_Handler.GetMarkerType(); }
129 
132 
133  void SetFlipped(bool f)
134  { m_Handler.SetFlipped(f); }
135 
136  bool GetFlipped() const
137  { return m_Handler.GetFlipped(); }
138 
139 public:
140  bool m_Deleted;
142 };
143 
144 ////////////////////////////////////////////////////////////////////////////////
145 /// class CSeqGraphicPane
147  public IMouseZoomHandlerHost, ///< for zooming with mouse
148  public ISelHandlerHost, ///< for linear selection
149  public ISeqMarkHandlerHost, ///< for seq bar hairpin
150  public ITrackHandlerHost, ///< for layout track interaction
151  public CEventHandler,
152  public ILayoutTrackHost,
153  public IGlyphDialogHost,
155  //public IClipboardHandler,
156 {
158 public:
160  fArea_Ruler = 1 << 0,
161  fArea_Object = 1 << 1,
162  fArea_Alignment = 1 << 2,
163  fArea_Feature = 1 << 3,
165  fArea_Track = 1 << 5,
166  fArea_Container = 1 << 6,
167  fArea_Other = 1 << 7,
168 
171  };
172 
175 
176  // Feature navigation
177  enum EDirection {
181  eDir_Right
182  };
183 
184  enum EMouseMode {
185  eMouse_RectSelect, ///< with SHIFT key down
186  eMouse_IncRectSelect, ///< with SHIFT and CTRL key down
187  eMouse_IncSelect, ///< with CTRL key down
188  eMouse_Pan, ///< left click and drag
189  eMouse_Down, ///< left button down, not sure what to do yet
190  eMouse_Idle ///< no button down
191  };
192 
194  //CSeqGraphicPane(int x, int y, int w, int h);
195  virtual ~CSeqGraphicPane();
196 
198  void SetNonAsnInput(const INonAsnTrackData& data);
202 
204 
205  //void SetWidget(CSeqGraphicWidget* pParent);
206  //void Resize(const TVPRect& rc);
207 
208  void SetExternalGlyphs(const CSeqGlyph::TObjects& objs);
209 
210  void GetFeatureNames(vector<string>& names);
211 
212  /* TODO: there is no implementation for the following functions
213  void ShowFeature(objects::CSeqFeatData::E_Choice t,
214  objects::CSeqFeatData::ESubtype s, bool flag);
215  bool IsFeatureShown(objects::CSeqFeatData::E_Choice t,
216  objects::CSeqFeatData::ESubtype s);
217 
218  TModelUnit GetZoomX(void) const;
219  */
220 
221  bool CanSetSwitchPoint();
222 
223  void OnKeyUp(wxKeyEvent& event);
224  void OnKeyDown(wxKeyEvent& event);
225  void OnMotion(wxMouseEvent& event);
226  void OnLeftUp(wxMouseEvent& event);
227  void OnLeftDown(wxMouseEvent& event);
228  void OnMiddleDown(wxMouseEvent& event);
229  void OnLeftDblClick(wxMouseEvent& event);
230  void OnMouseWheel(wxMouseEvent& event);
231  void OnContextMenu(wxContextMenuEvent& event);
232 
233  void OnScrollEnd(wxScrollEvent& event);
234  void OnMouseCaptureLost(wxMouseCaptureLostEvent& /*event*/);
235 
236  void OnKillFocus(wxFocusEvent& event);
237 
238  int GetPopupArea(wxPoint pos);
239 
241 
242  /// Potential actions include loading data and generating layouts.
243  void AdjustViewPort();
244  void SetUpdateContent();
245  void UpdateData(TSeqPos from, TSeqPos to);
247  void SetViewportWidth(TSeqPos from, TSeqPos to, TVPUnit vp_width);
248 
249  bool AllJobsFinished() const;
250  bool AllTracksCreated() const;
251 
252  void SetHorizontal(bool b_horz, bool b_flip);
253  bool IsHorizontal() const;
254  bool IsFlipped() const;
255 
256  void SetSeqMarker(TModelPoint point);
257  void RemoveMarker(const string& marker_id);
258  size_t GetMarkerNum() const;
259  const TSeqMarkers& GetAllMarkers() const;
260  void AddPointMarker(const string& name, TSeqPos pos, const CRgbaColor color);
261  void AddRangeMarker(const string& name, TSeqRange range, const CRgbaColor color);
262 
263  void RemoveAllMarkers();
264  string GetNewMarkerName();
265  void RenameMarker(const string& id, const string& label);
266  void ModifyMarker(const string& id, const string& label,
267  TSeqPos pos, const CRgbaColor color);
268  void ModifyMarker(const string& id, const string& label,
270 
271  void SetSeqStartPoint(TModelPoint point);
272  void SetSeqStart(TSeqPos pos);
273  void SetSeqStartMarker(const string& id);
274  void ResetSeqStart();
275  void SetSwitchPoint();
276 
277  string GetHitMarker() const;
278  CConstRef<CMarker> GetMarker(const string& id);
279 
280  /// @name interface from wxWindows.
281  /// @{
282  virtual void Update(void) override;
283  /// @}
284 
285  /// the config object just changed. Do what is necessary.
286  void UpdateConfig();
288  void OnDataChanged();
289 
290  /// @name selection operations
291  /// selection-related methods.
292  /// @{
293  void DeSelectObject(const CObject* obj);
294  void SelectObject(const CObject* obj, bool verified);
295  void SelectLastHitObject(int mouse_x, int mouse_y);
296  void SelectOnlyThisObject(const CSeqGlyph* glyph, int mouse_x, int mouse_y);
297  void SelectSeqLoc(const objects::CSeq_loc* loc);
298  void ResetSelection();
299  void ResetRangeSelection();
300  void ResetObjectSelection();
301  /// @}
302 
303  /// retrieve the selections from our renderer.
304  void GetObjectSelection(TConstObjects& objs) const;
305  const TRangeColl& GetRangeSelection(void) const;
306  void SetRangeSelection(const TRangeColl& ranges);
308 
309  /// @name IMouseZoomHandlerHost implementation
310  /// @{
311  virtual TModelUnit MZHH_GetScale(EScaleType type) override;
312  virtual void MZHH_SetScale(TModelUnit scale, const TModelPoint& point) override;
313  virtual void MZHH_ZoomPoint(const TModelPoint& point, TModelUnit factor) override;
314  virtual void MZHH_ZoomRect(const TModelRect& rc) override;
315  virtual void MZHH_Scroll(TModelUnit d_x, TModelUnit d_y) override;
316  virtual TVPUnit MZHH_GetVPPosByY(int y) const override;
317  virtual void MZHH_EndOp() override;
318  /// @}
319 
320  /// @name ISelHandlerHost implementation
321  /// @{
322  virtual void SHH_OnChanged() override;
323  virtual TModelUnit SHH_GetModelByWindow(int z, EOrientation orient) override;
324  virtual TVPUnit SHH_GetWindowByModel(TModelUnit z, EOrientation orient) override;
325  /// @}
326 
327  /// @name ISeqMarkHandlerHost implementation
328  /// @{
329  virtual TModelUnit SMHH_GetModelByWindow(int z, EOrientation orient) override;
330  virtual TSeqPos SMHH_GetSeqMark() const override;
331  virtual void SMHH_SetSeqMark(TSeqPos mark) override;
332  virtual void SMHH_OnReset(const string& id) override;
333  /// @}
334 
335  /// @name class ITrackHandlerHost implementation
336  /// @{
337  virtual CRef<CLayoutTrack> THH_GetLayoutTrack() override;
338  virtual TModelPoint THH_GetModelByWindow(const wxPoint& pt) override;
339  /// @}
340 
341  /// @name ITooltipClient implementation
342  /// @{
343  //virtual bool TC_NeedTooltip(const wxPoint&);
344  //virtual string TC_GetTooltip(const wxRect&);
345  /// @}
346 
347  /// @name IStickyTooltipHandlerHost implementation
348  /// @{
349  virtual string TTHH_NeedTooltip(const wxPoint& pt) override;
350  virtual CTooltipInfo TTHH_GetTooltip(const wxRect& rect) override;
351  virtual bool TTHH_ProcessURL(const wxString &href) override;
352  /// @}
353 
354 
355  /// @name ILayoutTrackHost implementation
356  /// @{
357  //virtual TVPPoint LTH_GetVPPosByWindowPos(const wxPoint& pos);
358  virtual void LTH_OnLayoutChanged() override;
359  virtual void LTH_ZoomOnRange(const TSeqRange& range) override;
360  virtual void LTH_PopupMenu(wxMenu* menu) override;
361  virtual void LTH_PushEventHandler(wxEvtHandler* handler) override;
362  virtual void LTH_PopEventHandler() override;
363  virtual void LTH_ConfigureTracksDlg(const string& category) override;
364  virtual void ResetSearch() override;
365  /// @}
366 
367 
368  /// @name IGlyphDialogHost implementation
369  /// @{
370  virtual void PreDialogShow() override;
371  virtual void PostDialogShow() override;
372  /// @}
373 
374 
375  TSeqRange FindText(const string &text, bool match_case);
376 
377 public:
378 
379  /// @name Command handlers
380  /// @{
381  void ZoomObject(void);
382  bool CanZoomSelection(void);
383 
384  //void OnEditCut(void);
385  void OnEditCopy(void);
386  //void OnEditPaste(void);
387  void NextPrevSplice(EDirection dir);
388 
389  void LoadDefaultTracks();
390  /// @param expand true if expand, false if collapse
391  void ExpandAllTracks(bool expand);
392  void ShowAllTracks(bool shown) { m_Renderer->ShowAllTracks(shown); }
393 
394  bool CanGoBack(void) const;
395  bool CanGoForward(void) const;
396  void GoBack(void);
397  void GoForward(void);
398  /// @}
399 
400  void SaveCurrentRange(); ///< For Back or Forward operations.
401  void SaveTrackConfig();
402 
403  /// @name IVectorGraphicsRenderer implementations
404  /// @{
405  virtual const TVPRect& GetViewportRect() const override;
406  /// Render for vector output.
407  virtual void RenderVectorGraphics(int vp_width, int vp_height) override;
408  virtual void UpdateVectorLayout() override;
409  virtual void AddTitle(bool b) override { m_Title = b; }
410  /// @)
411 
412  /// Indicate pane is only for creating vector graphics - ignore other draw events
413  void SetVectorMode(bool b) { m_VectorPane = b; }
414 
415  void OnSearchTip(const string& tip_id, const wxRect& tip_rect);
416  void OnZoomTip(const string& tip_id, const wxRect& /*tip_rect*/);
417  void OnInfoTip(const string& /*tip_id*/);
418  void SetActivatedTip(const string& id);
419  void OnTipAdded(const string& tip_id);
420  void OnTipRemoved(const string& tip_id);
421 
422  /// get/set markers stored as a string.
423  /// Syntax: <position>|<marker name>|<color in RGB hex>
424  /// Multiple markers can be set by separating the triples with a comma,
425  /// and the name and color parameters are optional.
426  /// Examples:
427  /// - 1000
428  /// - 1000|Marker1|00ff00,
429  /// - 1000|Marker1|00ff00,3000|Marker2|80ff10
430  string GetMarkers() const;
431  void SetMarkers(const string& markers);
432  TSeqPos GetSeqStart() const;
433 
434  void GetCurrentObject(int mouse_x, int mouse_y, TConstObjects& objs);
435 protected:
437 
438  void x_OnPurgeMarkers(CEvent*);
439 
440  /// @name Methods from CGLWidgetPane
441  /// @{
442  virtual int x_GetAreaByVPPos(int vp_x, int vp_y) override;
443 
444  /// Get GL view port size.
445  /// It is required by CGlWidgetPane. There is no actuall meaning.
446  virtual TVPPoint GetPortSize(void) override;
447  /// @}
448 
451 
452  /// Draw the GL window.
453  /// It is declared in CwxGLCanvas.
454  virtual void x_Render() override;
455 
457  { return (CSeqGraphicWidget*) GetParent(); }
458 
460  { return (CSeqGraphicWidget*) GetParent(); }
461 
462 private:
463  void x_SelectByRect();
465  void x_RenderRectSelHandler(CGlPane& pane); ///< Rectangular selection
466  void x_ChangeSwitchPoint();
467  void x_OnEndRectSelect();
468  void x_OnEndPan();
469  void x_OnPan();
470 
472  string x_GetCachedTipId(const CSeqGlyph* glyph) const;
473  CWeakRef<CSeqGlyph> x_GetGlyphByTipId(const string& tip_id);
474 
475  /// @name marker-related methods
476  /// @ {
478  void x_AddNewMarker(CRef<CMarker> marker,
479  const string& label,
480  const CRgbaColor& color);
481  void x_RemoveMarker(const string& id);
482  bool x_HasDefaultMarker() const;
483  void x_ClearMarkers();
484  bool x_ModifyMarker(CRef<CMarker>& marker,
485  const string& id,
486  const string& label,
487  const CRgbaColor color);
488  /// @ }
489 private:
490  typedef vector <TSeqRange> TRangeVec;
491 
496 
497  /// last hit glyph.
498  /// not necessarilly selected glyph, and not limited to selectable glyphs.
500 
501  /// @name Handlers
502  /// @{
506  //CTooltipHandler m_TooltipHandler;
509  /// @}
510 
511  /// @name navigation history
512  /// @{
514  size_t m_BackForwardPos; ///< position in m_BackForwardHistory
515  /// @}
516 
517  //string m_TooltipText;
522 
523  /// @name Rectangular selection
524  /// @{
525  wxPoint m_StartPoint;
526  wxPoint m_DragPoint;
527  wxPoint m_CurrMouse;
528  /// @}
529 
531  bool m_Flipped;
532  bool m_Horz;
533 
534  /// Marker handler index among all registered handlers.
536  size_t m_MarkerId;
538 
539  /// When rendering vector image, add a title
540  bool m_Title;
541 
542  /// If true pane is only for creating vector graphics - ignore other draw events
544 
545 #ifdef ATTRIB_MENU_SUPPORT
546  float m_RenderMs;
547  string m_GlRenderer;
548 #endif
549 };
550 
551 
552 ////////////////////////////////////////////////////////////////////////////////
553 /// class CSeqGraphicPane
554 ////////////////////////////////////////////////////////////////////////////////
555 inline
557 {
558  return m_Renderer->GetHeight();
559 }
560 
561 inline
563 {
565 }
566 
567 inline
569 {
570  return m_Horz;
571 }
572 
573 inline
575 {
576  return m_Flipped;
577 }
578 
579 inline
581 {
583 }
584 
585 inline
587 {
588  m_Renderer->ExpandAllTracks(expand);
589 }
590 
591 inline
593 {
595 }
596 
597 inline void CSeqGraphicPane::SetActivatedTip(const string& id)
598 {
599  m_ActivatedTipId = id;
600 }
601 
602 inline
604 {
605  return m_SeqMarkers;
606 }
607 
608 inline
610 {
612 }
613 
614 inline
616 {
617  return m_SeqStart;
618 }
619 
620 
622 
623 #endif /* GUI_WIDGETS_SEQ_GRAPHIC___SEQGRAPHIC_PANE__HPP */
void Add(CObject &obj)
CCachedTipHandle(const string &t_name, objects::CScope &scope)
const string & GetParentTrackName() const
bool HasMatches(const CObject &object, objects::CScope &scope) const
CObjectIndex m_ObjIndex
CConstRef –.
Definition: ncbiobj.hpp:1266
CEventHandler.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
class CGlPane
Definition: glpane.hpp:62
CGlWidgetPane represent a window component residing in CGlWidgetBase client area.
CLayoutTrackHandler - is the handler for handling the user interactions on layout tracks.
Class CLinearSelHandler represents in GUI a one-dimnesional multi-segment selection.
Help class to manage markers.
bool IsRemoved() const
void SetColor(const CRgbaColor &color)
void SetMarkerType(CSeqMarkHandler::EMarkerType t)
void SetFlipped(bool f)
void SetRemoved(bool f)
void SetExtendedPos(TModelUnit pos)
void Render(CGlPane &pane, CSeqMarkHandler::ERenderingOption option)
TSeqPos GetExtendedPos() const
const CRgbaColor & GetColor() const
void SetRange(TSeqRange range)
CSeqMarkHandler m_Handler
const string & GetLabel() const
void SetPos(TModelUnit pos)
bool GetFlipped() const
CSeqMarkHandler::EMarkerType GetMarkerType() const
TSeqPos GetPos() const
void SetLabel(const string &label)
CMouseZoomHandler provides support for mouse-driven zoom and pan operations.
void Clear(objects::CScope *scope)
bool HasMatches(const CObject &object, objects::CScope &scope) const
void Add(ISelObjectHandle *obj_handle, CObject &obj)
CObject –.
Definition: ncbiobj.hpp:180
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
class CSeqGlyph defines an interface that wraps a rectilinear abstract object.
Definition: seq_glyph.hpp:82
list< CRef< CSeqGlyph > > TObjects
Definition: seq_glyph.hpp:85
class CSeqGraphicPane
CConstRef< CSeqGlyph > x_GetOnlyOneSelectedGlyph()
virtual void SMHH_SetSeqMark(TSeqPos mark) override
The derived class may choose do something differently when marker position is changed.
void OnTipRemoved(const string &tip_id)
string GetMarkers() const
get/set markers stored as a string.
void OnTipAdded(const string &tip_id)
void x_RemoveMarker(const string &id)
virtual TModelUnit SMHH_GetModelByWindow(int z, EOrientation orient) override
CSeqMarkHandler & x_GetDefaultMarker()
CConstRef< CSeqGlyph > GetSelectedLayoutObj()
map< string, CRef< CMarker > > TSeqMarkers
void OnMiddleDown(wxMouseEvent &event)
void NextPrevSplice(EDirection dir)
CRef< CSeqGraphicConfig > m_ConfigSettings
TSeqMarkers m_SeqMarkers
CSeqGraphicWidget * x_GetParent()
virtual void LTH_OnLayoutChanged() override
provides mouse coords in OpenGL viewport coord system
virtual void MZHH_SetScale(TModelUnit scale, const TModelPoint &point) override
void ExpandAllTracks(bool expand)
@ eMouse_Idle
no button down
@ eMouse_RectSelect
with SHIFT key down
@ eMouse_IncRectSelect
with SHIFT and CTRL key down
@ eMouse_IncSelect
with CTRL key down
@ eMouse_Pan
left click and drag
@ eMouse_Down
left button down, not sure what to do yet
const TRangeColl & GetRangeSelection(void) const
virtual void UpdateVectorLayout() override
CConstRef< CMarker > GetMarker(const string &id)
TModelUnit GetHeight()
class CSeqGraphicPane
virtual ~CSeqGraphicPane()
virtual TModelPoint THH_GetModelByWindow(const wxPoint &pt) override
void SetRangeSelection(const TRangeColl &ranges)
void x_NotifyWidgetRangeChanged()
CTooltipInfo m_TooltipInfo
bool CanGoBack(void) const
virtual void MZHH_ZoomRect(const TModelRect &rc) override
virtual void PostDialogShow() override
Post-processing after showing a dialog.
CSeqGraphicPane(CSeqGraphicWidget *parent)
void SelectOnlyThisObject(const CSeqGlyph *glyph, int mouse_x, int mouse_y)
virtual const TVPRect & GetViewportRect() const override
virtual TVPUnit MZHH_GetVPPosByY(int y) const override
converts window coord to Viewport coord
void OnMouseCaptureLost(wxMouseCaptureLostEvent &)
void RemoveMarker(const string &marker_id)
void InitDataSource(SConstScopedObject &obj)
void SetViewportWidth(TSeqPos from, TSeqPos to, TVPUnit vp_width)
const CSeqGraphicWidget * x_GetParent() const
void SelectSeqLoc(const objects::CSeq_loc *loc)
TSeqRange FindText(const string &text, bool match_case)
bool CanGoForward(void) const
bool AllJobsFinished() const
virtual void SMHH_OnReset(const string &id) override
The derived class may need to do something differently when a marker gets reset, such as remove the m...
void AddPointMarker(const string &name, TSeqPos pos, const CRgbaColor color)
void GetFeatureNames(vector< string > &names)
void AdjustViewPort()
Potential actions include loading data and generating layouts.
void GetObjectSelection(TConstObjects &objs) const
retrieve the selections from our renderer.
CRef< CSeqGraphicConfig > GetConfig()
virtual void LTH_ZoomOnRange(const TSeqRange &range) override
notifies the host we need to zoom on to a range.
string GetHitMarker() const
CWeakRef< CSeqGlyph > x_GetGlyphByTipId(const string &tip_id)
void SetSeqStart(TSeqPos pos)
void SetInputObject(SConstScopedObject &obj)
void SetSeqStartMarker(const string &id)
bool IsHorizontal() const
void SetSeqStartPoint(TModelPoint point)
virtual void LTH_PopupMenu(wxMenu *menu) override
show track-specific context menu.
void x_RenderRectSelHandler(CGlPane &pane)
Rectangular selection.
void SetVectorMode(bool b)
@)
virtual void PreDialogShow() override
Prepare for showing a dialog.
bool m_VectorPane
If true pane is only for creating vector graphics - ignore other draw events.
CWeakRef< CSeqGlyph > m_LastHitGlyph
last hit glyph.
virtual void x_Render() override
Draw the GL window.
CRef< CSGSequenceDS > m_DS
void OnMouseWheel(wxMouseEvent &event)
const TSeqMarkers & GetAllMarkers() const
EMouseMode m_MouseMode
int m_MarkerHandlerIndex
Marker handler index among all registered handlers.
void SetHorizontal(bool b_horz, bool b_flip)
virtual void ResetSearch() override
TRangeVec m_BackForwardHistory
void OnLeftDblClick(wxMouseEvent &event)
void UpdateConfig()
the config object just changed. Do what is necessary.
bool AllTracksCreated() const
virtual TModelUnit MZHH_GetScale(EScaleType type) override
CMouseZoomHandler m_MouseZoomHandler
virtual void Update(void) override
void GetCurrentObject(int mouse_x, int mouse_y, TConstObjects &objs)
void SelectObject(const CObject *obj, bool verified)
virtual void MZHH_ZoomPoint(const TModelPoint &point, TModelUnit factor) override
CRef< CSeqGraphicRenderer > m_Renderer
virtual void LTH_PushEventHandler(wxEvtHandler *handler) override
CStickyTooltipHandler m_TooltipManager
void AdjustViewPortHeightToImage()
bool m_Title
When rendering vector image, add a title.
virtual CTooltipInfo TTHH_GetTooltip(const wxRect &rect) override
Return the contents to be displayed in the tool tip.
void OnScrollEnd(wxScrollEvent &event)
TSeqPos GetSeqStart() const
void ShowAllTracks(bool shown)
virtual void AddTitle(bool b) override
void x_OnPurgeMarkers(CEvent *)
CFeaturePanel * GetFeaturePanel()
TPinnedTips m_PinnedTips
bool IsFlipped() const
void SetExternalGlyphs(const CSeqGlyph::TObjects &objs)
CSGSequenceDS * GetDataSource(void)
virtual int x_GetAreaByVPPos(int vp_x, int vp_y) override
virtual void LTH_ConfigureTracksDlg(const string &category) override
void OnKeyUp(wxKeyEvent &event)
void SaveCurrentRange()
For Back or Forward operations.
void OnLeftUp(wxMouseEvent &event)
bool x_HasDefaultMarker() const
void ModifyMarker(const string &id, const string &label, TSeqPos pos, const CRgbaColor color)
virtual void MZHH_EndOp() override
size_t GetMarkerNum() const
virtual void MZHH_Scroll(TModelUnit d_x, TModelUnit d_y) override
virtual TModelUnit SHH_GetModelByWindow(int z, EOrientation orient) override
virtual TVPPoint GetPortSize(void) override
Get GL view port size.
map< string, CRef< CCachedTipHandle > > TPinnedTips
virtual TSeqPos SMHH_GetSeqMark() const override
If the host needs to dictate/store the marker position, then it needs to return a non (TSeqPos)-1 val...
virtual void SHH_OnChanged() override
ISelHandlerHost implementation.
size_t m_BackForwardPos
position in m_BackForwardHistory
CIRef< ISGDataSourceContext > m_DSContext
bool x_ModifyMarker(CRef< CMarker > &marker, const string &id, const string &label, const CRgbaColor color)
CLinearSelHandler::TRangeColl TRangeColl
virtual CRef< CLayoutTrack > THH_GetLayoutTrack() override
Get the layout track under the current mouse position.
virtual bool TTHH_ProcessURL(const wxString &href) override
Return true if the specified URL has been processed. Used for custom commands.
void DeSelectObject(const CObject *obj)
void SelectLastHitObject(int mouse_x, int mouse_y)
virtual string TTHH_NeedTooltip(const wxPoint &pt) override
Return id of the underlying element to dispaly a tooltip, otherwise "".
vector< TSeqRange > TRangeVec
@ }
CLayoutTrackHandler m_TrackHandler
void OnSearchTip(const string &tip_id, const wxRect &tip_rect)
void OnLeftDown(wxMouseEvent &event)
int GetPopupArea(wxPoint pos)
void OnZoomTip(const string &tip_id, const wxRect &)
void OnKeyDown(wxKeyEvent &event)
virtual void RenderVectorGraphics(int vp_width, int vp_height) override
Render for vector output.
void SetMarkers(const string &markers)
virtual void LTH_PopEventHandler() override
string x_GetCachedTipId(const CSeqGlyph *glyph) const
bool CanZoomSelection(void)
void SetSeqMarker(TModelPoint point)
CLinearSelHandler m_SelHandler
void OnKillFocus(wxFocusEvent &event)
void SetNonAsnInput(const INonAsnTrackData &data)
void OnInfoTip(const string &)
void RenameMarker(const string &id, const string &label)
void x_AddNewMarker(CRef< CMarker > marker, const string &label, const CRgbaColor &color)
void OnMotion(wxMouseEvent &event)
void AddRangeMarker(const string &name, TSeqRange range, const CRgbaColor color)
void SetActivatedTip(const string &id)
void OnContextMenu(wxContextMenuEvent &event)
virtual TVPUnit SHH_GetWindowByModel(TModelUnit z, EOrientation orient) override
void UpdateData(TSeqPos from, TSeqPos to)
void ShowAllTracks(bool shown)
void ExpandAllTracks(bool expand)
Class CSeqMarkHandler represents in GUI a single "hairpin" on a sequence bar.
const CRgbaColor & GetColor() const
void SetMarkerType(EMarkerType t)
void Render(CGlPane &Pane, ERenderingOption option)
const string & GetLabel() const
TSeqPos GetExtendedPos() const
EMarkerType GetMarkerType() const
bool GetFlipped() const
void SetLabel(const string &label)
void SetRange(TSeqRange range)
TSeqPos GetPos() const
void SetColor(const CRgbaColor &color)
void SetPos(TModelUnit pos)
void SetFlipped(bool flipped)
void SetExtendedPos(TModelUnit pos)
CStickyTooltipHandler : Class that manages all the tooltips for a specific window.
Contents of a single tool tip including display text and an ID that will indicate which underlying vi...
IGlyphDialogHost An interface used for handling issues related to any dialog pops up that requires so...
Definition: seq_glyph.hpp:399
ILayoutTrackHost An interface used for handling GUI-related events, such as layout change event that ...
Interface IMouseZoomHandlerHost represents a context in which CMouseZoomHandler functions.
class ISelHandlerHost
class ISeqMarkHandlerHost
ITrackHandlerHost ITrackHandlerHost represents a context for handling the user interactions on a layo...
Interface class for the pdf renderer.
Definition: map.hpp:338
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
static const struct name_t names[]
#define false
Definition: bool.h:36
#define option
char data[12]
Definition: iconv.c:80
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define NULL
Definition: ncbistd.hpp:225
GLdouble TModelUnit
Definition: gltypes.hpp:48
EScaleType
Definition: glpane.hpp:47
int TVPUnit
Definition: gltypes.hpp:47
EOrientation
Definition: gltypes.hpp:58
vector< CConstRef< CObject > > TConstObjects
Definition: objects.hpp:64
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static const char label[]
n background color
static void text(MDB_val *v)
Definition: mdb_dump.c:62
range(_Ty, _Ty) -> range< _Ty >
EIPRangeType t
Definition: ncbi_localip.c:101
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
Standard mechanism to include OpenGL headers for all platforms.
Definition: type.c:6
Modified on Tue Apr 23 07:40:58 2024 by modify_doxy.py rev. 669887