gs-json
Version:
gs-JSON is a domain agnostic unifying 3D file format for geometric and semantic modelling (hence the 'gs').
113 lines • 3.77 kB
JavaScript
/**
* Enum, the different types of geometric elements.
* Objects and Points are entities (see subclasses of the Ent class).
* Faces, Wires, Edges, and Vertices are topological components (see subclasses of the Topo class).
* Attributes can be attached to all these elements.
*/
export var EGeomType;
(function (EGeomType) {
EGeomType[EGeomType["points"] = 0] = "points";
EGeomType[EGeomType["vertices"] = 1] = "vertices";
EGeomType[EGeomType["edges"] = 2] = "edges";
EGeomType[EGeomType["wires"] = 3] = "wires";
EGeomType[EGeomType["faces"] = 4] = "faces";
EGeomType[EGeomType["objs"] = 5] = "objs";
})(EGeomType || (EGeomType = {}));
/**
* Enum, the different data types for attributes.
*/
export var EDataType;
(function (EDataType) {
EDataType[EDataType["type_str"] = 0] = "type_str";
EDataType[EDataType["type_num"] = 1] = "type_num";
EDataType[EDataType["type_bool"] = 2] = "type_bool";
EDataType[EDataType["type_str_arr"] = 3] = "type_str_arr";
EDataType[EDataType["type_num_arr"] = 4] = "type_num_arr";
EDataType[EDataType["type_bool_arr"] = 5] = "type_bool_arr";
})(EDataType || (EDataType = {}));
/**
* Map, from EObjType to string.
* This is used when generating string representations of objects.
*/
export let mapObjTypeToString = new Map([
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
]);
/**
* Map, from string to EGeomType.
* This is used when parsing JSON.
*/
export let mapStringToGeomType = new Map([
["objs", EGeomType.objs],
["faces", EGeomType.faces],
["wires", EGeomType.wires],
["edges", EGeomType.edges],
["vertices", EGeomType.vertices],
["points", EGeomType.points],
]);
/**
* Map, from EGeomType to string.
* This is used when generating JSON.
*/
export let mapGeomTypeToString = new Map([
[],
[],
[],
[],
[],
[],
]);
/**
* Map, from strings to DataType.
* This is used when parsing JSON.
*/
export let mapStringToDataType = new Map([
["string", EDataType.type_str],
["number", EDataType.type_num],
["boolean", EDataType.type_bool],
["string[]", EDataType.type_str_arr],
["number[]", EDataType.type_num_arr],
["boolean[]", EDataType.type_bool_arr],
]);
/**
* Map, from DataType to strings.
* This is used when generating JSON.
*/
export let mapDataTypeToString = new Map([
[],
[],
[],
[],
[],
[],
]);
/**
* Map, from GeomType to int.
* This is used when generating JSON.
*/
export let mapGeomTypeToTopoPathIndex = new Map([
[],
[],
[],
[],
]);
export let mapTTPathIndexToGeomType = new Map([
[],
[],
]);
export let mapSTPathIndexToGeomType = new Map([
[],
[],
]);
//# sourceMappingURL=enums.js.map