Engauge Digitizer  2
MigrateToVersion6.cpp
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #include "MigrateToVersion6.h"
8 
10 {
11 }
12 
13 ColorPalette MigrateToVersion6::colorPalette (int preVersion6) const
14 {
15  switch (preVersion6) {
16  case 0:
17  return COLOR_PALETTE_BLACK;
18 
19  case 1:
20  return COLOR_PALETTE_BLUE;
21 
22  case 2:
23  return COLOR_PALETTE_CYAN;
24 
25  case 3:
26  return COLOR_PALETTE_GOLD;
27 
28  case 4:
29  return COLOR_PALETTE_GREEN;
30 
31  case 5:
32  return COLOR_PALETTE_MAGENTA;
33 
34  case 6:
35  return COLOR_PALETTE_RED;
36 
37  case 7:
38  return COLOR_PALETTE_TRANSPARENT;
39 
40  case 8:
41  return COLOR_PALETTE_YELLOW;
42 
43  default:
44  return COLOR_PALETTE_BLACK;
45  }
46 }
47 
48 CurveConnectAs MigrateToVersion6::curveConnectAs (int preVersion6) const
49 {
50  switch (preVersion6) {
51  case 0:
52  return CONNECT_AS_FUNCTION_STRAIGHT;
53 
54  case 1:
55  return CONNECT_AS_RELATION_STRAIGHT;
56 
57  default:
58  return CONNECT_AS_FUNCTION_STRAIGHT;
59  }
60 }
61 
62 PointShape MigrateToVersion6::pointShape (int preVersion6) const
63 {
64  switch (preVersion6) {
65  case 0:
66  return POINT_SHAPE_CROSS;
67 
68  case 1:
69  return POINT_SHAPE_X;
70 
71  case 2:
72  return POINT_SHAPE_DIAMOND;
73 
74  case 3:
75  return POINT_SHAPE_SQUARE;
76 
77  case 4:
78  return POINT_SHAPE_TRIANGLE;
79 
80  default:
81  return POINT_SHAPE_CROSS;
82  }
83 }
84 
85 int MigrateToVersion6::pointRadius (int preVersion6) const
86 {
87  // From pointsetstyles.h
88  return 2 * (preVersion6 + 1);
89 }
int pointRadius(int preVersion6) const
Point radius.
CurveConnectAs curveConnectAs(int preVersion6) const
Line drawn between points.
ColorPalette colorPalette(int preVersion6) const
Color from color palette.
PointShape pointShape(int preVersion6) const
Point shape.
MigrateToVersion6()
Single constructor.