gs-bim-air 1.6.1-beta.56 → 1.6.1-beta.57

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.
Files changed (85) hide show
  1. package/README.md +16 -1
  2. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//344/277/256/346/224/271/351/242/234/350/211/262.html +90 -85
  3. package/demo//344/272/213/344/273/266/346/223/215/344/275/234//345/212/250/347/224/273/346/214/211/351/222/256.html +133 -109
  4. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//346/227/213/350/275/254/345/271/263/347/247/273/347/274/251/346/224/276.html +115 -112
  5. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//346/236/204/344/273/266/351/232/220/350/227/217/345/274/272/350/260/203.html +113 -0
  6. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//350/256/276/347/275/256viewHouse.html +81 -80
  7. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//350/267/257/345/276/204/345/212/250/347/224/273.html +143 -144
  8. package/demo//346/250/241/345/236/213/345/212/250/347/224/273//350/267/257/345/276/204/346/274/253/346/270/270.html +105 -0
  9. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//346/212/225/345/275/261/346/226/271/345/274/217/345/217/230/345/214/226.html +90 -0
  10. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//346/230/276/347/244/272/347/233/270/346/234/272/345/217/202/346/225/260.html +101 -101
  11. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//351/224/201/345/256/232/347/233/270/346/234/272/350/247/206/350/247/222.html +96 -96
  12. package/demo//346/250/241/345/236/213/346/225/210/346/236/234/2D/347/203/255/345/212/233/345/233/276.html +69 -47
  13. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/210/206/346/256/265/346/237/223/350/211/262/346/225/210/346/236/234.html +87 -0
  14. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//345/233/264/345/242/231/346/211/253/346/217/217/346/225/210/346/236/234.html +1 -0
  15. package/demo//346/250/241/345/236/213/346/225/210/346/236/234//346/214/207/345/256/232/346/236/204/344/273/266/346/227/213/350/275/254.html +3 -2
  16. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/351/232/220/350/227/217/343/200/201/346/236/204/344/273/266/345/274/272/350/260/203.html +97 -110
  17. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//346/236/204/344/273/266/351/232/224/347/246/273.html +91 -83
  18. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/216/267/345/217/226/346/236/204/344/273/266/345/214/205/345/233/264/347/233/222.html +99 -47
  19. package/demo//347/273/223/346/236/204/346/240/221/344/270/216/346/236/204/344/273/266//350/256/276/347/275/256/346/250/241/345/236/213/351/242/234/350/211/262.html +43 -41
  20. package/docs/.vuepress/config.js +252 -145
  21. package/docs/.vuepress/styles/palette.styl +1 -1
  22. package/docs/README.md +41 -81
  23. package/docs/classes/Animation.RegionLimitEffect.md +84 -0
  24. package/docs/classes/Animation.RegionLimitEffectConfig.md +197 -0
  25. package/docs/classes/Animation.SkyboxEffect.md +1 -1
  26. package/docs/classes/ComponentSelector.md +1 -1
  27. package/docs/classes/Longan.Vector.md +17 -0
  28. package/docs/classes/Material.md +2 -2
  29. package/docs/interfaces/ToolbarVisible.md +7 -0
  30. package/docs/interfaces/ViewerOptions.md +3 -0
  31. package/docs/modules/Animation.md +2 -0
  32. package/docs/web/347/253/257//345/205/266/344/273/226-/344/272/213/344/273/266/347/233/221/345/220/254/357/274/210EventListener/357/274/211.md +139 -0
  33. package/docs/web/347/253/257//345/205/266/344/273/226-/346/235/220/350/264/250/357/274/210Material/357/274/211.md +350 -0
  34. package/docs/web/347/253/257//345/205/266/344/273/226-/346/236/204/344/273/266/351/200/211/346/213/251/345/231/250/357/274/210ComponentSelector/357/274/211.md +837 -0
  35. package/docs/web/347/253/257//345/205/266/344/273/226-/350/267/257/345/276/204/346/274/253/346/270/270/357/274/210PathRoam/357/274/211.md +186 -0
  36. package/docs/web/347/253/257//345/212/240/350/275/275-/347/233/270/346/234/272/357/274/210Camera/357/274/211.md +209 -0
  37. package/docs/web/347/253/257//345/212/240/350/275/275-/350/247/206/345/233/276/357/274/210Viewer/357/274/211.md +2272 -0
  38. package/docs/web/347/253/257//345/212/240/350/275/275-/350/247/206/347/202/271/351/235/242/346/235/277/357/274/210ViewPointPanel/357/274/211.md +394 -0
  39. package/docs/web/347/253/257//345/212/250/347/224/273-UV/346/225/210/346/236/234/357/274/210UvEffect/357/274/211.md +95 -0
  40. package/docs/web/347/253/257//345/212/250/347/224/273-/345/210/206/346/256/265/346/237/223/350/211/262/357/274/210RegionLimit/357/274/211.md +72 -0
  41. package/docs/web/347/253/257//345/212/250/347/224/273-/345/217/257/350/247/206/346/200/247/345/210/206/346/236/220/357/274/210SightlineAnalysis/357/274/211.md +81 -0
  42. package/docs/web/347/253/257//345/212/250/347/224/273-/345/233/264/345/242/231/357/274/210WallScan/357/274/211.md +64 -0
  43. package/docs/web/347/253/257//345/212/250/347/224/273-/345/241/253/346/214/226/346/226/271/345/210/206/346/236/220/357/274/210CutFillAnalysis/357/274/211.md +75 -0
  44. package/docs/web/347/253/257//345/212/250/347/224/273-/345/244/251/347/251/272/347/233/222/357/274/210Skybox/357/274/211.md +82 -0
  45. package/docs/web/347/253/257//345/212/250/347/224/273-/346/211/207/345/275/242/346/211/253/346/217/217/357/274/210FanScan/357/274/211.md +65 -0
  46. package/docs/web/347/253/257//345/212/250/347/224/273-/346/216/247/351/253/230/345/210/206/346/236/220/357/274/210HeightLimit/357/274/211.md +63 -0
  47. package/docs/web/347/253/257//345/212/250/347/224/273-/346/260/264/351/235/242/346/225/210/346/236/234/357/274/210WaterEffect/357/274/211.md +63 -0
  48. package/docs/web/347/253/257//345/212/250/347/224/273-/347/203/255/345/212/233/345/233/276/357/274/210HeatMap/357/274/211.md +64 -0
  49. package/docs/web/347/253/257//345/212/250/347/224/273-/347/253/213/344/275/223/351/224/232/347/202/271/357/274/210Anchor/357/274/211.md +100 -0
  50. package/docs/web/347/253/257//345/212/250/347/224/273-/350/201/232/345/205/211/347/201/257/357/274/210SpotLight/357/274/211.md +66 -0
  51. package/docs/web/347/253/257//345/212/250/347/224/273-/350/267/257/345/276/204/346/225/210/346/236/234/357/274/210PathEffect/357/274/211.md +108 -0
  52. package/docs/web/347/253/257//345/212/250/347/224/273-/351/233/252/345/244/251/357/274/210SnowEffect/357/274/211.md +60 -0
  53. package/docs/web/347/253/257//345/257/271/350/261/241-/346/240/221/350/212/202/347/202/271/345/257/271/350/261/241/357/274/210TreeNodeObject/357/274/211.md +353 -0
  54. package/docs/web/347/253/257//345/257/271/350/261/241-/346/250/241/345/236/213/350/212/202/347/202/271/345/257/271/350/261/241/357/274/210segmentObject/357/274/211.md +450 -0
  55. package/docs/web/347/253/257//345/257/271/350/261/241-/350/275/273/351/207/217/345/214/226/346/250/241/345/236/213/357/274/210lightModel/357/274/211.md +641 -0
  56. package/docs/web/347/253/257//345/257/271/350/261/241-/351/222/273/345/255/224/347/273/204/345/257/271/350/261/241/357/274/210BoreholeObjects/357/274/211.md +439 -0
  57. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/344/270/264/346/227/266/345/257/271/350/261/241/347/256/241/347/220/206/345/231/250/357/274/210TemporaryObjectManager/357/274/211.md +208 -0
  58. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/345/212/250/347/224/273/347/256/241/347/220/206/345/231/250/357/274/210AnimationManager/357/274/211.md +370 -0
  59. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/345/217/202/346/225/260/345/214/226/345/207/240/344/275/225/347/256/241/347/220/206/345/231/250/357/274/210ParametricGeometryManager/357/274/211.md +92 -0
  60. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/345/217/202/346/225/260/347/256/241/347/220/206/345/231/250/357/274/210ParameterManager/357/274/211.md +58 -0
  61. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/345/217/257/350/247/206/346/200/247/347/256/241/347/220/206/345/231/250/357/274/210InvisibleManager/357/274/211.md +149 -0
  62. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/345/261/236/346/200/247/347/256/241/347/220/206/345/231/250/357/274/210PropertyManager/357/274/211.md +153 -0
  63. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/346/235/220/350/264/250/347/256/241/347/220/206/345/231/250/357/274/210MaterialManager/357/274/211.md +131 -0
  64. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/346/236/204/344/273/266/347/256/241/347/220/206/345/231/250/357/274/210ComponentManager/357/274/211.md +56 -0
  65. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/347/273/223/346/236/204/346/240/221/347/256/241/347/220/206/345/231/250/357/274/210StructureTreeManager/357/274/211.md +157 -0
  66. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/351/200/211/346/213/251/347/256/241/347/220/206/345/231/250/357/274/210SelectionManager/357/274/211.md +191 -0
  67. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/351/232/224/347/246/273/347/256/241/347/220/206/345/231/250/357/274/210IsolationManager/357/274/211.md +147 -0
  68. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/351/235/242/346/235/277/347/256/241/347/220/206/345/231/250/357/274/210PanelManager/357/274/211.md +71 -0
  69. package/docs/web/347/253/257//347/256/241/347/220/206/345/231/250-/351/253/230/344/272/256/347/256/241/347/220/206/345/231/250/357/274/210HighlightManager/357/274/211.md +127 -0
  70. package/docs/web/347/253/257//351/205/215/347/275/256-/345/212/240/350/275/275/351/200/211/351/241/271/357/274/210LoaderOptions/357/274/211.md +57 -0
  71. package/docs/web/347/253/257//351/205/215/347/275/256-/346/230/276/347/244/272/350/276/271/346/241/206/357/274/210ShowBorder/357/274/211.md +32 -0
  72. package/docs/web/347/253/257//351/205/215/347/275/256-/350/247/206/345/233/276/351/200/211/351/241/271/357/274/210viewerOptions/357/274/211.md +144 -0
  73. package/lib/BimAir.common-report.html +2 -2
  74. package/lib/BimAir.common.js +116 -26
  75. package/lib/BimAir.css +139 -139
  76. package/lib/BimAir.umd-report.html +2 -2
  77. package/lib/BimAir.umd.js +116 -26
  78. package/lib/BimAir.umd.min-report.html +2 -2
  79. package/lib/BimAir.umd.min.js +116 -26
  80. package/lib/undefined.gzundefined +0 -0
  81. package/package.json +1 -1
  82. package/demo//346/250/241/345/236/213/344/272/244/344/272/222//351/232/220/350/227/217/345/274/272/350/260/203.html +0 -121
  83. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//347/201/214/346/265/206/347/263/273/347/273/237/346/216/245/345/217/243ByMCA.html +0 -189
  84. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//347/201/214/346/265/206/347/263/273/347/273/237/346/216/245/345/217/243Demo.html +0 -74
  85. package/demo//346/250/241/345/236/213/346/223/215/344/275/234//350/216/267/345/217/226/347/233/270/346/234/272/345/217/202/346/225/260.html +0 -110
