1 /*
  2     Copyright 2008-2022
  3         Matthias Ehmann,
  4         Michael Gerhaeuser,
  5         Carsten Miller,
  6         Bianca Valentin,
  7         Andreas Walter,
  8         Alfred Wassermann,
  9         Peter Wilfahrt
 10 
 11     This file is part of JSXGraph.
 12 
 13     JSXGraph is free software dual licensed under the GNU LGPL or MIT License.
 14 
 15     You can redistribute it and/or modify it under the terms of the
 16 
 17       * GNU Lesser General Public License as published by
 18         the Free Software Foundation, either version 3 of the License, or
 19         (at your option) any later version
 20       OR
 21       * MIT License: https://github.com/jsxgraph/jsxgraph/blob/master/LICENSE.MIT
 22 
 23     JSXGraph is distributed in the hope that it will be useful,
 24     but WITHOUT ANY WARRANTY; without even the implied warranty of
 25     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 26     GNU Lesser General Public License for more details.
 27 
 28     You should have received a copy of the GNU Lesser General Public License and
 29     the MIT License along with JSXGraph. If not, see <http://www.gnu.org/licenses/>
 30     and <http://opensource.org/licenses/MIT/>.
 31  */
 32 
 33 /*global JXG: true, define: true*/
 34 /*jslint nomen: true, plusplus: true*/
 35 
 36 /* depends:
 37  jxg
 38  */
 39 
 40 define(['jxg'], function (JXG) {
 41     'use strict';
 42 
 43     var major = 1,
 44         minor = 4,
 45         patch = 6,
 46         add = '', //'dev'
 47         version = major + '.' + minor + '.' + patch + (add ? '-' + add : ''),
 48         constants;
 49 
 50     constants = /** @lends JXG */ {
 51         /**
 52          * Constant: the currently used JSXGraph version.
 53          *
 54          * @name JXG.version
 55          * @type String
 56          */
 57         version: version,
 58 
 59         /**
 60          * Constant: the small gray version indicator in the top left corner of every JSXGraph board (if
 61          * showCopyright is not set to false on board creation).
 62          *
 63          * @name JXG.licenseText
 64          * @type String
 65          */
 66         licenseText: 'JSXGraph v' + version + ' Copyright (C) see https://jsxgraph.org',
 67 
 68         /**
 69          *  Constant: user coordinates relative to the coordinates system defined by the bounding box.
 70          *  @name JXG.COORDS_BY_USER
 71          *  @type Number
 72          */
 73         COORDS_BY_USER: 0x0001,
 74 
 75         /**
 76          *  Constant: screen coordinates in pixel relative to the upper left corner of the div element.
 77          *  @name JXG.COORDS_BY_SCREEN
 78          *  @type Number
 79          */
 80         COORDS_BY_SCREEN: 0x0002,
 81 
 82         // object types
 83         OBJECT_TYPE_ARC: 1,
 84         OBJECT_TYPE_ARROW: 2,
 85         OBJECT_TYPE_AXIS: 3,
 86         OBJECT_TYPE_AXISPOINT: 4,
 87         OBJECT_TYPE_TICKS: 5,
 88         OBJECT_TYPE_CIRCLE: 6,
 89         OBJECT_TYPE_CONIC: 7,
 90         OBJECT_TYPE_CURVE: 8,
 91         OBJECT_TYPE_GLIDER: 9,
 92         OBJECT_TYPE_IMAGE: 10,
 93         OBJECT_TYPE_LINE: 11,
 94         OBJECT_TYPE_POINT: 12,
 95         OBJECT_TYPE_SLIDER: 13,
 96         OBJECT_TYPE_CAS: 14,
 97         OBJECT_TYPE_GXTCAS: 15,
 98         OBJECT_TYPE_POLYGON: 16,
 99         OBJECT_TYPE_SECTOR: 17,
100         OBJECT_TYPE_TEXT: 18,
101         OBJECT_TYPE_ANGLE: 19,
102         OBJECT_TYPE_INTERSECTION: 20,
103         OBJECT_TYPE_TURTLE: 21,
104         OBJECT_TYPE_VECTOR: 22,
105         OBJECT_TYPE_OPROJECT: 23,
106         OBJECT_TYPE_GRID: 24,
107         OBJECT_TYPE_TANGENT: 25,
108         OBJECT_TYPE_HTMLSLIDER: 26,
109         OBJECT_TYPE_CHECKBOX: 27,
110         OBJECT_TYPE_INPUT: 28,
111         OBJECT_TYPE_BUTTON: 29,
112         OBJECT_TYPE_TRANSFORMATION: 30,
113         OBJECT_TYPE_FOREIGNOBJECT: 31,
114 
115         OBJECT_TYPE_VIEW3D: 32,
116         OBJECT_TYPE_POINT3D: 33,
117         OBJECT_TYPE_LINE3D: 34,
118         OBJECT_TYPE_PLANE3D: 35,
119         OBJECT_TYPE_CURVE3D: 36,
120         OBJECT_TYPE_SURFACE3D: 37,
121 
122         // IMPORTANT:
123         // ----------
124         // For being able to differentiate between the (sketchometry specific) SPECIAL_OBJECT_TYPEs and
125         // (core specific) OBJECT_TYPEs, the non-sketchometry types MUST NOT be changed
126         // to values > 100.
127 
128         // object classes
129         OBJECT_CLASS_POINT: 1,
130         OBJECT_CLASS_LINE: 2,
131         OBJECT_CLASS_CIRCLE: 3,
132         OBJECT_CLASS_CURVE: 4,
133         OBJECT_CLASS_AREA: 5,
134         OBJECT_CLASS_OTHER: 6,
135         OBJECT_CLASS_TEXT: 7,
136         OBJECT_CLASS_3D: 8,
137 
138         // SketchReader constants
139         GENTYPE_ABC: 1, // unused
140         GENTYPE_AXIS: 2,
141         GENTYPE_MID: 3,
142 
143         /**
144          * @ignore
145          * @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_LINE}
146          *
147          */
148         GENTYPE_REFLECTION: 4,
149         /**
150          * @ignore
151          * @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_POINT}
152          */
153         GENTYPE_MIRRORELEMENT: 5,
154 
155         GENTYPE_REFLECTION_ON_LINE: 4,
156         GENTYPE_REFLECTION_ON_POINT: 5,
157         GENTYPE_TANGENT: 6,
158         GENTYPE_PARALLEL: 7,
159         GENTYPE_BISECTORLINES: 8,
160         GENTYPE_BOARDIMG: 9,
161         GENTYPE_BISECTOR: 10,
162         GENTYPE_NORMAL: 11,
163         GENTYPE_POINT: 12,
164         GENTYPE_GLIDER: 13,
165         GENTYPE_INTERSECTION: 14,
166         GENTYPE_CIRCLE: 15,
167         /**
168          * @ignore @deprecated NOT USED ANY MORE SINCE SKETCHOMETRY 2.0 (only for old constructions needed)
169          */
170         GENTYPE_CIRCLE2POINTS: 16,
171 
172         GENTYPE_LINE: 17,
173         GENTYPE_TRIANGLE: 18,
174         GENTYPE_QUADRILATERAL: 19,
175         GENTYPE_TEXT: 20,
176         GENTYPE_POLYGON: 21,
177         GENTYPE_REGULARPOLYGON: 22,
178         GENTYPE_SECTOR: 23,
179         GENTYPE_ANGLE: 24,
180         GENTYPE_PLOT: 25,
181         GENTYPE_SLIDER: 26,
182         GENTYPE_TRUNCATE: 27,
183         GENTYPE_JCODE: 28,
184         GENTYPE_MOVEMENT: 29,
185         GENTYPE_COMBINED: 30,
186         GENTYPE_RULER: 31,
187         GENTYPE_SLOPETRIANGLE: 32,
188         GENTYPE_PERPSEGMENT: 33,
189         GENTYPE_LABELMOVEMENT: 34,
190         GENTYPE_VECTOR: 35,
191         GENTYPE_NONREFLEXANGLE: 36,
192         GENTYPE_REFLEXANGLE: 37,
193         GENTYPE_PATH: 38,
194         GENTYPE_DERIVATIVE: 39,
195         // 40 // unused ...
196         GENTYPE_DELETE: 41,
197         GENTYPE_COPY: 42,
198         GENTYPE_MIRROR: 43,
199         GENTYPE_ROTATE: 44,
200         GENTYPE_ABLATION: 45,
201         GENTYPE_MIGRATE: 46,
202         GENTYPE_VECTORCOPY: 47,
203         GENTYPE_POLYGONCOPY: 48,    /**
204         * Constants
205         * @name Constants
206         * @namespace
207         */
208 
209         //        GENTYPE_TRANSFORM: 48, // unused
210         // 49 ... 50 // unused ...
211 
212         // IMPORTANT:
213         // ----------
214         // For being able to differentiate between the (GUI-specific) CTX and
215         // (CORE-specific) non-CTX steps, the non-CTX steps MUST NOT be changed
216         // to values > 50.
217 
218         GENTYPE_CTX_TYPE_G: 51,
219         GENTYPE_CTX_TYPE_P: 52,
220         GENTYPE_CTX_TRACE: 53,
221         GENTYPE_CTX_VISIBILITY: 54,
222         GENTYPE_CTX_CCVISIBILITY: 55, // unused
223         GENTYPE_CTX_MPVISIBILITY: 56,
224         GENTYPE_CTX_WITHLABEL: 57,
225         GENTYPE_CTX_LABEL: 58,
226         GENTYPE_CTX_FIXED: 59,
227         GENTYPE_CTX_STROKEWIDTH: 60,
228         GENTYPE_CTX_LABELSIZE: 61,
229         GENTYPE_CTX_SIZE: 62,
230         GENTYPE_CTX_FACE: 63,
231         GENTYPE_CTX_STRAIGHT: 64,
232         GENTYPE_CTX_ARROW: 65,
233         GENTYPE_CTX_COLOR: 66,
234         GENTYPE_CTX_RADIUS: 67,
235         GENTYPE_CTX_COORDS: 68,
236         GENTYPE_CTX_TEXT: 69,
237         GENTYPE_CTX_ANGLERADIUS: 70,
238         GENTYPE_CTX_DOTVISIBILITY: 71,
239         GENTYPE_CTX_FILLOPACITY: 72,
240         GENTYPE_CTX_PLOT: 73,
241         GENTYPE_CTX_SCALE: 74,
242         GENTYPE_CTX_INTVAL: 75,
243         GENTYPE_CTX_POINT1: 76,
244         GENTYPE_CTX_POINT2: 77,
245         GENTYPE_CTX_LABELSTICKY: 78,
246         GENTYPE_CTX_TYPE_I: 79,
247         GENTYPE_CTX_HASINNERPOINTS: 80,
248         GENTYPE_CTX_SNAPWIDTH: 81,
249         GENTYPE_CTX_SNAPTOGRID: 82
250     };
251 
252     JXG.extendConstants(JXG, constants);
253 
254     return constants;
255 });
256