NCBI C++ ToolKit
|
Search Toolkit Book for CSelectionEvent
CSelectionEvent CSelectionEvent is used for broadcasting selection between views. More...
#include <gui/objutils/obj_event.hpp>
Public Types | |
enum | EObjMatchPolicy { eAllIds , eAtLeastOne } |
enum | EIdMatchPolicy { eExact , eAccOnly } |
typedef CRangeCollection< TSeqPos > | TRangeColl |
typedef TRangeColl::TRange | TRange |
typedef vector< CConstRef< objects::CSeq_feat > > | TFeats |
typedef vector< CConstRef< objects::CSeq_align > > | TAligns |
typedef vector< CConstRef< objects::CSeq_loc > > | TSeqLocs |
typedef vector< CConstRef< objects::CSeq_id > > | TIds |
typedef vector< CConstRef< CIdLoc > > | TIdLocs |
typedef CTaxIdSelSet | TTaxIds |
typedef TTaxIds::TTaxId | TTaxId |
typedef vector< CConstRef< CObject > > | TOther |
typedef vector< CConstRef< objects::CVcfVariant > > | TVcfVariants |
typedef map< string, TConstObjects > | TIndexed |
Public Member Functions | |
CSelectionEvent (objects::CScope &scope) | |
objects::CScope & | GetScope () |
bool | HasRangeSelection () const |
Range Selection - represents a collection of selected segments. More... | |
const objects::CHandleRangeMap & | GetRangeSelection () const |
void | AddRangeSelection (const objects::CSeq_id &id, const TRangeColl &segs) |
void | AddRangeSelection (const objects::CSeq_loc &loc) |
bool | GetRangeSelection (const objects::CSeq_id &id, objects::CScope &scope, TRangeColl &segs) |
void | GetRangeSelectionAsLocs (TConstObjects &objs) const |
bool | HasObjectSelection () |
Object Selection - represents select Objects (such as features, alignments, etc) More... | |
bool | AddObjectSelection (const CObject &obj) |
void | AddObjectSelection (const TConstObjects &objs) |
void | AddObjectSelection (const objects::CSeq_id &id) |
void | AddObjectSelection (const objects::CSeq_feat &feat) |
void | AddObjectSelection (const objects::CSeq_align &align) |
void | AddObjectSelection (const objects::CSeq_loc &loc) |
void | AddObjectSelection (const objects::CSeq_id &id, const CRange< TSeqPos > &range) |
void | AddObjectSelection (const objects::CVcfVariant &vcf_variant) |
void | AddTaxIDSelection (TTaxId tid) |
const TFeats & | GetFeats () const |
const TAligns & | GetAligns () const |
const TSeqLocs & | GetSeqLocs () const |
const TIds & | GetIds () const |
const TIdLocs & | GetIdLocs () const |
const TTaxIds & | GetTaxIDs () const |
const TVcfVariants & | GetVcfVariants () const |
void | GetAllObjects (TConstObjects &objs) const |
void | GetOther (TConstObjects &objs) const |
Private selection broadcasting functions | |
Private is used for View-to-View communication, when Views need to send extended broadcastin information which only view of the same type can understand. Selection inspector is not supposed to interpret this. Functionality is added to implement robust tree comparison GB-3152 | |
void | AddIndexed (const string &area_name, const CObject &obj) |
Add private selection broadcasting info. More... | |
void | GetIndexed (const string &area_name, TConstObjects &objs) const |
Get Objects from the private broadcasting area (caller has to make sure output objs is empty) More... | |
const TIndexed & | GetIndexMap () const |
Get access to private index map (all areas) (mostly to avoid copy-ctr overhead associated with GetIndexed() ) More... | |
Static Public Member Functions | |
Matching functons | |
static bool | Match (const CObject &obj1, objects::CScope &scope1, const CObject &obj2, objects::CScope &scope2) |
static bool | MatchFeatWithFeat (const objects::CSeq_feat &feat1, objects::CScope &scope1, const objects::CSeq_feat &feat2, objects::CScope &scope2) |
static bool | MatchFeatWithLoc (const objects::CSeq_feat &feat1, objects::CScope &scope1, const objects::CSeq_loc &loc2, objects::CScope &scope2) |
static bool | MatchFeatWithId (const objects::CSeq_feat &feat1, objects::CScope &scope1, const objects::CSeq_id &id2, objects::CScope &scope2) |
static bool | MatchAlignWithAlign (const objects::CSeq_align &align1, objects::CScope &scope1, const objects::CSeq_align &align2, objects::CScope &scope2) |
static bool | MatchLocWithLoc (const objects::CSeq_loc &loc1, objects::CScope &scope1, const objects::CSeq_loc &loc2, objects::CScope &scope2) |
static bool | MatchLocWithId (const objects::CSeq_loc &loc1, objects::CScope &scope1, const objects::CSeq_id &id2, objects::CScope &scope2) |
static bool | MatchIdWithId (const objects::CSeq_id &id1, objects::CScope &scope1, const objects::CSeq_id &id2, objects::CScope &scope2) |
Static Public Attributes | |
static EObjMatchPolicy | sm_ObjMatchPolicy = CSelectionEvent::eAtLeastOne |
static EIdMatchPolicy | sm_IdMatchPolicy = CSelectionEvent::eAccOnly |
static bool | sm_MatchAlnLocs = true |
static bool | sm_MatchByProduct = true |
static bool | sm_AutoBroadcast = true |
static bool | sm_InterDocBroadcast = true |
static vector< string > | sm_TreeBroadcastProperties |
broadcast sel. between documents More... | |
static bool | sm_TreeBroadcastOneToOne = true |
Node properties used to compare trees when broadcasting. More... | |
Protected Types | |
enum | EObjType { eSeq_feat , eSeq_align , eSeq_loc , eSeq_id , eSeq_vcf_variant } |
typedef map< string, EObjType > | TRawNameToType |
Static Protected Member Functions | |
static bool | x_SimpleMatch (const objects::CSeq_id_Handle &h_sel_id, const objects::CSeq_id_Handle &h_id) |
Matches two ids using current policy; does not consider synonyms. More... | |
Protected Attributes | |
CRef< objects::CScope > | m_Scope |
bool | m_HasRangeSelection |
objects::CHandleRangeMap | m_RangeMap |
bool | m_HasObjectSelection |
TFeats | m_Feats |
TAligns | m_Aligns |
TSeqLocs | m_SeqLocs |
TIds | m_Ids |
TIdLocs | m_IdLocs |
TTaxIds | m_TaxIds |
TOther | m_Other |
TIndexed | m_Indexed |
TVcfVariants | m_VcfVariants |
Static Protected Attributes | |
static TRawNameToType | sm_RawNameToType |
Private Member Functions | |
void | x_Init () |
CSelectionEvent CSelectionEvent is used for broadcasting selection between views.
It containes separate "packages" for different types of selection. If package This class is not thread-safe.
Definition at line 67 of file obj_event.hpp.
typedef vector< CConstRef<objects::CSeq_align> > CSelectionEvent::TAligns |
Definition at line 73 of file obj_event.hpp.
typedef vector< CConstRef<objects::CSeq_feat> > CSelectionEvent::TFeats |
Definition at line 72 of file obj_event.hpp.
typedef vector< CConstRef<CIdLoc> > CSelectionEvent::TIdLocs |
Definition at line 76 of file obj_event.hpp.
typedef vector< CConstRef<objects::CSeq_id> > CSelectionEvent::TIds |
Definition at line 75 of file obj_event.hpp.
typedef map<string, TConstObjects> CSelectionEvent::TIndexed |
Definition at line 82 of file obj_event.hpp.
typedef vector< CConstRef<CObject> > CSelectionEvent::TOther |
Definition at line 79 of file obj_event.hpp.
Definition at line 71 of file obj_event.hpp.
Definition at line 70 of file obj_event.hpp.
|
protected |
Definition at line 226 of file obj_event.hpp.
typedef vector< CConstRef<objects::CSeq_loc> > CSelectionEvent::TSeqLocs |
Definition at line 74 of file obj_event.hpp.
Definition at line 78 of file obj_event.hpp.
typedef CTaxIdSelSet CSelectionEvent::TTaxIds |
Definition at line 77 of file obj_event.hpp.
typedef vector< CConstRef<objects::CVcfVariant> > CSelectionEvent::TVcfVariants |
Definition at line 80 of file obj_event.hpp.
Enumerator | |
---|---|
eExact | |
eAccOnly |
Definition at line 90 of file obj_event.hpp.
Enumerator | |
---|---|
eAllIds | |
eAtLeastOne |
Definition at line 86 of file obj_event.hpp.
|
protected |
Enumerator | |
---|---|
eSeq_feat | |
eSeq_align | |
eSeq_loc | |
eSeq_id | |
eSeq_vcf_variant |
Definition at line 219 of file obj_event.hpp.
CSelectionEvent::CSelectionEvent | ( | objects::CScope & | scope | ) |
Definition at line 64 of file obj_event.cpp.
References x_Init().
Add private selection broadcasting info.
area_name | is a string used to identify private information |
obj | - CObject derived class with selection infomation (can be downcasted by the receiver) |
Definition at line 235 of file obj_event.cpp.
References m_Indexed.
Referenced by CTableSelectionBioTreeContainer::GetSelection(), and CPhyTreeView::GetSelection().
Definition at line 177 of file obj_event.cpp.
References info.
Referenced by AddObjectSelection(), CTableSelectionBioTreeContainer::GetSelection(), CVcfTableSelection::GetSelection(), CSelectionClient::GetSelection(), CSimpleProjectView::GetSelection(), CCrossAlignView::GetSelection(), CDotMatrixView::GetSelection(), CMultiAlignView::GetSelection(), CPhyTreeView::GetSelection(), CFeatTableView::GetSelection(), CViewGraphic::GetSelection(), CSequinDesktopView::GetSelection(), CGridWidget::GetSelection(), CSelectionView::GetSelection(), CTextView::GetSelection(), CVcfTableView::GetSelection(), CTableViewWithTextViewNav::GetSelection(), CSequenceEditingEventHandler::LinkmRNACDS(), and CSelectFeatures::OnAccept().
void CSelectionEvent::AddObjectSelection | ( | const objects::CSeq_align & | align | ) |
void CSelectionEvent::AddObjectSelection | ( | const objects::CSeq_feat & | feat | ) |
void CSelectionEvent::AddObjectSelection | ( | const objects::CSeq_id & | id | ) |
void CSelectionEvent::AddObjectSelection | ( | const objects::CSeq_id & | id, |
const CRange< TSeqPos > & | range | ||
) |
Definition at line 296 of file obj_event.cpp.
References m_HasObjectSelection, CIdLoc::m_Id, m_IdLocs, CIdLoc::m_Range, compile_time_bits::range(), and CConstRef< C, Locker >::Reset().
void CSelectionEvent::AddObjectSelection | ( | const objects::CSeq_loc & | loc | ) |
void CSelectionEvent::AddObjectSelection | ( | const objects::CVcfVariant & | vcf_variant | ) |
void CSelectionEvent::AddObjectSelection | ( | const TConstObjects & | objs | ) |
Definition at line 205 of file obj_event.cpp.
References AddObjectSelection(), info, ITERATE, and m_Other.
void CSelectionEvent::AddRangeSelection | ( | const objects::CSeq_id & | id, |
const TRangeColl & | segs | ||
) |
void CSelectionEvent::AddRangeSelection | ( | const objects::CSeq_loc & | loc | ) |
Definition at line 120 of file obj_event.cpp.
References m_HasRangeSelection, and m_RangeMap.
void CSelectionEvent::AddTaxIDSelection | ( | TTaxId | tid | ) |
Definition at line 306 of file obj_event.cpp.
References m_HasObjectSelection, m_TaxIds, and CTaxIdSelSet::SelectTaxId().
Referenced by CTableSelectionBioTreeContainer::GetSelection(), and CPhyTreeView::GetSelection().
Definition at line 120 of file obj_event.hpp.
References m_Aligns.
void CSelectionEvent::GetAllObjects | ( | TConstObjects & | objs | ) | const |
Definition at line 314 of file obj_event.cpp.
References ITERATE, m_Aligns, m_Feats, m_IdLocs, m_Ids, m_SeqLocs, and m_VcfVariants.
Referenced by CProjectView::GetSelection(), CGridWidget::SetSelection(), CSimpleProjectView::x_OnSetSelection(), CCrossAlignView::x_OnSetSelection(), CDotMatrixView::x_OnSetSelection(), CSeqTextView::x_OnSetSelection(), CViewGraphic::x_OnSetSelection(), CSequinDesktopView::x_OnSetSelection(), and CTextView::x_OnSetSelection().
Definition at line 119 of file obj_event.hpp.
References m_Feats.
Definition at line 123 of file obj_event.hpp.
References m_IdLocs.
Referenced by CMultiAlignView::x_OnSetSelection(), and CPhyTreeView::x_OnSetSelection().
Definition at line 122 of file obj_event.hpp.
References m_Ids.
Referenced by CTableSelectionBioTreeContainer::GetRows(), CMultiAlignView::x_OnSetSelection(), and CPhyTreeView::x_OnSetSelection().
void CSelectionEvent::GetIndexed | ( | const string & | area_name, |
TConstObjects & | objs | ||
) | const |
Get Objects from the private broadcasting area (caller has to make sure output objs is empty)
Definition at line 240 of file obj_event.cpp.
References copy(), map_checker< Container >::end(), map_checker< Container >::find(), and m_Indexed.
Referenced by CTableSelectionBioTreeContainer::GetRows(), and CPhyTreeView::x_OnSetSelection().
Get access to private index map (all areas) (mostly to avoid copy-ctr overhead associated with GetIndexed() )
Definition at line 155 of file obj_event.hpp.
References m_Indexed.
void CSelectionEvent::GetOther | ( | TConstObjects & | objs | ) | const |
Definition at line 338 of file obj_event.cpp.
References ITERATE, and m_Other.
Referenced by CGridWidget::SetSelection(), CSimpleProjectView::x_OnSetSelection(), CSequinDesktopView::x_OnSetSelection(), and CTextView::x_OnSetSelection().
const CHandleRangeMap & CSelectionEvent::GetRangeSelection | ( | ) | const |
Definition at line 98 of file obj_event.cpp.
References m_RangeMap.
Referenced by CCrossAlignView::x_OnSetSelection(), CDotMatrixView::x_OnSetSelection(), CMultiAlignView::x_OnSetSelection(), CSeqTextView::x_OnSetSelection(), and CViewGraphic::x_OnSetSelection().
bool CSelectionEvent::GetRangeSelection | ( | const objects::CSeq_id & | id, |
objects::CScope & | scope, | ||
TRangeColl & | segs | ||
) |
void CSelectionEvent::GetRangeSelectionAsLocs | ( | TConstObjects & | objs | ) | const |
Definition at line 145 of file obj_event.cpp.
References CSeq_id::Assign(), ITERATE, and m_RangeMap.
Referenced by CProjectView::GetSelection(), and CMultiAlignView::x_OnSetSelection().
|
inline |
Definition at line 95 of file obj_event.hpp.
References m_Scope.
Referenced by CSelectionService::Broadcast(), CCrossAlignView::x_OnSetSelection(), CDotMatrixView::x_OnSetSelection(), CMultiAlignView::x_OnSetSelection(), CPhyTreeView::x_OnSetSelection(), and CViewGraphic::x_OnSetSelection().
Definition at line 121 of file obj_event.hpp.
References m_SeqLocs.
Definition at line 124 of file obj_event.hpp.
References m_TaxIds.
Referenced by CTableSelectionBioTreeContainer::GetRows(), and CPhyTreeView::x_OnSetSelection().
|
inline |
Definition at line 125 of file obj_event.hpp.
References m_VcfVariants.
Referenced by CVcfTableSelection::GetRows().
bool CSelectionEvent::HasObjectSelection | ( | ) |
Object Selection - represents select Objects (such as features, alignments, etc)
Definition at line 171 of file obj_event.cpp.
References m_HasObjectSelection.
Referenced by CAlignSpanView::x_OnSetSelection(), CCrossAlignView::x_OnSetSelection(), CDotMatrixView::x_OnSetSelection(), CMultiAlignView::x_OnSetSelection(), CPhyTreeView::x_OnSetSelection(), and CSeqTextView::x_OnSetSelection().
bool CSelectionEvent::HasRangeSelection | ( | ) | const |
Range Selection - represents a collection of selected segments.
Definition at line 92 of file obj_event.cpp.
References m_HasRangeSelection.
Referenced by CCrossAlignView::x_OnSetSelection(), CDotMatrixView::x_OnSetSelection(), CMultiAlignView::x_OnSetSelection(), CSeqTextView::x_OnSetSelection(), and CViewGraphic::x_OnSetSelection().
|
static |
Definition at line 346 of file obj_event.cpp.
References _ASSERT, map_checker< Container >::end(), eSeq_align, eSeq_feat, eSeq_id, eSeq_loc, eSeq_vcf_variant, map_checker< Container >::find(), MatchAlignWithAlign(), MatchFeatWithFeat(), MatchFeatWithId(), MatchFeatWithLoc(), MatchIdWithId(), MatchLocWithId(), MatchLocWithLoc(), NULL, sm_RawNameToType, and CVcfVariant::WeakMatch().
Referenced by CCrossAlignView::x_OnSetSelection(), and CDotMatrixView::x_OnSetSelection().
|
static |
Definition at line 471 of file obj_event.cpp.
References CSerialObject::Equals().
Referenced by Match().
|
static |
Definition at line 431 of file obj_event.cpp.
References CSerialObject::Equals().
Referenced by Match().
|
static |
Definition at line 458 of file obj_event.cpp.
References CSeq_feat_Base::GetProduct(), CSeq_feat_Base::IsSetProduct(), MatchLocWithId(), and sm_MatchByProduct.
Referenced by Match().
|
static |
Definition at line 439 of file obj_event.cpp.
References CSeq_feat_Base::CanGetLocation(), CSeq_feat_Base::CanGetProduct(), CSeq_feat_Base::GetLocation(), CSeq_feat_Base::GetProduct(), MatchLocWithLoc(), and sm_MatchByProduct.
Referenced by Match().
|
static |
Definition at line 526 of file obj_event.cpp.
References _ASSERT, eAllIds, eAtLeastOne, CScope::GetIds(), i, sm_ObjMatchPolicy, ct::sort(), and x_SimpleMatch().
Referenced by Match(), MatchLocWithId(), and CViewGraphic::x_OnSetSelection().
|
static |
Definition at line 487 of file obj_event.cpp.
References eAtLeastOne, set< Key, Compare >::end(), set< Key, Compare >::find(), CSeq_id_Handle::GetHandle(), set< Key, Compare >::insert(), ITERATE, MatchIdWithId(), and sm_ObjMatchPolicy.
Referenced by Match(), and MatchFeatWithId().
|
static |
Definition at line 479 of file obj_event.cpp.
References CSerialObject::Equals().
Referenced by Match(), and MatchFeatWithLoc().
|
private |
Definition at line 72 of file obj_event.cpp.
References eSeq_align, eSeq_feat, eSeq_id, eSeq_loc, eSeq_vcf_variant, map_checker< Container >::size(), and sm_RawNameToType.
Referenced by CSelectionEvent().
|
staticprotected |
Matches two ids using current policy; does not consider synonyms.
Definition at line 562 of file obj_event.cpp.
References _ASSERT, eAccOnly, eExact, and sm_IdMatchPolicy.
Referenced by MatchIdWithId().
|
protected |
Definition at line 238 of file obj_event.hpp.
Referenced by GetAligns(), and GetAllObjects().
|
protected |
Definition at line 237 of file obj_event.hpp.
Referenced by GetAllObjects(), and GetFeats().
|
protected |
Definition at line 236 of file obj_event.hpp.
Referenced by AddObjectSelection(), AddTaxIDSelection(), and HasObjectSelection().
|
protected |
Definition at line 232 of file obj_event.hpp.
Referenced by AddRangeSelection(), and HasRangeSelection().
|
protected |
Definition at line 241 of file obj_event.hpp.
Referenced by AddObjectSelection(), GetAllObjects(), and GetIdLocs().
|
protected |
Definition at line 240 of file obj_event.hpp.
Referenced by GetAllObjects(), and GetIds().
|
protected |
Definition at line 244 of file obj_event.hpp.
Referenced by AddIndexed(), GetIndexed(), and GetIndexMap().
|
protected |
Definition at line 243 of file obj_event.hpp.
Referenced by AddObjectSelection(), and GetOther().
|
protected |
Definition at line 233 of file obj_event.hpp.
Referenced by AddRangeSelection(), GetRangeSelection(), and GetRangeSelectionAsLocs().
|
protected |
Definition at line 229 of file obj_event.hpp.
Referenced by GetScope().
|
protected |
Definition at line 239 of file obj_event.hpp.
Referenced by GetAllObjects(), and GetSeqLocs().
|
protected |
Definition at line 242 of file obj_event.hpp.
Referenced by AddTaxIDSelection(), and GetTaxIDs().
|
protected |
Definition at line 245 of file obj_event.hpp.
Referenced by GetAllObjects(), and GetVcfVariants().
Definition at line 210 of file obj_event.hpp.
Referenced by CSelectionService::LoadSettings().
|
static |
Definition at line 207 of file obj_event.hpp.
Referenced by CObjectIndex::GetMatches(), CObjectIndex::HasMatches(), CSelectionService::LoadSettings(), CSelectionBroadcastSlot::OnPaint(), CSelectionService::SaveSettings(), x_SimpleMatch(), and CSelectionBroadcastSlot::x_Update().
Definition at line 211 of file obj_event.hpp.
Referenced by CSelectionService::Broadcast(), CSelectionService::LoadSettings(), and CSelectionService::SaveSettings().
Definition at line 208 of file obj_event.hpp.
Referenced by CMultiAlignView::GetSelection(), CSelectionService::LoadSettings(), CSelectionService::SaveSettings(), and CMultiAlignView::x_OnSetSelection().
Definition at line 209 of file obj_event.hpp.
Referenced by CObjectIndex::GetObjects(), CSelectionService::LoadSettings(), MatchFeatWithId(), MatchFeatWithLoc(), CSelectionService::SaveSettings(), CObjectIndex::x_GetMatches(), and CObjectIndex::x_HasMatches().
|
static |
Definition at line 206 of file obj_event.hpp.
Referenced by CObjectIndex::GetMatches(), CObjectIndex::HasMatches(), CSelectionService::LoadSettings(), MatchIdWithId(), MatchLocWithId(), CSelectionBroadcastSlot::OnPaint(), CSelectionService::SaveSettings(), and CSelectionBroadcastSlot::x_Update().
|
staticprotected |
Definition at line 227 of file obj_event.hpp.
Node properties used to compare trees when broadcasting.
If true, when views of the same tree are opened, selection will be broadcasted based on node ids. If false, selection will be defined by broadcast properties
Definition at line 216 of file obj_event.hpp.
Referenced by CTableSelectionBioTreeContainer::GetRows(), CSelectionService::LoadSettings(), CSelectionService::SaveSettings(), and CPhyTreeView::x_OnSetSelection().
|
static |
broadcast sel. between documents
Definition at line 213 of file obj_event.hpp.
Referenced by CTableSelectionBioTreeContainer::GetRows(), CSelectionService::LoadSettings(), CSelectionService::SaveSettings(), and CPhyTreeView::x_OnSetSelection().