package/README.md CHANGED
@@ -1,5 +1,20 @@
1
1
  ## 更新日志
2
2
 
3
+ ### 1.6.1-beta.57
4
+
5
+ > Longan 更新为 v1.6.1-beta.25
6
+
7
+ - fix: 修复剖切后模型没更新
8
+ - fix: 隐藏结构树上的天空盒节点
9
+ - fix: 修复元素剖切删除 viewPointStateObject 出错问题
10
+ - fix: 取消面积测量的几何不封闭判断
11
+
12
+ ---
13
+
14
+ - feat: 添加 esc 取消选中状态
15
+ - feat: setImageByFile 添加回调
16
+ - feat: 添加绘制信息功能,可显示页面帧率
17
+
3
18
  ### 1.6.1-beta.56
4
19
 
5
20
  - fix: segmentObject 的 size 只计算 TriangularShell
@@ -15,7 +30,7 @@
15
30
 
16
31
  - fix: 修复基本信息错乱问题
17
32
 
18
- ### 1.6.1-beta.53p
33
+ ### 1.6.1-beta.53
19
34
 
20
35
  - fix: 修改体积测量逻辑
21
36
  - fix: 修复切换模型后无法加载模型问题
@@ -1,95 +1,100 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <meta charset="UTF-8" />
5
- <title>修改颜色</title>
6
- <!-- demo的样式 -->
7
- <link rel="stylesheet" href="https://static.belife-bim.com/demo.css" />
8
- <link
9
- rel="stylesheet"
10
- href="https://static.belife-bim.com/bimAir/BimAir.css"
11
- />
12
- <script src="https://static.belife-bim.com/vue.min.js"></script>
13
- <script src="https://static.belife-bim.com/bimAir/BimAir.umd.min.js"></script>
14
- </head>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>修改颜色</title>
6
+ <!-- demo的样式 -->
7
+ <link rel="stylesheet" href="https://static.belife-bim.com/demo.css" />
8
+ <link
9
+ rel="stylesheet"
10
+ href="https://static.belife-bim.com/bimAir/BimAir.css"
11
+ />
12
+ <script src="https://static.belife-bim.com/vue.min.js"></script>
13
+ <script src="https://static.belife-bim.com/bimAir/BimAir.umd.min.js"></script>
14
+ </head>
15
15
 
