Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
cola::VariableIDMap Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ VariableIDMap()

cola::VariableIDMap::VariableIDMap ( )

Definition at line 1586 of file compound_constraints.cpp.

◆ ~VariableIDMap()

cola::VariableIDMap::~VariableIDMap ( )

Definition at line 1590 of file compound_constraints.cpp.

Member Function Documentation

◆ addMappingForVariable()

bool cola::VariableIDMap::addMappingForVariable ( const unsigned  from,
const unsigned  to 
)

Adds a mapping between a pair of variables.

Parameters
[in]fromThe variable index to map from.
[in]toThe variable index to map to.
Returns
True if the mapping was successfully added.

Definition at line 1597 of file compound_constraints.cpp.

References m_mapping.

◆ clear()

void cola::VariableIDMap::clear ( void  )

Definition at line 1664 of file compound_constraints.cpp.

References m_mapping.

◆ mappingForVariable()

unsigned cola::VariableIDMap::mappingForVariable ( const unsigned  var,
bool  forward = true 
) const

◆ printCreationCode()

void cola::VariableIDMap::printCreationCode ( FILE *  fp) const

Definition at line 1622 of file compound_constraints.cpp.

References m_mapping.

Member Data Documentation

◆ m_mapping

std::list<std::pair<unsigned, unsigned> > cola::VariableIDMap::m_mapping
private

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