Adaptagrams
|
A boundary constraint specifies a bounding line that a set of nodes must be either to the left or right of. More...
#include <compound_constraints.h>
Public Member Functions | |
BoundaryConstraint (const vpsc::Dim dim) | |
Constructs a new BoundaryConstraint in the specified dimension. More... | |
void | addShape (const unsigned int index, const double offset) |
Mark a node as being part of this boundary constraint. More... | |
std::string | toString (void) const |
Returns a textual description of the compound constraint. More... | |
void | generateVariables (const vpsc::Dim dim, vpsc::Variables &vars) |
Implemented by the compound constraint to generate any additional required variables in the given dimension. More... | |
void | generateSeparationConstraints (const vpsc::Dim dim, vpsc::Variables &vars, vpsc::Constraints &cs, vpsc::Rectangles &bbs) |
Implemented by the compound constraint to generate the low-level separation constraints in the given dimension. More... | |
void | updatePosition (const vpsc::Dim dim) |
Implemented by the compound constraint to send position information back to the interface. More... | |
Public Attributes | |
double | position |
Holds the position of the boundary line, once layout is complete. | |
A boundary constraint specifies a bounding line that a set of nodes must be either to the left or right of.
A boundary constraint gives a bounding line in a particular dimension (with position stored in a variable) and a set of nodes required to be to the left of that line and nodes required to be to the right of the line. Separations are determined by offsets passed to addShape().
cola::BoundaryConstraint::BoundaryConstraint | ( | const vpsc::Dim | dim | ) |
Constructs a new BoundaryConstraint in the specified dimension.
[in] | dim | The dimension the constraints will operate in. |
void cola::BoundaryConstraint::addShape | ( | const unsigned int | index, |
const double | offset | ||
) |
Mark a node as being part of this boundary constraint.
[in] | index | The index of the node in the Rectangles vector. |
[in] | offset | The minimum amount to separate the node from the boundary line. Negative if left-of, positive if right-of. Will usually be equal to half a node's size plus a buffer amount. |
|
virtual |
Implemented by the compound constraint to generate the low-level separation constraints in the given dimension.
These constraints will be added to the list of constraints cs.
[in] | dim | The current active dimension. |
[in] | vars | The list of variables for the overall problem instance. |
[in,out] | cs | The list of constraints to which the generated constraints will be added. |
[in] | bbs | The list of bounding boxes for all rectangles in the current problem. It has the same order as vars. |
Implements cola::CompoundConstraint.
|
virtual |
Implemented by the compound constraint to generate any additional required variables in the given dimension.
Generate any additional variables required by this compound constraint when operating in the given dimension dim and add them to vars. These variables should be cleaned up by the caller after the VPSC problem is solved.
The variables' ideal position and weight should be set by the compound constraint and they should be added to the end of vars.
[in] | dim | The current active dimension. |
[in,out] | vars | The list of variables for the overall problem instance to which any variables generated should be appended. |
Implements cola::CompoundConstraint.
References position.
|
virtual |
Returns a textual description of the compound constraint.
Implements cola::CompoundConstraint.
|
virtual |
Implemented by the compound constraint to send position information back to the interface.
This will be called for each compound constraint once the VPSC instance is solved to allow them to pass information such as variable values back to the graphical user interface.
[in] | dim | The current active dimension. |
Reimplemented from cola::CompoundConstraint.
References position.