NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Attributes | Protected Types | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
CSelectionEvent Class Reference

Search Toolkit Book for CSelectionEvent

CSelectionEvent CSelectionEvent is used for broadcasting selection between views. More...

#include <gui/objutils/obj_event.hpp>

+ Collaboration diagram for CSelectionEvent:

Public Types

enum  EObjMatchPolicy { eAllIds , eAtLeastOne }
 
enum  EIdMatchPolicy { eExact , eAccOnly }
 
typedef CRangeCollection< TSeqPosTRangeColl
 
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, TConstObjectsTIndexed
 

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 TFeatsGetFeats () const
 
const TAlignsGetAligns () const
 
const TSeqLocsGetSeqLocs () const
 
const TIdsGetIds () const
 
const TIdLocsGetIdLocs () const
 
const TTaxIdsGetTaxIDs () const
 
const TVcfVariantsGetVcfVariants () 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 TIndexedGetIndexMap () 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< stringsm_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, EObjTypeTRawNameToType
 

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 ()
 

Detailed Description

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.

Member Typedef Documentation

◆ TAligns

typedef vector< CConstRef<objects::CSeq_align> > CSelectionEvent::TAligns

Definition at line 73 of file obj_event.hpp.

◆ TFeats

typedef vector< CConstRef<objects::CSeq_feat> > CSelectionEvent::TFeats

Definition at line 72 of file obj_event.hpp.

◆ TIdLocs

Definition at line 76 of file obj_event.hpp.

◆ TIds

typedef vector< CConstRef<objects::CSeq_id> > CSelectionEvent::TIds

Definition at line 75 of file obj_event.hpp.

◆ TIndexed

Definition at line 82 of file obj_event.hpp.

◆ TOther

Definition at line 79 of file obj_event.hpp.

◆ TRange

Definition at line 71 of file obj_event.hpp.

◆ TRangeColl

Definition at line 70 of file obj_event.hpp.

◆ TRawNameToType

Definition at line 226 of file obj_event.hpp.

◆ TSeqLocs

typedef vector< CConstRef<objects::CSeq_loc> > CSelectionEvent::TSeqLocs

Definition at line 74 of file obj_event.hpp.

◆ TTaxId

Definition at line 78 of file obj_event.hpp.

◆ TTaxIds

Definition at line 77 of file obj_event.hpp.

◆ TVcfVariants

typedef vector< CConstRef<objects::CVcfVariant> > CSelectionEvent::TVcfVariants

Definition at line 80 of file obj_event.hpp.

Member Enumeration Documentation

◆ EIdMatchPolicy

Enumerator
eExact 
eAccOnly 

Definition at line 90 of file obj_event.hpp.

◆ EObjMatchPolicy

Enumerator
eAllIds 
eAtLeastOne 

Definition at line 86 of file obj_event.hpp.

◆ EObjType

enum CSelectionEvent::EObjType
protected
Enumerator
eSeq_feat 
eSeq_align 
eSeq_loc 
eSeq_id 
eSeq_vcf_variant 

Definition at line 219 of file obj_event.hpp.

Constructor & Destructor Documentation

◆ CSelectionEvent()

CSelectionEvent::CSelectionEvent ( objects::CScope &  scope)

Definition at line 64 of file obj_event.cpp.

References x_Init().

Member Function Documentation

◆ AddIndexed()

void CSelectionEvent::AddIndexed ( const string area_name,
const CObject obj 
)

Add private selection broadcasting info.

Parameters
area_nameis 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().

◆ AddObjectSelection() [1/8]

bool CSelectionEvent::AddObjectSelection ( const CObject obj)

◆ AddObjectSelection() [2/8]

void CSelectionEvent::AddObjectSelection ( const objects::CSeq_align &  align)

◆ AddObjectSelection() [3/8]

void CSelectionEvent::AddObjectSelection ( const objects::CSeq_feat &  feat)

◆ AddObjectSelection() [4/8]

void CSelectionEvent::AddObjectSelection ( const objects::CSeq_id &  id)

◆ AddObjectSelection() [5/8]

void CSelectionEvent::AddObjectSelection ( const objects::CSeq_id &  id,
const CRange< TSeqPos > &  range 
)

◆ AddObjectSelection() [6/8]

void CSelectionEvent::AddObjectSelection ( const objects::CSeq_loc &  loc)

◆ AddObjectSelection() [7/8]

void CSelectionEvent::AddObjectSelection ( const objects::CVcfVariant &  vcf_variant)

◆ AddObjectSelection() [8/8]

void CSelectionEvent::AddObjectSelection ( const TConstObjects objs)

Definition at line 205 of file obj_event.cpp.

References AddObjectSelection(), info, ITERATE, and m_Other.

◆ AddRangeSelection() [1/2]

void CSelectionEvent::AddRangeSelection ( const objects::CSeq_id &  id,
const TRangeColl segs 
)

