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

Search Toolkit Book for CVisibleRange

#include <gui/objutils/visible_range.hpp>

+ Collaboration diagram for CVisibleRange:

Public Types

enum  EBasicPolicy {
  eBasic_Track , eBasic_TrackCenter , eBasic_TrackExpand , eBasic_TrackContract ,
  eBasic_Slave , eBasic_Ignore
}
 
typedef list< CConstRef< objects::CSeq_loc > > TLocations
 

Public Member Functions

 CVisibleRange (objects::CScope &scope)
 
 ~CVisibleRange ()
 
void SetVisibleRangePolicy (EBasicPolicy policy)
 
void AddLocation (const objects::CSeq_loc &loc)
 
const TLocationsGetLocations () const
 
bool Match (const objects::CSeq_id &id) const
 See if we can match the supplied range. More...
 
bool Clamp (const objects::CBioseq_Handle &handle, TSeqRange &range) const
 Alter the supplied range according to the rules provided in the policy and the supplied new location. More...
 
bool Clamp (objects::CSeq_loc &loc) const
 Alter the supplied location according to the rules provided in the policy and the supplied new location. More...
 

Static Public Member Functions

static bool IsAutoBroadcast ()
 
static void SetAutoBroadcast (bool flag)
 
static EBasicPolicy GetDefaultVisibleRangePolicy ()
 
static void SetDefaultVisibleRangePolicy (EBasicPolicy policy)
 

Private Types

enum  EPolicy {
  eDefault = 0 , ePositionMask = 0xff , ePosition_Ignore = 1 , ePosition_Track = 2 ,
  ePosition_TrackCenter = 3 , ePosition_Slave = 4 , eScaleMask = 0xff << 8 , eScale_Ignore = 1 << 8 ,
  eScale_Expand = 2 << 8 , eScale_Contract = 3 << 8 , eScale_TrackRatio = 4 << 8 , eScale_TrackScale = 5 << 8 ,
  eScale_Slave = 6 << 8 , eVisible_Ignore = ePosition_Ignore | eScale_Ignore , eVisible_Slave = ePosition_Slave | eScale_Slave , eVisible_Track = ePosition_Track ,
  eVisible_TrackCenter = ePosition_TrackCenter , eVisible_TrackExpand = ePosition_Track | eScale_Expand , eVisible_TrackContract = ePosition_Track | eScale_Contract
}
 enum controlling policy for response to a change in visible range More...
 

Private Member Functions

bool x_Clamp (const objects::CSeq_loc &loc, const objects::CBioseq_Handle &handle, TSeqRange &range) const
 internal clamping function to clamp a total range based on a location More...
 
bool x_Clamp (objects::CSeq_loc &loc, const TSeqRange &range) const
 
int x_GetPolicy () const
 

Private Attributes

TLocations m_Locs
 
CRef< objects::CScope > m_Scope
 
EBasicPolicy m_Policy
 

Static Private Attributes

static bool sm_AutoBroadcast = true
 
static EBasicPolicy sm_DefaultPolicy = eBasic_Track
 

Detailed Description

Definition at line 43 of file visible_range.hpp.

Member Typedef Documentation

◆ TLocations

typedef list< CConstRef<objects::CSeq_loc> > CVisibleRange::TLocations

Definition at line 55 of file visible_range.hpp.

Member Enumeration Documentation

◆ EBasicPolicy

Enumerator
eBasic_Track 
eBasic_TrackCenter 
eBasic_TrackExpand 
eBasic_TrackContract 
eBasic_Slave 
eBasic_Ignore 

Definition at line 46 of file visible_range.hpp.

◆ EPolicy

enum CVisibleRange::EPolicy
private

enum controlling policy for response to a change in visible range

Enumerator
eDefault 
ePositionMask 

position tracking options

ePosition_Ignore 
ePosition_Track 
ePosition_TrackCenter 
ePosition_Slave 
eScaleMask 

location scale tracking options

eScale_Ignore 
eScale_Expand 
eScale_Contract 
eScale_TrackRatio 
eScale_TrackScale 
eScale_Slave 
eVisible_Ignore 

combination options

eVisible_Slave 
eVisible_Track 
eVisible_TrackCenter 
eVisible_TrackExpand 
eVisible_TrackContract 

Definition at line 85 of file visible_range.hpp.

Constructor & Destructor Documentation

◆ CVisibleRange()

