NCBI C++ ToolKit
|
Search Toolkit Book for CAlignMarkHandler
CAlignMarkHandler manages handling and editing of marks on alignments. More...
#include <gui/widgets/aln_multiple/align_mark_handler.hpp>
Classes | |
struct | SMarkDelta |
helper class representing range being edited More... | |
Public Types | |
typedef IAlnExplorer::TNumrow | TNumrow |
typedef IAlignMarkHandlerHost::TRangeColl | TRangeColl |
typedef IAlignMarkHandlerHost::TSelListModel | TSelListModel |
typedef map< TNumrow, TRangeColl > | TRowToMarkMap |
Public Member Functions | |
CAlignMarkHandler () | |
void | SetHost (IAlignMarkHandlerHost *pHost) |
IGenericHandlerHost * | GetGenericHost () |
virtual void | SetPane (CGlPane *pane) |
virtual wxEvtHandler * | GetEvtHandler () |
void | Render (CGlPane &Pane) |
Operations with Mark (don't automaticaly update display) | |
void | MarkRowSeq (TNumrow row, const TRangeColl &C, bool set) |
mark/unmark a collection of intervals in seq. coordinates More... | |
void | MarkRow (TNumrow row, const TRangeColl &C, bool set) |
mark/unmark a collection of intervals in alignment coordinates More... | |
void | UnMarkAll (TNumrow row) |
const TRangeColl * | GetMark (TNumrow row) const |
void | MarkSelectedRows (const TRangeColl &C, bool set) |
void | UnMarkAll () |
void | UnMarkSelected () |
const TRowToMarkMap & | GetMarks () const |
wxWidgets event handling | |
void | OnLeftDown (wxMouseEvent &event) |
void | OnLeftUp (wxMouseEvent &event) |
void | OnMotion (wxMouseEvent &event) |
void | OnMouseCaptureLost (wxMouseCaptureLostEvent &evt) |
void | OnKeyDown (wxKeyEvent &event) |
void | OnKeyUp (wxKeyEvent &event) |
Public Member Functions inherited from IGlEventHandler | |
virtual | ~IGlEventHandler () |
Protected Types | |
enum | EState { eIdle , eReady , eResize } |
typedef map< TNumrow, SMarkDelta > | TRowToDeltaMap |
Protected Attributes | |
TRowToMarkMap | m_mpRowToMark |
TRowToDeltaMap | m_mpRowToDelta |
Marks. More... | |
IAlignMarkHandlerHost * | m_Host |
Ranges being edited. More... | |
CGlPane * | m_Pane |
bool | m_bHitResizable |
EState | m_State |
wxStockCursor | m_CursorId |
operation type More... | |
TSeqPos | m_PrevPos |
CRgbaColor | m_FillColor |
CRgbaColor | m_FrameColor |
int | m_DragArea |
CAlignMarkHandler manages handling and editing of marks on alignments.
It holds a collection of marks corresponding to sequences of the alignment and processes events in order to provide interactive editing of marks. CAlignMarkHandler renders marks in the provided CGlPane instance (which needs to be properly setup). Each mark is represented as collection of intervals stored in CRangeCollection container.
Definition at line 98 of file align_mark_handler.hpp.
Definition at line 104 of file align_mark_handler.hpp.
Definition at line 106 of file align_mark_handler.hpp.
|
protected |
Definition at line 206 of file align_mark_handler.hpp.
typedef map<TNumrow, TRangeColl> CAlignMarkHandler::TRowToMarkMap |
Definition at line 109 of file align_mark_handler.hpp.
Definition at line 107 of file align_mark_handler.hpp.
|
protected |
Enumerator | |
---|---|
eIdle | |
eReady | |
eResize |
Definition at line 149 of file align_mark_handler.hpp.
CAlignMarkHandler::CAlignMarkHandler | ( | ) |
Definition at line 57 of file align_mark_handler.cpp.
|
virtual |
Implements IGlEventHandler.
Definition at line 90 of file align_mark_handler.cpp.
IGenericHandlerHost * CAlignMarkHandler::GetGenericHost | ( | ) |
Definition at line 78 of file align_mark_handler.cpp.
References m_Host.
Referenced by OnKeyDown(), OnMouseCaptureLost(), x_OnChangeSelRange(), x_OnEndSelRange(), x_OnResetAll(), x_OnSelectCursor(), x_OnStartSel(), and x_UpdateState().
const CAlignMarkHandler::TRangeColl * CAlignMarkHandler::GetMark | ( | TNumrow | row | ) | const |
Definition at line 146 of file align_mark_handler.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), m_mpRowToMark, NULL, and row.
const CAlignMarkHandler::TRowToMarkMap & CAlignMarkHandler::GetMarks | ( | ) | const |
Definition at line 189 of file align_mark_handler.cpp.
References m_mpRowToMark.
Referenced by CAlnMultiPane::GetMarks().
void CAlignMarkHandler::MarkRow | ( | TNumrow | row, |
const TRangeColl & | C, | ||
bool | set | ||
) |
mark/unmark a collection of intervals in alignment coordinates
Definition at line 115 of file align_mark_handler.cpp.
References map_checker< Container >::end(), IAlnExplorer::eRight, map_checker< Container >::find(), IAlnMultiDataSource::GetSeqPosFromAlnPos(), map_checker< Container >::insert(), ITERATE, m_mpRowToMark, IAlignMarkHandlerHost::MHH_GetAlnDS(), row, and x_GetHost().
Referenced by MarkSelectedRows().
void CAlignMarkHandler::MarkRowSeq | ( | TNumrow | row, |
const TRangeColl & | C, | ||
bool | set | ||
) |
mark/unmark a collection of intervals in seq. coordinates
Definition at line 99 of file align_mark_handler.cpp.
References CRangeCollection< Position >::CombineWith(), map_checker< Container >::end(), map_checker< Container >::find(), map_checker< Container >::insert(), m_mpRowToMark, row, and CRangeCollection< Position >::Subtract().
void CAlignMarkHandler::MarkSelectedRows | ( | const TRangeColl & | C, |
bool | set | ||
) |
Definition at line 153 of file align_mark_handler.cpp.
References ITERATE, MarkRow(), IAlignMarkHandlerHost::MHH_GetSelListModel(), row, ISelListModel< Item >::SLM_GetItem(), ISelListModel< Item >::SLM_GetSelectedIndices(), and x_GetHost().
Referenced by CAlnMultiPane::MarkSelectedRows().
void CAlignMarkHandler::OnKeyDown | ( | wxKeyEvent & | event | ) |
Definition at line 247 of file align_mark_handler.cpp.
References GetGenericHost(), IGenericHandlerHost::GHH_Redraw(), UnMarkSelected(), x_MarkState(), and x_UpdateState().
void CAlignMarkHandler::OnKeyUp | ( | wxKeyEvent & | event | ) |
Definition at line 263 of file align_mark_handler.cpp.
References eIdle, eResize, m_State, x_MarkState(), x_OnEndSelRange(), and x_UpdateState().
void CAlignMarkHandler::OnLeftDown | ( | wxMouseEvent & | event | ) |
Definition at line 204 of file align_mark_handler.cpp.
References x_MarkState(), x_OnSelectCursor(), and x_OnStartSel().
void CAlignMarkHandler::OnLeftUp | ( | wxMouseEvent & | event | ) |
Definition at line 233 of file align_mark_handler.cpp.
References eIdle, eReady, eResize, m_State, x_MarkState(), and x_OnEndSelRange().
void CAlignMarkHandler::OnMotion | ( | wxMouseEvent & | event | ) |
Definition at line 215 of file align_mark_handler.cpp.
References eResize, m_State, x_MarkState(), x_OnChangeSelRange(), and x_OnSelectCursor().
void CAlignMarkHandler::OnMouseCaptureLost | ( | wxMouseCaptureLostEvent & | evt | ) |
Definition at line 757 of file align_mark_handler.cpp.
References eIdle, GetGenericHost(), IGenericHandlerHost::GHH_Redraw(), m_State, and x_OnSelectCursor().
void CAlignMarkHandler::Render | ( | CGlPane & | Pane | ) |
Definition at line 650 of file align_mark_handler.cpp.
References CGlRect< T >::Bottom(), CGlPane::Close(), IRender::Color4d(), IRender::ColorC(), delta(), COpenRange< Position >::Empty(), map_checker< Container >::end(), map_checker< Container >::find(), CRange_Base::GetFrom(), GetGl(), CGlPane::GetOffsetX(), CGlPane::GetOffsetY(), COpenRange< Position >::GetToOpen(), CGlPane::GetVisibleRect(), CGlRect< T >::IsEmpty(), ITERATE, m_FillColor, m_FrameColor, m_mpRowToDelta, m_mpRowToMark, IAlignMarkHandlerHost::MHH_GetAlnDS(), IAlignMarkHandlerHost::MHH_GetLineByRowNum(), IAlignMarkHandlerHost::MHH_GetLineHeight(), IAlignMarkHandlerHost::MHH_GetLinePosY(), IAlignMarkHandlerHost::MHH_GetSelListModel(), CGlPane::OpenOrtho(), IRender::PolygonMode(), IRender::Rectd(), row, ISelListModel< Item >::SLM_IsItemSelected(), CGlRect< T >::Top(), x_AlnRangeFromSeqRange(), and x_GetHost().
Referenced by CAlnMultiPane::x_RenderMark().
void CAlignMarkHandler::SetHost | ( | IAlignMarkHandlerHost * | pHost | ) |
Definition at line 72 of file align_mark_handler.cpp.
References m_Host.
|
virtual |
Reimplemented from IGlEventHandler.
Definition at line 84 of file align_mark_handler.cpp.
References m_Pane.
void CAlignMarkHandler::UnMarkAll | ( | ) |
Definition at line 168 of file align_mark_handler.cpp.
References map_checker< Container >::clear(), and m_mpRowToMark.
void CAlignMarkHandler::UnMarkAll | ( | TNumrow | row | ) |
Definition at line 140 of file align_mark_handler.cpp.
References map_checker< Container >::erase(), m_mpRowToMark, and row.
Referenced by CAlnMultiPane::UnMarkAll().
void CAlignMarkHandler::UnMarkSelected | ( | ) |
Definition at line 174 of file align_mark_handler.cpp.
References map_checker< Container >::erase(), ITERATE, m_mpRowToMark, IAlignMarkHandlerHost::MHH_GetRowByLine(), IAlignMarkHandlerHost::MHH_GetSelListModel(), row, ISelListModel< Item >::SLM_GetSelectedIndices(), and x_GetHost().
Referenced by OnKeyDown().
|
protected |
Definition at line 721 of file align_mark_handler.cpp.
References IAlnExplorer::eLeft, COpenRange< Position >::Empty(), IAlnExplorer::eRight, IAlnMultiDataSource::GetAlnPosFromSeqPos(), CRange_Base::GetFrom(), CRange_Base::GetTo(), IAlnMultiDataSource::IsNegativeStrand(), negative(), r(), and row.
Referenced by Render().
Definition at line 534 of file align_mark_handler.cpp.
References CGlPane::GetModelLimitsRect(), CGlRect< T >::Left(), m_Pane, max(), min(), and CGlRect< T >::Right().
Referenced by x_OnChangeSelRange().
|
inlineprotected |
Definition at line 202 of file align_mark_handler.hpp.
References m_Host.
|
inlineprotected |
Definition at line 201 of file align_mark_handler.hpp.
References m_Host.
Referenced by MarkRow(), MarkSelectedRows(), Render(), UnMarkSelected(), x_HitRangeBorder(), x_HitSelectedLine(), x_HitTest(), x_InitDeltaMap(), and x_UpdateSelection().
Definition at line 465 of file align_mark_handler.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), m_mpRowToMark, IAlignMarkHandlerHost::MHH_GetLineByWindowY(), IAlignMarkHandlerHost::MHH_GetRowByLine(), IAlignMarkHandlerHost::MHH_GetSelListModel(), COpenRange< Position >::NotEmpty(), row, ISelListModel< Item >::SLM_IsItemSelected(), x_GetHost(), and x_HitTest().
Referenced by x_OnSelectCursor().
Definition at line 455 of file align_mark_handler.cpp.
References IAlignMarkHandlerHost::MHH_GetLineByWindowY(), IAlignMarkHandlerHost::MHH_GetSelListModel(), ISelListModel< Item >::SLM_IsItemSelected(), and x_GetHost().
Referenced by x_OnSelectCursor(), x_OnStartSel(), and x_UpdateState().
|
protected |
Definition at line 494 of file align_mark_handler.cpp.
References _ASSERT, abs, C, D, IAlnMultiDataSource::GetAlnPosFromSeqPos(), CRange_Base::GetFrom(), COpenRange< Position >::GetToOpen(), ITERATE, m_DragArea, m_Pane, IAlignMarkHandlerHost::MHH_GetAlnDS(), CGlPane::ProjectX(), row, COpenRange< Position >::SetLength(), and x_GetHost().
Referenced by x_HitRangeBorder(), and x_InitDeltaMap().
|
protected |
Definition at line 396 of file align_mark_handler.cpp.
References map_checker< Container >::clear(), CAlignMarkHandler::SMarkDelta::eExtRangeEnd, CAlignMarkHandler::SMarkDelta::eExtRangeStart, map_checker< Container >::end(), CAlignMarkHandler::SMarkDelta::eNoExt, IAlnExplorer::eRight, map_checker< Container >::find(), CRange_Base::GetFrom(), IAlnMultiDataSource::GetSeqPosFromAlnPos(), COpenRange< Position >::GetToOpen(), IAlnMultiDataSource::IsPositiveStrand(), ITERATE, m_mpRowToDelta, m_mpRowToMark, IAlignMarkHandlerHost::MHH_GetAlnDS(), IAlignMarkHandlerHost::MHH_GetRowByLine(), IAlignMarkHandlerHost::MHH_GetSelListModel(), COpenRange< Position >::NotEmpty(), positive(), row, CRange_Base::SetFrom(), COpenRange< Position >::SetLength(), ISelListModel< Item >::SLM_GetSelectedIndices(), x_GetHost(), x_HitTest(), and x_MouseToSeqPos().
Referenced by x_OnStartSel().
|
protected |
Definition at line 198 of file align_mark_handler.cpp.
Referenced by OnKeyDown(), OnKeyUp(), OnLeftDown(), OnLeftUp(), and OnMotion().
|
protected |
helper functions
Definition at line 388 of file align_mark_handler.cpp.
References _ASSERT, m_Host, m_Pane, and IAlignMarkHandlerHost::MHH_GetSeqPosByX().
Referenced by x_InitDeltaMap(), and x_OnChangeSelRange().
|
protected |
Definition at line 293 of file align_mark_handler.cpp.
References GetGenericHost(), IGenericHandlerHost::GHH_Redraw(), m_PrevPos, x_ClipPosByRange(), x_MouseToSeqPos(), and x_UpdateSelection().
Referenced by OnMotion(), and x_OnEndSelRange().
Definition at line 308 of file align_mark_handler.cpp.
References GetGenericHost(), IGenericHandlerHost::GHH_Redraw(), IGenericHandlerHost::GHH_ReleaseMouse(), m_State, x_OnChangeSelRange(), x_OnSelectCursor(), and x_UpdateMarks().
Referenced by OnKeyUp(), and OnLeftUp().
|
protected |
Definition at line 321 of file align_mark_handler.cpp.
References map_checker< Container >::clear(), eIdle, GetGenericHost(), IGenericHandlerHost::GHH_Redraw(), m_mpRowToDelta, m_mpRowToMark, m_PrevPos, and m_State.
|
protected |
Definition at line 358 of file align_mark_handler.cpp.
References eIdle, eReady, eResize, GetGenericHost(), IGenericHandlerHost::GHH_SetCursor(), m_CursorId, m_State, x_HitRangeBorder(), and x_HitSelectedLine().
Referenced by OnLeftDown(), OnMotion(), OnMouseCaptureLost(), x_OnEndSelRange(), and x_UpdateState().
|
protected |
Signal handlers.
Definition at line 279 of file align_mark_handler.cpp.
References eResize, GetGenericHost(), IGenericHandlerHost::GHH_CaptureMouse(), IGenericHandlerHost::GHH_Redraw(), m_PrevPos, m_State, x_HitSelectedLine(), and x_InitDeltaMap().
Referenced by OnLeftDown().
|
protected |
Definition at line 564 of file align_mark_handler.cpp.
References CAlignMarkHandler::SMarkDelta::eExtRangeEnd, CAlignMarkHandler::SMarkDelta::eExtRangeStart, and CAlignMarkHandler::SMarkDelta::eNoExt.
Referenced by x_UpdateSelection().
|
protected |
applies changes in SMarkDelta to mark collection
Definition at line 598 of file align_mark_handler.cpp.
References C, map_checker< Container >::clear(), delta(), CAlignMarkHandler::SMarkDelta::eExtRangeEnd, CAlignMarkHandler::SMarkDelta::eExtRangeStart, map_checker< Container >::end(), CAlignMarkHandler::SMarkDelta::eNoExt, map_checker< Container >::find(), CRange_Base::GetFrom(), CRange_Base::GetTo(), COpenRange< Position >::GetToOpen(), map_checker< Container >::insert(), ITERATE, m_mpRowToDelta, m_mpRowToMark, max(), min(), P, and row.
Referenced by x_OnEndSelRange().
|
protected |
Definition at line 544 of file align_mark_handler.cpp.
References delta(), IAlnExplorer::eLeft, IAlnExplorer::eRight, IAlnMultiDataSource::GetSeqPosFromAlnPos(), IAlnMultiDataSource::IsNegativeStrand(), m_mpRowToDelta, IAlignMarkHandlerHost::MHH_GetAlnDS(), negative(), NON_CONST_ITERATE, row, x_GetHost(), and x_UpdateDelta().
Referenced by x_OnChangeSelRange().
Definition at line 333 of file align_mark_handler.cpp.
References eIdle, eReady, eResize, GetGenericHost(), IGenericHandlerHost::GHH_Redraw(), m_State, x_HitSelectedLine(), and x_OnSelectCursor().
Referenced by OnKeyDown(), and OnKeyUp().
|
protected |
Definition at line 214 of file align_mark_handler.hpp.
|
protected |
operation type
Definition at line 217 of file align_mark_handler.hpp.
Referenced by x_OnSelectCursor().
|
protected |
Definition at line 222 of file align_mark_handler.hpp.
Referenced by x_HitTest().
|
protected |
Definition at line 220 of file align_mark_handler.hpp.
Referenced by Render().
|
protected |
Definition at line 221 of file align_mark_handler.hpp.
Referenced by Render().
|
protected |
Ranges being edited.
Definition at line 211 of file align_mark_handler.hpp.
Referenced by GetGenericHost(), SetHost(), x_GetHost(), and x_MouseToSeqPos().
|
protected |
Marks.
Definition at line 209 of file align_mark_handler.hpp.
Referenced by Render(), x_InitDeltaMap(), x_OnResetAll(), x_UpdateMarks(), and x_UpdateSelection().
|
protected |
Definition at line 208 of file align_mark_handler.hpp.
Referenced by GetMark(), GetMarks(), MarkRow(), MarkRowSeq(), Render(), UnMarkAll(), UnMarkSelected(), x_HitRangeBorder(), x_InitDeltaMap(), x_OnResetAll(), and x_UpdateMarks().
|
protected |
Definition at line 212 of file align_mark_handler.hpp.
Referenced by SetPane(), x_ClipPosByRange(), x_HitTest(), and x_MouseToSeqPos().
|
protected |
Definition at line 218 of file align_mark_handler.hpp.
Referenced by x_OnChangeSelRange(), x_OnResetAll(), and x_OnStartSel().
|
protected |
Definition at line 215 of file align_mark_handler.hpp.
Referenced by OnKeyUp(), OnLeftUp(), OnMotion(), OnMouseCaptureLost(), x_OnEndSelRange(), x_OnResetAll(), x_OnSelectCursor(), x_OnStartSel(), and x_UpdateState().