/* * iGeom by LInE * Definitions of ID to Geometric Objects * www.matematica.br/igeom * ./app/core/enums/elements-class-enum.js * @version 2020/11/02: Implemented Line instersection */ // TYPE of objects in iGeom // * PONTO = 0; // * PONTO_INTERSECAO = 1; // * PONTO_SOBRE = 2; // * CIRCUNFERENCIA = 3; // * RETA = 4; // * SEMIRETA = 5; // * SEGMENTO = 6; // * MED_DISTANCIA = 7; // Script: MEDIDA = 7 // * MED_AREA = 8; // * PARALELA = 9; // * PERPENDICULAR = 10; // * MED_ARCO = 11; // * MED_EXPR = 12; // * PONTO_MEDIO = 13; // * CIRC_RAIO = 14; // * POLIGONO = 15; // * PONTO_SOBRE_DIST = 16; // * LOCUS = 17; // * MED_TEXTO = 20; // para textos // * CIRCUNFERENCIA_INT = 21; // [11/01/2006] estava 56, mas este num. e de rotacao export const ELEMENTS_CLASS = { NONE: -1, POINT: 0, INTERSECTION_POINT: 1, CIRCUMFERENCE: 3, LINE: 4, LINE_SEGMENT: 6, MIDDLE_POINT: 13 }; // Function to analyse the item TYPE (type of object: Point,...) // @calledby app/core/parser/file-parser.js!parseObjectLine (object_line) // @param {number} code export function fromCodeToClass (code) { //D console.trace(); //D console.log("elements-class-enum.js!fromCodeToClass(" + code + ")"); switch (code) { case 0: // type of object is Point return ELEMENTS_CLASS.POINT; case 1: // intersection point return ELEMENTS_CLASS.INTERSECTION_POINT; case 6: // segment return ELEMENTS_CLASS.LINE_SEGMENT; case 3: // circumference return ELEMENTS_CLASS.CIRCUMFERENCE; case 4: // line return ELEMENTS_CLASS.LINE; case 13: // mippoint return ELEMENTS_CLASS.MIDDLE_POINT; default: console.error("Type \"" + code + "\" is not yet implemented!"); return ELEMENTS_CLASS.POINT; } }