bruce-models 1.9.7 → 1.9.8
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 +9 -3
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +9 -3
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-settings.js +2 -2
- package/dist/lib/account/account.js +185 -185
- package/dist/lib/ann-document/ann-document.js +86 -86
- package/dist/lib/api/abstract-api.js +246 -246
- package/dist/lib/api/api-getters.js +134 -134
- package/dist/lib/api/api.js +93 -93
- package/dist/lib/api/bruce-api.js +216 -216
- package/dist/lib/api/cam-api.js +82 -82
- package/dist/lib/api/global-api.js +81 -81
- package/dist/lib/api/idm-api.js +82 -82
- package/dist/lib/bruce-models.js +86 -86
- package/dist/lib/calculator/calculator.js +341 -335
- package/dist/lib/calculator/calculator.js.map +1 -1
- package/dist/lib/client-file/client-file.js +245 -245
- package/dist/lib/common/bounds.js +61 -61
- package/dist/lib/common/bruce-event.js +46 -46
- package/dist/lib/common/bruce-variable.js +60 -60
- package/dist/lib/common/cache.js +165 -165
- package/dist/lib/common/camera.js +11 -11
- package/dist/lib/common/cartes.js +123 -123
- package/dist/lib/common/carto.js +60 -60
- package/dist/lib/common/color.js +86 -86
- package/dist/lib/common/delay-queue.js +56 -56
- 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-content.js +26 -26
- package/dist/lib/custom-form/custom-form.js +106 -106
- package/dist/lib/data-lab/data-lab.js +49 -49
- package/dist/lib/entity/entity-attachment-type.js +83 -83
- package/dist/lib/entity/entity-attachment.js +122 -122
- package/dist/lib/entity/entity-attribute.js +29 -29
- package/dist/lib/entity/entity-comment.js +82 -82
- package/dist/lib/entity/entity-coords.js +149 -149
- package/dist/lib/entity/entity-link.js +82 -82
- package/dist/lib/entity/entity-lod-category.js +100 -100
- package/dist/lib/entity/entity-lod.js +185 -185
- package/dist/lib/entity/entity-relation-type.js +109 -109
- package/dist/lib/entity/entity-relation.js +132 -132
- package/dist/lib/entity/entity-source.js +136 -136
- package/dist/lib/entity/entity-tag.js +149 -149
- package/dist/lib/entity/entity-type-visual-settings.js +13 -13
- package/dist/lib/entity/entity-type.js +113 -113
- package/dist/lib/entity/entity.js +319 -319
- package/dist/lib/entity/getters/batched-data-getter.js +84 -84
- package/dist/lib/entity/getters/entity-filter-getter.js +303 -303
- package/dist/lib/entity/getters/entity-globe.js +211 -211
- package/dist/lib/entity/getters/view-monitor.js +2 -2
- package/dist/lib/import/import-cad.js +53 -53
- package/dist/lib/import/import-csv.js +23 -23
- package/dist/lib/import/import-json.js +23 -23
- package/dist/lib/import/import-kml.js +23 -23
- package/dist/lib/import/imported-file.js +91 -91
- package/dist/lib/internal/uploader.js +76 -76
- package/dist/lib/markup/markup.js +185 -185
- package/dist/lib/plugin/plugin.js +83 -83
- package/dist/lib/program-key/program-key.js +111 -111
- package/dist/lib/project/menu-item.js +121 -121
- package/dist/lib/project/project-view-bookmark.js +147 -147
- package/dist/lib/project/project-view-legacy-tile.js +77 -77
- package/dist/lib/project/project-view-tile.js +125 -125
- package/dist/lib/project/project-view.js +133 -133
- package/dist/lib/project/zoom-control.js +17 -17
- package/dist/lib/server/message-broker.js +142 -142
- package/dist/lib/server/pending-action.js +71 -71
- package/dist/lib/server/task.js +63 -63
- package/dist/lib/style/style.js +117 -117
- package/dist/lib/tileset/tileset.js +415 -415
- package/dist/lib/user/permission.js +20 -20
- package/dist/lib/user/session.js +137 -137
- package/dist/lib/user/user-group.js +94 -94
- package/dist/lib/user/user.js +446 -446
- package/dist/lib/util/encrypt-utils.js +19 -19
- package/dist/lib/util/math-utils.js +40 -40
- 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 +94 -94
- package/package.json +1 -1
|
@@ -1,112 +1,112 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ProgramKey = void 0;
|
|
13
|
-
const api_1 = require("../api/api");
|
|
14
|
-
/**
|
|
15
|
-
* Describes the "Program Key" concept within Bruce.
|
|
16
|
-
* A program key is an access token for an arbitrary software.
|
|
17
|
-
*/
|
|
18
|
-
var ProgramKey;
|
|
19
|
-
(function (ProgramKey) {
|
|
20
|
-
function GetCacheKey(programId) {
|
|
21
|
-
return api_1.Api.ECacheKey.ProgramKey + api_1.Api.ECacheKey.Id + programId;
|
|
22
|
-
}
|
|
23
|
-
ProgramKey.GetCacheKey = GetCacheKey;
|
|
24
|
-
function GetListCacheKey() {
|
|
25
|
-
return api_1.Api.ECacheKey.ProgramKey;
|
|
26
|
-
}
|
|
27
|
-
ProgramKey.GetListCacheKey = GetListCacheKey;
|
|
28
|
-
let EProgramId;
|
|
29
|
-
(function (EProgramId) {
|
|
30
|
-
EProgramId["CesiumIon"] = "CesiumIon";
|
|
31
|
-
EProgramId["BingMaps"] = "BingMaps";
|
|
32
|
-
EProgramId["Mapbox"] = "Mapbox";
|
|
33
|
-
})(EProgramId = ProgramKey.EProgramId || (ProgramKey.EProgramId = {}));
|
|
34
|
-
function Get(params) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const { api, programId, req: reqParams } = params;
|
|
37
|
-
if (!programId) {
|
|
38
|
-
throw ("Program ID is required.");
|
|
39
|
-
}
|
|
40
|
-
const key = GetCacheKey(programId);
|
|
41
|
-
const cacheData = api.GetCacheItem(key, reqParams);
|
|
42
|
-
if (cacheData) {
|
|
43
|
-
return cacheData;
|
|
44
|
-
}
|
|
45
|
-
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
try {
|
|
47
|
-
const data = yield api.GET(`programkey/${programId}`, api_1.Api.PrepReqParams(reqParams));
|
|
48
|
-
res({
|
|
49
|
-
programKey: data
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
rej(e);
|
|
54
|
-
}
|
|
55
|
-
}));
|
|
56
|
-
api.Cache.Set(key, prom, api_1.Api.DEFAULT_CACHE_DURATION);
|
|
57
|
-
return prom;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
ProgramKey.Get = Get;
|
|
61
|
-
function GetList(params) {
|
|
62
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
const { api, req: reqParams } = params;
|
|
64
|
-
const cacheData = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
65
|
-
if (cacheData) {
|
|
66
|
-
return cacheData;
|
|
67
|
-
}
|
|
68
|
-
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
try {
|
|
70
|
-
const data = yield api.GET("programkeys", api_1.Api.PrepReqParams(reqParams));
|
|
71
|
-
res({
|
|
72
|
-
programKeys: data.Items
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
catch (e) {
|
|
76
|
-
rej(e);
|
|
77
|
-
}
|
|
78
|
-
}));
|
|
79
|
-
api.Cache.Set(GetListCacheKey(), req, api_1.Api.DEFAULT_CACHE_DURATION);
|
|
80
|
-
return req;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
ProgramKey.GetList = GetList;
|
|
84
|
-
function Delete(params) {
|
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
const { api, programId, req: reqParams } = params;
|
|
87
|
-
if (!programId) {
|
|
88
|
-
throw ("Program ID is required.");
|
|
89
|
-
}
|
|
90
|
-
yield api.DELETE(`programkey/${programId}`, api_1.Api.PrepReqParams(reqParams));
|
|
91
|
-
api.Cache.Remove(GetCacheKey(programId));
|
|
92
|
-
api.Cache.Remove(GetListCacheKey());
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
ProgramKey.Delete = Delete;
|
|
96
|
-
function Update(params) {
|
|
97
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const { api, programKey: data, req: reqParams } = params;
|
|
99
|
-
if (!(data === null || data === void 0 ? void 0 : data.ProgramId)) {
|
|
100
|
-
throw ("Program ID is required.");
|
|
101
|
-
}
|
|
102
|
-
const res = yield api.POST("programkey", data, api_1.Api.PrepReqParams(reqParams));
|
|
103
|
-
api.Cache.Remove(GetCacheKey(data.ProgramId));
|
|
104
|
-
api.Cache.Remove(GetListCacheKey());
|
|
105
|
-
return {
|
|
106
|
-
programKey: res
|
|
107
|
-
};
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
ProgramKey.Update = Update;
|
|
111
|
-
})(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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProgramKey = void 0;
|
|
13
|
+
const api_1 = require("../api/api");
|
|
14
|
+
/**
|
|
15
|
+
* Describes the "Program Key" concept within Bruce.
|
|
16
|
+
* A program key is an access token for an arbitrary software.
|
|
17
|
+
*/
|
|
18
|
+
var ProgramKey;
|
|
19
|
+
(function (ProgramKey) {
|
|
20
|
+
function GetCacheKey(programId) {
|
|
21
|
+
return api_1.Api.ECacheKey.ProgramKey + api_1.Api.ECacheKey.Id + programId;
|
|
22
|
+
}
|
|
23
|
+
ProgramKey.GetCacheKey = GetCacheKey;
|
|
24
|
+
function GetListCacheKey() {
|
|
25
|
+
return api_1.Api.ECacheKey.ProgramKey;
|
|
26
|
+
}
|
|
27
|
+
ProgramKey.GetListCacheKey = GetListCacheKey;
|
|
28
|
+
let EProgramId;
|
|
29
|
+
(function (EProgramId) {
|
|
30
|
+
EProgramId["CesiumIon"] = "CesiumIon";
|
|
31
|
+
EProgramId["BingMaps"] = "BingMaps";
|
|
32
|
+
EProgramId["Mapbox"] = "Mapbox";
|
|
33
|
+
})(EProgramId = ProgramKey.EProgramId || (ProgramKey.EProgramId = {}));
|
|
34
|
+
function Get(params) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const { api, programId, req: reqParams } = params;
|
|
37
|
+
if (!programId) {
|
|
38
|
+
throw ("Program ID is required.");
|
|
39
|
+
}
|
|
40
|
+
const key = GetCacheKey(programId);
|
|
41
|
+
const cacheData = api.GetCacheItem(key, reqParams);
|
|
42
|
+
if (cacheData) {
|
|
43
|
+
return cacheData;
|
|
44
|
+
}
|
|
45
|
+
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
try {
|
|
47
|
+
const data = yield api.GET(`programkey/${programId}`, api_1.Api.PrepReqParams(reqParams));
|
|
48
|
+
res({
|
|
49
|
+
programKey: data
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
rej(e);
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
api.Cache.Set(key, prom, api_1.Api.DEFAULT_CACHE_DURATION);
|
|
57
|
+
return prom;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
ProgramKey.Get = Get;
|
|
61
|
+
function GetList(params) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const { api, req: reqParams } = params;
|
|
64
|
+
const cacheData = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
65
|
+
if (cacheData) {
|
|
66
|
+
return cacheData;
|
|
67
|
+
}
|
|
68
|
+
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
try {
|
|
70
|
+
const data = yield api.GET("programkeys", api_1.Api.PrepReqParams(reqParams));
|
|
71
|
+
res({
|
|
72
|
+
programKeys: data.Items
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch (e) {
|
|
76
|
+
rej(e);
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
api.Cache.Set(GetListCacheKey(), req, api_1.Api.DEFAULT_CACHE_DURATION);
|
|
80
|
+
return req;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
ProgramKey.GetList = GetList;
|
|
84
|
+
function Delete(params) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
const { api, programId, req: reqParams } = params;
|
|
87
|
+
if (!programId) {
|
|
88
|
+
throw ("Program ID is required.");
|
|
89
|
+
}
|
|
90
|
+
yield api.DELETE(`programkey/${programId}`, api_1.Api.PrepReqParams(reqParams));
|
|
91
|
+
api.Cache.Remove(GetCacheKey(programId));
|
|
92
|
+
api.Cache.Remove(GetListCacheKey());
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
ProgramKey.Delete = Delete;
|
|
96
|
+
function Update(params) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const { api, programKey: data, req: reqParams } = params;
|
|
99
|
+
if (!(data === null || data === void 0 ? void 0 : data.ProgramId)) {
|
|
100
|
+
throw ("Program ID is required.");
|
|
101
|
+
}
|
|
102
|
+
const res = yield api.POST("programkey", data, api_1.Api.PrepReqParams(reqParams));
|
|
103
|
+
api.Cache.Remove(GetCacheKey(data.ProgramId));
|
|
104
|
+
api.Cache.Remove(GetListCacheKey());
|
|
105
|
+
return {
|
|
106
|
+
programKey: res
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
ProgramKey.Update = Update;
|
|
111
|
+
})(ProgramKey = exports.ProgramKey || (exports.ProgramKey = {}));
|
|
112
112
|
//# sourceMappingURL=program-key.js.map
|
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MenuItem = void 0;
|
|
4
|
-
const tileset_1 = require("../tileset/tileset");
|
|
5
|
-
const object_utils_1 = require("../util/object-utils");
|
|
6
|
-
const 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
|
-
let 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"] = "ArbitraryTileset";
|
|
22
|
-
EType["IonTileset"] = "Cesium3DTileset";
|
|
23
|
-
EType["Kml"] = "StaticKML";
|
|
24
|
-
EType["EntityTileset"] = "EntitiesTileset";
|
|
25
|
-
EType["EntityRaster"] = "RasterEntitiesTileset";
|
|
26
|
-
EType["PointCloud"] = "PointCloudTileset";
|
|
27
|
-
EType["EntitiesLoaded"] = "LoadedEntities";
|
|
28
|
-
EType["EntitiesIds"] = "EntitiesIds";
|
|
29
|
-
EType["Relations"] = "Relations";
|
|
30
|
-
})(EType = MenuItem.EType || (MenuItem.EType = {}));
|
|
31
|
-
function CreateFromEntityId(entityId, typeId, styleId) {
|
|
32
|
-
return {
|
|
33
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
34
|
-
Type: EType.Entity,
|
|
35
|
-
Caption: "Generated Entity Menu Item",
|
|
36
|
-
BruceEntity: {
|
|
37
|
-
"EntityType.ID": typeId,
|
|
38
|
-
EntityId: entityId
|
|
39
|
-
},
|
|
40
|
-
CameraZoomSettings: [
|
|
41
|
-
{
|
|
42
|
-
DisplayType: zoom_control_1.ZoomControl.EDisplayType.Model3D,
|
|
43
|
-
MaxZoom: 8000,
|
|
44
|
-
MinZoom: 0,
|
|
45
|
-
StyleID: styleId
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
MenuItem.CreateFromEntityId = CreateFromEntityId;
|
|
51
|
-
function CreateFromTypeId(typeId, styleId) {
|
|
52
|
-
return {
|
|
53
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
54
|
-
Type: EType.Entities,
|
|
55
|
-
Caption: "Generated Entity Type Menu Item",
|
|
56
|
-
BruceEntity: {
|
|
57
|
-
"EntityType.ID": typeId
|
|
58
|
-
},
|
|
59
|
-
CameraZoomSettings: [
|
|
60
|
-
{
|
|
61
|
-
DisplayType: zoom_control_1.ZoomControl.EDisplayType.Model3D,
|
|
62
|
-
MaxZoom: 8000,
|
|
63
|
-
MinZoom: 0,
|
|
64
|
-
StyleID: styleId
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
MenuItem.CreateFromTypeId = CreateFromTypeId;
|
|
70
|
-
function CreateFromTilesetId(tilesetId, type) {
|
|
71
|
-
if (type === tileset_1.Tileset.EType.Cad) {
|
|
72
|
-
return {
|
|
73
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
74
|
-
Type: EType.CadTileset,
|
|
75
|
-
Caption: "Generated CAD Menu Item",
|
|
76
|
-
FlyTo: false,
|
|
77
|
-
tileset: {
|
|
78
|
-
TilesetID: tilesetId
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
else if (type == tileset_1.Tileset.EType.EntitiesSet) {
|
|
83
|
-
return {
|
|
84
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
85
|
-
Type: EType.EntityTileset,
|
|
86
|
-
Caption: "Generated Entities Menu Item",
|
|
87
|
-
FlyTo: false,
|
|
88
|
-
tileset: {
|
|
89
|
-
TilesetID: tilesetId
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
else if (type == tileset_1.Tileset.EType.PointCloud) {
|
|
94
|
-
return {
|
|
95
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
96
|
-
Type: EType.PointCloud,
|
|
97
|
-
Caption: "Generated Point Cloud Menu Item",
|
|
98
|
-
FlyTo: false,
|
|
99
|
-
tileset: {
|
|
100
|
-
TilesetID: tilesetId
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
else if (type == tileset_1.Tileset.EType.EntitiesMap) {
|
|
105
|
-
return {
|
|
106
|
-
id: object_utils_1.ObjectUtils.UId(),
|
|
107
|
-
Type: EType.EntityRaster,
|
|
108
|
-
Caption: "Generated Entities Menu Item",
|
|
109
|
-
tileset: {
|
|
110
|
-
TilesetID: tilesetId
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
throw ("Tileset type not supported.");
|
|
115
|
-
}
|
|
116
|
-
MenuItem.CreateFromTilesetId = CreateFromTilesetId;
|
|
117
|
-
let Item;
|
|
118
|
-
(function (Item) {
|
|
119
|
-
;
|
|
120
|
-
})(Item = MenuItem.Item || (MenuItem.Item = {}));
|
|
121
|
-
})(MenuItem = exports.MenuItem || (exports.MenuItem = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MenuItem = void 0;
|
|
4
|
+
const tileset_1 = require("../tileset/tileset");
|
|
5
|
+
const object_utils_1 = require("../util/object-utils");
|
|
6
|
+
const 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
|
+
let 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"] = "ArbitraryTileset";
|
|
22
|
+
EType["IonTileset"] = "Cesium3DTileset";
|
|
23
|
+
EType["Kml"] = "StaticKML";
|
|
24
|
+
EType["EntityTileset"] = "EntitiesTileset";
|
|
25
|
+
EType["EntityRaster"] = "RasterEntitiesTileset";
|
|
26
|
+
EType["PointCloud"] = "PointCloudTileset";
|
|
27
|
+
EType["EntitiesLoaded"] = "LoadedEntities";
|
|
28
|
+
EType["EntitiesIds"] = "EntitiesIds";
|
|
29
|
+
EType["Relations"] = "Relations";
|
|
30
|
+
})(EType = MenuItem.EType || (MenuItem.EType = {}));
|
|
31
|
+
function CreateFromEntityId(entityId, typeId, styleId) {
|
|
32
|
+
return {
|
|
33
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
34
|
+
Type: EType.Entity,
|
|
35
|
+
Caption: "Generated Entity Menu Item",
|
|
36
|
+
BruceEntity: {
|
|
37
|
+
"EntityType.ID": typeId,
|
|
38
|
+
EntityId: entityId
|
|
39
|
+
},
|
|
40
|
+
CameraZoomSettings: [
|
|
41
|
+
{
|
|
42
|
+
DisplayType: zoom_control_1.ZoomControl.EDisplayType.Model3D,
|
|
43
|
+
MaxZoom: 8000,
|
|
44
|
+
MinZoom: 0,
|
|
45
|
+
StyleID: styleId
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
MenuItem.CreateFromEntityId = CreateFromEntityId;
|
|
51
|
+
function CreateFromTypeId(typeId, styleId) {
|
|
52
|
+
return {
|
|
53
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
54
|
+
Type: EType.Entities,
|
|
55
|
+
Caption: "Generated Entity Type Menu Item",
|
|
56
|
+
BruceEntity: {
|
|
57
|
+
"EntityType.ID": typeId
|
|
58
|
+
},
|
|
59
|
+
CameraZoomSettings: [
|
|
60
|
+
{
|
|
61
|
+
DisplayType: zoom_control_1.ZoomControl.EDisplayType.Model3D,
|
|
62
|
+
MaxZoom: 8000,
|
|
63
|
+
MinZoom: 0,
|
|
64
|
+
StyleID: styleId
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
MenuItem.CreateFromTypeId = CreateFromTypeId;
|
|
70
|
+
function CreateFromTilesetId(tilesetId, type) {
|
|
71
|
+
if (type === tileset_1.Tileset.EType.Cad) {
|
|
72
|
+
return {
|
|
73
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
74
|
+
Type: EType.CadTileset,
|
|
75
|
+
Caption: "Generated CAD Menu Item",
|
|
76
|
+
FlyTo: false,
|
|
77
|
+
tileset: {
|
|
78
|
+
TilesetID: tilesetId
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
else if (type == tileset_1.Tileset.EType.EntitiesSet) {
|
|
83
|
+
return {
|
|
84
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
85
|
+
Type: EType.EntityTileset,
|
|
86
|
+
Caption: "Generated Entities Menu Item",
|
|
87
|
+
FlyTo: false,
|
|
88
|
+
tileset: {
|
|
89
|
+
TilesetID: tilesetId
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
else if (type == tileset_1.Tileset.EType.PointCloud) {
|
|
94
|
+
return {
|
|
95
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
96
|
+
Type: EType.PointCloud,
|
|
97
|
+
Caption: "Generated Point Cloud Menu Item",
|
|
98
|
+
FlyTo: false,
|
|
99
|
+
tileset: {
|
|
100
|
+
TilesetID: tilesetId
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
else if (type == tileset_1.Tileset.EType.EntitiesMap) {
|
|
105
|
+
return {
|
|
106
|
+
id: object_utils_1.ObjectUtils.UId(),
|
|
107
|
+
Type: EType.EntityRaster,
|
|
108
|
+
Caption: "Generated Entities Menu Item",
|
|
109
|
+
tileset: {
|
|
110
|
+
TilesetID: tilesetId
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
throw ("Tileset type not supported.");
|
|
115
|
+
}
|
|
116
|
+
MenuItem.CreateFromTilesetId = CreateFromTilesetId;
|
|
117
|
+
let Item;
|
|
118
|
+
(function (Item) {
|
|
119
|
+
;
|
|
120
|
+
})(Item = MenuItem.Item || (MenuItem.Item = {}));
|
|
121
|
+
})(MenuItem = exports.MenuItem || (exports.MenuItem = {}));
|
|
122
122
|
//# sourceMappingURL=menu-item.js.map
|