16
- <body>
17
- <div id="app">
18
- <!-- <div id="viewer">
19
- </div> -->
20
- <div class="button-group">
21
- <button onclick="setScene()">设置视角</button>
22
- <button onclick="setColor()">设置颜色</button>
23
- <button onclick="cancelColor()">取消颜色</button>
24
- </div>
25
- <viewer-wrapper elementId="viewer" style="height: 100%; width: 100%" />
26
- </div>
16
+ <body>
17
+ <div id="app">
18
+ <!-- <div id="viewer">
19
+ </div> -->
20
+ <div class="button-group">
21
+ <button onclick="setScene()">设置视角</button>
22
+ <button onclick="setColor()" id="btn">设置颜色</button>
23
+ </div>
24
+ <viewer-wrapper elementId="viewer" style="height: 100%; width: 100%" />
25
+ </div>
27
26
 
28
- <script type="text/javascript">
29
- new Vue({
30
- el: "#app",
31
- });
27
+ <script type="text/javascript">
28
+ new Vue({
29
+ el: "#app",
30
+ });
31
+ let colorTag=false;
32
+ let options = {
33
+ // viewerType: "model",
34
+ elementId: "viewer",
32
35
 
33
- let options = {
34
- // viewerType: "model",
35
- elementId: "viewer",
36
+ modelService: "https://static.belife-bim.com/modelApi",
37
+ fileService: "https://static.belife-bim.com/fileApi",
38
+ };
39
+ //设置相机参数
40
+ let aboutCamera = {
41
+ position: [380038.099, 39326.678, 3079.396],
42
+ "target": [379881.182, 39790.017, 2818.129],
43
+ up: [-0.141, 0.450, 0.882],
44
+ field: 554.132,
45
+ };
46
+ let viewer;
47
+ let lightModels;
48
+ let model1 = "632273cfbc278049a0898a12";
49
+ let objectID1 = "QMD+M+4G+HYD+XDRA01+EL002";
36
50
 
37
- modelService: "https://static.belife-bim.com/modelApi",
38
- fileService: "https://static.belife-bim.com/fileApi",
39
- };
40
- let aboutCamera = {
41
- position: [379720.251, 39004.605, 3324.137],
42
- target: [379993.054, 39422.028, 3082.479],
43
- up: [-0.453, -0.206, -0.867],
44
- field: 554.132,
45
- };
46
- let viewer;
47
- let lightModels;
48
- let roamTime = 8;
49
- let animation;
50
- let id = "632273cbbc278049a0898a0e";
51
- let model1 = "632273cfbc278049a0898a12";
51
+ BimAir.Loader({ url: "https://static.belife-bim.com/bimAir" }).then(
52
+ () => {
53
+ viewer = new BimAir.Viewer(options);
54
+ this.viewer = viewer;
55
+ this.viewer.loadModels( [model1]).then((lightModels) => {
56
+ this.lightModels = lightModels;
57
+ this.viewer.fitWorld();
58
+ });
59
+ }
60
+ );
52
61
 
