Project

General

Profile

Download (17.1 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / objects / TwistyDiamond.java @ abf36986

1 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20
package org.distorted.objects;
21
22
import android.content.res.Resources;
23
24 f10a88a8 Leszek Koltunski
import org.distorted.helpers.ObjectShape;
25 9c06394a Leszek Koltunski
import org.distorted.helpers.ObjectSticker;
26 6cf89a3e Leszek Koltunski
import org.distorted.helpers.ScrambleState;
27 ece1b58d Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
28
import org.distorted.library.main.DistortedTexture;
29
import org.distorted.library.mesh.MeshSquare;
30
import org.distorted.library.type.Static3D;
31
import org.distorted.library.type.Static4D;
32 6fd4a72c Leszek Koltunski
import org.distorted.main.R;
33 ece1b58d Leszek Koltunski
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35
36 9c2f0c91 Leszek Koltunski
public class TwistyDiamond extends TwistyObject
37 ece1b58d Leszek Koltunski
{
38
  // the four rotation axis of a Diamond. Must be normalized.
39
  static final Static3D[] ROT_AXIS = new Static3D[]
40
         {
41
           new Static3D(+SQ6/3,+SQ3/3,     0),
42
           new Static3D(-SQ6/3,+SQ3/3,     0),
43 cc99cf91 Leszek Koltunski
           new Static3D(     0,-SQ3/3,-SQ6/3),
44
           new Static3D(     0,-SQ3/3,+SQ6/3)
45 ece1b58d Leszek Koltunski
         };
46
47
  private static final int[] FACE_COLORS = new int[]
48
         {
49 2ef489e2 Leszek Koltunski
           COLOR_ORANGE, COLOR_VIOLET,
50
           COLOR_WHITE , COLOR_BLUE  ,
51
           COLOR_YELLOW, COLOR_RED   ,
52
           COLOR_GREEN , COLOR_GREY
53 ece1b58d Leszek Koltunski
         };
54
55
  private static final float DIST = 0.50f;
56 aec5cc91 Leszek Koltunski
  private static final int FACES_PER_CUBIT =8;
57 9c06394a Leszek Koltunski
58 91792184 Leszek Koltunski
  private ScrambleState[] mStates;
59 aec5cc91 Leszek Koltunski
  private int[] mBasicAngle;
60
  private int[] mFaceMap;
61
  private Static4D[] mQuats;
62
  private int[] mTetraToFaceMap;
63
  private ObjectSticker[] mStickers;
64 486b3417 Leszek Koltunski
65 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
66
67 9c2f0c91 Leszek Koltunski
  TwistyDiamond(int size, Static4D quat, DistortedTexture texture,
68
                MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
69 ece1b58d Leszek Koltunski
    {
70 db875721 Leszek Koltunski
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.DIAM, res, scrWidth);
71 91792184 Leszek Koltunski
    }
72 486b3417 Leszek Koltunski
73 91792184 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
74 486b3417 Leszek Koltunski
75 91792184 Leszek Koltunski
  ScrambleState[] getScrambleStates()
76
    {
77
    if( mStates==null )
78 486b3417 Leszek Koltunski
      {
79 91792184 Leszek Koltunski
      int size = getNumLayers();
80
      int[] tmp = new int[3*2*size];
81
82
      for(int i=0; i<2*size; i++)
83
        {
84
        tmp[3*i  ] = (i<size) ?  i:i-size;
85
        tmp[3*i+1] = (i%2==0) ? -1:1;
86
        tmp[3*i+2] = 0;
87
        }
88
89
      mStates = new ScrambleState[]
90
        {
91
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
92
        };
93 486b3417 Leszek Koltunski
      }
94
95 91792184 Leszek Koltunski
    return mStates;
96 ece1b58d Leszek Koltunski
    }
97
98 aec5cc91 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
99
100
  private void initializeQuats()
101
    {
102
    mQuats = new Static4D[]
103
         {
104
          new Static4D(  0.0f,  0.0f,   0.0f,  1.0f ),
105
          new Static4D(  0.0f,  1.0f,   0.0f,  0.0f ),
106
          new Static4D(+SQ2/2,  0.0f, -SQ2/2,  0.0f ),
107
          new Static4D(-SQ2/2,  0.0f, -SQ2/2,  0.0f ),
108
109
          new Static4D(+SQ2/2,  0.5f,   0.0f,  0.5f ),
110
          new Static4D(-SQ2/2,  0.5f,   0.0f,  0.5f ),
111
          new Static4D(  0.0f,  0.5f, +SQ2/2,  0.5f ),
112
          new Static4D(  0.0f,  0.5f, -SQ2/2,  0.5f ),
113
          new Static4D(+SQ2/2,  0.5f,   0.0f, -0.5f ),
114
          new Static4D(-SQ2/2,  0.5f,   0.0f, -0.5f ),
115
          new Static4D(  0.0f,  0.5f, +SQ2/2, -0.5f ),
116
          new Static4D(  0.0f,  0.5f, -SQ2/2, -0.5f )
117
         };
118
    }
119
120 a480ee80 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
121
122
  int[] getSolvedQuats(int cubit, int numLayers)
123
    {
124 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
125
    if( mFaceMap==null ) mFaceMap = new int[] {4,0,6,2,7,3,5,1};
126 a480ee80 Leszek Koltunski
    int status = retCubitSolvedStatus(cubit,numLayers);
127 aec5cc91 Leszek Koltunski
    return status<0 ? null : buildSolvedQuats(MovementDiamond.FACE_AXIS[mFaceMap[status]],mQuats);
128 a480ee80 Leszek Koltunski
    }
129
130 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
131
132
  float getScreenRatio()
133
    {
134 ab0c28f0 Leszek Koltunski
    return 0.65f;
135 ece1b58d Leszek Koltunski
    }
136
137
///////////////////////////////////////////////////////////////////////////////////////////////////
138
139
  Static4D[] getQuats()
140
    {
141 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
142
    return mQuats;
143 ece1b58d Leszek Koltunski
    }
144
145
///////////////////////////////////////////////////////////////////////////////////////////////////
146
147 abf36986 Leszek Koltunski
  int getNumFaceColors()
148 ece1b58d Leszek Koltunski
    {
149
    return FACE_COLORS.length;
150
    }
151
152
///////////////////////////////////////////////////////////////////////////////////////////////////
153
154
  boolean shouldResetTextureMaps()
155
    {
156
    return false;
157
    }
158
159 169219a7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
160
161
  int getSolvedFunctionIndex()
162
    {
163
    return 0;
164
    }
165
166 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
167
168 a64e07d0 Leszek Koltunski
  int getNumStickerTypes(int numLayers)
169 ece1b58d Leszek Koltunski
    {
170 aec5cc91 Leszek Koltunski
    return 1;
171 ece1b58d Leszek Koltunski
    }
172
173
///////////////////////////////////////////////////////////////////////////////////////////////////
174
175 e6734aa9 Leszek Koltunski
  float[][] getCuts(int numLayers)
176 ece1b58d Leszek Koltunski
    {
177 680f921e Leszek Koltunski
    if( numLayers<2 )
178
      {
179
      return null;
180
      }
181
    else
182
      {
183 e6734aa9 Leszek Koltunski
      float[][] cuts = new float[4][numLayers-1];
184 68b5f9c5 Leszek Koltunski
      float dist = SQ6*0.666f*DIST;
185 680f921e Leszek Koltunski
      float cut  = 0.5f*dist*(2-numLayers);
186
187
      for(int i=0; i<numLayers-1; i++)
188
        {
189 e6734aa9 Leszek Koltunski
        cuts[0][i] = cut;
190
        cuts[1][i] = cut;
191
        cuts[2][i] = cut;
192
        cuts[3][i] = cut;
193 680f921e Leszek Koltunski
        cut += dist;
194
        }
195
196
      return cuts;
197
      }
198 ece1b58d Leszek Koltunski
    }
199
200
///////////////////////////////////////////////////////////////////////////////////////////////////
201
202
  int getNumCubitFaces()
203
    {
204
    return FACES_PER_CUBIT;
205
    }
206
207
///////////////////////////////////////////////////////////////////////////////////////////////////
208
209 680f921e Leszek Koltunski
  private int getNumOctahedrons(int layers)
210
    {
211
    return layers==1 ? 1 : 4*(layers-1)*(layers-1) + 2;
212
    }
213
214
///////////////////////////////////////////////////////////////////////////////////////////////////
215
216
  private int getNumTetrahedrons(int layers)
217
    {
218
    return 4*layers*(layers-1);
219
    }
220
221
///////////////////////////////////////////////////////////////////////////////////////////////////
222
223 31cd7256 Leszek Koltunski
  private int createOctaPositions(float[][] centers, int index, int layers, float height)
224 680f921e Leszek Koltunski
    {
225
    float x = DIST*(layers-1);
226
    float z = DIST*(layers+1);
227
228
    for(int i=0; i<layers; i++, index++)
229
      {
230
      z -= 2*DIST;
231
      centers[index][0] = x;
232
      centers[index][1] = height;
233
      centers[index][2] = z;
234
      }
235
236
    for(int i=0; i<layers-1; i++, index++)
237
      {
238
      x -= 2*DIST;
239
      centers[index][0] = x;
240
      centers[index][1] = height;
241
      centers[index][2] = z;
242
      }
243
244
    for(int i=0; i<layers-1; i++, index++)
245
      {
246
      z += 2*DIST;
247
      centers[index][0] = x;
248
      centers[index][1] = height;
249
      centers[index][2] = z;
250
      }
251
252
    for(int i=0; i<layers-2; i++, index++)
253
      {
254
      x += 2*DIST;
255
      centers[index][0] = x;
256
      centers[index][1] = height;
257
      centers[index][2] = z;
258
      }
259
260
    return index;
261
    }
262
263
///////////////////////////////////////////////////////////////////////////////////////////////////
264
265 31cd7256 Leszek Koltunski
  private int createTetraPositions(float[][] centers, int index, int layers, float height)
266 ece1b58d Leszek Koltunski
    {
267 680f921e Leszek Koltunski
    float x = DIST*(layers-1);
268
    float z = DIST*layers;
269
270
    for(int i=0; i<layers-1; i++, index++)
271
      {
272
      z -= 2*DIST;
273
      centers[index][0] = x;
274
      centers[index][1] = height;
275
      centers[index][2] = z;
276
      }
277
278
    x += DIST;
279
    z -= DIST;
280
281
    for(int i=0; i<layers-1; i++, index++)
282
      {
283
      x -= 2*DIST;
284
      centers[index][0] = x;
285
      centers[index][1] = height;
286
      centers[index][2] = z;
287
      }
288
289
    x -= DIST;
290
    z -= DIST;
291
292
    for(int i=0; i<layers-1; i++, index++)
293
      {
294
      z += 2*DIST;
295
      centers[index][0] = x;
296
      centers[index][1] = height;
297
      centers[index][2] = z;
298
      }
299
300
    x -= DIST;
301
    z += DIST;
302
303
    for(int i=0; i<layers-1; i++, index++)
304
      {
305
      x += 2*DIST;
306
      centers[index][0] = x;
307
      centers[index][1] = height;
308
      centers[index][2] = z;
309
      }
310
311
    return index;
312
    }
313
314
///////////////////////////////////////////////////////////////////////////////////////////////////
315
316
  float[][] getCubitPositions(int layers)
317
    {
318
    int numO = getNumOctahedrons(layers);
319
    int numT = getNumTetrahedrons(layers);
320
    int index = 0;
321
    float height = 0.0f;
322
323
    float[][] CENTERS = new float[numO+numT][3];
324
325 31cd7256 Leszek Koltunski
    index = createOctaPositions(CENTERS,index,layers,height);
326 680f921e Leszek Koltunski
327
    for(int i=layers-1; i>0; i--)
328
      {
329
      height += SQ2*DIST;
330 31cd7256 Leszek Koltunski
      index = createOctaPositions(CENTERS,index,i,+height);
331
      index = createOctaPositions(CENTERS,index,i,-height);
332 680f921e Leszek Koltunski
      }
333
334
    height = DIST*SQ2/2;
335
336
    for(int i=layers; i>1; i--)
337
      {
338 31cd7256 Leszek Koltunski
      index = createTetraPositions(CENTERS,index,i,+height);
339
      index = createTetraPositions(CENTERS,index,i,-height);
340 680f921e Leszek Koltunski
      height += SQ2*DIST;
341
      }
342
343 ece1b58d Leszek Koltunski
    return CENTERS;
344
    }
345
346
///////////////////////////////////////////////////////////////////////////////////////////////////
347
348 680f921e Leszek Koltunski
  private int retFaceTetraBelongsTo(int tetra, int numLayers)
349 ece1b58d Leszek Koltunski
    {
350 aec5cc91 Leszek Koltunski
    if( mTetraToFaceMap==null ) mTetraToFaceMap = new int[] {1,2,3,0,5,6,7,4};
351
352 68b5f9c5 Leszek Koltunski
    for(int i=numLayers-1; i>0; i--)
353 ece1b58d Leszek Koltunski
      {
354 68b5f9c5 Leszek Koltunski
      if( tetra < 8*i ) return mTetraToFaceMap[tetra/i];
355
      tetra -= 8*i;
356 680f921e Leszek Koltunski
      }
357 68b5f9c5 Leszek Koltunski
358
    return -1;
359 680f921e Leszek Koltunski
    }
360
361 f10a88a8 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
362
363
  ObjectShape getObjectShape(int cubit, int numLayers)
364
    {
365
    int variant = getCubitVariant(cubit,numLayers);
366 f56b53cb Leszek Koltunski
    int N = numLayers>3 ? 5:6;
367 7d11f930 Leszek Koltunski
    int E = numLayers>2 ? (numLayers>3 ? 0:1):2;
368 ece1b58d Leszek Koltunski
369 f10a88a8 Leszek Koltunski
    if( variant==0 )
370 ece1b58d Leszek Koltunski
      {
371 aec5cc91 Leszek Koltunski
      double[][] vertices = new double[][]
372
          {
373
             { 0.5,   0.0, 0.5},
374
             { 0.5,   0.0,-0.5},
375
             {-0.5,   0.0,-0.5},
376
             {-0.5,   0.0, 0.5},
377
             { 0.0, SQ2/2, 0.0},
378
             { 0.0,-SQ2/2, 0.0}
379
          };
380
381
      int[][] vert_indices = new int[][]
382
          {
383
             {3,0,4},
384
             {0,1,4},
385
             {1,2,4},
386
             {2,3,4},
387
             {5,0,3},
388
             {5,1,0},
389
             {5,2,1},
390
             {5,3,2}
391
          };
392
393 f10a88a8 Leszek Koltunski
      float[][] bands     = new float[][] { {0.05f,35,0.5f,0.8f,N,E,E} };
394
      int[] bandIndices   = new int[] { 0,0,0,0,0,0,0,0 };
395
      float[][] corners   = new float[][] { {0.04f,0.20f} };
396
      int[] cornerIndices = new int[] { 0,0,0,0,0,0 };
397
      float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
398
      int[] centerIndices = new int[] { 0,0,0,0,0,0 };
399 aec5cc91 Leszek Koltunski
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
400 ece1b58d Leszek Koltunski
      }
401
    else
402
      {
403 aec5cc91 Leszek Koltunski
      double[][] vertices = new double[][] { {-0.5, SQ2/4, 0.0}, { 0.5, SQ2/4, 0.0}, { 0.0,-SQ2/4, 0.5}, { 0.0,-SQ2/4,-0.5} };
404
      int[][] vert_indices = new int[][]  { {2,1,0}, {2,3,1}, {3,2,0}, {3,0,1} };
405 f10a88a8 Leszek Koltunski
      float[][] bands     = new float[][] { {0.05f,35,0.5f,0.8f,N,E,E} };
406
      int[] bandIndices   = new int[] { 0,0,0,0 };
407
      float[][] corners   = new float[][] { {0.08f,0.15f} };
408
      int[] cornerIndices = new int[] { 0,0,0,0 };
409
      float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
410
      int[] centerIndices = new int[] { 0,0,0,0 };
411 aec5cc91 Leszek Koltunski
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
412 f10a88a8 Leszek Koltunski
      }
413
    }
414
415
///////////////////////////////////////////////////////////////////////////////////////////////////
416
417 3e605536 Leszek Koltunski
  Static4D getQuat(int cubit, int numLayers)
418 f10a88a8 Leszek Koltunski
    {
419 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
420 3e605536 Leszek Koltunski
    int numO = getNumOctahedrons(numLayers);
421 f10a88a8 Leszek Koltunski
422 aec5cc91 Leszek Koltunski
    if( cubit<numO ) return mQuats[0];
423 f10a88a8 Leszek Koltunski
424 3e605536 Leszek Koltunski
    switch( retFaceTetraBelongsTo(cubit-numO, numLayers) )
425 f10a88a8 Leszek Koltunski
      {
426 aec5cc91 Leszek Koltunski
      case 0: return mQuats[0];                         // unit quat
427 3e605536 Leszek Koltunski
      case 1: return new Static4D(0,-SQ2/2,0,SQ2/2);    //  90 along Y
428 aec5cc91 Leszek Koltunski
      case 2: return mQuats[1];                         // 180 along Y
429 3e605536 Leszek Koltunski
      case 3: return new Static4D(0,+SQ2/2,0,SQ2/2);    //  90 along
430
      case 4: return new Static4D(0,     0,1,    0);    // 180 along Z
431
      case 5: return new Static4D(SQ2/2, 0,SQ2/2,0);    //
432
      case 6: return new Static4D(     1,0,0,    0);    // 180 along X
433
      case 7: return new Static4D(-SQ2/2,0,SQ2/2,0);    //
434 ece1b58d Leszek Koltunski
      }
435
436 3e605536 Leszek Koltunski
    return null;
437
    }
438
439
///////////////////////////////////////////////////////////////////////////////////////////////////
440 ece1b58d Leszek Koltunski
441 3e605536 Leszek Koltunski
  int getNumCubitVariants(int numLayers)
442
    {
443
    return 2;
444
    }
445
446
///////////////////////////////////////////////////////////////////////////////////////////////////
447
448
  int getCubitVariant(int cubit, int numLayers)
449
    {
450
    return cubit<getNumOctahedrons(numLayers) ? 0 : 1;
451 ece1b58d Leszek Koltunski
    }
452
453
///////////////////////////////////////////////////////////////////////////////////////////////////
454
455 2ef489e2 Leszek Koltunski
  int getFaceColor(int cubit, int cubitface, int size)
456 ece1b58d Leszek Koltunski
    {
457 2ef489e2 Leszek Koltunski
    int numO = getNumOctahedrons(size);
458 680f921e Leszek Koltunski
459
    if( cubit<numO )
460
      {
461 2ef489e2 Leszek Koltunski
      int axis = 0;
462
      int layer= 1;
463
464
      switch(cubitface)
465
        {
466
        case 0: axis = 2; layer =             1; break;
467
        case 1: axis = 0; layer = (1<<(size-1)); break;
468
        case 2: axis = 3; layer =             1; break;
469
        case 3: axis = 1; layer = (1<<(size-1)); break;
470
        case 4: axis = 3; layer = (1<<(size-1)); break;
471
        case 5: axis = 1; layer =             1; break;
472
        case 6: axis = 2; layer = (1<<(size-1)); break;
473
        case 7: axis = 0; layer =             1; break;
474
        }
475
476 a4962b9c Leszek Koltunski
      return CUBITS[cubit].mRotationRow[axis] == layer ? cubitface : NUM_TEXTURES;
477 680f921e Leszek Koltunski
      }
478
    else
479
      {
480 a4962b9c Leszek Koltunski
      return cubitface>0 ? NUM_TEXTURES : retFaceTetraBelongsTo(cubit-numO, size);
481 680f921e Leszek Koltunski
      }
482 ece1b58d Leszek Koltunski
    }
483
484
///////////////////////////////////////////////////////////////////////////////////////////////////
485
486 9c06394a Leszek Koltunski
  int getColor(int face)
487 ece1b58d Leszek Koltunski
    {
488 9c06394a Leszek Koltunski
    return FACE_COLORS[face];
489
    }
490
491
///////////////////////////////////////////////////////////////////////////////////////////////////
492 76c2bd07 Leszek Koltunski
493 9c06394a Leszek Koltunski
  ObjectSticker retSticker(int face)
494
    {
495 aec5cc91 Leszek Koltunski
    if( mStickers==null )
496
      {
497
      float[][] STICKERS = new float[][] { { -0.4330127f, -0.25f, 0.4330127f, -0.25f, 0.0f, 0.5f } };
498
      float radius = 0.06f;
499
      float stroke = 0.07f;
500
      float[] radii = new float[] {radius,radius,radius};
501
      mStickers     = new ObjectSticker[STICKERS.length];
502
      mStickers[0]  = new ObjectSticker(STICKERS[0],null,radii,stroke);
503
      }
504
505 abf36986 Leszek Koltunski
    return mStickers[face/NUM_FACE_COLORS];
506 ece1b58d Leszek Koltunski
    }
507
508
///////////////////////////////////////////////////////////////////////////////////////////////////
509
510
  float returnMultiplier()
511
    {
512 cc99cf91 Leszek Koltunski
    return 1.5f;
513 ece1b58d Leszek Koltunski
    }
514
515
///////////////////////////////////////////////////////////////////////////////////////////////////
516 e1dc3366 Leszek Koltunski
// PUBLIC API
517 ece1b58d Leszek Koltunski
518 e1dc3366 Leszek Koltunski
  public Static3D[] getRotationAxis()
519
    {
520
    return ROT_AXIS;
521
    }
522
523
///////////////////////////////////////////////////////////////////////////////////////////////////
524
525
  public int[] getBasicAngle()
526
    {
527 aec5cc91 Leszek Koltunski
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
528
    return mBasicAngle;
529 e1dc3366 Leszek Koltunski
    }
530
531 6fd4a72c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
532
533
  public int getObjectName(int numLayers)
534
    {
535 2ef489e2 Leszek Koltunski
    switch(numLayers)
536
      {
537
      case 2: return R.string.diam2;
538
      case 3: return R.string.diam3;
539 2adf1263 Leszek Koltunski
      case 4: return R.string.diam4;
540 2ef489e2 Leszek Koltunski
      }
541
542
    return 0;
543 6fd4a72c Leszek Koltunski
    }
544
545
///////////////////////////////////////////////////////////////////////////////////////////////////
546
547
  public int getInventor(int numLayers)
548
    {
549 2ef489e2 Leszek Koltunski
    switch(numLayers)
550
      {
551
      case 2: return R.string.diam2_inventor;
552
      case 3: return R.string.diam3_inventor;
553 2adf1263 Leszek Koltunski
      case 4: return R.string.diam4_inventor;
554 2ef489e2 Leszek Koltunski
      }
555
556
    return 0;
557 6fd4a72c Leszek Koltunski
    }
558
559
///////////////////////////////////////////////////////////////////////////////////////////////////
560
561
  public int getComplexity(int numLayers)
562
    {
563 2ef489e2 Leszek Koltunski
    switch(numLayers)
564
      {
565 2adf1263 Leszek Koltunski
      case 2: return 4;
566
      case 3: return 6;
567
      case 4: return 8;
568 2ef489e2 Leszek Koltunski
      }
569
570
    return 0;
571 6fd4a72c Leszek Koltunski
    }
572 ece1b58d Leszek Koltunski
}