Envision
A visual programming IDE for object-oriented languages
|
This class can solve the linear program given by a list of elements and anchors. More...
Public Member Functions | |
AnchorLayoutConstraintSolver () | |
virtual | ~AnchorLayoutConstraintSolver () |
void | placeElements (const QVector< FormElement * > &elements, QList< AnchorLayoutAnchor * > &anchors, AnchorLayoutAnchor::Orientation orientation, Item *item) |
Taking a list of elements and a list of anchors, computes the positions along the axis given by orientation for all the elements, relative to the item. More... | |
Private Member Functions | |
void | addConstraint (int type, QVector< QPair< int, float >> constraintRow, float result) |
void | cleanUpConstraintSolver () |
int | endVariable (int elementIndex) |
void | initializeConstraintSolver (int numVariables) |
void | prepareLP (const QVector< FormElement * > &elements, QList< AnchorLayoutAnchor * > &anchors, AnchorLayoutAnchor::Orientation orientation, Item *item) |
void | setMinimizeObjective (QVector< float > objectiveRow) |
QVector< float > | solveConstraints () |
int | startVariable (int elementIndex) |
void | updateLP (const QVector< FormElement * > &elements, AnchorLayoutAnchor::Orientation orientation, Item *item) |
Private Attributes | |
int * | columnIndices_ {} |
_lprec * | lp_ {} |
int | numVariables_ {} |
double * | rowValues_ {} |
This class can solve the linear program given by a list of elements and anchors.
That is, it can place elements along an axis, even if there are some circular dependencies involved. This solver is only used, if there are such dependencies along the axis to be handled.
The library used to solve the linear programming problem is lp_solve.
Visualization::AnchorLayoutConstraintSolver::AnchorLayoutConstraintSolver | ( | ) |
|
virtual |
|
private |
|
private |
|
inlineprivate |
|
private |
void Visualization::AnchorLayoutConstraintSolver::placeElements | ( | const QVector< FormElement * > & | elements, |
QList< AnchorLayoutAnchor * > & | anchors, | ||
AnchorLayoutAnchor::Orientation | orientation, | ||
Item * | item | ||
) |
Taking a list of elements and a list of anchors, computes the positions along the axis given by orientation for all the elements, relative to the item.
|
private |
|
private |
|
private |
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |