A Margin is used to determine what to clip in a graph. More...
#include <ComposedMargin.h>
Public Member Functions | |
ComposedMargin () | |
Creates a new ComposedMargin. | |
virtual | ~ComposedMargin () |
Deletes this ComposedMargin. | |
virtual double | getMargin (double clipSize) |
Returns the maximum margin from contained margins (max borderSize). | |
virtual double | getMargin (double clipSize, CurvePtr p) |
Returns the maximum margin from contained margins. | |
virtual double | getMargin (double clipSize, AreaPtr a) |
Returns the maximum margin from contained margins. | |
void | addMargin (Margin *m) |
Adds a margin. | |
void | removeMargin (Margin *m) |
Removes a margin. | |
Private Attributes | |
vector< Margin * > | margins |
list of margins. |
A Margin is used to determine what to clip in a graph.
It enables to take into account the width of a curve when clipping a box. For example, when drawing a road that would go along a border, the curve would be in only one tile, but considering the curve's width, the drawing would be cut on the tile border. That is why we need margins. This class enables to check multiple Margins at the same time.
proland::ComposedMargin::ComposedMargin | ( | ) |
Creates a new ComposedMargin.
virtual proland::ComposedMargin::~ComposedMargin | ( | ) | [virtual] |
Deletes this ComposedMargin.
void proland::ComposedMargin::addMargin | ( | Margin * | m | ) |
Adds a margin.
m | a margin. |
virtual double proland::ComposedMargin::getMargin | ( | double | clipSize, | |
AreaPtr | a | |||
) | [virtual] |
Returns the maximum margin from contained margins.
clipSize | size of the clipping box. | |
a | the area to get the margin from. |
Reimplemented from proland::Margin.
virtual double proland::ComposedMargin::getMargin | ( | double | clipSize, | |
CurvePtr | p | |||
) | [virtual] |
Returns the maximum margin from contained margins.
clipSize | size of the clipping box. | |
p | the curve to get the margin from. |
Implements proland::Margin.
virtual double proland::ComposedMargin::getMargin | ( | double | clipSize | ) | [virtual] |
Returns the maximum margin from contained margins (max borderSize).
clipSize | size of the clipping box. |
Implements proland::Margin.
void proland::ComposedMargin::removeMargin | ( | Margin * | m | ) |
Removes a margin.
param m a margin.
vector<Margin*> proland::ComposedMargin::margins [private] |
list of margins.