NCBI C++ ToolKit
|
Search Toolkit Book for ILayoutPolicy
class ILayoutPolicy defines the abstract interface required for generating layout based on a set of given CSeqGlyphs (layout objects). More...
#include <gui/widgets/seq_graphic/layout_policy.hpp>
Classes | |
struct | SBoundingBox |
Public Types | |
typedef list< CRef< CSeqGlyph > > | TObjectList |
typedef vector< CRef< CSeqGlyph > > | TLayoutRow |
typedef vector< TLayoutRow > | TLayout |
typedef std::function< bool(const CRef< CSeqGlyph > &, const CRef< CSeqGlyph > &)> | TSorter |
Public Member Functions | |
virtual | ~ILayoutPolicy () |
virtual void | BuildLayout (CLayoutGroup &group, SBoundingBox &bound) const =0 |
Build layout for a list of layout objects. More... | |
void | SetSorter (TSorter &sorter) |
Protected Member Functions | |
void | x_SeparateObjects (CLayoutGroup &group, TLayout &layout, SBoundingBox &bound, size_t group_size, int vert_space) const |
Separate objects into multiple sub-groups. More... | |
virtual void | x_SetObjectPos (TLayout &layout, SBoundingBox &bound) const |
Set the objects' position (Y), and update the bounding box of the group (of all objects). More... | |
Protected Attributes | |
TSorter | m_Sorter = nullptr |
class ILayoutPolicy defines the abstract interface required for generating layout based on a set of given CSeqGlyphs (layout objects).
Definition at line 52 of file layout_policy.hpp.
typedef vector<TLayoutRow> ILayoutPolicy::TLayout |
Definition at line 57 of file layout_policy.hpp.
typedef vector< CRef<CSeqGlyph> > ILayoutPolicy::TLayoutRow |
Definition at line 56 of file layout_policy.hpp.
typedef list< CRef<CSeqGlyph> > ILayoutPolicy::TObjectList |
Definition at line 55 of file layout_policy.hpp.
Definition at line 58 of file layout_policy.hpp.
|
inlinevirtual |
Definition at line 67 of file layout_policy.hpp.
|
pure virtual |
Build layout for a list of layout objects.
bound | the bounding box for all objects |
Implemented in COverlayLayout, CInlineLayout, CSimpleLayout, CLayeredLayout, CCompactLayout, and CColumnLayout.
|
inline |
Definition at line 73 of file layout_policy.hpp.
References m_Sorter.
Referenced by CIntronTrack::x_OnLayoutPolicyChanged().
|
protected |
Separate objects into multiple sub-groups.
CLayoutPolicy.
This is for rendering performance consideration. By creating multiple groups, the visibility detection can be done more efficiently based on group boundary such that the whole group of objects can be skipped from rendering if it is not visible to users.
Definition at line 44 of file layout_policy.cpp.
References _ASSERT, bound(), CLayoutGroup::GetChildren(), CSeqGlyph::GetLevel(), CLayoutGroup::GetLinkedFeat(), max(), min(), NON_CONST_ITERATE, CLayoutGroup::PushBack(), row, CLayoutGroup::SetConfig(), CSeqGlyph::SetHeight(), CLayoutGroup::SetLayoutPolicy(), CSeqGlyph::SetLeft(), CSeqGlyph::SetLevel(), CSeqGlyph::SetWidth(), and x_SetObjectPos().
Referenced by CColumnLayout::BuildLayout(), CLayeredLayout::x_LayerByPos(), and CLayeredLayout::x_LayerBySize().
|
inlineprotectedvirtual |
Set the objects' position (Y), and update the bounding box of the group (of all objects).
Reimplemented in CLayeredLayout, and CColumnLayout.
Definition at line 89 of file layout_policy.hpp.
Referenced by x_SeparateObjects().
Definition at line 91 of file layout_policy.hpp.
Referenced by CSimpleLayout::BuildLayout(), SetSorter(), CLayeredLayout::x_LayerByPos(), and CLayeredLayout::x_LayerBySize().