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

A multi-separation constraint Specifies a set of horizontal or vertical equal spacing constraints between pairs of alignment constraints. More...

#include <compound_constraints.h>

Inheritance diagram for cola::MultiSeparationConstraint:
Inheritance graph
Collaboration diagram for cola::MultiSeparationConstraint:
Collaboration graph

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MultiSeparationConstraint()

cola::MultiSeparationConstraint::MultiSeparationConstraint ( const vpsc::Dim  dim,
double  minSep = 0,
bool  equality = false 
)

Constructs a new empty MultiSeparationConstraint with a minimum or exact spacing.

Parameters
[in]dimThe dimension the constraints will operate in.
[in]minSepThe minimum or exact distance to separate the alignment constraints.
[in]equalityWhether or not the constraints will be an exact distance.

Member Function Documentation

◆ addAlignmentPair()

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.

Parameters
[in]ac1A pointer to the left AlignmentConstraint object of the pair.
[in]ac2A pointer to the right AlignmentConstraint object of the pair.

◆ generateSeparationConstraints()

void cola::MultiSeparationConstraint::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::MultiSeparationConstraint::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.

◆ setSeparation()

void cola::MultiSeparationConstraint::setSeparation ( double  sep)

Alter the minimum or exact spacing between each pair of alignment constraints.

Parameters
[in]sepThe minimum or exact distance to separate the alignment constraints.

◆ toString()

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

Returns a textual description of the compound constraint.

Returns
A string describing the compound constraint.

Implements cola::CompoundConstraint.

Member Data Documentation

◆ indicator

void* cola::MultiSeparationConstraint::indicator

Generic pointer to an indicator object being used to represent this compound constraint in the GUI.


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