CVisibleRange::CVisibleRange ( objects::CScope &  scope)

Definition at line 45 of file visible_range.cpp.

◆ ~CVisibleRange()

CVisibleRange::~CVisibleRange ( )

Definition at line 51 of file visible_range.cpp.

Member Function Documentation

◆ AddLocation()

void CVisibleRange::AddLocation ( const objects::CSeq_loc &  loc)

◆ Clamp() [1/2]

bool CVisibleRange::Clamp ( const objects::CBioseq_Handle &  handle,
TSeqRange range 
) const

Alter the supplied range according to the rules provided in the policy and the supplied new location.

Referenced by CCrossAlignView::OnVisibleRangeChanged(), CDotMatrixView::OnVisibleRangeChanged(), and CViewGraphic::OnVisibleRangeChanged().

◆ Clamp() [2/2]

bool CVisibleRange::Clamp ( objects::CSeq_loc &  loc) const

Alter the supplied location according to the rules provided in the policy and the supplied new location.

Definition at line 219 of file visible_range.cpp.

References Error(), CScope::GetBioseqHandle(), CBioseq_Handle::GetBioseqLength(), GetId(), GetIdHandle(), CException::GetMsg(), CSeq_id_Handle::GetSeqId(), COpenRange< Position >::IsWhole(), ITERATE, LOG_POST, m_Locs, m_Scope, CSeqUtils::Match(), CRange_Base::SetTo(), and x_Clamp().

◆ GetDefaultVisibleRangePolicy()

static EBasicPolicy CVisibleRange::GetDefaultVisibleRangePolicy ( )
inlinestatic

◆ GetLocations()

const CVisibleRange::TLocations & CVisibleRange::GetLocations ( ) const

Definition at line 60 of file visible_range.cpp.

References m_Locs.

Referenced by CProjectView::GetReflectionInfo().

◆ IsAutoBroadcast()

static bool CVisibleRange::IsAutoBroadcast ( )
inlinestatic

◆ Match()

bool CVisibleRange::Match ( const objects::CSeq_id &  id) const

◆ SetAutoBroadcast()

static void CVisibleRange::SetAutoBroadcast ( bool  flag)
inlinestatic

Definition at line 78 of file visible_range.hpp.

References sm_AutoBroadcast.

Referenced by CVisibleRangeService::LoadSettings().

◆ SetDefaultVisibleRangePolicy()

static void CVisibleRange::SetDefaultVisibleRangePolicy ( EBasicPolicy  policy)
inlinestatic

Definition at line 81 of file visible_range.hpp.

References sm_DefaultPolicy.

Referenced by CVisibleRangeService::LoadSettings().

◆ SetVisibleRangePolicy()

void CVisibleRange::SetVisibleRangePolicy ( EBasicPolicy  policy)
inline

◆ x_Clamp() [1/2]

bool CVisibleRange::x_Clamp ( const objects::CSeq_loc &  loc,
const objects::CBioseq_Handle &  handle,
TSeqRange range 
) const
private

◆ x_Clamp() [2/2]

bool CVisibleRange::x_Clamp ( objects::CSeq_loc &  loc,
const TSeqRange range 
) const
private

◆ x_GetPolicy()

int CVisibleRange::x_GetPolicy ( ) const
private

Member Data Documentation

◆ m_Locs

TLocations CVisibleRange::m_Locs
private

Definition at line 123 of file visible_range.hpp.

Referenced by AddLocation(), Clamp(), GetLocations(), and Match().

◆ m_Policy

EBasicPolicy CVisibleRange::m_Policy
private

Definition at line 125 of file visible_range.hpp.

Referenced by SetVisibleRangePolicy(), and x_GetPolicy().

◆ m_Scope

CRef<objects::CScope> CVisibleRange::m_Scope
private

Definition at line 124 of file visible_range.hpp.

Referenced by Clamp(), and Match().

◆ sm_AutoBroadcast

bool CVisibleRange::sm_AutoBroadcast = true
staticprivate

Definition at line 128 of file visible_range.hpp.

Referenced by IsAutoBroadcast(), and SetAutoBroadcast().

◆ sm_DefaultPolicy

CVisibleRange::EBasicPolicy CVisibleRange::sm_DefaultPolicy = eBasic_Track
staticprivate

The documentation for this class was generated from the following files:
Modified on Mon Feb 26 04:03:08 2024 by modify_doxy.py rev. 669887