leiting-bim 1.1.0 → 1.1.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/leitingbim.es.js +195 -39
- package/package.json +1 -1
- package/style.css +11 -11
package/leitingbim.es.js
CHANGED
|
@@ -199427,6 +199427,79 @@ function DxfParser(stream) {
|
|
|
199427
199427
|
layers2[layerName] = layer;
|
|
199428
199428
|
return layers2;
|
|
199429
199429
|
};
|
|
199430
|
+
var parseStyles = function() {
|
|
199431
|
+
var styles = {};
|
|
199432
|
+
var style = {};
|
|
199433
|
+
var styleName;
|
|
199434
|
+
log3.debug("Style {");
|
|
199435
|
+
curr = scanner.next();
|
|
199436
|
+
while (!groupIs(0, END_OF_TABLE_VALUE)) {
|
|
199437
|
+
switch (curr.code) {
|
|
199438
|
+
case 100:
|
|
199439
|
+
style.subClassMarker = curr.value;
|
|
199440
|
+
curr = scanner.next();
|
|
199441
|
+
break;
|
|
199442
|
+
case 2:
|
|
199443
|
+
style.styleName = curr.value;
|
|
199444
|
+
styleName = curr.value;
|
|
199445
|
+
curr = scanner.next();
|
|
199446
|
+
break;
|
|
199447
|
+
case 70:
|
|
199448
|
+
style.standardFlag = curr.value;
|
|
199449
|
+
curr = scanner.next();
|
|
199450
|
+
break;
|
|
199451
|
+
case 40:
|
|
199452
|
+
style.fixedTextHeight = curr.value;
|
|
199453
|
+
curr = scanner.next();
|
|
199454
|
+
break;
|
|
199455
|
+
case 41:
|
|
199456
|
+
style.widthFactor = curr.value;
|
|
199457
|
+
curr = scanner.next();
|
|
199458
|
+
break;
|
|
199459
|
+
case 50:
|
|
199460
|
+
style.obliqueAngle = curr.value;
|
|
199461
|
+
curr = scanner.next();
|
|
199462
|
+
break;
|
|
199463
|
+
case 71:
|
|
199464
|
+
style.textGenerationFlag = curr.value;
|
|
199465
|
+
curr = scanner.next();
|
|
199466
|
+
break;
|
|
199467
|
+
case 42:
|
|
199468
|
+
style.lastHeight = curr.value;
|
|
199469
|
+
curr = scanner.next();
|
|
199470
|
+
break;
|
|
199471
|
+
case 3:
|
|
199472
|
+
style.font = curr.value;
|
|
199473
|
+
curr = scanner.next();
|
|
199474
|
+
break;
|
|
199475
|
+
case 4:
|
|
199476
|
+
style.bigFont = curr.value;
|
|
199477
|
+
curr = scanner.next();
|
|
199478
|
+
break;
|
|
199479
|
+
case 1071:
|
|
199480
|
+
style.extendedFont = curr.value;
|
|
199481
|
+
curr = scanner.next();
|
|
199482
|
+
break;
|
|
199483
|
+
case 0:
|
|
199484
|
+
if (curr.value === "STYLE") {
|
|
199485
|
+
log3.debug("}");
|
|
199486
|
+
styles[styleName] = style;
|
|
199487
|
+
log3.debug("Style {");
|
|
199488
|
+
style = {};
|
|
199489
|
+
styleName = void 0;
|
|
199490
|
+
curr = scanner.next();
|
|
199491
|
+
}
|
|
199492
|
+
break;
|
|
199493
|
+
default:
|
|
199494
|
+
logUnhandledGroup(curr);
|
|
199495
|
+
curr = scanner.next();
|
|
199496
|
+
break;
|
|
199497
|
+
}
|
|
199498
|
+
}
|
|
199499
|
+
log3.debug("}");
|
|
199500
|
+
styles[styleName] = style;
|
|
199501
|
+
return styles;
|
|
199502
|
+
};
|
|
199430
199503
|
var tableDefinitions = {
|
|
199431
199504
|
VPORT: {
|
|
199432
199505
|
tableRecordsProperty: "viewPorts",
|
|
@@ -199445,6 +199518,12 @@ function DxfParser(stream) {
|
|
|
199445
199518
|
tableName: "layer",
|
|
199446
199519
|
dxfSymbolName: "LAYER",
|
|
199447
199520
|
parseTableRecords: parseLayers
|
|
199521
|
+
},
|
|
199522
|
+
STYLE: {
|
|
199523
|
+
tableRecordsProperty: "styles",
|
|
199524
|
+
tableName: "style",
|
|
199525
|
+
dxfSymbolName: "STYLE",
|
|
199526
|
+
parseTableRecords: parseStyles
|
|
199448
199527
|
}
|
|
199449
199528
|
};
|
|
199450
199529
|
var parseEntities = function(forBlock) {
|
|
@@ -200405,7 +200484,7 @@ function DxfParser(stream) {
|
|
|
200405
200484
|
};
|
|
200406
200485
|
var parseTEXT = function() {
|
|
200407
200486
|
var entity;
|
|
200408
|
-
entity = { type: curr.value };
|
|
200487
|
+
entity = { type: curr.value, textStyle: "STANDARD" };
|
|
200409
200488
|
curr = scanner.next();
|
|
200410
200489
|
while (curr !== "EOF") {
|
|
200411
200490
|
if (curr.code === 0) break;
|
|
@@ -200432,6 +200511,10 @@ function DxfParser(stream) {
|
|
|
200432
200511
|
entity.text = curr.value;
|
|
200433
200512
|
curr = scanner.next();
|
|
200434
200513
|
break;
|
|
200514
|
+
case 7:
|
|
200515
|
+
entity.textStyle = curr.value;
|
|
200516
|
+
curr = scanner.next();
|
|
200517
|
+
break;
|
|
200435
200518
|
case 72:
|
|
200436
200519
|
entity.halign = curr.value;
|
|
200437
200520
|
curr = scanner.next();
|
|
@@ -223908,6 +223991,9 @@ function getUnitScaleToMeter(insUnits) {
|
|
|
223908
223991
|
}
|
|
223909
223992
|
}
|
|
223910
223993
|
function wrapLine(line2, maxChars) {
|
|
223994
|
+
if (line2.length === 0) {
|
|
223995
|
+
return [""];
|
|
223996
|
+
}
|
|
223911
223997
|
const result = [];
|
|
223912
223998
|
let currentLine = line2;
|
|
223913
223999
|
while (currentLine.length > maxChars) {
|
|
@@ -223979,12 +224065,20 @@ function convertHatchToPolygon(entity) {
|
|
|
223979
224065
|
return { type: "MultiPolygon", coordinates: multi };
|
|
223980
224066
|
}
|
|
223981
224067
|
function extractText(dxfString) {
|
|
223982
|
-
|
|
223983
|
-
|
|
223984
|
-
|
|
223985
|
-
|
|
223986
|
-
|
|
223987
|
-
|
|
224068
|
+
if (!dxfString) return "";
|
|
224069
|
+
let text2 = dxfString;
|
|
224070
|
+
text2 = text2.replace(/\\P/g, "\n");
|
|
224071
|
+
text2 = text2.replace(/\\[ACFfHQTWp][^;]*;/g, "");
|
|
224072
|
+
text2 = text2.replace(/\\S([^;]*);/g, (match2, p1) => {
|
|
224073
|
+
return p1.replace(/[\^#]/g, "/");
|
|
224074
|
+
});
|
|
224075
|
+
text2 = text2.replace(/\\[LOKlok]/g, "");
|
|
224076
|
+
text2 = text2.replace(/\\~/g, " ");
|
|
224077
|
+
text2 = text2.replace(/\\\\/g, "\\");
|
|
224078
|
+
text2 = text2.replace(/\\{/g, "{");
|
|
224079
|
+
text2 = text2.replace(/\\}/g, "}");
|
|
224080
|
+
text2 = text2.replace(/[{}]/g, "");
|
|
224081
|
+
return text2.trim();
|
|
223988
224082
|
}
|
|
223989
224083
|
function convertCircleToLines(circle2, segments = 20) {
|
|
223990
224084
|
const lines_geojson = {
|
|
@@ -224237,15 +224331,14 @@ class BaseNormalDxfParse {
|
|
|
224237
224331
|
const min3 = dxf.header.$EXTMIN;
|
|
224238
224332
|
const max3 = dxf.header.$EXTMAX;
|
|
224239
224333
|
if (dxf.header.$INSUNITS === 0) {
|
|
224240
|
-
if (max3.x - min3.x >
|
|
224334
|
+
if (max3.x - min3.x > 1e6) {
|
|
224335
|
+
unit_to_scale_text = 1e-4;
|
|
224336
|
+
} else if (max3.x - min3.x > 1e5) {
|
|
224241
224337
|
unit_to_scale_text = 1e-3;
|
|
224242
224338
|
} else if (max3.x - min3.x < 1e4) {
|
|
224243
|
-
unit_to_scale_text =
|
|
224339
|
+
unit_to_scale_text = 10;
|
|
224244
224340
|
}
|
|
224245
224341
|
}
|
|
224246
|
-
if (max3.x - min3.x > 1e5) {
|
|
224247
|
-
unit_to_scale_text = 1e-4;
|
|
224248
|
-
}
|
|
224249
224342
|
dxfModel2.unit = unit_to_scale_text;
|
|
224250
224343
|
const geojson = this.convertToDxf(modelId2, dxf, unit_to_scale_text);
|
|
224251
224344
|
const createdEntities = await this.drawGeoJsonLocal(
|
|
@@ -224293,7 +224386,7 @@ class BaseNormalDxfParse {
|
|
|
224293
224386
|
const gtype = feat.geometry.type;
|
|
224294
224387
|
const layerName = feat.properties && feat.properties.layer || "0";
|
|
224295
224388
|
if (!layerGroups[layerName])
|
|
224296
|
-
layerGroups[layerName] = { lineInstances: [], polygonInstances: [], points: [] };
|
|
224389
|
+
layerGroups[layerName] = { lineInstances: [], polygonInstances: [], points: [], pointPrimitives: [] };
|
|
224297
224390
|
if (gtype === "LineString" || gtype === "MultiLineString") {
|
|
224298
224391
|
const coordsArr = gtype === "LineString" ? [feat.geometry.coordinates] : feat.geometry.coordinates;
|
|
224299
224392
|
for (const coords of coordsArr) {
|
|
@@ -224338,7 +224431,7 @@ class BaseNormalDxfParse {
|
|
|
224338
224431
|
color: Cesium2.ColorGeometryInstanceAttribute.fromColor(
|
|
224339
224432
|
Cesium2.Color.fromCssColorString(
|
|
224340
224433
|
feat.properties && (feat.properties.FillColor || feat.properties.color) || "rgba(255,255,255,0.1)"
|
|
224341
|
-
).withAlpha(
|
|
224434
|
+
).withAlpha(1)
|
|
224342
224435
|
)
|
|
224343
224436
|
}
|
|
224344
224437
|
});
|
|
@@ -224360,6 +224453,14 @@ class BaseNormalDxfParse {
|
|
|
224360
224453
|
};
|
|
224361
224454
|
const newLongitude = origCoords[0] + (tvec.longitude || 0);
|
|
224362
224455
|
const newLatitude = origCoords[1] + (tvec.latitude || 0);
|
|
224456
|
+
const pointPos = localToWorld([newLongitude, newLatitude, 0]);
|
|
224457
|
+
layerGroups[layerName].points.push(pointPos);
|
|
224458
|
+
layerGroups[layerName].pointPrimitives.push({
|
|
224459
|
+
position: pointPos,
|
|
224460
|
+
color: Cesium2.Color.fromCssColorString(
|
|
224461
|
+
feat.properties && feat.properties.color || "#ffffff"
|
|
224462
|
+
)
|
|
224463
|
+
});
|
|
224363
224464
|
if ((feat == null ? void 0 : feat.properties) && feat.properties.text && typeof textToPolygonForLoader === "function") {
|
|
224364
224465
|
const textFeature = Object.assign({}, feat, {
|
|
224365
224466
|
geometry: { type: "Point", coordinates: [newLongitude, newLatitude] },
|
|
@@ -224391,7 +224492,7 @@ class BaseNormalDxfParse {
|
|
|
224391
224492
|
});
|
|
224392
224493
|
const ln = rf.properties && rf.properties.layer || layerName;
|
|
224393
224494
|
if (!layerGroups[ln])
|
|
224394
|
-
layerGroups[ln] = { lineInstances: [], polygonInstances: [], points: [] };
|
|
224495
|
+
layerGroups[ln] = { lineInstances: [], polygonInstances: [], points: [], pointPrimitives: [] };
|
|
224395
224496
|
layerGroups[ln].lineInstances.push(gi);
|
|
224396
224497
|
for (let i2 = 0; i2 < positions2.length; i2++)
|
|
224397
224498
|
layerGroups[ln].points.push(positions2[i2]);
|
|
@@ -224418,13 +224519,13 @@ class BaseNormalDxfParse {
|
|
|
224418
224519
|
color: Cesium2.ColorGeometryInstanceAttribute.fromColor(
|
|
224419
224520
|
Cesium2.Color.fromCssColorString(
|
|
224420
224521
|
rf.properties && (rf.properties.FillColor || rf.properties.color) || feat.properties && feat.properties.color || "#ffffff"
|
|
224421
|
-
).withAlpha(
|
|
224522
|
+
).withAlpha(1)
|
|
224422
224523
|
)
|
|
224423
224524
|
}
|
|
224424
224525
|
});
|
|
224425
224526
|
const ln = rf.properties && rf.properties.layer || layerName;
|
|
224426
224527
|
if (!layerGroups[ln])
|
|
224427
|
-
layerGroups[ln] = { lineInstances: [], polygonInstances: [], points: [] };
|
|
224528
|
+
layerGroups[ln] = { lineInstances: [], polygonInstances: [], points: [], pointPrimitives: [] };
|
|
224428
224529
|
layerGroups[ln].polygonInstances.push(gi);
|
|
224429
224530
|
for (let i2 = 0; i2 < outerPositions.length; i2++)
|
|
224430
224531
|
layerGroups[ln].points.push(outerPositions[i2]);
|
|
@@ -224444,7 +224545,7 @@ class BaseNormalDxfParse {
|
|
|
224444
224545
|
}
|
|
224445
224546
|
}
|
|
224446
224547
|
Object.keys(layerGroups).forEach((layer) => {
|
|
224447
|
-
var _a2, _b2, _c2, _d, _e, _f;
|
|
224548
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i;
|
|
224448
224549
|
const group = layerGroups[layer];
|
|
224449
224550
|
if (group.lineInstances.length) {
|
|
224450
224551
|
const linePrimitive = new Cesium2.Primitive({
|
|
@@ -224485,6 +224586,25 @@ class BaseNormalDxfParse {
|
|
|
224485
224586
|
})) == null ? void 0 : _e.properties) == null ? void 0 : _f.color) || "#ffffff";
|
|
224486
224587
|
this.mapLayers[modelId2][layer].push({ primitive: polygonPrimitive, color: layerColor });
|
|
224487
224588
|
}
|
|
224589
|
+
if (group.pointPrimitives && group.pointPrimitives.length) {
|
|
224590
|
+
const pointCollection = new Cesium2.PointPrimitiveCollection();
|
|
224591
|
+
group.pointPrimitives.forEach((p2) => {
|
|
224592
|
+
pointCollection.add({
|
|
224593
|
+
position: p2.position,
|
|
224594
|
+
color: p2.color,
|
|
224595
|
+
pixelSize: 5
|
|
224596
|
+
});
|
|
224597
|
+
});
|
|
224598
|
+
const layerState = this.layers.get(layer);
|
|
224599
|
+
pointCollection.show = !(layerState && layerState.visible === false);
|
|
224600
|
+
viewer.scene.primitives.add(pointCollection);
|
|
224601
|
+
if (!this.mapLayers[modelId2][layer]) this.mapLayers[modelId2][layer] = [];
|
|
224602
|
+
const layerColor = ((_i = (_h = (_g = geojson.features) == null ? void 0 : _g.find((f2) => {
|
|
224603
|
+
var _a3;
|
|
224604
|
+
return ((_a3 = f2.properties) == null ? void 0 : _a3.layer) === layer;
|
|
224605
|
+
})) == null ? void 0 : _h.properties) == null ? void 0 : _i.color) || "#ffffff";
|
|
224606
|
+
this.mapLayers[modelId2][layer].push({ primitive: pointCollection, color: layerColor });
|
|
224607
|
+
}
|
|
224488
224608
|
});
|
|
224489
224609
|
const points2 = [];
|
|
224490
224610
|
Object.keys(layerGroups).forEach((layer) => {
|
|
@@ -225330,7 +225450,6 @@ class BaseNormalDxfParse {
|
|
|
225330
225450
|
if (!insertEntity.name || !dxf2.blocks || !dxf2.blocks[insertEntity.name]) return;
|
|
225331
225451
|
const block = dxf2.blocks[insertEntity.name];
|
|
225332
225452
|
if (!block || !block.entities) return;
|
|
225333
|
-
const insertLayerName = isNested ? insertEntity.layer : null;
|
|
225334
225453
|
insertEntity.position || {};
|
|
225335
225454
|
const insXScale = typeof insertEntity.xScale === "number" ? insertEntity.xScale : 1;
|
|
225336
225455
|
const insYScale = typeof insertEntity.yScale === "number" ? insertEntity.yScale : 1;
|
|
@@ -225338,7 +225457,10 @@ class BaseNormalDxfParse {
|
|
|
225338
225457
|
const insRotation = typeof insertEntity.rotation === "number" ? insertEntity.rotation : 0;
|
|
225339
225458
|
const insMirror = !!insertEntity.extrusionDirection && insertEntity.extrusionDirection.z < 0;
|
|
225340
225459
|
const currentScale = parentScale * insXScale;
|
|
225341
|
-
|
|
225460
|
+
let currentRotation = parentRotation + insRotation;
|
|
225461
|
+
if (insXScale < 0) {
|
|
225462
|
+
currentRotation += 180;
|
|
225463
|
+
}
|
|
225342
225464
|
const transformPointWithInsert = (x2, y2) => {
|
|
225343
225465
|
const blockPos = block.position || { x: 0, y: 0 };
|
|
225344
225466
|
const relX = x2 - blockPos.x;
|
|
@@ -225368,6 +225490,7 @@ class BaseNormalDxfParse {
|
|
|
225368
225490
|
};
|
|
225369
225491
|
block.entities.forEach((_blockEntity) => {
|
|
225370
225492
|
var _a2, _b2, _c2, _d, _e, _f;
|
|
225493
|
+
const insertLayerName = _blockEntity.layer == 0 ? insertEntity.layer : null;
|
|
225371
225494
|
if (_blockEntity.type === "INSERT") {
|
|
225372
225495
|
processInsert(
|
|
225373
225496
|
_blockEntity,
|
|
@@ -225886,7 +226009,7 @@ class BaseNormalDxfParse {
|
|
|
225886
226009
|
}
|
|
225887
226010
|
}
|
|
225888
226011
|
dxf.entities.forEach((entity) => {
|
|
225889
|
-
var _a2, _b2, _c2, _d, _e, _f, _g, _h;
|
|
226012
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i;
|
|
225890
226013
|
if (!this._FilterEntity(entity)) return;
|
|
225891
226014
|
const layerColor = layerColors[entity.layer] || "#ffffff";
|
|
225892
226015
|
let geometry;
|
|
@@ -226081,6 +226204,13 @@ class BaseNormalDxfParse {
|
|
|
226081
226204
|
type: "Point",
|
|
226082
226205
|
coordinates: [entity.startPoint.x, entity.startPoint.y]
|
|
226083
226206
|
};
|
|
226207
|
+
let _geometry = null;
|
|
226208
|
+
if (entity.endPoint) {
|
|
226209
|
+
_geometry = {
|
|
226210
|
+
type: "Point",
|
|
226211
|
+
coordinates: [entity.endPoint.x, entity.endPoint.y]
|
|
226212
|
+
};
|
|
226213
|
+
}
|
|
226084
226214
|
attachmentPoint = "bottom-left";
|
|
226085
226215
|
if (entity.halign && entity.valign) {
|
|
226086
226216
|
attachmentPoint = getGeoJSONAnchor(entity.halign, entity.valign);
|
|
@@ -226089,6 +226219,14 @@ class BaseNormalDxfParse {
|
|
|
226089
226219
|
if (entity.rotation) {
|
|
226090
226220
|
rotation2 = entity.rotation;
|
|
226091
226221
|
}
|
|
226222
|
+
let heightScale = 1;
|
|
226223
|
+
if (entity.endPoint) {
|
|
226224
|
+
const dx = entity.endPoint.x - entity.startPoint.x;
|
|
226225
|
+
const dy = entity.endPoint.y - entity.startPoint.y;
|
|
226226
|
+
const dist2 = Math.sqrt(dx * dx + dy * dy);
|
|
226227
|
+
const baseWidth = 680;
|
|
226228
|
+
heightScale = dist2 / entity.text.length / baseWidth;
|
|
226229
|
+
}
|
|
226092
226230
|
entities.push({
|
|
226093
226231
|
type: "Feature",
|
|
226094
226232
|
geometry,
|
|
@@ -226103,6 +226241,22 @@ class BaseNormalDxfParse {
|
|
|
226103
226241
|
lineType: dxf.tables.lineType.lineTypes[((_d = entity.lineType) == null ? void 0 : _d.toLocaleUpperCase()) || `BYBLOCK`]
|
|
226104
226242
|
}
|
|
226105
226243
|
});
|
|
226244
|
+
if (_geometry) {
|
|
226245
|
+
entities.push({
|
|
226246
|
+
type: "Feature",
|
|
226247
|
+
geometry: _geometry,
|
|
226248
|
+
properties: {
|
|
226249
|
+
layer: entity.layer,
|
|
226250
|
+
color: this.intToHexColor(this._GetEntityColor(entity)),
|
|
226251
|
+
text: "1",
|
|
226252
|
+
height: entity.textHeight * heightScale || entity.height,
|
|
226253
|
+
attachmentPoint,
|
|
226254
|
+
rotation: 360 - rotation2,
|
|
226255
|
+
lineWeight: lineWeight2,
|
|
226256
|
+
lineType: dxf.tables.lineType.lineTypes[((_e = entity.lineType) == null ? void 0 : _e.toLocaleUpperCase()) || `BYBLOCK`]
|
|
226257
|
+
}
|
|
226258
|
+
});
|
|
226259
|
+
}
|
|
226106
226260
|
return;
|
|
226107
226261
|
case "MTEXT":
|
|
226108
226262
|
attachmentPoint = "top-left";
|
|
@@ -226318,7 +226472,7 @@ class BaseNormalDxfParse {
|
|
|
226318
226472
|
FillColor: this.intToHexColor(this._GetEntityColor(entity)),
|
|
226319
226473
|
lineWeight: lineWeight2,
|
|
226320
226474
|
fill: true,
|
|
226321
|
-
lineType: dxf.tables.lineType.lineTypes[((
|
|
226475
|
+
lineType: dxf.tables.lineType.lineTypes[((_f = entity.lineType) == null ? void 0 : _f.toLocaleUpperCase()) || `BYBLOCK`]
|
|
226322
226476
|
}
|
|
226323
226477
|
});
|
|
226324
226478
|
}
|
|
@@ -226352,7 +226506,7 @@ class BaseNormalDxfParse {
|
|
|
226352
226506
|
color: this.intToHexColor(this._GetEntityColor(entity)),
|
|
226353
226507
|
FillColor: this.intToHexColor(this._GetEntityColor(entity)),
|
|
226354
226508
|
lineWeight: lineWeight2,
|
|
226355
|
-
lineType: dxf.tables.lineType.lineTypes[((
|
|
226509
|
+
lineType: dxf.tables.lineType.lineTypes[((_g = entity.lineType) == null ? void 0 : _g.toLocaleUpperCase()) || `BYBLOCK`]
|
|
226356
226510
|
}
|
|
226357
226511
|
});
|
|
226358
226512
|
return;
|
|
@@ -226384,7 +226538,7 @@ class BaseNormalDxfParse {
|
|
|
226384
226538
|
color: this.intToHexColor(this._GetEntityColor(entity)),
|
|
226385
226539
|
FillColor: this.intToHexColor(this._GetEntityColor(entity)),
|
|
226386
226540
|
lineWeight: entity.lineWeight,
|
|
226387
|
-
lineType: dxf.tables.lineType.lineTypes[((
|
|
226541
|
+
lineType: dxf.tables.lineType.lineTypes[((_h = entity.lineType) == null ? void 0 : _h.toLocaleUpperCase()) || "BYBLOCK"]
|
|
226388
226542
|
}
|
|
226389
226543
|
});
|
|
226390
226544
|
}
|
|
@@ -226401,7 +226555,7 @@ class BaseNormalDxfParse {
|
|
|
226401
226555
|
color: this.intToHexColor(this._GetEntityColor(entity)),
|
|
226402
226556
|
FillColor: this.intToHexColor(this._GetEntityColor(entity)),
|
|
226403
226557
|
lineWeight: lineWeight2,
|
|
226404
|
-
lineType: dxf.tables.lineType.lineTypes[((
|
|
226558
|
+
lineType: dxf.tables.lineType.lineTypes[((_i = entity.lineType) == null ? void 0 : _i.toLocaleUpperCase()) || `BYBLOCK`]
|
|
226405
226559
|
}
|
|
226406
226560
|
});
|
|
226407
226561
|
});
|
|
@@ -235197,12 +235351,13 @@ class BaseDxf {
|
|
|
235197
235351
|
this.viewer = viewer;
|
|
235198
235352
|
this.cesium = cesium;
|
|
235199
235353
|
}
|
|
235200
|
-
setRectangle(
|
|
235354
|
+
setRectangle(tileset) {
|
|
235201
235355
|
const Cesium2 = this.cesium;
|
|
235202
|
-
this.viewer.scene.
|
|
235356
|
+
this.viewer.scene.postProcessStages.fxaa.enabled = false;
|
|
235357
|
+
this.viewer.scene.globe.baseColor = this.cesium.Color.fromCssColorString("#000000");
|
|
235203
235358
|
this.viewer.scene.screenSpaceCameraController.zoomFactor = 10;
|
|
235204
235359
|
this.viewer.scene.screenSpaceCameraController.enableZoomInertia = false;
|
|
235205
|
-
this.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 0
|
|
235360
|
+
this.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 0;
|
|
235206
235361
|
this.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 1e6;
|
|
235207
235362
|
this.viewer.scene.screenSpaceCameraController.enableCollisionDetection = true;
|
|
235208
235363
|
this.viewer.imageryLayers.removeAll();
|
|
@@ -235330,7 +235485,7 @@ class BaseDxf {
|
|
|
235330
235485
|
const viewer = this.viewer;
|
|
235331
235486
|
const radius2 = ((_a2 = tileset.boundingSphere) == null ? void 0 : _a2.radius) || 1e3;
|
|
235332
235487
|
const opts = {
|
|
235333
|
-
offset: new Cesium2.HeadingPitchRange(0, -Math.PI / 2, radius2 *
|
|
235488
|
+
offset: new Cesium2.HeadingPitchRange(0, -Math.PI / 2, radius2 * 0.5)
|
|
235334
235489
|
};
|
|
235335
235490
|
const duration = opts.duration ?? 0;
|
|
235336
235491
|
viewer.flyTo(tileset, { duration, offset: opts.offset });
|
|
@@ -235373,15 +235528,12 @@ class BaseDxf {
|
|
|
235373
235528
|
if (this.renderGenAll !== startAllGen) return;
|
|
235374
235529
|
const startModelGen = this.renderGenByModel[file.modelId] || 0;
|
|
235375
235530
|
if ((this.renderGenByModel[file.modelId] || 0) !== startModelGen) return;
|
|
235376
|
-
|
|
235531
|
+
`${file.outPutPath}${file.dbName}/layerInfo.json`;
|
|
235377
235532
|
const tilesetUrl = `${file.outPutPath}${file.dbName}/tileset.json`;
|
|
235378
235533
|
const options2 = _options ? Object.assign(this.options, _options) : this.options;
|
|
235379
235534
|
try {
|
|
235380
|
-
|
|
235381
|
-
|
|
235382
|
-
const layerInfoZip = `${file.outPutPath}${file.dbName}/layerInfo.zip`;
|
|
235383
|
-
layerInfo = await this.loadModelFile(layerInfoZip);
|
|
235384
|
-
}
|
|
235535
|
+
const layerInfoZip = `${file.outPutPath}${file.dbName}/layerInfo.zip`;
|
|
235536
|
+
const layerInfo = await this.loadModelFile(layerInfoZip);
|
|
235385
235537
|
if (this.renderGenAll !== startAllGen) return;
|
|
235386
235538
|
if ((this.renderGenByModel[file.modelId] || 0) !== startModelGen) return;
|
|
235387
235539
|
const tileset = await this.cesium.Cesium3DTileset.fromUrl(tilesetUrl);
|
|
@@ -235422,7 +235574,7 @@ class BaseDxf {
|
|
|
235422
235574
|
const Cesium2 = this.cesium;
|
|
235423
235575
|
const radius2 = ((_a2 = tileset.boundingSphere) == null ? void 0 : _a2.radius) || 1e3;
|
|
235424
235576
|
this.flyToBounds(tileset, {
|
|
235425
|
-
offset: new Cesium2.HeadingPitchRange(0, -Math.PI / 2, radius2 *
|
|
235577
|
+
offset: new Cesium2.HeadingPitchRange(0, -Math.PI / 2, radius2 * 0.5)
|
|
235426
235578
|
});
|
|
235427
235579
|
}
|
|
235428
235580
|
} catch (error) {
|
|
@@ -285230,7 +285382,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
285230
285382
|
toggleCadCard,
|
|
285231
285383
|
showTianDiTuLayer,
|
|
285232
285384
|
loadAnnotations,
|
|
285233
|
-
saveAnnotations
|
|
285385
|
+
saveAnnotations,
|
|
285386
|
+
handleClearAnnotations
|
|
285234
285387
|
};
|
|
285235
285388
|
function changeShowGlobal(cesiumSceneConfig) {
|
|
285236
285389
|
baseViewerManagements.getBaseCesium().enableCesiumSceneConfig(cesiumSceneConfig);
|
|
@@ -285681,7 +285834,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
285681
285834
|
default: () => [createVNode$1("div", {
|
|
285682
285835
|
"ref": rootRef,
|
|
285683
285836
|
"class": "base-cx-BIM-gis",
|
|
285684
|
-
"style": cadLoading.value ? "background:#
|
|
285837
|
+
"style": cadLoading.value ? "background:#000000;" : "background: linear-gradient(0deg, #eef7ffff 0%, #b2daf4ff 70%, #8dbeddff 100%);"
|
|
285685
285838
|
}, [createVNode$1("div", {
|
|
285686
285839
|
"class": "selectionRectangle"
|
|
285687
285840
|
}, null), createVNode$1(_sfc_main$q, {
|
|
@@ -285903,7 +286056,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
285903
286056
|
});
|
|
285904
286057
|
}
|
|
285905
286058
|
});
|
|
285906
|
-
const BaseCxBImGis = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
286059
|
+
const BaseCxBImGis = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a0bcf5b0"]]);
|
|
285907
286060
|
function useCesium(options2) {
|
|
285908
286061
|
const CesiumRef = ref(null);
|
|
285909
286062
|
function register4(instance2) {
|
|
@@ -286435,6 +286588,9 @@ function useCesium(options2) {
|
|
|
286435
286588
|
},
|
|
286436
286589
|
saveAnnotations() {
|
|
286437
286590
|
return getCesiumInstance().saveAnnotations();
|
|
286591
|
+
},
|
|
286592
|
+
handleClearAnnotations() {
|
|
286593
|
+
return getCesiumInstance().handleClearAnnotations();
|
|
286438
286594
|
}
|
|
286439
286595
|
};
|
|
286440
286596
|
return [register4, methods];
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1668,7 +1668,7 @@
|
|
|
1668
1668
|
margin: 4px 0 0 0;
|
|
1669
1669
|
}
|
|
1670
1670
|
@item-hover-bg :rgba (255, 255, 255, 0.08);
|
|
1671
|
-
.base-cx-BIM-gis[data-v-
|
|
1671
|
+
.base-cx-BIM-gis[data-v-a0bcf5b0] {
|
|
1672
1672
|
background-size: cover;
|
|
1673
1673
|
/* 调整背景图片大小以填充整个元素 */
|
|
1674
1674
|
background-position: center;
|
|
@@ -1681,28 +1681,28 @@
|
|
|
1681
1681
|
overflow: hidden;
|
|
1682
1682
|
position: relative;
|
|
1683
1683
|
}
|
|
1684
|
-
.base-cx-BIM-gis .base-cx-BIM-gis[data-v-
|
|
1684
|
+
.base-cx-BIM-gis .base-cx-BIM-gis[data-v-a0bcf5b0] .cesium-widget, .base-cx-BIM-gis .base-cx-BIM-gis[data-v-a0bcf5b0] .cesium-viewer {
|
|
1685
1685
|
position: absolute;
|
|
1686
1686
|
inset: 0;
|
|
1687
1687
|
width: 100%;
|
|
1688
1688
|
height: 100%;
|
|
1689
1689
|
}
|
|
1690
|
-
.base-cx-BIM-gis .base-cx-BIM-gis[data-v-
|
|
1690
|
+
.base-cx-BIM-gis .base-cx-BIM-gis[data-v-a0bcf5b0] .cesium-widget canvas {
|
|
1691
1691
|
width: 100% !important;
|
|
1692
1692
|
height: 100% !important;
|
|
1693
1693
|
display: block;
|
|
1694
1694
|
touch-action: none;
|
|
1695
1695
|
}
|
|
1696
|
-
.base-cx-BIM-gis .base-cx-BIM-gis[data-v-
|
|
1696
|
+
.base-cx-BIM-gis .base-cx-BIM-gis[data-v-a0bcf5b0] .cesium-viewer-bottom, .base-cx-BIM-gis .base-cx-BIM-gis[data-v-a0bcf5b0] .cesium-viewer-animationContainer, .base-cx-BIM-gis .base-cx-BIM-gis[data-v-a0bcf5b0] .cesium-viewer-timelineContainer {
|
|
1697
1697
|
display: none;
|
|
1698
1698
|
}
|
|
1699
|
-
.base-cx-BIM-gis .base-cx-BIM-gis[data-v-
|
|
1699
|
+
.base-cx-BIM-gis .base-cx-BIM-gis[data-v-a0bcf5b0] .vc-viewer, .base-cx-BIM-gis .base-cx-BIM-gis[data-v-a0bcf5b0] .cesium-viewer {
|
|
1700
1700
|
position: absolute;
|
|
1701
1701
|
inset: 0;
|
|
1702
1702
|
width: 100%;
|
|
1703
1703
|
height: 100%;
|
|
1704
1704
|
}
|
|
1705
|
-
.base-cx-BIM-gis .LeiTingBIM[data-v-
|
|
1705
|
+
.base-cx-BIM-gis .LeiTingBIM[data-v-a0bcf5b0] {
|
|
1706
1706
|
background-size: cover;
|
|
1707
1707
|
/* 调整背景图片大小以填充整个元素 */
|
|
1708
1708
|
background-position: center;
|
|
@@ -1715,13 +1715,13 @@
|
|
|
1715
1715
|
overflow: hidden;
|
|
1716
1716
|
position: relative;
|
|
1717
1717
|
}
|
|
1718
|
-
.base-cx-BIM-gis .cadBackground[data-v-
|
|
1719
|
-
background: #
|
|
1718
|
+
.base-cx-BIM-gis .cadBackground[data-v-a0bcf5b0] {
|
|
1719
|
+
background: #000000;
|
|
1720
1720
|
}
|
|
1721
|
-
.base-cx-BIM-gis .tileBackground[data-v-
|
|
1721
|
+
.base-cx-BIM-gis .tileBackground[data-v-a0bcf5b0] {
|
|
1722
1722
|
background: linear-gradient(0deg, #eef7ffff 0%, #b2daf4ff 70%, #8dbeddff 100%);
|
|
1723
1723
|
}
|
|
1724
|
-
.base-cx-BIM-gis .context-menu ul[data-v-
|
|
1724
|
+
.base-cx-BIM-gis .context-menu ul[data-v-a0bcf5b0] {
|
|
1725
1725
|
background: rgba(5, 28, 51, 0.8);
|
|
1726
1726
|
border-radius: 2px;
|
|
1727
1727
|
-webkit-backdrop-filter: blur(5px);
|
|
@@ -1733,6 +1733,6 @@
|
|
|
1733
1733
|
color: #fff;
|
|
1734
1734
|
border-right: none;
|
|
1735
1735
|
}
|
|
1736
|
-
.base-cx-BIM-gis .context-menu ul li[data-v-
|
|
1736
|
+
.base-cx-BIM-gis .context-menu ul li[data-v-a0bcf5b0]:hover {
|
|
1737
1737
|
color: rgba(255, 255, 255, 0.6) !important;
|
|
1738
1738
|
}
|