Adaptagrams
Public Member Functions | List of all members
cola::FixedRelativeConstraint Class Reference

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>

Inheritance diagram for cola::FixedRelativeConstraint:
Inheritance graph
Collaboration diagram for cola::FixedRelativeConstraint:
Collaboration graph

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FixedRelativeConstraint()

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.

Parameters
[in]rsThe list of bounding boxes for the rectangles for all nodes in the current problem.
[in]shapeIdsA vector of indices into the rc vector for the nodes that will be fixed relative to each other.
[in]fixedPositionWhether of not the nodes should ideally be fixed to the current position. The default is not fixed.

Member Function Documentation

◆ generateSeparationConstraints()

void cola::FixedRelativeConstraint::generateSeparationConstraints ( const vpsc::Dim  dim,
vpsc::Variables var,
vpsc::Constraints cs,
vpsc::Rectangles bbs 
)
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.

Parameters
[in]dimThe current active dimension.
[in]varsThe list of variables for the overall problem instance.
[in,out]csThe list of constraints to which the generated constraints will be added.
[in]bbsThe list of bounding boxes for all rectangles in the current problem. It has the same order as vars.

Implements cola::CompoundConstraint.

◆ generateVariables()

void cola::FixedRelativeConstraint::generateVariables ( const vpsc::Dim  dim,
vpsc::Variables vars 
)
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.

Parameters
[in]dimThe current active dimension.
[in,out]varsThe list of variables for the overall problem instance to which any variables generated should be appended.

Implements cola::CompoundConstraint.

◆ toString()

std::string cola::FixedRelativeConstraint::toString ( void  ) const
virtual

Returns a textual description of the compound constraint.

Returns
A string describing the compound constraint.

Implements cola::CompoundConstraint.


The documentation for this class was generated from the following files: