Adaptagrams
box.h
1 /*
2  * vim: ts=4 sw=4 et tw=0 wm=0
3  *
4  * libcola - A library providing force-directed network layout using the
5  * stress-majorization method subject to separation constraints.
6  *
7  * Copyright (C) 2014 Monash University
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  * See the file LICENSE.LGPL distributed with the library.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  * Author(s): Michael Wybrow
20  *
21 */
22 
23 #ifndef LIBCOLA_BOX_H
24 #define LIBCOLA_BOX_H
25 
26 #include <cstdio>
27 
28 #include "libvpsc/rectangle.h"
29 
30 
31 namespace cola {
32 
37 class Box
38 {
39  public:
51  Box(double xMin, double xMax, double yMin, double yMax);
60  Box(double all);
64  Box();
65  ~Box();
66 
67  bool empty(void) const;
68  double min(size_t dim) const;
69  double max(size_t dim) const;
70  void outputCode(FILE *fp) const;
71  vpsc::Rectangle rectangleByApplyingBox(
72  const vpsc::Rectangle rectangle) const;
73 
74  private:
75  static double nonNegative(double value);
76 
77  double m_min[2];
78  double m_max[2];
79 };
80 
81 } // namespace cola
82 #endif
Box()
Constructs an empty padding or margin box.
Definition: box.cpp:44
A box consisting of four edge values for representing padding or margins for rectangles.
Definition: box.h:37
A rectangle represents a fixed-size shape in the diagram that may be moved to prevent overlaps and sa...
Definition: rectangle.h:78
libcola: Force-directed network layout subject to separation constraints library. ...
Definition: box.cpp:25