/* * LayoutAuto.hh * * Created on: Sep, 2, 2014 * Author: AKKA */ #ifndef LAYOUTAUTO_HH_ #define LAYOUTAUTO_HH_ #include #include #include #include "Layout.hh" namespace plot { /** * LayoutAuto */ class LayoutAuto : public Layout { public: 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), _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() { } void computePanelsPosition (std::vector> _plots, std::map *parameterValues = NULL); 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; void addPanel (PanelConstraint panelConstraint, double preferedWidth=-1, double preferedHeight=-1); void reset (void); Bounds & getNextBounds (PanelConstraint panelConstraint); }; } /* namespace plot */ #endif /* LAYOUTAUTO_HH_ */