◆ AddRangeSelection() [2/2]

void CSelectionEvent::AddRangeSelection ( const objects::CSeq_loc &  loc)

Definition at line 120 of file obj_event.cpp.

References m_HasRangeSelection, and m_RangeMap.

◆ AddTaxIDSelection()

void CSelectionEvent::AddTaxIDSelection ( TTaxId  tid)

◆ GetAligns()

const TAligns& CSelectionEvent::GetAligns ( ) const
inline

Definition at line 120 of file obj_event.hpp.

References m_Aligns.

◆ GetAllObjects()

void CSelectionEvent::GetAllObjects ( TConstObjects objs) const

◆ GetFeats()

const TFeats& CSelectionEvent::GetFeats ( ) const
inline

Definition at line 119 of file obj_event.hpp.

References m_Feats.

◆ GetIdLocs()

const TIdLocs& CSelectionEvent::GetIdLocs ( ) const
inline

Definition at line 123 of file obj_event.hpp.

References m_IdLocs.

Referenced by CMultiAlignView::x_OnSetSelection(), and CPhyTreeView::x_OnSetSelection().

◆ GetIds()

const TIds& CSelectionEvent::GetIds ( void  ) const
inline

◆ GetIndexed()

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().

◆ GetIndexMap()

const TIndexed& CSelectionEvent::GetIndexMap ( ) const
inline

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.

◆ GetOther()

void CSelectionEvent::GetOther ( TConstObjects objs) const

◆ GetRangeSelection() [1/2]

const CHandleRangeMap & CSelectionEvent::GetRangeSelection ( ) const

◆ GetRangeSelection() [2/2]

bool CSelectionEvent::GetRangeSelection ( const objects::CSeq_id &  id,
objects::CScope &  scope,
TRangeColl segs 
)

◆ GetRangeSelectionAsLocs()

void CSelectionEvent::GetRangeSelectionAsLocs ( TConstObjects objs) const

◆ GetScope()

objects::CScope& CSelectionEvent::GetScope ( void  )
inline

◆ GetSeqLocs()

const TSeqLocs& CSelectionEvent::GetSeqLocs ( ) const
inline

Definition at line 121 of file obj_event.hpp.

References m_SeqLocs.

◆ GetTaxIDs()

const TTaxIds& CSelectionEvent::GetTaxIDs ( ) const
inline

Definition at line 124 of file obj_event.hpp.

References m_TaxIds.

Referenced by CTableSelectionBioTreeContainer::GetRows(), and CPhyTreeView::x_OnSetSelection().

◆ GetVcfVariants()

const TVcfVariants& CSelectionEvent::GetVcfVariants ( ) const
inline

Definition at line 125 of file obj_event.hpp.

References m_VcfVariants.

Referenced by CVcfTableSelection::GetRows().

◆ HasObjectSelection()

bool CSelectionEvent::HasObjectSelection ( )

◆ HasRangeSelection()

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().

◆ Match()

bool CSelectionEvent::Match ( const CObject obj1,
objects::CScope &  scope1,
const CObject obj2,
objects::CScope &  scope2 
)
static

◆ MatchAlignWithAlign()

bool CSelectionEvent::MatchAlignWithAlign ( const objects::CSeq_align &  align1,
objects::CScope &  scope1,
const objects::CSeq_align &  align2,
objects::CScope &  scope2 
)
static

Definition at line 471 of file obj_event.cpp.

References CSerialObject::Equals().

Referenced by Match().

◆ MatchFeatWithFeat()

bool CSelectionEvent::MatchFeatWithFeat ( const objects::CSeq_feat &  feat1,
objects::CScope &  scope1,
const objects::CSeq_feat &  feat2,
objects::CScope &  scope2 
)
static

Definition at line 431 of file obj_event.cpp.

References CSerialObject::Equals().

Referenced by Match().

◆ MatchFeatWithId()

bool CSelectionEvent::MatchFeatWithId ( const objects::CSeq_feat &  feat1,
objects::CScope &  scope1,
const objects::CSeq_id &  id2,
objects::CScope &  scope2 
)
static

◆ MatchFeatWithLoc()

bool CSelectionEvent::MatchFeatWithLoc ( const objects::CSeq_feat &  feat1,
objects::CScope &  scope1,
const objects::CSeq_loc &  loc2,
objects::CScope &  scope2 
)
static

◆ MatchIdWithId()

bool CSelectionEvent::MatchIdWithId ( const objects::CSeq_id &  id1,
objects::CScope &  scope1,
const objects::CSeq_id &  id2,
objects::CScope &  scope2 
)
static

◆ MatchLocWithId()

bool CSelectionEvent::MatchLocWithId ( const objects::CSeq_loc &  loc1,
objects::CScope &  scope1,
const objects::CSeq_id &  id2,
objects::CScope &  scope2 
)
static

◆ MatchLocWithLoc()

