Adaptagrams
|
A multi-separation constraint Specifies a set of horizontal or vertical equal spacing constraints between pairs of alignment constraints. More...
#include <compound_constraints.h>
Public Member Functions | |
MultiSeparationConstraint (const vpsc::Dim dim, double minSep=0, bool equality=false) | |
Constructs a new empty MultiSeparationConstraint with a minimum or exact spacing. More... | |
void | addAlignmentPair (AlignmentConstraint *ac1, AlignmentConstraint *ac2) |
Mark a pair of alignment constraints as being part of this multi separation constraint. More... | |
void | setSeparation (double sep) |
Alter the minimum or 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 &vs, 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 multi-separation constraint Specifies a set of horizontal or vertical equal spacing constraints between pairs of alignment constraints.
This is a way of arranging a group of alignment lines to be equally distributed, or given a uniform minimum spacing.
cola::MultiSeparationConstraint::MultiSeparationConstraint | ( | const vpsc::Dim | dim, |
double | minSep = 0 , |
||
bool | equality = false |
||
) |
Constructs a new empty MultiSeparationConstraint with a minimum or exact spacing.
[in] | dim | The dimension the constraints will operate in. |
[in] | minSep | The minimum or exact distance to separate the alignment constraints. |
[in] | equality | Whether or not the constraints will be an exact distance. |
void cola::MultiSeparationConstraint::addAlignmentPair | ( | AlignmentConstraint * | ac1, |
AlignmentConstraint * | ac2 | ||
) |
Mark a pair of alignment constraints as being part of this multi separation constraint.
You will often 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)}), but you can also specify non-neighbouring alignment constraints, if you wish them to have equal exact or minimum separation.
[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::MultiSeparationConstraint::setSeparation | ( | double | sep | ) |
Alter the minimum or exact spacing between each pair of alignment constraints.
[in] | sep | The minimum or exact distance to separate the alignment constraints. |
|
virtual |
Returns a textual description of the compound constraint.
Implements cola::CompoundConstraint.
void* cola::MultiSeparationConstraint::indicator |
Generic pointer to an indicator object being used to represent this compound constraint in the GUI.