NCBI C++ ToolKit
column_layout_policy.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___COLUMN_LAYOUT_POLICY__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___COLUMN_LAYOUT_POLICY__HPP
3 
4 /* $Id: column_layout_policy.hpp 34827 2016-02-17 00:59:08Z rudnev $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Liangshou Wu
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbiobj.hpp>
36 #include <gui/gui_export.h>
38 
40 
41 ///////////////////////////////////////////////////////////////////////////////
42 /// CColumnLayout is for creating layout by sorting glyphs into 'columns'.
43 /// The 'column' here is more or less in shape of column, to exactly one
44 /// glyph per row in one 'column'. The glyph in each column is sorted by pos.
45 
47  public CObject,
48  public ILayoutPolicy
49 {
50 public:
52  : m_MinDist(0)
53  , m_VertSpace(3)
54  , m_LimitRowPerGroup(true)
55  {}
56 
57  /// access the minimum distance between two objects.
58  /// The distance is in bases.
59  TSeqPos GetMinDist(void) const;
60  void SetMinDist(TSeqPos dist);
61  void SetVertSpace(int d);
62  void SetLimitRowPerGroup(bool f);
63 
64  /// @name ILayoutPolicy interface implementation.
65  /// @{
66  virtual void BuildLayout(CLayoutGroup& group, SBoundingBox& bound) const;
67  /// @}
68 
69 private:
70  /// Set the objects' position (Y), and update the bounding
71  /// box of the group (of all objects).
72  void x_SetObjectPos(TLayout& layout, SBoundingBox& bound) const;
73 
74 private:
75  /// The minimum distance we permit two items to be within, horizontally.
78  ///
80 };
81 
82 ///////////////////////////////////////////////////////////////////////////////
83 /// CColumnLayout inline methods.
84 
85 inline
87 {
88  return m_MinDist;
89 }
90 
91 inline
93 {
94  m_MinDist = dist;
95 }
96 
97 inline
99 {
100  m_VertSpace = d;
101 }
102 
103 inline
105 {
107 }
108 
109 
111 
112 #endif // GUI_WIDGETS_SEQ_GRAPHIC___COLUMN_LAYOUT_POLICY__HPP
113 
114 
CColumnLayout is for creating layout by sorting glyphs into 'columns'.
TSeqPos GetMinDist(void) const
access the minimum distance between two objects.
void SetVertSpace(int d)
TSeqPos m_MinDist
The minimum distance we permit two items to be within, horizontally.
void SetMinDist(TSeqPos dist)
void SetLimitRowPerGroup(bool f)
CLayoutGroup is a container of CSeqGlyphs (layout objects).
CObject –.
Definition: ncbiobj.hpp:180
class ILayoutPolicy defines the abstract interface required for generating layout based on a set of g...
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).
virtual void BuildLayout(CLayoutGroup &group, SBoundingBox &bound) const =0
Build layout for a list of layout objects.
#define true
Definition: bool.h:35
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_SEQGRAPHIC_EXPORT
Definition: gui_export.h:536
Defines to provide correct exporting from DLLs in Windows.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
T bound(T x_, T xlo_, T xhi_)
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
Modified on Thu Jun 13 17:25:22 2024 by modify_doxy.py rev. 669887