#include <solution.h>
Public Member Functions | |
solution_c (assembly_c *assm, unsigned int assmNum, separation_c *t, unsigned int solNum) | |
create a solution with a proper separation | |
solution_c (assembly_c *assm, unsigned int assmNum, separationInfo_c *ti, unsigned int solNum) | |
create a solution with only separation information | |
solution_c (assembly_c *assm, unsigned int assmNum) | |
creat a solution with assembly only, no disassembly | |
solution_c (xmlParser_c &pars, unsigned int pieces, const gridType_c *gt) | |
load a solution from file | |
~solution_c (void) | |
void | save (xmlWriter_c &xml) const |
save the solution to the XML file | |
assembly_c * | getAssembly (void) |
get the assembly from this solution, it will always be not NULL | |
const assembly_c * | getAssembly (void) const |
separation_c * | getDisassembly (void) |
get the full disassembly or 0 if there is none | |
const separation_c * | getDisassembly (void) const |
disassembly_c * | getDisassemblyInfo (void) |
get either the disassembly or the disassembly information or nothing | |
const disassembly_c * | getDisassemblyInfo (void) const |
unsigned int | getAssemblyNumber (void) const |
get the assembly number | |
unsigned int | getSolutionNumber (void) const |
get the solution number (0 if this solution has no disassembly | |
void | removeDisassembly (void) |
remove an existing disassembly, and replace it by disassembly information | |
void | setDisassembly (separation_c *sep) |
add a new disassembly to this solution, deleting an old one, in case such an old exists | |
void | exchangeShape (unsigned int s1, unsigned int s2) |
change the solution so that shape s1 and s2 are swapped | |
void | removePieces (unsigned int start, unsigned int count) |
remove count pieces starting with start from all information within this solution | |
void | addNonPlacedPieces (unsigned int start, unsigned int count) |
add count not placed pieces starting at position start | |
Private Attributes | |
assembly_c * | assembly |
separation_c * | tree |
separationInfo_c * | treeInfo |
unsigned int | assemblyNum |
unsigned int | solutionNum |
solution_c::solution_c | ( | assembly_c * | assm, | |
unsigned int | assmNum, | |||
separation_c * | t, | |||
unsigned int | solNum | |||
) | [inline] |
create a solution with a proper separation
solution_c::solution_c | ( | assembly_c * | assm, | |
unsigned int | assmNum, | |||
separationInfo_c * | ti, | |||
unsigned int | solNum | |||
) | [inline] |
create a solution with only separation information
solution_c::solution_c | ( | assembly_c * | assm, | |
unsigned int | assmNum | |||
) | [inline] |
creat a solution with assembly only, no disassembly
solution_c::solution_c | ( | xmlParser_c & | pars, | |
unsigned int | pieces, | |||
const gridType_c * | gt | |||
) |
load a solution from file
References assembly, assemblyNum, xmlParser_c::END_TAG, xmlParser_c::exception(), xmlParser_c::getAttributeValue(), xmlParser_c::getName(), assembly_c::isPlaced(), xmlParser_c::nextTag(), assembly_c::placementCount(), xmlParser_c::require(), xmlParser_c::skipSubTree(), solutionNum, xmlParser_c::START_TAG, tree, and treeInfo.
void solution_c::addNonPlacedPieces | ( | unsigned int | start, | |
unsigned int | count | |||
) |
add count not placed pieces starting at position start
References separation_c::addNonPlacedPieces(), assembly_c::addNonPlacedPieces(), assembly, and tree.
void solution_c::exchangeShape | ( | unsigned int | s1, | |
unsigned int | s2 | |||
) |
change the solution so that shape s1 and s2 are swapped
References assembly, separation_c::exchangeShape(), assembly_c::exchangeShape(), and tree.
const assembly_c* solution_c::getAssembly | ( | void | ) | const [inline] |
References assembly.
assembly_c* solution_c::getAssembly | ( | void | ) | [inline] |
get the assembly from this solution, it will always be not NULL
References assembly.
Referenced by comp_3_pieces().
unsigned int solution_c::getAssemblyNumber | ( | void | ) | const [inline] |
const separation_c* solution_c::getDisassembly | ( | void | ) | const [inline] |
References tree.
separation_c* solution_c::getDisassembly | ( | void | ) | [inline] |
get the full disassembly or 0 if there is none
References tree.
Referenced by solveThread_c::assembly().
const disassembly_c * solution_c::getDisassemblyInfo | ( | void | ) | const |
disassembly_c * solution_c::getDisassemblyInfo | ( | void | ) |
get either the disassembly or the disassembly information or nothing
References tree, and treeInfo.
Referenced by solveThread_c::assembly(), comp_1_level(), and comp_2_moves().
unsigned int solution_c::getSolutionNumber | ( | void | ) | const [inline] |
void solution_c::removeDisassembly | ( | void | ) |
void solution_c::removePieces | ( | unsigned int | start, | |
unsigned int | count | |||
) |
remove count pieces starting with start from all information within this solution
References assembly, separation_c::removePieces(), assembly_c::removePieces(), and tree.
void solution_c::save | ( | xmlWriter_c & | xml | ) | const |
save the solution to the XML file
References assembly, assemblyNum, xmlWriter_c::endTag(), xmlWriter_c::newAttrib(), xmlWriter_c::newTag(), separationInfo_c::save(), separation_c::save(), assembly_c::save(), solutionNum, tree, and treeInfo.
void solution_c::setDisassembly | ( | separation_c * | sep | ) |
assembly_c* solution_c::assembly [private] |
Referenced by addNonPlacedPieces(), exchangeShape(), getAssembly(), removePieces(), save(), solution_c(), and ~solution_c().
unsigned int solution_c::assemblyNum [private] |
Referenced by getAssemblyNumber(), save(), and solution_c().
unsigned int solution_c::solutionNum [private] |
Referenced by getSolutionNumber(), save(), and solution_c().
separation_c* solution_c::tree [private] |
separationInfo_c* solution_c::treeInfo [private] |
Referenced by getDisassemblyInfo(), removeDisassembly(), save(), setDisassembly(), solution_c(), and ~solution_c().