Adaptagrams
|
A distribution constraint specifies an ordered set of alignment constraints and a fixed separation required between them. More...
#include <compound_constraints.h>
Public Member Functions | |
DistributionConstraint (const vpsc::Dim dim) | |
Constructs a new empty DistributionConstraint with a minimum or exact spacing. More... | |
void | addAlignmentPair (AlignmentConstraint *ac1, AlignmentConstraint *ac2) |
Mark a pair of alignment constraints as being part of this distribution constraint. More... | |
void | setSeparation (double sep) |
Alter the exact spacing between each pair of alignment constraints. 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 &gcs, vpsc::Rectangles &bbs) |
Implemented by the compound constraint to generate the low-level separation constraints in the given dimension. More... | |
Public Member Functions inherited from cola::CompoundConstraint | |
virtual void | updatePosition (const vpsc::Dim dim) |
Implemented by the compound constraint to send position information back to the interface. More... | |
Public Attributes | |
void * | indicator |
A distribution constraint specifies an ordered set of alignment constraints and a fixed separation required between them.
This compound constraint it used to keep a set of alignment constraints equally distributed.
If no separation distance is set, then it is detemined from the distance between the two outer alignments, divided by the number of alignments - 1.
cola::DistributionConstraint::DistributionConstraint | ( | const vpsc::Dim | dim | ) |
Constructs a new empty DistributionConstraint with a minimum or exact spacing.
[in] | dim | The dimension the constraints will operate in. |
void cola::DistributionConstraint::addAlignmentPair | ( | AlignmentConstraint * | ac1, |
AlignmentConstraint * | ac2 | ||
) |
Mark a pair of alignment constraints as being part of this distribution constraint.
You should specify spacing beteen a set of alignments (e.g., {1, 2, 3, 4}) by calling this method with each neighbouring pair (e.g., {(1, 2), (2, 3), (3, 4)}).
[in] | ac1 | A pointer to the left AlignmentConstraint object of the pair. |
[in] | ac2 | A pointer to the right AlignmentConstraint object of the pair. |
|
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.
void cola::DistributionConstraint::setSeparation | ( | double | sep | ) |
Alter the exact spacing between each pair of alignment constraints.
[in] | sep | The exact distance to separate the alignment constraints. |
|
virtual |
Returns a textual description of the compound constraint.
Implements cola::CompoundConstraint.
void* cola::DistributionConstraint::indicator |
Generic pointer to an indicator object being used to represent this compound constraint in the GUI.