50 , m_bFlipStrand(
false)
51 , m_bInlineChildren(
false)
231 TLayout::iterator it =
m_Layout.begin() + row;
263 return (obj1->GetRange() < obj2->GetRange() &&
264 obj1->GetRange().GetTo() < obj2->GetRange().GetFrom());
293 throw runtime_error(
"GetLocation() not implemented");
299 throw runtime_error(
"LessByPos() not implemented");
305 throw runtime_error(
"LessBySize() not implemented");
313 throw runtime_error(
"GetObject() not implemented");
319 throw runtime_error(
"GetObjects() not implemented");
325 throw runtime_error(
"HasObject() not implemented");
331 throw runtime_error(
"GetType() not implemented");
354 TObjects::const_reverse_iterator riter(objs.end());
355 TObjects::const_reverse_iterator rend (objs.begin());
356 for ( ; riter != rend; ++riter) {
358 bool need_extra_space =
false;
368 TSeqRange intersect_range = ref->GetRange();
374 if (intersect_range.
GetFrom() > from_off) {
386 if (expanded_to > intersect_range.
GetTo()) {
388 intersect_range.
SetTo(expanded_to);
392 range_holder.
SetRange(intersect_range);
394 bool inserted =
false;
396 bool intersects =
false;
398 CLayout::TLayoutRow::iterator row_iter =
399 std::lower_bound(iter->begin(), iter->end(), ref_obj, func);
403 if (row_iter != iter->end()) {
404 ref_row_iter = *row_iter;
405 total_range = (*row_iter)->GetRange();
408 ((*row_iter)->GetRange());
412 iter->insert(row_iter, ref);
466 new_range = (*iter)->GetRange();
483 bool inserted =
false;
491 row_iter->push_back(*iter);
497 row_iter->push_back(*iter);
508 row.push_back(*iter);
519 _TRACE(
"\n" <<
features.size() <<
" items, spacing = " << spacing);
523 <<
features[
i]->GetExtent().GetFrom() <<
" - "
524 <<
features[
i]->GetExtent().GetTo() <<
"}");
527 for (
i = 0;
i <
pack.size(); ++
i) {
529 for (j = 0; j <
pack[
i].size(); ++j) {
531 dumpRecursive(*
pack[
i][j]);
bool LessBySize(const CLayoutObject &) const
compare this object to another, based on size
const objects::CSeq_loc & GetLocation(void) const
all other interfaces to this class throw an exception
bool LessByPos(const CLayoutObject &) const
compare this object to another, based on position
bool HasObject(CConstRef< CObject >) const
check if the wrapped object(s) is the one
EType GetType() const
retrieve the type of this object
CConstRef< CObject > GetObject(TSeqPos) const
access our core component - we wrap an object(s) of some sort.
void SetRange(const TSeqRange &range)
TSeqRange GetRange(void) const
access the position of this object.
void GetObjects(vector< CConstRef< CObject > > &) const
retrieve CObjects corresponding to this CLayoutObject
class CLayoutObject defines an interface that wraps a rectilinear abstract object.
class CLayout is a container of objects laid out in a series of rows or tracks.
static const char * pack(const char *fmt,...)
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 NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
TObjects & SetChildren(void)
TSeqPos m_MinDist
the minimum distance we permit two items to be within
void SetModelRect(const TModelRect &rect)
void Clear(void)
clear opur internal list of objects
bool IsFlippedStrand() const
bool IsSelected() const
object is selected
TLayoutRow & SetRow(size_t row)
vector< TLayoutRow > TLayout
void SetParent(CLayoutObject *feat)
const TLayoutRow & GetRow(size_t row) const
access a row of the layout
vector< CRef< CLayoutObject > > TObjects
const TLayout & GetLayout(void) const
access the entire layout
TModelRect GetModelRect() const
area rectangle of the object in model space
bool IsHorizontal() const
vector< TSeqRange > m_Intervals
virtual void Layout(TObjects &objects, CLayout &layout, bool side_label=false)
void SetHorizontal(bool b_horz)
vector< CRef< CObject > > TObjects
EType
type of layout objects currently supported
TSeqPos m_SideSpace
preserved left side space for label.
void SetFlippedStrand(bool b_flip)
virtual void x_CalcIntervals(void) const
TLayout & SetLayout(void)
const vector< TSeqRange > & GetIntervals(void) const
virtual TSeqRange GetRange(void) const =0
access the position of this object.
TLayoutRow & AddRow(void)
add a row to the layout
vector< CRef< CLayoutObject > > TLayoutRow
void Append(const CLayout &layout)
append an entire layout to this one
const CLayoutObject * GetParent(void) const
EChildrenLayout GetChildrenLayout(void) const
void SetChildrenLayout(EChildrenLayout type)
TLayout m_Layout
our layout. This is a nested container - a set of rows.
void Insert(const CLayout &layout, size_t row)
insert an entire layout to this one
void SetSelected(bool flag)
const TObjects & GetChildren(void) const
bool IntersectingWith(const TThisType &r) const
static TThisType GetWhole(void)
#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.
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
Useful/utility classes and methods.
basic sort by size function
sorting functor for finding a range inside a collection of layout objects
bool operator()(const CRef< CLayoutObject > &obj1, const CRef< CLayoutObject > &obj2) const
static const char *const features[]