digiKam
atkinspagelayoutnode.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2007-02-13
7  * Description : Layouting photos on a page
8  *
9  * Copyright (C) 2007-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_ATKINS_PAGE_LAYOUT_NODE_H
25 #define DIGIKAM_ATKINS_PAGE_LAYOUT_NODE_H
26 
27 // Qt includes
28 
29 #include <QRectF>
30 #include <QMap>
31 
51 {
52 
54 {
55 public:
56 
57  enum Type
58  {
62  };
63 
64 public:
65 
67  double relativeArea,
68  int index);
70  AtkinsPageLayoutNode* const terminalChild,
71  bool horizontal,
72  int index);
75 
77 
78  double aspectRatio() const;
79  double relativeArea() const;
80  double division() const;
81  Type type() const;
82  int index() const;
83 
86 
90  void takeAndSetChild(AtkinsPageLayoutNode* const oldChild,
91  AtkinsPageLayoutNode* const newChild);
92 
97 
102 
107  void computeRelativeSizes();
108 
113  void computeDivisions();
114 
115 private:
116 
117  double m_a;
118  double m_e;
119  double m_division;
120 
121  Type m_type;
122 
123  int m_index;
124 
125  AtkinsPageLayoutNode* m_leftChild;
126  AtkinsPageLayoutNode* m_rightChild;
127 };
128 
129 } // Namespace Digikam
130 
131 #endif // DIGIKAM_ATKINS_PAGE_LAYOUT_NODE_H
Definition: atkinspagelayoutnode.h:54
AtkinsPageLayoutNode * leftChild() const
Definition: atkinspagelayoutnode.cpp:230
void takeAndSetChild(AtkinsPageLayoutNode *const oldChild, AtkinsPageLayoutNode *const newChild)
Definition: atkinspagelayoutnode.cpp:88
AtkinsPageLayoutNode & operator=(const AtkinsPageLayoutNode &)
Definition: atkinspagelayoutnode.cpp:75
double relativeArea() const
Definition: atkinspagelayoutnode.cpp:210
AtkinsPageLayoutNode * parentOf(AtkinsPageLayoutNode *const child)
Definition: atkinspagelayoutnode.cpp:123
void computeRelativeSizes()
Definition: atkinspagelayoutnode.cpp:145
~AtkinsPageLayoutNode()
Definition: atkinspagelayoutnode.cpp:69
Type
Definition: atkinspagelayoutnode.h:58
@ TerminalNode
Definition: atkinspagelayoutnode.h:59
@ VerticalDivision
images side by side
Definition: atkinspagelayoutnode.h:61
@ HorizontalDivision
one image on top of the other
Definition: atkinspagelayoutnode.h:60
Type type() const
Definition: atkinspagelayoutnode.cpp:220
double division() const
Definition: atkinspagelayoutnode.cpp:215
int index() const
Definition: atkinspagelayoutnode.cpp:225
void computeDivisions()
Definition: atkinspagelayoutnode.cpp:175
AtkinsPageLayoutNode(double aspectRatio, double relativeArea, int index)
Definition: atkinspagelayoutnode.cpp:37
double aspectRatio() const
Definition: atkinspagelayoutnode.cpp:205
AtkinsPageLayoutNode * rightChild() const
Definition: atkinspagelayoutnode.cpp:235
AtkinsPageLayoutNode * nodeForIndex(int index)
Definition: atkinspagelayoutnode.cpp:101
Definition: advprintphoto.cpp:43