NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ILayoutPolicy Class Referenceabstract

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>

+ Inheritance diagram for ILayoutPolicy:

Classes

struct  SBoundingBox
 

Public Types

typedef list< CRef< CSeqGlyph > > TObjectList
 
typedef vector< CRef< CSeqGlyph > > TLayoutRow
 
typedef vector< TLayoutRowTLayout
 
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
 

Detailed Description

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.

Member Typedef Documentation

◆ TLayout

Definition at line 57 of file layout_policy.hpp.

◆ TLayoutRow

Definition at line 56 of file layout_policy.hpp.

◆ TObjectList

Definition at line 55 of file layout_policy.hpp.

◆ TSorter

Definition at line 58 of file layout_policy.hpp.

Constructor & Destructor Documentation

◆ ~ILayoutPolicy()

virtual ILayoutPolicy::~ILayoutPolicy ( )
inlinevirtual

Definition at line 67 of file layout_policy.hpp.

Member Function Documentation

◆ BuildLayout()

virtual void ILayoutPolicy::BuildLayout ( CLayoutGroup group,
SBoundingBox bound 
) const
pure virtual

Build layout for a list of layout objects.

Parameters
boundthe bounding box for all objects

Implemented in COverlayLayout, CInlineLayout, CSimpleLayout, CLayeredLayout, CCompactLayout, and CColumnLayout.

◆ SetSorter()

void ILayoutPolicy::SetSorter ( TSorter sorter)
inline

Definition at line 73 of file layout_policy.hpp.

References m_Sorter.

Referenced by CIntronTrack::x_OnLayoutPolicyChanged().

◆ x_SeparateObjects()

void ILayoutPolicy::x_SeparateObjects ( CLayoutGroup group,
TLayout layout,
SBoundingBox bound,
size_t  group_size,
int  vert_space 
) const
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().

◆ x_SetObjectPos()

virtual void ILayoutPolicy::x_SetObjectPos ( TLayout layout,
SBoundingBox bound 
) const
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().

Member Data Documentation

◆ m_Sorter

TSorter ILayoutPolicy::m_Sorter = nullptr
protected

The documentation for this class was generated from the following files:
Modified on Sat Jun 15 11:49:12 2024 by modify_doxy.py rev. 669887