1 /*
  2     Copyright 2008-2021
  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 = 0,
 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         // IMPORTANT:
116         // ----------
117         // For being able to differentiate between the (sketchometry specific) SPECIAL_OBJECT_TYPEs and
118         // (core specific) OBJECT_TYPEs, the non-sketchometry types MUST NOT be changed
119         // to values > 100.
120 
121         // object classes
122         OBJECT_CLASS_POINT: 1,
123         OBJECT_CLASS_LINE: 2,
124         OBJECT_CLASS_CIRCLE: 3,
125         OBJECT_CLASS_CURVE: 4,
126         OBJECT_CLASS_AREA: 5,
127         OBJECT_CLASS_OTHER: 6,
128         OBJECT_CLASS_TEXT: 7,
129 
130         // SketchReader constants
131         GENTYPE_ABC: 1, // unused
132         GENTYPE_AXIS: 2,
133         GENTYPE_MID: 3,
134 
135         /** 
136          * @ignore
137          * @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_LINE} 
138          * 
139          */  
140         GENTYPE_REFLECTION: 4,
141         /** 
142          * @ignore 
143          * @deprecated, now use {@link JXG.GENTYPE_REFLECTION_ON_POINT} 
144          */ 
145         GENTYPE_MIRRORELEMENT: 5,
146 
147         GENTYPE_REFLECTION_ON_LINE: 4,
148         GENTYPE_REFLECTION_ON_POINT: 5,
149         GENTYPE_TANGENT: 6,
150         GENTYPE_PARALLEL: 7,
151         GENTYPE_BISECTORLINES: 8,
152         GENTYPE_BOARDIMG: 9,
153         GENTYPE_BISECTOR: 10,
154         GENTYPE_NORMAL: 11,
155         GENTYPE_POINT: 12,
156         GENTYPE_GLIDER: 13,
157         GENTYPE_INTERSECTION: 14,
158         GENTYPE_CIRCLE: 15,
159         /** 
160          * @ignore @deprecated NOT USED ANY MORE SINCE SKETCHOMETRY 2.0 (only for old constructions needed) 
161          */ 
162         GENTYPE_CIRCLE2POINTS: 16,
163 
164         GENTYPE_LINE: 17,
165         GENTYPE_TRIANGLE: 18,
166         GENTYPE_QUADRILATERAL: 19,
167         GENTYPE_TEXT: 20,
168         GENTYPE_POLYGON: 21,
169         GENTYPE_REGULARPOLYGON: 22,
170         GENTYPE_SECTOR: 23,
171         GENTYPE_ANGLE: 24,
172         GENTYPE_PLOT: 25,
173         GENTYPE_SLIDER: 26,
174         GENTYPE_TRUNCATE: 27,
175         GENTYPE_JCODE: 28,
176         GENTYPE_MOVEMENT: 29,
177         GENTYPE_COMBINED: 30,
178         GENTYPE_RULER: 31,
179         GENTYPE_SLOPETRIANGLE: 32,
180         GENTYPE_PERPSEGMENT: 33,
181         GENTYPE_LABELMOVEMENT: 34,
182         GENTYPE_VECTOR: 35,
183         GENTYPE_NONREFLEXANGLE: 36,
184         GENTYPE_REFLEXANGLE: 37,
185         GENTYPE_PATH: 38,
186         GENTYPE_DERIVATIVE: 39,
187         // 40 // unused ...
188         GENTYPE_DELETE: 41,
189         GENTYPE_COPY: 42,
190         GENTYPE_MIRROR: 43,
191         GENTYPE_ROTATE: 44,
192         GENTYPE_ABLATION: 45,
193         GENTYPE_MIGRATE: 46,
194         GENTYPE_VECTORCOPY: 47,
195         GENTYPE_POLYGONCOPY: 48,    /**
196         * Constants
197         * @name Constants
198         * @namespace
199         */
200    
201         //        GENTYPE_TRANSFORM: 48, // unused
202         // 49 ... 50 // unused ...
203 
204         // IMPORTANT:
205         // ----------
206         // For being able to differentiate between the (GUI-specific) CTX and
207         // (CORE-specific) non-CTX steps, the non-CTX steps MUST NOT be changed
208         // to values > 50.
209 
210         GENTYPE_CTX_TYPE_G: 51,
211         GENTYPE_CTX_TYPE_P: 52,
212         GENTYPE_CTX_TRACE: 53,
213         GENTYPE_CTX_VISIBILITY: 54,
214         GENTYPE_CTX_CCVISIBILITY: 55, // unused
215         GENTYPE_CTX_MPVISIBILITY: 56,
216         GENTYPE_CTX_WITHLABEL: 57,
217         GENTYPE_CTX_LABEL: 58,
218         GENTYPE_CTX_FIXED: 59,
219         GENTYPE_CTX_STROKEWIDTH: 60,
220         GENTYPE_CTX_LABELSIZE: 61,
221         GENTYPE_CTX_SIZE: 62,
222         GENTYPE_CTX_FACE: 63,
223         GENTYPE_CTX_STRAIGHT: 64,
224         GENTYPE_CTX_ARROW: 65,
225         GENTYPE_CTX_COLOR: 66,
226         GENTYPE_CTX_RADIUS: 67,
227         GENTYPE_CTX_COORDS: 68,
228         GENTYPE_CTX_TEXT: 69,
229         GENTYPE_CTX_ANGLERADIUS: 70,
230         GENTYPE_CTX_DOTVISIBILITY: 71,
231         GENTYPE_CTX_FILLOPACITY: 72,
232         GENTYPE_CTX_PLOT: 73,
233         GENTYPE_CTX_SCALE: 74,
234         GENTYPE_CTX_INTVAL: 75,
235         GENTYPE_CTX_POINT1: 76,
236         GENTYPE_CTX_POINT2: 77,
237         GENTYPE_CTX_LABELSTICKY: 78,
238         GENTYPE_CTX_TYPE_I: 79,
239         GENTYPE_CTX_HASINNERPOINTS: 80,
240         GENTYPE_CTX_SNAPWIDTH: 81,
241         GENTYPE_CTX_SNAPTOGRID: 82
242     };
243 
244     JXG.extendConstants(JXG, constants);
245 
246     return constants;
247 });
248