32 |
#include "board.h" |
#include "board.h" |
33 |
#include "queens.h" |
#include "queens.h" |
34 |
#include "solution.h" |
#include "solution.h" |
35 |
#include "solutionvector.h" |
|
36 |
#include "solutionlist.h" |
#include "containervector.h" |
37 |
#include "solutionhash.h" |
#include "containerlist.h" |
38 |
#include "solutionmnvector.h" |
#include "containerhash.h" |
39 |
|
#include "containermnvector.h" |
40 |
|
|
41 |
#include "config.h" |
#include "config.h" |
42 |
|
|
83 |
m_sortalgo = SortList; |
m_sortalgo = SortList; |
84 |
m_solutions = NULL; |
m_solutions = NULL; |
85 |
m_queens = NULL; |
m_queens = NULL; |
86 |
|
m_sol = NULL; |
87 |
|
|
88 |
connect(m_quit, |
connect(m_quit, |
89 |
SIGNAL( clicked() ), |
SIGNAL( clicked() ), |
145 |
delete m_solutions; |
delete m_solutions; |
146 |
switch (m_sortalgo) { |
switch (m_sortalgo) { |
147 |
case SortList: |
case SortList: |
148 |
m_solutions = new SolutionList(this); |
m_solutions = new ContainerList(this); |
149 |
break; |
break; |
150 |
case SortVector: |
case SortVector: |
151 |
m_solutions = new SolutionVector(this); |
m_solutions = new ContainerVector(this); |
152 |
break; |
break; |
153 |
case SortHash: |
case SortHash: |
154 |
m_solutions = new SolutionHash(this); |
m_solutions = new ContainerHash(this); |
155 |
break; |
break; |
156 |
case SortMNVector: |
case SortMNVector: |
157 |
m_solutions = new SolutionMNVector(this); |
m_solutions = new ContainerMNVector(this); |
158 |
break; |
break; |
159 |
} |
} |
160 |
|
|
174 |
|
|
175 |
m_elapsed.start(); |
m_elapsed.start(); |
176 |
m_time.start(); |
m_time.start(); |
177 |
m_queens = new Queens(this, m_solutions, m_sizeSelector->value() ,false); |
m_queens = new Queens(this, m_sol, m_solutions, m_sizeSelector->value() ,false); |
178 |
m_queens->start(); |
m_queens->start(); |
179 |
} |
} |
180 |
|
|
222 |
{ |
{ |
223 |
int index = m_list->currentItem(); |
int index = m_list->currentItem(); |
224 |
Solution* sol = m_solutions->solution( index ); |
Solution* sol = m_solutions->solution( index ); |
225 |
m_board->setMatrix( *sol ); |
m_board->setMatrix( sol ); |
226 |
} |
} |
227 |
|
|
228 |
void QueensMain::resize(int size) |
void QueensMain::resize(int size) |