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