53
- let objectID1 = "QMD+M+4G+HYD+XDRA01+EL002";
62
+ function setScene() {
63
+ this.viewer.camera.position = aboutCamera.position;
64
+ this.viewer.camera.target = aboutCamera.target;
65
+ this.viewer.camera.up = aboutCamera.up;
66
+ this.viewer.camera.setField(aboutCamera.field, aboutCamera.field);
67
+ this.viewer.updateDisplay();
68
+ }
54
69
 
55
- BimAir.Loader({ url: "https://static.belife-bim.com/bimAir" }).then(
56
- () => {
57
- viewer = new BimAir.Viewer(options);
58
- this.viewer = viewer;
59
- this.viewer.loadModels([id, model1]).then((lightModels) => {
60
- this.lightModels = lightModels;
61
- this.viewer.fitWorld();
62
- });
63
- }
64
- );
70
+ let tag=false;
71
+ function setColor() {
72
+ if(tag==false){
73
+ let material1 = new BimAir.Material(this.viewer, "test");
74
+ material1.setColor(127, 250, 0, 1);
75
+ let material2 = new BimAir.Material(this.viewer, "test2");
76
+ material2.setColor(127, 0, 0, 1);
77
+ //this.lightModels[0].setAllComponentsVisible(false);
78
+ let objcet1 = this.lightModels[0].segmentObject;
79
+ objcet1.setMaterial(material1);
80
+ this.lightModels[0].setComponentsColor([objectID1], material2);
81
+ this.viewer.updateDisplay();
82
+ var obj=document.getElementById("btn");
83
+ obj.innerText="恢复颜色";
84
+ tag=true;
85
+ }
86
+ else{
87
+ cancelColor();
88
+ var obj=document.getElementById("btn");
89
+ obj.innerText="修改颜色";
90
+ tag=false;
91
+ }
92
+ }
65
93
 