bool CSelectionEvent::MatchLocWithLoc ( const objects::CSeq_loc &  loc1,
objects::CScope &  scope1,
const objects::CSeq_loc &  loc2,
objects::CScope &  scope2 
)
static

Definition at line 479 of file obj_event.cpp.

References CSerialObject::Equals().

Referenced by Match(), and MatchFeatWithLoc().

◆ x_Init()

void CSelectionEvent::x_Init ( void  )
private

◆ x_SimpleMatch()

bool CSelectionEvent::x_SimpleMatch ( const objects::CSeq_id_Handle &  h_sel_id,
const objects::CSeq_id_Handle &  h_id 
)
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().

Member Data Documentation

◆ m_Aligns

TAligns CSelectionEvent::m_Aligns
protected

Definition at line 238 of file obj_event.hpp.

Referenced by GetAligns(), and GetAllObjects().

◆ m_Feats

TFeats CSelectionEvent::m_Feats
protected

Definition at line 237 of file obj_event.hpp.

Referenced by GetAllObjects(), and GetFeats().

◆ m_HasObjectSelection

bool CSelectionEvent::m_HasObjectSelection
protected

Definition at line 236 of file obj_event.hpp.

Referenced by AddObjectSelection(), AddTaxIDSelection(), and HasObjectSelection().

◆ m_HasRangeSelection

bool CSelectionEvent::m_HasRangeSelection
protected

Definition at line 232 of file obj_event.hpp.

Referenced by AddRangeSelection(), and HasRangeSelection().

◆ m_IdLocs

TIdLocs CSelectionEvent::m_IdLocs
protected

Definition at line 241 of file obj_event.hpp.

Referenced by AddObjectSelection(), GetAllObjects(), and GetIdLocs().

◆ m_Ids

TIds CSelectionEvent::m_Ids
protected

Definition at line 240 of file obj_event.hpp.

Referenced by GetAllObjects(), and GetIds().

◆ m_Indexed

TIndexed CSelectionEvent::m_Indexed
protected

Definition at line 244 of file obj_event.hpp.

Referenced by AddIndexed(), GetIndexed(), and GetIndexMap().

◆ m_Other

TOther CSelectionEvent::m_Other
protected

Definition at line 243 of file obj_event.hpp.

Referenced by AddObjectSelection(), and GetOther().

◆ m_RangeMap

objects::CHandleRangeMap CSelectionEvent::m_RangeMap
protected

Definition at line 233 of file obj_event.hpp.

Referenced by AddRangeSelection(), GetRangeSelection(), and GetRangeSelectionAsLocs().

◆ m_Scope

CRef<objects::CScope> CSelectionEvent::m_Scope
protected

Definition at line 229 of file obj_event.hpp.

Referenced by GetScope().

◆ m_SeqLocs

TSeqLocs CSelectionEvent::m_SeqLocs
protected

Definition at line 239 of file obj_event.hpp.

Referenced by GetAllObjects(), and GetSeqLocs().

◆ m_TaxIds

TTaxIds CSelectionEvent::m_TaxIds
protected

Definition at line 242 of file obj_event.hpp.

Referenced by AddTaxIDSelection(), and GetTaxIDs().

◆ m_VcfVariants

TVcfVariants CSelectionEvent::m_VcfVariants
protected

Definition at line 245 of file obj_event.hpp.

Referenced by GetAllObjects(), and GetVcfVariants().

◆ sm_AutoBroadcast

bool CSelectionEvent::sm_AutoBroadcast = true
static

Definition at line 210 of file obj_event.hpp.

Referenced by CSelectionService::LoadSettings().

◆ sm_IdMatchPolicy

CSelectionEvent::EIdMatchPolicy CSelectionEvent::sm_IdMatchPolicy = CSelectionEvent::eAccOnly
static

◆ sm_InterDocBroadcast

bool CSelectionEvent::sm_InterDocBroadcast = true
static

◆ sm_MatchAlnLocs

bool CSelectionEvent::sm_MatchAlnLocs = true
static

◆ sm_MatchByProduct

bool CSelectionEvent::sm_MatchByProduct = true
static

◆ sm_ObjMatchPolicy

CSelectionEvent::EObjMatchPolicy CSelectionEvent::sm_ObjMatchPolicy = CSelectionEvent::eAtLeastOne
static

◆ sm_RawNameToType

CSelectionEvent::TRawNameToType CSelectionEvent::sm_RawNameToType
staticprotected

Definition at line 227 of file obj_event.hpp.

Referenced by Match(), and x_Init().

◆ sm_TreeBroadcastOneToOne

bool CSelectionEvent::sm_TreeBroadcastOneToOne = true
static

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().

◆ sm_TreeBroadcastProperties

vector< string > CSelectionEvent::sm_TreeBroadcastProperties
static

The documentation for this class was generated from the following files:
Modified on Tue Apr 23 07:38:06 2024 by modify_doxy.py rev. 669887