47 , m_Policy(sm_DefaultPolicy)
122 const objects::CBioseq_Handle& handle,
131 this_range.
SetTo(handle.GetBioseqLength());
133 TSeqRange other_range = loc.GetTotalRange();
135 other_range.
SetTo(handle.GetBioseqLength());
143 this_range = other_range;
147 this_range = other_range;
151 this_range = other_range;
164 this_range = other_range;
172 this_range.
SetTo ((
unsigned)(this_range.
GetTo() - diff));
173 }
else if (other_range.
GetTo() > this_range.
GetTo()) {
174 size_t diff = other_range.
GetTo() - this_range.
GetTo();
176 this_range.
SetTo ((
unsigned)(this_range.
GetTo() + diff));
182 this_range.
SetTo ((
unsigned)(this_range.
GetTo() + diff));
183 }
else if (this_range.
GetTo() > other_range.
GetTo()) {
184 size_t diff = this_range.
GetTo() - other_range.
GetTo();
186 this_range.
SetTo ((
unsigned)(this_range.
GetTo() - diff));
201 }
else if (new_to > handle.GetBioseqLength()) {
202 new_from -= new_to - handle.GetBioseqLength();
203 new_to = handle.GetBioseqLength();
207 this_range.
SetTo(new_to);
212 bool ret_val = (this_range !=
range);
225 TSeqRange total_range = loc.GetTotalRange();
231 bool clamped =
false;
236 if (
x_Clamp(**iter, bsh2, total_range)) {
250 return x_Clamp(loc, total_range);
262 switch (loc.
Which()) {
279 CSeq_loc::TPacked_int::Tdata::iterator iter = loc.
SetPacked_int().Set().begin();
280 CSeq_loc::TPacked_int::Tdata::iterator
end = loc.
SetPacked_int().Set().end();
281 for ( ; iter !=
end; ++iter) {
298 CSeq_loc::TMix::Tdata::iterator iter = loc.
SetMix().Set().begin();
299 CSeq_loc::TMix::Tdata::iterator
end = loc.
SetMix().Set().end();
300 for ( ; iter !=
end; ++iter) {
306 loc.
SetMix().Set().erase(iter++);
316 LOG_POST(
Error <<
"CVisibleRange::x_Clamp(): unhandled loc type");
static CRef< CScope > m_Scope
@ eVisible_Ignore
combination options
@ ePositionMask
position tracking options
@ eScaleMask
location scale tracking options
static EBasicPolicy GetDefaultVisibleRangePolicy()
CVisibleRange(objects::CScope &scope)
static EBasicPolicy sm_DefaultPolicy
static bool sm_AutoBroadcast
CRef< objects::CScope > m_Scope
list< CConstRef< objects::CSeq_loc > > TLocations
const TLocations & GetLocations() const
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.
bool Match(const objects::CSeq_id &id) const
See if we can match the supplied range.
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
void AddLocation(const objects::CSeq_loc &loc)
constexpr auto end(const ct_const_array< T, N > &in) noexcept
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
static bool Match(const objects::CSeq_id &id1, const objects::CSeq_id &id2, objects::CScope *scope=NULL)
check to see if two seq-ids are identical.
CConstRef< CSeq_id > GetSeqId(void) const
void SetPacked_int(TPacked_int &v)
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
TRange GetTotalRange(void) const
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
CSeq_id_Handle GetIdHandle(const CSeq_loc &loc, CScope *scope)
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
TSeqPos GetBioseqLength(void) const
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
position_type GetLength(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetTo(TTo value)
Assign a value to To data member.
void SetTo(TTo value)
Assign a value to To data member.
TFrom GetFrom(void) const
Get the From member data.
E_Choice Which(void) const
Which variant is currently selected.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
range(_Ty, _Ty) -> range< _Ty >
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)