66
- function setScene() {
67
- this.viewer.camera.position = aboutCamera.position;
68
- this.viewer.camera.target = aboutCamera.target;
69
- this.viewer.camera.up = aboutCamera.up;
70
- this.viewer.camera.setField(aboutCamera.field, aboutCamera.field);
71
- this.viewer.updateDisplay();
72
- }
73
-
74
- function setColor() {
75
- let material1 = new BimAir.Material(this.viewer, "test");
76
- material1.setColor(127, 250, 0, 1);
77
-
78
- let material2 = new BimAir.Material(this.viewer, "test2");
79
- material2.setColor(127, 0, 0, 1);
80
-
81
- this.lightModels[0].setAllComponentsVisible(false);
82
- let objcet1 = this.lightModels[1].segmentObject;
83
- objcet1.setMaterial(material1);
84
-
85
- this.lightModels[1].setComponentsColor([objectID1], material2);
86
- this.viewer.updateDisplay();
87
- }
88
-
89
- function cancelColor() {
90
- this.lightModels[1].setAllComponentsColor(null);
91
- this.viewer.updateDisplay();
92
- }
93
- </script>
94
- </body>
94
+ function cancelColor() {
95
+ this.lightModels[0].setAllComponentsColor(null);
96
+ this.viewer.updateDisplay();
97
+ }
98
+ </script>
99
+ </body>
95
100
  </html>
@@ -1,130 +1,154 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <meta charset="UTF-8" />
5
- <title>动画播放</title>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>动画播放</title>
6
6
 
7
- <!-- demo的样式 -->
8
- <link rel="stylesheet" href="https://static.belife-bim.com/demo.css" />
9
- <link
10
- rel="stylesheet"
11
- href="https://static.belife-bim.com/bimAir/BimAir.css"
12
- />
13
- <script src="https://static.belife-bim.com/vue.min.js"></script>
14
- <script src="https://static.belife-bim.com/bimAir/BimAir.umd.min.js"></script>
15
- </head>
7
+ <!-- demo的样式 -->
8
+ <link rel="stylesheet" href="https://static.belife-bim.com/demo.css" />
9
+ <link
10
+ rel="stylesheet"
11
+ href="https://static.belife-bim.com/bimAir/BimAir.css"
12
+ />
13
+ <script src="https://static.belife-bim.com/vue.min.js"></script>
14
+ <script src="https://static.belife-bim.com/bimAir/BimAir.umd.min.js"></script>
15
+ </head>
16
16
 
