bruce-models 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account.js +244 -244
- package/dist/lib/ann-document/ann-document.js +116 -116
- package/dist/lib/api/abstract-api.js +267 -267
- package/dist/lib/api/api.js +85 -85
- package/dist/lib/api/bruce-api.js +202 -202
- package/dist/lib/api/cam-api.js +132 -132
- package/dist/lib/api/global-api.js +131 -131
- package/dist/lib/api/idm-api.js +132 -132
- package/dist/lib/bruce-models.js +83 -83
- package/dist/lib/calculator/calculator.js +158 -158
- package/dist/lib/client-file/client-file.js +188 -188
- package/dist/lib/common/bounds.js +2 -2
- package/dist/lib/common/bruce-event.js +48 -48
- package/dist/lib/common/bruce-variable.js +54 -54
- package/dist/lib/common/cache.js +86 -86
- package/dist/lib/common/camera.js +11 -11
- package/dist/lib/common/cartes.js +55 -55
- package/dist/lib/common/carto.js +60 -60
- package/dist/lib/common/color.js +86 -86
- package/dist/lib/common/delay-queue.js +60 -60
- package/dist/lib/common/dictionary.js +2 -2
- package/dist/lib/common/geometry.js +120 -120
- package/dist/lib/common/transform.js +2 -2
- package/dist/lib/common/utc.js +39 -39
- package/dist/lib/custom-form/custom-form.js +136 -136
- package/dist/lib/data-lab/data-lab.js +90 -90
- package/dist/lib/entity/entity-attachment-type.js +132 -132
- package/dist/lib/entity/entity-attachment.js +208 -208
- package/dist/lib/entity/entity-comment.js +132 -132
- package/dist/lib/entity/entity-link.js +132 -132
- package/dist/lib/entity/entity-lod.js +189 -189
- package/dist/lib/entity/entity-relation-type.js +150 -150
- package/dist/lib/entity/entity-relation.js +189 -189
- package/dist/lib/entity/entity-source.js +176 -176
- package/dist/lib/entity/entity-tag.js +229 -229
- package/dist/lib/entity/entity-type.js +163 -163
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/entity/entity.js +349 -349
- package/dist/lib/entity/getters/batched-data-getter.js +91 -91
- package/dist/lib/entity/getters/entity-filter-getter.js +344 -344
- package/dist/lib/entity/getters/entity-globe.js +135 -135
- package/dist/lib/entity/getters/view-monitor.js +2 -2
- package/dist/lib/import/import-cad.js +82 -82
- package/dist/lib/import/import-csv.js +51 -51
- package/dist/lib/import/import-json.js +51 -51
- package/dist/lib/import/import-kml.js +51 -51
- package/dist/lib/import/imported-file.js +121 -121
- package/dist/lib/markup/markup.js +40 -40
- package/dist/lib/program-key/program-key.js +152 -152
- package/dist/lib/project/menu-item.js +115 -115
- package/dist/lib/project/project-view-bookmark.js +172 -172
- package/dist/lib/project/project-view-tile-source.js +115 -115
- package/dist/lib/project/project-view.js +166 -166
- package/dist/lib/project/zoom-control.js +17 -17
- package/dist/lib/server/pending-action.js +106 -106
- package/dist/lib/server/task.js +113 -113
- package/dist/lib/style/style.js +152 -152
- package/dist/lib/tileset/tileset-cad.js +2 -2
- package/dist/lib/tileset/tileset-entities-map-tiles.js +18 -18
- package/dist/lib/tileset/tileset-entities.js +2 -2
- package/dist/lib/tileset/tileset-ext-map-tiles.js +17 -17
- package/dist/lib/tileset/tileset-ext-terrain-tiles.js +2 -2
- package/dist/lib/tileset/tileset-map-tiles.js +2 -2
- package/dist/lib/tileset/tileset-pointcloud.js +2 -2
- package/dist/lib/tileset/tileset-terrain-tiles.js +2 -2
- package/dist/lib/tileset/tileset.js +403 -403
- package/dist/lib/ucs/ucs.js +135 -135
- package/dist/lib/user/permission.js +20 -20
- package/dist/lib/user/session.js +160 -160
- package/dist/lib/user/user-group.js +139 -139
- package/dist/lib/user/user.js +451 -451
- package/dist/lib/util/encrypt-utils.js +20 -20
- package/dist/lib/util/math-utils.js +41 -41
- package/dist/lib/util/object-utils.js +17 -17
- package/dist/lib/util/path-utils.js +61 -61
- package/dist/lib/util/url-utils.js +107 -107
- package/dist/types/entity/entity-type.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.ProgramKey = void 0;
|
|
40
|
-
var api_1 = require("../api/api");
|
|
41
|
-
/**
|
|
42
|
-
* Describes the "Program Key" concept within Bruce.
|
|
43
|
-
* A program key is an access token for an arbitrary software.
|
|
44
|
-
*/
|
|
45
|
-
var ProgramKey;
|
|
46
|
-
(function (ProgramKey) {
|
|
47
|
-
function GetCacheKey(programId) {
|
|
48
|
-
return api_1.Api.ECacheKey.ProgramKey + api_1.Api.ECacheKey.Id + programId;
|
|
49
|
-
}
|
|
50
|
-
ProgramKey.GetCacheKey = GetCacheKey;
|
|
51
|
-
function GetListCacheKey() {
|
|
52
|
-
return api_1.Api.ECacheKey.ProgramKey;
|
|
53
|
-
}
|
|
54
|
-
ProgramKey.GetListCacheKey = GetListCacheKey;
|
|
55
|
-
var EProgramId;
|
|
56
|
-
(function (EProgramId) {
|
|
57
|
-
EProgramId["CesiumIon"] = "CesiumIon";
|
|
58
|
-
EProgramId["BingMaps"] = "BingMaps";
|
|
59
|
-
EProgramId["Mapbox"] = "Mapbox";
|
|
60
|
-
})(EProgramId = ProgramKey.EProgramId || (ProgramKey.EProgramId = {}));
|
|
61
|
-
function Get(api, programId) {
|
|
62
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
-
var key, cacheData, req;
|
|
64
|
-
return __generator(this, function (_a) {
|
|
65
|
-
if (!programId) {
|
|
66
|
-
throw ("Program ID is required.");
|
|
67
|
-
}
|
|
68
|
-
key = GetCacheKey(programId);
|
|
69
|
-
cacheData = api.Cache.Get(key);
|
|
70
|
-
if (cacheData) {
|
|
71
|
-
return [2 /*return*/, cacheData];
|
|
72
|
-
}
|
|
73
|
-
req = api.GET("programkey/" + programId, api_1.Api.PrepReqParams());
|
|
74
|
-
api.Cache.Set(key, req, api_1.Api.DEFAULT_CACHE_DURATION);
|
|
75
|
-
return [2 /*return*/, req];
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
ProgramKey.Get = Get;
|
|
80
|
-
function GetList(api) {
|
|
81
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
-
var cacheData, req;
|
|
83
|
-
var _this = this;
|
|
84
|
-
return __generator(this, function (_a) {
|
|
85
|
-
cacheData = api.Cache.Get(GetListCacheKey());
|
|
86
|
-
if (cacheData) {
|
|
87
|
-
return [2 /*return*/, cacheData];
|
|
88
|
-
}
|
|
89
|
-
req = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
90
|
-
var data, e_1;
|
|
91
|
-
return __generator(this, function (_a) {
|
|
92
|
-
switch (_a.label) {
|
|
93
|
-
case 0:
|
|
94
|
-
_a.trys.push([0, 2, , 3]);
|
|
95
|
-
return [4 /*yield*/, api.GET("programkeys", api_1.Api.PrepReqParams())];
|
|
96
|
-
case 1:
|
|
97
|
-
data = _a.sent();
|
|
98
|
-
res(data.Items);
|
|
99
|
-
return [3 /*break*/, 3];
|
|
100
|
-
case 2:
|
|
101
|
-
e_1 = _a.sent();
|
|
102
|
-
rej(e_1);
|
|
103
|
-
return [3 /*break*/, 3];
|
|
104
|
-
case 3: return [2 /*return*/];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}); });
|
|
108
|
-
api.Cache.Set(GetListCacheKey(), req, api_1.Api.DEFAULT_CACHE_DURATION);
|
|
109
|
-
return [2 /*return*/, req];
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
ProgramKey.GetList = GetList;
|
|
114
|
-
function Delete(api, programId) {
|
|
115
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
116
|
-
return __generator(this, function (_a) {
|
|
117
|
-
switch (_a.label) {
|
|
118
|
-
case 0:
|
|
119
|
-
if (!programId) {
|
|
120
|
-
throw ("Program ID is required.");
|
|
121
|
-
}
|
|
122
|
-
return [4 /*yield*/, api.DELETE("programkey/" + programId, api_1.Api.PrepReqParams())];
|
|
123
|
-
case 1:
|
|
124
|
-
_a.sent();
|
|
125
|
-
api.Cache.Remove(GetCacheKey(programId));
|
|
126
|
-
api.Cache.Remove(GetListCacheKey());
|
|
127
|
-
return [2 /*return*/];
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
ProgramKey.Delete = Delete;
|
|
133
|
-
function Update(api, data) {
|
|
134
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
-
return __generator(this, function (_a) {
|
|
136
|
-
switch (_a.label) {
|
|
137
|
-
case 0:
|
|
138
|
-
if (!(data === null || data === void 0 ? void 0 : data.ProgramId)) {
|
|
139
|
-
throw ("Program ID is required.");
|
|
140
|
-
}
|
|
141
|
-
return [4 /*yield*/, api.POST("programkey", data, api_1.Api.PrepReqParams())];
|
|
142
|
-
case 1:
|
|
143
|
-
data = _a.sent();
|
|
144
|
-
api.Cache.Remove(GetCacheKey(data.ProgramId));
|
|
145
|
-
api.Cache.Remove(GetListCacheKey());
|
|
146
|
-
return [2 /*return*/, data];
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
ProgramKey.Update = Update;
|
|
152
|
-
})(ProgramKey = exports.ProgramKey || (exports.ProgramKey = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ProgramKey = void 0;
|
|
40
|
+
var api_1 = require("../api/api");
|
|
41
|
+
/**
|
|
42
|
+
* Describes the "Program Key" concept within Bruce.
|
|
43
|
+
* A program key is an access token for an arbitrary software.
|
|
44
|
+
*/
|
|
45
|
+
var ProgramKey;
|
|
46
|
+
(function (ProgramKey) {
|
|
47
|
+
function GetCacheKey(programId) {
|
|
48
|
+
return api_1.Api.ECacheKey.ProgramKey + api_1.Api.ECacheKey.Id + programId;
|
|
49
|
+
}
|
|
50
|
+
ProgramKey.GetCacheKey = GetCacheKey;
|
|
51
|
+
function GetListCacheKey() {
|
|
52
|
+
return api_1.Api.ECacheKey.ProgramKey;
|
|
53
|
+
}
|
|
54
|
+
ProgramKey.GetListCacheKey = GetListCacheKey;
|
|
55
|
+
var EProgramId;
|
|
56
|
+
(function (EProgramId) {
|
|
57
|
+
EProgramId["CesiumIon"] = "CesiumIon";
|
|
58
|
+
EProgramId["BingMaps"] = "BingMaps";
|
|
59
|
+
EProgramId["Mapbox"] = "Mapbox";
|
|
60
|
+
})(EProgramId = ProgramKey.EProgramId || (ProgramKey.EProgramId = {}));
|
|
61
|
+
function Get(api, programId) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
var key, cacheData, req;
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
if (!programId) {
|
|
66
|
+
throw ("Program ID is required.");
|
|
67
|
+
}
|
|
68
|
+
key = GetCacheKey(programId);
|
|
69
|
+
cacheData = api.Cache.Get(key);
|
|
70
|
+
if (cacheData) {
|
|
71
|
+
return [2 /*return*/, cacheData];
|
|
72
|
+
}
|
|
73
|
+
req = api.GET("programkey/" + programId, api_1.Api.PrepReqParams());
|
|
74
|
+
api.Cache.Set(key, req, api_1.Api.DEFAULT_CACHE_DURATION);
|
|
75
|
+
return [2 /*return*/, req];
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
ProgramKey.Get = Get;
|
|
80
|
+
function GetList(api) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
+
var cacheData, req;
|
|
83
|
+
var _this = this;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
cacheData = api.Cache.Get(GetListCacheKey());
|
|
86
|
+
if (cacheData) {
|
|
87
|
+
return [2 /*return*/, cacheData];
|
|
88
|
+
}
|
|
89
|
+
req = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
90
|
+
var data, e_1;
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
_a.trys.push([0, 2, , 3]);
|
|
95
|
+
return [4 /*yield*/, api.GET("programkeys", api_1.Api.PrepReqParams())];
|
|
96
|
+
case 1:
|
|
97
|
+
data = _a.sent();
|
|
98
|
+
res(data.Items);
|
|
99
|
+
return [3 /*break*/, 3];
|
|
100
|
+
case 2:
|
|
101
|
+
e_1 = _a.sent();
|
|
102
|
+
rej(e_1);
|
|
103
|
+
return [3 /*break*/, 3];
|
|
104
|
+
case 3: return [2 /*return*/];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}); });
|
|
108
|
+
api.Cache.Set(GetListCacheKey(), req, api_1.Api.DEFAULT_CACHE_DURATION);
|
|
109
|
+
return [2 /*return*/, req];
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
ProgramKey.GetList = GetList;
|
|
114
|
+
function Delete(api, programId) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
if (!programId) {
|
|
120
|
+
throw ("Program ID is required.");
|
|
121
|
+
}
|
|
122
|
+
return [4 /*yield*/, api.DELETE("programkey/" + programId, api_1.Api.PrepReqParams())];
|
|
123
|
+
case 1:
|
|
124
|
+
_a.sent();
|
|
125
|
+
api.Cache.Remove(GetCacheKey(programId));
|
|
126
|
+
api.Cache.Remove(GetListCacheKey());
|
|
127
|
+
return [2 /*return*/];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
ProgramKey.Delete = Delete;
|
|
133
|
+
function Update(api, data) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0:
|
|
138
|
+
if (!(data === null || data === void 0 ? void 0 : data.ProgramId)) {
|
|
139
|
+
throw ("Program ID is required.");
|
|
140
|
+
}
|
|
141
|
+
return [4 /*yield*/, api.POST("programkey", data, api_1.Api.PrepReqParams())];
|
|
142
|
+
case 1:
|
|
143
|
+
data = _a.sent();
|
|
144
|
+
api.Cache.Remove(GetCacheKey(data.ProgramId));
|
|
145
|
+
api.Cache.Remove(GetListCacheKey());
|
|
146
|
+
return [2 /*return*/, data];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
ProgramKey.Update = Update;
|
|
152
|
+
})(ProgramKey = exports.ProgramKey || (exports.ProgramKey = {}));
|
|
153
153
|
//# sourceMappingURL=program-key.js.map
|
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuItem = void 0;
|
|
4
|
-
var tileset_1 = require("../tileset/tileset");
|
|
5
|
-
var object_utils_1 = require("../util/object-utils");
|
|
6
|
-
var zoom_control_1 = require("./zoom-control");
|
|
7
|
-
/**
|
|
8
|
-
* Describes a menu item found in project views.
|
|
9
|
-
* Menu items are used to dictate what data to load in a scene.
|
|
10
|
-
* A menu item may be a container for other items.
|
|
11
|
-
*/
|
|
12
|
-
var MenuItem;
|
|
13
|
-
(function (MenuItem) {
|
|
14
|
-
var EType;
|
|
15
|
-
(function (EType) {
|
|
16
|
-
EType["None"] = "NONE";
|
|
17
|
-
EType["Entities"] = "BruceEntity";
|
|
18
|
-
EType["Entity"] = "SingleEntity";
|
|
19
|
-
EType["Osm"] = "OSMBuildingsTileset";
|
|
20
|
-
EType["CadTileset"] = "ModelTileset";
|
|
21
|
-
EType["ArbTileset"] = "Cesium3DTileset";
|
|
22
|
-
EType["Kml"] = "StaticKML";
|
|
23
|
-
EType["EntityTileset"] = "EntitiesTileset";
|
|
24
|
-
EType["EntityRaster"] = "RasterEntitiesTileset";
|
|
25
|
-
EType["PointCloud"] = "PointCloudTileset";
|
|
26
|
-
EType["EntitiesLoaded"] = "LoadedEntities";
|
|
27
|
-
EType["EntitiesIds"] = "EntitiesIds";
|
|
28
|
-
})(EType = MenuItem.EType || (MenuItem.EType = {}));
|
|
29
|
-
function CreateFromEntityId(entityId, typeId, styleId) {
|
|
30
|
-
return {
|
|
31
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
32
|
-
Type: EType.Entity,
|
|
33
|
-
Caption: "Generated Entity Menu Item",
|
|
34
|
-
BruceEntity: {
|
|
35
|
-
"EntityType.ID": typeId,
|
|
36
|
-
EntityId: entityId
|
|
37
|
-
},
|
|
38
|
-
CameraZoomSettings: [
|
|
39
|
-
{
|
|
40
|
-
DisplayType: zoom_control_1.ZoomControl.EDisplayType.Model3D,
|
|
41
|
-
MaxZoom: 8000,
|
|
42
|
-
MinZoom: 0,
|
|
43
|
-
StyleID: styleId
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
MenuItem.CreateFromEntityId = CreateFromEntityId;
|
|
49
|
-
function CreateFromTypeId(typeId, styleId) {
|
|
50
|
-
return {
|
|
51
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
52
|
-
Type: EType.Entities,
|
|
53
|
-
Caption: "Generated Entity Type Menu Item",
|
|
54
|
-
BruceEntity: {
|
|
55
|
-
"EntityType.ID": typeId
|
|
56
|
-
},
|
|
57
|
-
CameraZoomSettings: [
|
|
58
|
-
{
|
|
59
|
-
DisplayType: zoom_control_1.ZoomControl.EDisplayType.Model3D,
|
|
60
|
-
MaxZoom: 8000,
|
|
61
|
-
MinZoom: 0,
|
|
62
|
-
StyleID: styleId
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
MenuItem.CreateFromTypeId = CreateFromTypeId;
|
|
68
|
-
function CreateFromTilesetId(tilesetId, type) {
|
|
69
|
-
if (type === tileset_1.Tileset.EType.Cad) {
|
|
70
|
-
return {
|
|
71
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
72
|
-
Type: EType.CadTileset,
|
|
73
|
-
Caption: "Generated CAD Menu Item",
|
|
74
|
-
FlyTo: false,
|
|
75
|
-
tileset: {
|
|
76
|
-
TilesetID: tilesetId
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
else if (type == tileset_1.Tileset.EType.EntitiesSet) {
|
|
81
|
-
return {
|
|
82
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
83
|
-
Type: EType.EntityTileset,
|
|
84
|
-
Caption: "Generated Entities Menu Item",
|
|
85
|
-
FlyTo: false,
|
|
86
|
-
tileset: {
|
|
87
|
-
TilesetID: tilesetId
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
else if (type == tileset_1.Tileset.EType.PointCloud) {
|
|
92
|
-
return {
|
|
93
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
94
|
-
Type: EType.PointCloud,
|
|
95
|
-
Caption: "Generated Point Cloud Menu Item",
|
|
96
|
-
FlyTo: false,
|
|
97
|
-
tileset: {
|
|
98
|
-
TilesetID: tilesetId
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
else if (type == tileset_1.Tileset.EType.EntitiesMap) {
|
|
103
|
-
return {
|
|
104
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
105
|
-
Type: EType.EntityRaster,
|
|
106
|
-
Caption: "Generated Entities Menu Item",
|
|
107
|
-
tileset: {
|
|
108
|
-
TilesetID: tilesetId
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
throw ("Tileset type not supported.");
|
|
113
|
-
}
|
|
114
|
-
MenuItem.CreateFromTilesetId = CreateFromTilesetId;
|
|
115
|
-
})(MenuItem = exports.MenuItem || (exports.MenuItem = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MenuItem = void 0;
|
|
4
|
+
var tileset_1 = require("../tileset/tileset");
|
|
5
|
+
var object_utils_1 = require("../util/object-utils");
|
|
6
|
+
var zoom_control_1 = require("./zoom-control");
|
|
7
|
+
/**
|
|
8
|
+
* Describes a menu item found in project views.
|
|
9
|
+
* Menu items are used to dictate what data to load in a scene.
|
|
10
|
+
* A menu item may be a container for other items.
|
|
11
|
+
*/
|
|
12
|
+
var MenuItem;
|
|
13
|
+
(function (MenuItem) {
|
|
14
|
+
var EType;
|
|
15
|
+
(function (EType) {
|
|
16
|
+
EType["None"] = "NONE";
|
|
17
|
+
EType["Entities"] = "BruceEntity";
|
|
18
|
+
EType["Entity"] = "SingleEntity";
|
|
19
|
+
EType["Osm"] = "OSMBuildingsTileset";
|
|
20
|
+
EType["CadTileset"] = "ModelTileset";
|
|
21
|
+
EType["ArbTileset"] = "Cesium3DTileset";
|
|
22
|
+
EType["Kml"] = "StaticKML";
|
|
23
|
+
EType["EntityTileset"] = "EntitiesTileset";
|
|
24
|
+
EType["EntityRaster"] = "RasterEntitiesTileset";
|
|
25
|
+
EType["PointCloud"] = "PointCloudTileset";
|
|
26
|
+
EType["EntitiesLoaded"] = "LoadedEntities";
|
|
27
|
+
EType["EntitiesIds"] = "EntitiesIds";
|
|
28
|
+
})(EType = MenuItem.EType || (MenuItem.EType = {}));
|
|
29
|
+
function CreateFromEntityId(entityId, typeId, styleId) {
|
|
30
|
+
return {
|
|
31
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
32
|
+
Type: EType.Entity,
|
|
33
|
+
Caption: "Generated Entity Menu Item",
|
|
34
|
+
BruceEntity: {
|
|
35
|
+
"EntityType.ID": typeId,
|
|
36
|
+
EntityId: entityId
|
|
37
|
+
},
|
|
38
|
+
CameraZoomSettings: [
|
|
39
|
+
{
|
|
40
|
+
DisplayType: zoom_control_1.ZoomControl.EDisplayType.Model3D,
|
|
41
|
+
MaxZoom: 8000,
|
|
42
|
+
MinZoom: 0,
|
|
43
|
+
StyleID: styleId
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
MenuItem.CreateFromEntityId = CreateFromEntityId;
|
|
49
|
+
function CreateFromTypeId(typeId, styleId) {
|
|
50
|
+
return {
|
|
51
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
52
|
+
Type: EType.Entities,
|
|
53
|
+
Caption: "Generated Entity Type Menu Item",
|
|
54
|
+
BruceEntity: {
|
|
55
|
+
"EntityType.ID": typeId
|
|
56
|
+
},
|
|
57
|
+
CameraZoomSettings: [
|
|
58
|
+
{
|
|
59
|
+
DisplayType: zoom_control_1.ZoomControl.EDisplayType.Model3D,
|
|
60
|
+
MaxZoom: 8000,
|
|
61
|
+
MinZoom: 0,
|
|
62
|
+
StyleID: styleId
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
MenuItem.CreateFromTypeId = CreateFromTypeId;
|
|
68
|
+
function CreateFromTilesetId(tilesetId, type) {
|
|
69
|
+
if (type === tileset_1.Tileset.EType.Cad) {
|
|
70
|
+
return {
|
|
71
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
72
|
+
Type: EType.CadTileset,
|
|
73
|
+
Caption: "Generated CAD Menu Item",
|
|
74
|
+
FlyTo: false,
|
|
75
|
+
tileset: {
|
|
76
|
+
TilesetID: tilesetId
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
else if (type == tileset_1.Tileset.EType.EntitiesSet) {
|
|
81
|
+
return {
|
|
82
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
83
|
+
Type: EType.EntityTileset,
|
|
84
|
+
Caption: "Generated Entities Menu Item",
|
|
85
|
+
FlyTo: false,
|
|
86
|
+
tileset: {
|
|
87
|
+
TilesetID: tilesetId
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
else if (type == tileset_1.Tileset.EType.PointCloud) {
|
|
92
|
+
return {
|
|
93
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
94
|
+
Type: EType.PointCloud,
|
|
95
|
+
Caption: "Generated Point Cloud Menu Item",
|
|
96
|
+
FlyTo: false,
|
|
97
|
+
tileset: {
|
|
98
|
+
TilesetID: tilesetId
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
else if (type == tileset_1.Tileset.EType.EntitiesMap) {
|
|
103
|
+
return {
|
|
104
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
105
|
+
Type: EType.EntityRaster,
|
|
106
|
+
Caption: "Generated Entities Menu Item",
|
|
107
|
+
tileset: {
|
|
108
|
+
TilesetID: tilesetId
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
throw ("Tileset type not supported.");
|
|
113
|
+
}
|
|
114
|
+
MenuItem.CreateFromTilesetId = CreateFromTilesetId;
|
|
115
|
+
})(MenuItem = exports.MenuItem || (exports.MenuItem = {}));
|
|
116
116
|
//# sourceMappingURL=menu-item.js.map
|