00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __SOLUTION_H__
00022 #define __SOLUTION_H__
00023
00024 class assembly_c;
00025 class separation_c;
00026 class separationInfo_c;
00027 class xmlParser_c;
00028 class xmlWriter_c;
00029 class gridType_c;
00030 class disassembly_c;
00031
00036 class solution_c
00037 {
00038
00039
00040 assembly_c * assembly;
00041
00042
00043
00044
00045 separation_c * tree;
00046
00047
00048
00049
00050
00051 separationInfo_c * treeInfo;
00052
00053
00054
00055
00056
00057
00058
00059 unsigned int assemblyNum;
00060 unsigned int solutionNum;
00061
00062 public:
00063
00065 solution_c(assembly_c * assm, unsigned int assmNum, separation_c * t, unsigned int solNum) :
00066 assembly(assm), tree(t), treeInfo(0), assemblyNum(assmNum), solutionNum(solNum) {}
00067
00069 solution_c(assembly_c * assm, unsigned int assmNum, separationInfo_c * ti, unsigned int solNum) :
00070 assembly(assm), tree(0), treeInfo(ti), assemblyNum(assmNum), solutionNum(solNum) {}
00071
00073 solution_c(assembly_c * assm, unsigned int assmNum) :
00074 assembly(assm), tree(0), treeInfo(0), assemblyNum(assmNum), solutionNum(0) {}
00075
00077 solution_c(xmlParser_c & pars, unsigned int pieces, const gridType_c * gt);
00078
00079 ~solution_c(void);
00080
00082 void save(xmlWriter_c & xml) const;
00083
00085 assembly_c * getAssembly(void) { return assembly; }
00086 const assembly_c * getAssembly(void) const { return assembly; }
00087
00089 separation_c * getDisassembly(void) { return tree; }
00090 const separation_c * getDisassembly(void) const { return tree; }
00091
00093 disassembly_c * getDisassemblyInfo(void);
00094 const disassembly_c * getDisassemblyInfo(void) const;
00095
00097 unsigned int getAssemblyNumber(void) const { return assemblyNum; }
00099 unsigned int getSolutionNumber(void) const { return solutionNum; }
00100
00102 void removeDisassembly(void);
00106 void setDisassembly(separation_c * sep);
00107
00109 void exchangeShape(unsigned int s1, unsigned int s2);
00110
00112 void removePieces(unsigned int start, unsigned int count);
00113
00115 void addNonPlacedPieces(unsigned int start, unsigned int count);
00116 };
00117
00118 #endif