Blame view

src/ParamOutputImpl/Plot/LayoutAuto.hh 1.65 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * LayoutAuto.hh
 *
 *  Created on: Sep, 2, 2014
 *      Author: AKKA
 */

#ifndef LAYOUTAUTO_HH_
#define LAYOUTAUTO_HH_

#include <iostream>
#include <map>
#include <string>

#include "Layout.hh"

namespace plot {

/**
 * LayoutAuto
 */
class LayoutAuto : public Layout {
public:
12353568   Benjamin Renard   Add layout proper...
24
25
	LayoutAuto(double panelHeight, double panelSpacing, double firstPanelHeightFactor = 1.0, bool autoExpand = true, double xyRatio = 1.0, bool onlyLowerTimeAxesLegend = false) :
		Layout (panelHeight, panelSpacing, firstPanelHeightFactor, autoExpand, xyRatio, onlyLowerTimeAxesLegend),
fbe3c2bb   Benjamin Renard   First commit
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
		_nbMaxWidthPanel(0),
		_nbSquarePanel(0),
		_curMaxWidthPanel(0),
		_curSquarePanel(0),
		_curSquarePanelLine(0),
		_computedPanelBounds(),
		_panelHeight(0),
		_panelWidth(0),
		_panelXSpacing(0),
		_panelYSpacing(0),
 		_nbMaxSquarePanelByLine(0),
 		_nbLineForSquarePanel(0),
 		_firstPanelHeightDelta(0)
	{
	}

	virtual ~LayoutAuto() {
	}

2f0b202e   Benjamin Renard   Reverse panels or...
45
	void computePanelsPosition (std::vector<boost::shared_ptr<PanelPlotOutput>> _plots);
fbe3c2bb   Benjamin Renard   First commit
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

private:
	double computeLayoutHeight (void);
	void shrink (double step);
	void expand (double step);

	int 		_nbMaxWidthPanel;
	int 		_nbSquarePanel;

	int 		_curMaxWidthPanel;
	int 		_curSquarePanel;
	int 		_curSquarePanelLine;

	Bounds		_computedPanelBounds;
	double		_panelHeight;
	double		_panelWidth;
	double		_panelXSpacing;
	double		_panelYSpacing;
	int 		_nbMaxSquarePanelByLine;
	int 		_nbLineForSquarePanel;
	double 		_firstPanelHeightDelta;
2f0b202e   Benjamin Renard   Reverse panels or...
67
68
69
70

	void addPanel (PanelConstraint panelConstraint, double preferedWidth=-1, double preferedHeight=-1);
	void reset (void);
	Bounds & getNextBounds (PanelConstraint panelConstraint);
fbe3c2bb   Benjamin Renard   First commit
71
72
73
74
75
};

} /* namespace plot */

#endif /* LAYOUTAUTO_HH_ */