fl-web-component 1.2.6 → 1.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";#fl-model[data-v-
|
|
1
|
+
@charset "UTF-8";#fl-model[data-v-9d23b864],#konva-container[data-v-1eba8e28]{width:100%;height:100%;cursor:pointer}#konva-container[data-v-1eba8e28]{z-index:3;overflow:hidden}span[data-v-f547d5c6]{font-weight:bolder}.text[data-v-f547d5c6]{margin-top:20px}.line[data-v-f547d5c6]{border-bottom:1px solid #dcdfe6;margin:20px 0}.center[data-v-f547d5c6]{display:flex;flex-direction:column;align-items:center}.center .cen span[data-v-f547d5c6],.center .top span[data-v-f547d5c6]{color:"#53a8ff";display:inline-block;width:30px;height:30px;text-align:center;line-height:30px;border:1px solid;padding:5px;margin-bottom:10px;background-color:#e9f3ff}.center .cen span[data-v-f547d5c6]{margin:10px}.button[data-v-f547d5c6]{display:flex;justify-content:end;margin-top:20px}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff2?t=1646635700216) format("woff2"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff?t=1646635700216) format("woff"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.ttf?t=1646635700216) format("truetype")}.iconfont[data-v-f547d5c6]{font-family:iconfont!important;font-size:50px;font-style:normal;color:"#53a8ff";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-shubiao[data-v-f547d5c6]:before{content:""}#svg-tigger[data-v-0ec35ee4]{cursor:pointer;height:100%;width:100%}
|
package/package.json
CHANGED
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
renderer.autoClearStencil = false;
|
|
169
169
|
},
|
|
170
170
|
initScene() {
|
|
171
|
-
|
|
171
|
+
modelGroup = new this.THREE.Group();
|
|
172
172
|
scene = new this.THREE.Scene();
|
|
173
173
|
},
|
|
174
174
|
initCamera() {
|
|
@@ -216,8 +216,7 @@
|
|
|
216
216
|
}
|
|
217
217
|
const { instances, drawObjs } = parseData(data);
|
|
218
218
|
if (instances.length > 0) {
|
|
219
|
-
modelGroup
|
|
220
|
-
modelGroup = handleInstancedMeshModel(
|
|
219
|
+
handleInstancedMeshModel(modelGroup,
|
|
221
220
|
instances,
|
|
222
221
|
drawObjs,
|
|
223
222
|
'',
|
|
@@ -269,6 +268,7 @@
|
|
|
269
268
|
});
|
|
270
269
|
// cameraControls.fitToSphere(scene, true); // TODO 待处理,先用 setModelCenter 进行定位
|
|
271
270
|
this.setModelCenter(modelGroup);
|
|
271
|
+
console.log(modelGroup)
|
|
272
272
|
this.$emit('modelLoaded')
|
|
273
273
|
// cameraControls.saveState();
|
|
274
274
|
}
|
|
@@ -669,10 +669,14 @@
|
|
|
669
669
|
},
|
|
670
670
|
// 删除场景中所有的实体
|
|
671
671
|
removeAll() {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
672
|
+
return new Promise((resolve) => {
|
|
673
|
+
if (scene) {
|
|
674
|
+
this.removeTraverse()
|
|
675
|
+
resolve()
|
|
676
|
+
} else {
|
|
677
|
+
resolve()
|
|
678
|
+
}
|
|
679
|
+
})
|
|
676
680
|
},
|
|
677
681
|
removeTraverse() {
|
|
678
682
|
let length = modelGroup.children.length
|
|
@@ -683,21 +687,22 @@
|
|
|
683
687
|
item.material.dispose();
|
|
684
688
|
item.geometry.dispose();
|
|
685
689
|
item.clear();
|
|
690
|
+
item.material = null;
|
|
691
|
+
item.geometry = null;
|
|
686
692
|
modelGroup.remove(item);
|
|
693
|
+
item = null;
|
|
687
694
|
}
|
|
688
695
|
});
|
|
689
696
|
modelGroup.remove(list);
|
|
690
697
|
this.removeTraverse();
|
|
691
698
|
} else {
|
|
692
699
|
// 在这里清除一些标记之类的
|
|
693
|
-
|
|
694
|
-
scene.remove(item)
|
|
695
|
-
})
|
|
700
|
+
modelGroup.clear();
|
|
696
701
|
scene.remove(modelGroup);
|
|
697
702
|
renderer.clear();
|
|
698
|
-
modelGroup = null
|
|
703
|
+
modelGroup = null;
|
|
704
|
+
modelGroup = new this.THREE.Group();
|
|
699
705
|
}
|
|
700
|
-
|
|
701
706
|
},
|
|
702
707
|
// 销毁场景 释放内存
|
|
703
708
|
destroyScene() {
|
|
@@ -26,6 +26,7 @@ let drawObjMapInstance = {};
|
|
|
26
26
|
* @param {Array} drawObjs - 绘制对象数组,包含几何数据
|
|
27
27
|
*/
|
|
28
28
|
function handleInstancedMeshModel(
|
|
29
|
+
modelGroup,
|
|
29
30
|
instances,
|
|
30
31
|
drawObjs,
|
|
31
32
|
type,
|
|
@@ -34,8 +35,9 @@ function handleInstancedMeshModel(
|
|
|
34
35
|
meshNameConfig,
|
|
35
36
|
customOpacity
|
|
36
37
|
) {
|
|
38
|
+
drawObjMapInstance = {};
|
|
37
39
|
// 第一阶段:构建实例映射表
|
|
38
|
-
let modelGroup = new THREE.Group();
|
|
40
|
+
// let modelGroup = new THREE.Group();
|
|
39
41
|
for (let i = 0; i < instances.length; i++) {
|
|
40
42
|
formatInstancedMap(instances[i], drawObjs);
|
|
41
43
|
}
|