Inkscape
Vector Graphics Editor
|
Holds a mapping between two sets of Variable indices. More...
#include <compound_constraints.h>
Public Member Functions | |
VariableIDMap () | |
~VariableIDMap () | |
bool | addMappingForVariable (const unsigned from, const unsigned to) |
Adds a mapping between a pair of variables. | |
unsigned | mappingForVariable (const unsigned var, bool forward=true) const |
void | clear (void) |
void | printCreationCode (FILE *fp) const |
Private Attributes | |
std::list< std::pair< unsigned, unsigned > > | m_mapping |
Holds a mapping between two sets of Variable indices.
This can be used to rewrite the Rectangles to which a set of CompoundConstraints apply to. This is useful when creating another instance of the problem, but using the same CompoundConstraints list. You should not usually need to use this yourself. It is utilised by addons such as topology::AvoidTopologyAddon.
If a mapping for a particular value is not set, it is considered to be equal on both sides of the mapping.
Definition at line 93 of file compound_constraints.h.
cola::VariableIDMap::VariableIDMap | ( | ) |
Definition at line 1586 of file compound_constraints.cpp.
cola::VariableIDMap::~VariableIDMap | ( | ) |
Definition at line 1590 of file compound_constraints.cpp.
bool cola::VariableIDMap::addMappingForVariable | ( | const unsigned | from, |
const unsigned | to | ||
) |
Adds a mapping between a pair of variables.
[in] | from | The variable index to map from. |
[in] | to | The variable index to map to. |
Definition at line 1597 of file compound_constraints.cpp.
References m_mapping.
void cola::VariableIDMap::clear | ( | void | ) |
Definition at line 1664 of file compound_constraints.cpp.
References m_mapping.
unsigned cola::VariableIDMap::mappingForVariable | ( | const unsigned | var, |
bool | forward = true |
||
) | const |
Definition at line 1634 of file compound_constraints.cpp.
References m_mapping.
Referenced by cola::SubConstraintInfo::updateVarIDsWithMapping(), and cola::FixedRelativeConstraint::updateVarIDsWithMapping().
void cola::VariableIDMap::printCreationCode | ( | FILE * | fp | ) | const |
Definition at line 1622 of file compound_constraints.cpp.
References m_mapping.
|
private |
Definition at line 113 of file compound_constraints.h.
Referenced by addMappingForVariable(), clear(), mappingForVariable(), and printCreationCode().