Layout.hh 1.37 KB
/*
 * Layout.hh
 *
 *  Created on: Sep, 2, 2014
 *      Author: AKKA
 */

#ifndef LAYOUT_HH_
#define LAYOUT_HH_

#include <iostream>
#include <map>
#include <string>
#include <boost/shared_ptr.hpp>
#include <vector>

#include "LayoutProperties.hh"
#include "Bounds.hh"

namespace plot {

class PanelPlotOutput;

/**
 * Available panel constrains in the layout.
 * MaxWidth means the panel must occupy the maximum width drawn on a page
 * Square means the panel must keep a square geometric form when drawn on a page
 *
 */
enum class PanelConstraint {
	MaxWidth,
	Square
};

/**
 * Generic Layout interface
 */
class Layout {
public:
	Layout(double panelHeight, double panelSpacing, double firstPanelHeightFactor = 1.0, bool autoExpand = true, double xyRatio = 1.0,  bool onlyLowerTimeAxesLegend = false) :
		_requestPanelHeight (panelHeight),
		_requestPanelSpacing(panelSpacing),
		_firstPanelHeightFactor(firstPanelHeightFactor),
		_autoExpand (autoExpand),
		_xyRatio (xyRatio),
		_onlyLowerTimeAxesLegend(onlyLowerTimeAxesLegend)
	{
	}

	virtual ~Layout() {
	}

	virtual void computePanelsPosition (std::vector<boost::shared_ptr<PanelPlotOutput>> _plots) = 0;

protected:
	double		_requestPanelHeight;
	double		_requestPanelSpacing;
	double 		_firstPanelHeightFactor;
	bool		_autoExpand;
	double		_xyRatio;
	bool            _onlyLowerTimeAxesLegend;
};

} /* namespace plot */

#endif /* LAYOUT_HH_ */