digiKam
atkinspagelayouttree.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_TREE_H
25 #define DIGIKAM_ATKINS_PAGE_LAYOUT_TREE_H
26 
27 // Qt includes
28 
29 #include <QRectF>
30 #include <QMap>
31 
52 {
53 
54 class AtkinsPageLayoutNode;
55 
57 {
58 public:
59 
60  AtkinsPageLayoutTree(double aspectRatioPage,
61  double absoluteAreaPage);
64 
66 
67  int addImage(double aspectRatio,
68  double relativeArea);
69  QRectF drawingArea(int index,
70  const QRectF& absoluteRectPage);
71 
72  int count() const;
73  double score(AtkinsPageLayoutNode* const root,
74  int nodeCount);
75  double G() const;
76 
77 private:
78 
79  double absoluteArea(AtkinsPageLayoutNode* const node);
80 
85  QRectF rectInRect(const QRectF& rect,
86  double aspectRatio,
87  double absoluteArea);
88 
89 private:
90 
91  AtkinsPageLayoutNode* m_root;
92  int m_count;
93 
94  double m_aspectRatioPage;
95  double m_absoluteAreaPage;
96 };
97 
98 } // Namespace Digikam
99 
100 #endif // DIGIKAM_ATKINS_PAGE_LAYOUT_TREE_H
Definition: atkinspagelayoutnode.h:54
Definition: atkinspagelayouttree.h:57
double G() const
Section 2.2.2.
Definition: atkinspagelayouttree.cpp:200
int addImage(double aspectRatio, double relativeArea)
Definition: atkinspagelayouttree.cpp:75
AtkinsPageLayoutTree(double aspectRatioPage, double absoluteAreaPage)
Definition: atkinspagelayouttree.cpp:41
~AtkinsPageLayoutTree()
Definition: atkinspagelayouttree.cpp:70
double score(AtkinsPageLayoutNode *const root, int nodeCount)
Section 2.2.1.
Definition: atkinspagelayouttree.cpp:171
AtkinsPageLayoutTree & operator=(const AtkinsPageLayoutTree &other)
Definition: atkinspagelayouttree.cpp:56
QRectF drawingArea(int index, const QRectF &absoluteRectPage)
Definition: atkinspagelayouttree.cpp:229
Definition: advprintphoto.cpp:43