Adaptagrams
Public Member Functions | List of all members
cola::CompoundConstraint Class Referenceabstract

An abstract base class for all high-level compound constraints. More...

#include <compound_constraints.h>

Inheritance diagram for cola::CompoundConstraint:
Inheritance graph
Collaboration diagram for cola::CompoundConstraint:
Collaboration graph

Public Member Functions

virtual void generateVariables (const vpsc::Dim dim, vpsc::Variables &vars)=0
 Implemented by the compound constraint to generate any additional required variables in the given dimension. More...
 
virtual void generateSeparationConstraints (const vpsc::Dim dim, vpsc::Variables &var, vpsc::Constraints &cs, vpsc::Rectangles &bbs)=0
 Implemented by the compound constraint to generate the low-level separation constraints in the given dimension. More...
 
virtual void updatePosition (const vpsc::Dim dim)
 Implemented by the compound constraint to send position information back to the interface. More...
 
virtual std::string toString (void) const =0
 Returns a textual description of the compound constraint. More...
 

Detailed Description

An abstract base class for all high-level compound constraints.

A compound constraint is a conceptual, diagramming application oriented type of constraint, which can be translated into a set of simple separation constraints, possibly extra dummy variables, and perhaps even some extra terms for the quadratic objective function used in the gradient projection solver.

Member Function Documentation

◆ generateSeparationConstraints()

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

Implemented in cola::PageBoundaryConstraints, cola::FixedRelativeConstraint, cola::DistributionConstraint, cola::MultiSeparationConstraint, cola::SeparationConstraint, cola::AlignmentConstraint, and cola::BoundaryConstraint.

◆ generateVariables()

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

Implemented in cola::PageBoundaryConstraints, cola::FixedRelativeConstraint, cola::DistributionConstraint, cola::MultiSeparationConstraint, cola::SeparationConstraint, cola::AlignmentConstraint, and cola::BoundaryConstraint.

◆ toString()

virtual std::string cola::CompoundConstraint::toString ( void  ) const
pure virtual

Returns a textual description of the compound constraint.

Returns
A string describing the compound constraint.

Implemented in cola::PageBoundaryConstraints, cola::FixedRelativeConstraint, cola::DistributionConstraint, cola::MultiSeparationConstraint, cola::SeparationConstraint, cola::AlignmentConstraint, and cola::BoundaryConstraint.

◆ updatePosition()

virtual void cola::CompoundConstraint::updatePosition ( const vpsc::Dim  dim)
inlinevirtual

Implemented by the compound constraint to send position information back to the interface.

This will be called for each compound constraint once the VPSC instance is solved to allow them to pass information such as variable values back to the graphical user interface.

Parameters
[in]dimThe current active dimension.

Reimplemented in cola::PageBoundaryConstraints, cola::AlignmentConstraint, and cola::BoundaryConstraint.


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