00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __ASSEMBLER_H__
00022 #define __ASSEMBLER_H__
00023
00028 class voxel_c;
00029 class assembly_c;
00030 class problem_c;
00031 class xmlWriter_c;
00032
00041 class assembler_cb {
00042
00043 public:
00044
00045
00046
00047
00048
00049 virtual bool assembly(assembly_c * a) = 0;
00050
00051 virtual ~assembler_cb(void) {}
00052 };
00053
00063 class assembler_c {
00064
00065 public:
00066
00068 typedef enum {
00069 ERR_NONE,
00070 ERR_TOO_MANY_UNITS,
00071 ERR_TOO_FEW_UNITS,
00072 ERR_CAN_NOT_PLACE,
00073 ERR_CAN_NOT_RESTORE_VERSION,
00074 ERR_CAN_NOT_RESTORE_SYNTAX,
00075 ERR_PUZZLE_UNHANDABLE
00076 } errState;
00077
00081 assembler_c(void) {}
00082
00083 virtual ~assembler_c(void) { }
00084
00090 virtual errState createMatrix(const problem_c * , bool , bool , bool );
00091
00096 virtual int getErrorsParam(void) { return 0; }
00097
00107 virtual void reduce(void) { }
00108
00118 virtual unsigned int getReducePiece(void) const { return 0; }
00119
00126 virtual void assemble(assembler_cb * ) {}
00127
00133 virtual unsigned long getIterations(void) { return 0; }
00134
00140 virtual float getFinished(void) const { return 0; }
00141
00143 virtual void stop(void) {}
00144
00146 virtual bool stopped(void) const { return false; }
00147
00155 virtual errState setPosition(const char * string, const char * version);
00156
00163 virtual void save(xmlWriter_c & xml) const;
00164
00165
00166
00167
00168
00169
00170
00171 virtual bool getPiecePlacementSupported(void) const { return false; }
00172
00173
00174 virtual unsigned int getPiecePlacementCount(unsigned int ) const { return 0; }
00175
00176
00177
00178
00179
00180
00181 virtual unsigned int getPiecePlacement(unsigned int , int ,
00182 unsigned int , unsigned char * , int * , int * , int * ) const { return 0; }
00183
00184
00185
00186
00187
00188 virtual void debug_step(unsigned long ) {};
00189
00190
00191
00192
00193 virtual assembly_c * getAssembly(void) = 0;
00194
00195 private:
00196
00197
00198 assembler_c(const assembler_c&);
00199 void operator=(const assembler_c&);
00200
00201 };
00202
00203 #endif