Adaptagrams
|
A fixed-relative constraint specifies that a group of nodes are constrained to be fixed in position relative to each other. More...
#include <compound_constraints.h>
Public Member Functions | |
FixedRelativeConstraint (const vpsc::Rectangles &rs, std::vector< unsigned > shapeIds, const bool fixedPosition=false) | |
Constructs a new FixedRelativeConstraint between a set of nodes, optionally with a fixed position. 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... | |
A fixed-relative constraint specifies that a group of nodes are constrained to be fixed in position relative to each other.
These nodes are fixed relative to each other in both the x- and y-dimensions but still free to move as a group.
Optionally, this compound constraint can be marked as desiring a fixed position. If this is specified, the group of nodes will attempt to stay close to its current position.
cola::FixedRelativeConstraint::FixedRelativeConstraint | ( | const vpsc::Rectangles & | rs, |
std::vector< unsigned > | shapeIds, | ||
const bool | fixedPosition = false |
||
) |
Constructs a new FixedRelativeConstraint between a set of nodes, optionally with a fixed position.
[in] | rs | The list of bounding boxes for the rectangles for all nodes in the current problem. |
[in] | shapeIds | A vector of indices into the rc vector for the nodes that will be fixed relative to each other. |
[in] | fixedPosition | Whether of not the nodes should ideally be fixed to the current position. The default is not fixed. |
|
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.
|
virtual |
Returns a textual description of the compound constraint.
Implements cola::CompoundConstraint.