NCBI C++ ToolKit
|
Search Toolkit Book for CSelectionVisitor
class CSelectionVisitor is a concrete glyph visitor for selection traversal and deselection traversal on a layout tree. More...
#include <gui/widgets/seq_graphic/selection_manager.hpp>
Public Types | |
enum | EActionMode { eAct_Select , eAct_Deselect , eAct_CollectSel } |
enum | EPostUpdateAction { ePUA_None , ePUA_CallLayoutChanged } |
action that needs to be executed on selected glyphs after the visitor finishes visiting _all_ glyphs More... | |
typedef EActionMode | TActionMode |
typedef list< CWeakRef< CSeqGlyph > > | TSelectedGlyphs |
Private Types | |
typedef set< CConstRef< CObject > > | TSelectedObjects |
Private Member Functions | |
bool | x_DoSelection (CSeqGlyph *glyph) |
bool | x_NeedUpdate () const |
Private Attributes | |
CObjectIndex | m_SelectedIndexes |
TSelectedObjects | m_SelectedObjects |
CObjectIndex | m_UnknownSelectedIndexes |
list< string > | m_SelectedSignatures |
CSeqGlyph::TConstObjects | m_SelGlyphs |
TSelectedGlyphs | m_SelFeatures |
TSelectedGlyphs | m_SelCDSFeatures |
TModelRect | m_SelRect |
CRef< objects::CScope > | m_Scope |
TActionMode | m_ActionMode |
size_t | m_TraversedObjs |
size_t | m_TraversedSigs |
size_t | m_DeselectedObjs |
EPostUpdateAction | m_PostUpdateAction |
class CSelectionVisitor is a concrete glyph visitor for selection traversal and deselection traversal on a layout tree.
The selected objects can be objects broadcasted from other views, signatures from cgi, or user-selected objects in current view.
Definition at line 50 of file selection_manager.hpp.
Definition at line 67 of file selection_manager.hpp.
typedef list< CWeakRef<CSeqGlyph> > CSelectionVisitor::TSelectedGlyphs |
Definition at line 68 of file selection_manager.hpp.
|
private |
Definition at line 121 of file selection_manager.hpp.
Enumerator | |
---|---|
eAct_Select | |
eAct_Deselect | |
eAct_CollectSel |
Definition at line 53 of file selection_manager.hpp.
action that needs to be executed on selected glyphs after the visitor finishes visiting _all_ glyphs
Enumerator | |
---|---|
ePUA_None | |
ePUA_CallLayoutChanged | call LayoutChanged for all glyphs that are CFeatGlyph |
Definition at line 61 of file selection_manager.hpp.
|
inline |
Definition at line 70 of file selection_manager.hpp.
|
inlinevirtual |
Definition at line 78 of file selection_manager.hpp.
void CSelectionVisitor::Clear | ( | void | ) |
Definition at line 83 of file selection_manager.cpp.
References set< Key, Compare >::clear(), CObjectIndex::Clear(), ePUA_None, m_PostUpdateAction, m_Scope, m_SelCDSFeatures, m_SelectedIndexes, m_SelectedObjects, m_SelFeatures, and m_UnknownSelectedIndexes.
Referenced by CAlnVecRow::OnMouseEvent(), CSeqGraphicRenderer::SetInputObject(), and SetScope().
|
inline |
Definition at line 171 of file selection_manager.hpp.
References ePUA_None, m_PostUpdateAction, m_SelCDSFeatures, and m_SelFeatures.
Referenced by CSeqGraphicRenderer::OnDataChanged(), and CSeqGraphicRenderer::OnDataChanging().
Definition at line 169 of file selection_manager.cpp.
References set< Key, Compare >::clear(), CObjectIndex::Clear(), eGetId_Canonical, CObjectIndex::Empty(), set< Key, Compare >::empty(), set< Key, Compare >::end(), set< Key, Compare >::erase(), set< Key, Compare >::find(), GetId(), IsObjectSelected(), m_DeselectedObjs, m_Scope, m_SelectedIndexes, m_SelectedObjects, NON_CONST_ITERATE, and CObjectIndex::Remove().
Referenced by CSeqGraphicRenderer::DeSelectObject(), and CAlnVecRow::OnMouseEvent().
void CSelectionVisitor::GetObjectSelection | ( | TConstObjects & | objs | ) | const |
Definition at line 146 of file selection_manager.cpp.
References ITERATE, m_SelectedObjects, and set< Key, Compare >::size().
Referenced by CSeqGraphicRenderer::GetObjectSelection(), and CAlnMultiPane::GetObjectSelection().
objects::CScope * CSelectionVisitor::GetScope | ( | void | ) |
Definition at line 47 of file selection_manager.cpp.
References CRef< C, Locker >::GetPointer(), and m_Scope.
Referenced by CAlnMultiPane::TTHH_ProcessURL().
|
inline |
Definition at line 166 of file selection_manager.hpp.
References m_SelCDSFeatures.
Referenced by CSeqGraphicRenderer::CSeqGraphicRenderer().
|
inline |
Definition at line 161 of file selection_manager.hpp.
References m_SelFeatures.
Referenced by CSeqGraphicRenderer::CSeqGraphicRenderer().
const CSeqGlyph::TConstObjects & CSelectionVisitor::GetSelectedLayoutObjects | ( | CSeqGlyph * | top_glyph | ) |
Definition at line 136 of file selection_manager.cpp.
References CSeqGlyph::Accept(), eAct_CollectSel, m_SelGlyphs, and SetActionMode().
Referenced by CSeqGraphicRenderer::GetSelectedLayoutObjects().
|
inline |
Definition at line 156 of file selection_manager.hpp.
References set< Key, Compare >::empty(), and m_SelectedObjects.
Referenced by CSeqGraphicRenderer::DeSelectObject(), CAlnMultiPane::HasSelectedObjects(), CSeqGraphicRenderer::HasSelectedObjects(), and CAlnVecRow::OnMouseEvent().
Definition at line 95 of file selection_manager.cpp.
References CSeqFeatData::eSubtype_variation, CSeq_feat_Base::GetData(), CSeqFeatData::GetSubtype(), CObjectIndex::HasMatches(), m_Scope, m_SelectedIndexes, m_SelectedObjects, and CVcfVariant::WeakMatch().
Referenced by DeSelectObject(), CSeqGraphicRenderer::IsObjectSelected(), CAlnVecRow::OnMouseEvent(), and x_DoSelection().
void CSelectionVisitor::ResetObjectSelection | ( | CSeqGlyph * | glyph | ) |
Definition at line 155 of file selection_manager.cpp.
References CSeqGlyph::Accept(), set< Key, Compare >::clear(), CObjectIndex::Clear(), eAct_Deselect, m_Scope, m_SelCDSFeatures, m_SelectedIndexes, m_SelectedObjects, m_SelFeatures, m_UnknownSelectedIndexes, SetActionMode(), and x_NeedUpdate().
Referenced by CSeqGraphicRenderer::ResetObjectSelection(), and CAlnVecRow::x_ResetTrackPanel().
Definition at line 203 of file selection_manager.cpp.
References CObjectIndex::Add(), CObjectIndex::HasMatches(), set< Key, Compare >::insert(), m_Scope, m_SelectedIndexes, m_SelectedObjects, m_UnknownSelectedIndexes, and NULL.
Referenced by CAlnVecRow::OnMouseEvent(), and CSeqGraphicRenderer::SelectObject().
void CSelectionVisitor::SelectSelection | ( | const CSeqGlyph::TConstObjects & | glyphs | ) |
Definition at line 219 of file selection_manager.cpp.
References CObjectIndex::Add(), IObjectBasedGlyph::GetObjects(), set< Key, Compare >::insert(), ITERATE, m_SelectedIndexes, m_SelectedObjects, NON_CONST_ITERATE, and NULL.
Referenced by CSeqGraphicRenderer::SelectObjByRect().
|
inline |
CSelectionVisitor inline methods.
Definition at line 152 of file selection_manager.hpp.
References m_ActionMode.
Referenced by GetSelectedLayoutObjects(), ResetObjectSelection(), and UpdateSelection().
void CSelectionVisitor::SetScope | ( | objects::CScope * | scope | ) |
Definition at line 41 of file selection_manager.cpp.
References Clear(), m_Scope, and CRef< C, Locker >::Reset().
Referenced by CAlnMultiPane::Init(), and CSeqGraphicRenderer::SetInputObject().
Definition at line 72 of file selection_manager.cpp.
References NStr::fSplit_Tokenize, m_SelectedSignatures, NON_CONST_ITERATE, NStr::Split(), and NStr::TruncateSpacesInPlace().
Referenced by CSeqGraphicRenderer::SelectObjectSig().
void CSelectionVisitor::UpdateSelection | ( | CSeqGlyph * | glyph | ) |
Definition at line 238 of file selection_manager.cpp.
References CSeqGlyph::Accept(), eAct_Select, CObjectIndex::Empty(), ePUA_CallLayoutChanged, ePUA_None, CRef< C, Locker >::GetPointerOrNull(), ITERATE, CFeatGlyph::LayoutChanged(), m_PostUpdateAction, m_SelCDSFeatures, m_SelectedObjects, m_SelFeatures, m_TraversedObjs, m_TraversedSigs, m_UnknownSelectedIndexes, NON_CONST_ITERATE, CRef< C, Locker >::NotNull(), CObjectIndex::Remove(), SetActionMode(), and x_NeedUpdate().
Referenced by CSeqGraphicRenderer::GetHeight(), CAlnVecRow::LTH_OnLayoutChanged(), CSeqGraphicRenderer::x_Draw(), CSeqGraphicRenderer::x_DrawVectorGraphics(), CAlnVecRow::x_HitTest(), and CAlnVecRow::x_RenderTracks().
Implements IGlyphVisitor.
Definition at line 52 of file selection_manager.cpp.
References _ASSERT, eAct_CollectSel, eAct_Deselect, eAct_Select, CSeqGlyph::IsSelected(), m_ActionMode, m_SelGlyphs, CSeqGlyph::SetSelected(), and x_DoSelection().
Definition at line 273 of file selection_manager.cpp.
References CObjectIndex::Add(), CObjectIndex::Empty(), ePUA_CallLayoutChanged, IObjectBasedGlyph::GetObjects(), IObjectBasedGlyph::GetSignature(), CObjectIndex::HasMatches(), set< Key, Compare >::insert(), IsObjectSelected(), CSeqGlyph::IsSelected(), ITERATE, m_DeselectedObjs, m_PostUpdateAction, m_Scope, m_SelCDSFeatures, m_SelectedIndexes, m_SelectedObjects, m_SelectedSignatures, m_SelFeatures, m_TraversedObjs, m_TraversedSigs, m_UnknownSelectedIndexes, NULL, results, and CSeqGlyph::SetSelected().
Referenced by Visit().
|
inlineprivate |
Definition at line 179 of file selection_manager.hpp.
References CObjectIndex::Empty(), set< Key, Compare >::empty(), m_DeselectedObjs, m_SelectedIndexes, m_SelectedObjects, m_SelectedSignatures, and m_UnknownSelectedIndexes.
Referenced by ResetObjectSelection(), and UpdateSelection().
|
private |
Definition at line 138 of file selection_manager.hpp.
Referenced by SetActionMode(), and Visit().
|
private |
Definition at line 142 of file selection_manager.hpp.
Referenced by DeSelectObject(), x_DoSelection(), and x_NeedUpdate().
|
private |
Definition at line 144 of file selection_manager.hpp.
Referenced by Clear(), ClearSelectedFeats(), UpdateSelection(), and x_DoSelection().
|
private |
Definition at line 137 of file selection_manager.hpp.
Referenced by Clear(), DeSelectObject(), GetScope(), IsObjectSelected(), ResetObjectSelection(), SelectObject(), SetScope(), and x_DoSelection().
|
private |
Definition at line 133 of file selection_manager.hpp.
Referenced by Clear(), ClearSelectedFeats(), GetSelectedCDSFeats(), ResetObjectSelection(), UpdateSelection(), and x_DoSelection().
|
private |
Definition at line 123 of file selection_manager.hpp.
Referenced by Clear(), DeSelectObject(), IsObjectSelected(), ResetObjectSelection(), SelectObject(), SelectSelection(), x_DoSelection(), and x_NeedUpdate().
|
private |
Definition at line 124 of file selection_manager.hpp.
Referenced by Clear(), DeSelectObject(), GetObjectSelection(), HasSelectedObjects(), IsObjectSelected(), ResetObjectSelection(), SelectObject(), SelectSelection(), UpdateSelection(), x_DoSelection(), and x_NeedUpdate().
|
private |
Definition at line 129 of file selection_manager.hpp.
Referenced by SetSelectedObjectSig(), x_DoSelection(), and x_NeedUpdate().
|
private |
Definition at line 132 of file selection_manager.hpp.
Referenced by Clear(), ClearSelectedFeats(), GetSelectedFeats(), ResetObjectSelection(), UpdateSelection(), and x_DoSelection().
|
private |
Definition at line 130 of file selection_manager.hpp.
Referenced by GetSelectedLayoutObjects(), and Visit().
|
private |
Definition at line 135 of file selection_manager.hpp.
|
private |
Definition at line 140 of file selection_manager.hpp.
Referenced by UpdateSelection(), and x_DoSelection().
|
private |
Definition at line 141 of file selection_manager.hpp.
Referenced by UpdateSelection(), and x_DoSelection().
|
private |
Definition at line 127 of file selection_manager.hpp.
Referenced by Clear(), ResetObjectSelection(), SelectObject(), UpdateSelection(), x_DoSelection(), and x_NeedUpdate().