17
- <body>
18
- <div id="app">
19
- <!-- <div id="viewer">
20
- </div> -->
21
- <div class="button-group">
22
- <button onclick="getAnimation()">播放动画</button>
23
- <button onclick="pauseAnimation()">暂停动画</button>
24
- <button onclick="continueAnimation()">继续动画</button>
25
- <button onclick="stopAnimation()">结束动画</button>
26
- <button onclick="restartAnimation()">重启动画</button>
27
- </div>
28
- <viewer-wrapper elementId="viewer" style="height: 100%; width: 100%" />
29
- </div>
17
+ <body>
18
+ <div id="app">
19
+ <!-- <div id="viewer">
20
+ </div> -->
21
+ <div class="button-group">
22
+ <button onclick="getAnimation()" id="btn">播放动画</button>
23
+ <button onclick="stopAnimation()" id="btn2">结束动画</button>
24
+ </div>
25
+ <viewer-wrapper elementId="viewer" style="height: 100%; width: 100%" />
26
+ </div>
30
27
 
31
- <script type="text/javascript">
32
- new Vue({
33
- el: "#app",
34
- });
28
+ <script type="text/javascript">
29
+ new Vue({
30
+ el: "#app",
31
+ });
35
32
 
36
- let options = {
37
- // viewerType: "model",
38
- elementId: "viewer",
33
+ let options = {
34
+ // viewerType: "model",
35
+ elementId: "viewer",
39
36
 
40
- modelService: "https://static.belife-bim.com/modelApi",
41
- fileService: "https://static.belife-bim.com/fileApi",
42
- };
43
- let aboutCamera = {
44
- position: new Float64Array([379633.85, 39084.71, 3129.943]),
45
- target: new Float64Array([380036.613, 39459.857, 3066.088]),
46
- up: new Float64Array([0.084, 0.079, 0.993]),
47
- field: 554.132,
48
- };
49
- let viewer;
50
- let lightModels;
51
- let roamTime = 8;
52
- let animation;
53
- let id = "632273cbbc278049a0898a0e";
54
- let model1 = "632273cfbc278049a0898a12";
55
- let objectID1 = "QMD+M+4G+HYD+XDRA01+EL002";
37
+ modelService: "https://static.belife-bim.com/modelApi",
38
+ fileService: "https://static.belife-bim.com/fileApi",
39
+ };
40
+ let aboutCamera = {
41
+ position: [380037.8171853031, 39324.16306542623, 3080.2530399562834],
42
+ target: [379881.182, 39790.017, 2818.129],
43
+ up: [-0.141, 0.450, 0.882],
44
+ field: 5.132,
45
+ };
46
+ let viewer;
47
+ let lightModels;
48
+ let roamTime = 8;
49
+ let animation;
50
+ //let id = "632273cbbc278049a0898a0e";
51
+ let model1 = "632273cfbc278049a0898a12";
52
+ let objectID1 = "QMD+M+4G+HYD+XDRA01+EL002";
56
53
 
57
- BimAir.Loader({ url: "https://static.belife-bim.com/bimAir" }).then(
58
- () => {
59
- viewer = new BimAir.Viewer(options);
60
- this.viewer = viewer;
61
- this.viewer.loadModels([id, model1]).then((lightModels) => {
62
- this.lightModels = lightModels;
54
+ BimAir.Loader({ url: "https://static.belife-bim.com/bimAir" }).then(
55
+ () => {
56
+ viewer = new BimAir.Viewer(options);
57
+ this.viewer = viewer;
58
+ this.viewer.loadModels([model1]).then((lightModels) => {
59
+ this.lightModels = lightModels;
60
+ this.viewer.camera.position = aboutCamera.position;
61
+ this.viewer.camera.target = aboutCamera.target;
62
+ this.viewer.camera.up = aboutCamera.up;
63
+ this.viewer.camera.setField(aboutCamera.field, aboutCamera.field);
64
+ this.viewer.fitWorld();
65
+ });
66
+ }
67
+ );
63
68
 
64
- this.viewer.camera.position = aboutCamera.position;
65
- this.viewer.camera.target = aboutCamera.target;
66
- this.viewer.camera.up = aboutCamera.up;
67
- this.viewer.camera.setField(aboutCamera.field, aboutCamera.field);
68
- this.viewer.fitWorld();
69
- });
70
- }
71
- );
72
69
 
73
- function getAnimation() {
74
- this.lightModels[0].setAllComponentsIsolation();
75
- let moveSegmentObject = this.lightModels[1].getComponent(objectID1);
76
- let bb = this.viewer.computeViewBoundingBox(moveSegmentObject.segment);
77
- let center = new Float64Array([
78
- (bb[0] + bb[3]) / 2,
79
- (bb[1] + bb[4]) / 2,
80
- (bb[2] + bb[5]) / 2,
81
- ]);
82
- let p0 = new BimAir.Longan.Point();
83
- p0[0] = center[0];
84
- p0[1] = center[1];
85
- p0[2] = center[2] + 60;
70
+ let tag=false;
71
+ function getAnimation() {
72
+ var obj2=document.getElementById("btn");
73
+ var obj=document.getElementById("btn2")
74
+ //obj.innerText="恢复颜色";
75
+ if(obj2.innerText=="播放动画"){
76
+ this.lightModels[0].setAllComponentsIsolation();
77
+ let moveSegmentObject = this.lightModels[0].getComponent(objectID1);
78
+ let bb = this.viewer.computeViewBoundingBox(moveSegmentObject.segment);
79
+ let center = new Float64Array([
80
+ (bb[0] + bb[3]) / 2,
81
+ (bb[1] + bb[4]) / 2,
82
+ (bb[2] + bb[5]) / 2,
83
+ ]);
84
+ let p0 = new BimAir.Longan.Point();
85
+ p0[0] = center[0];
86
+ p0[1] = center[1];
87
+ p0[2] = center[2] + 10;
86
88
 
87
- let p1 = new BimAir.Longan.Point();
88
- p1[0] = center[0];
89
- p1[1] = center[1];
90
- p1[2] = center[2];
91
- let points = new Array();
92
- points.push(p0);
93
- points.push(p1);
89
+ let p1 = new BimAir.Longan.Point();
90
+ p1[0] = center[0];
91
+ p1[1] = center[1];
92
+ p1[2] = center[2];
93
+ let points = new Array();
94
+ points.push(p0);
95
+ points.push(p1);
94
96
 
95
- // this.viewer.process.animationManager.drawStraight(this.viewer, points);
96
- this.animation =
97
- this.viewer.process.animationManager.objectRoamWithoutRotate(
98
- this.viewer,
99
- moveSegmentObject,
100
- points,
101
- roamTime,
102
- 0,
103
- () => {
104
- console.log("animation finish");
105
- }
106
- );
107
- this.viewer.process.animationManager.run([this.animation]);
108
- // return animationId;
109
- }
110
-
111
- function pauseAnimation() {
97
+ // this.viewer.process.animationManager.drawStraight(this.viewer, points);
98
+ this.animation =
99
+ this.viewer.process.animationManager.objectRoamWithoutRotate(
100
+ this.viewer,
101
+ moveSegmentObject,
102
+ points,
103
+ roamTime,
104
+ 0,
105
+ () => {
106
+ obj.innerText="播放动画";
107
+ console.log("animation finish");
108
+ }
109
+ );
110
+ this.viewer.process.animationManager.run([this.animation]);
111
+ obj2.innerText="暂停动画";
112
+ obj.innerText="结束动画";
113
+ }
114
+ else{
115
+ if(obj2.innerText=="暂停动画"){
112
116
  let palyingPercent = this.viewer.process.animationManager.pauseAnime(
113
- this.animation
117
+ this.animation
114
118
  );
119
+ obj2.innerText="继续动画";
115
120
  }
121
+ else{
116
122
 
117
- function continueAnimation() {
118
123
  this.viewer.process.animationManager.run([this.animation]);
124
+ obj2.innerText="暂停动画";
119
125
  }
126
+ }
127
+ // return animationId;
128
+ }
129
+ function getPose(){
130
+ console.log("position",this.viewer.camera.position);
131
+ console.log("target",this.viewer.camera.target);
132
+ console.log("up",this.viewer.camera.up);
133
+ }
120
134
 
121
- function stopAnimation() {
122
- this.viewer.process.animationManager.stopAnime(this.animation, true);
123
- }
135
+ function stopAnimation() {
136
+ var obj=document.getElementById("btn2");
137
+ var obj2=document.getElementById("btn")
138
+ if(obj.innerText=="结束动画"){
139
+ this.viewer.process.animationManager.stopAnime(this.animation, true);
140
+ obj.innerText="重启动画";
141
+ obj2.innerText="播放动画";
142
+ }
143
+ else{
144
+ this.viewer.process.animationManager.restartAnime(this.animation, true);
145
+ obj.innerText="结束动画";
146
+ obj2.innerText="暂停动画";
147
+ }
124
148
 
125
- function restartAnimation() {
126
- this.viewer.process.animationManager.restartAnime(this.animation, true);
127
- }
128
- </script>
129
- </body>
149
+ }
150
+
151
+
152
+ </script>
153
+ </body>
130
154
  </html>