فهرست منبع

Merge branch 'master' of http://192.168.0.115:3000/4dkankan/laser_v1

bill 4 سال پیش
والد
کامیت
a38fad5015
8فایلهای تغییر یافته به همراه138 افزوده شده و 27 حذف شده
  1. 27 9
      IndoorViewerAPI.js
  2. 4 4
      api/tiled_maps
  3. 47 6
      css/style.css
  4. BIN
      img/icon/icon_location_n.png
  5. BIN
      img/icon/icon_location_s.png
  6. 1 2
      index.html
  7. 1 1
      translations/zh.json
  8. 58 5
      笔记.js

+ 27 - 9
IndoorViewerAPI.js

@@ -191420,18 +191420,33 @@ and limitations under the License.
         ,
         t.prototype.updateSubTiles = function(e, n, r, o, a, s, c) {
             for (var l = !0, u = [-.25 * o, .25 * o, -.25 * o, .25 * o], d = [.25 * o, .25 * o, -.25 * o, -.25 * o], p = 0; p < 4; ++p) {
-                var h = c + p.toString(10);
-                if (!e.tilePresenceMap || e.tilePresenceMap[h]) {
+                var h = c + p.toString(10);  //一级(512):0 1 2 3分别为左上、右上、左下、右下。二级(1024)就是把一级的每一块分裂,如00 01 02 03分别是0的左上、右上、左下、右下……
+                //if (!e.tilePresenceMap || e.tilePresenceMap[h]) { //去掉判断,直接显示
                     var f = a + u[p]
                       , m = s + d[p];
-                    i.sharedData.tempVector.set(f, m, 0),
-                    e.isTileVisible(i.sharedData.tempVector, .5 * o, n) ? (this.children[p] || (this.children[p] = new t(this.mapLayer,this.objectGroup,this.tileColor)),
+                    i.sharedData.tempVector.set(f, m, 0);
+                    if(e.isTileVisible(i.sharedData.tempVector, .5 * o, n)){
+                        if(log ){
+                            console.log('isTileVisible '+h)
+                        }
+                         
+                        this.children[p] || (this.children[p] = new t(this.mapLayer,this.objectGroup,this.tileColor))
+                        l = this.children[p].update(e, n, r - 1, .5 * o, f, m, h, log) && l  
+                    }else{
+                        if(this.children[p]){
+                            this.children[p].remove() 
+                            delete this.children[p]
+                        }
+                          
+                    }
+                    /* e.isTileVisible(i.sharedData.tempVector, .5 * o, n) ? (this.children[p] || (this.children[p] = new t(this.mapLayer,this.objectGroup,this.tileColor)),
                     l = this.children[p].update(e, n, r - 1, .5 * o, f, m, h) && l) : this.children[p] && (this.children[p].remove(),
-                    delete this.children[p])
-                }
+                    delete this.children[p]) */
+                //}
             }
             return l && this.removeObject3D(),
-            l
+            l 
+            
         }
         ,
         t.prototype.createTileObject = function(t, e, n, a) {
@@ -191443,6 +191458,9 @@ and limitations under the License.
               , u = n / e + .5 * (c - 1)
               , d = -a / e + .5 * (c - 1)
               , p = t.getTileUrl(Math.round(l), Math.round(u), Math.round(d));
+              if(p.includes("mapTest3/2") ){
+                console.log(p)
+            }
             this.mesh.renderOrder = -(1e6 - l - 100 * (t.zIndex || 0));
             var h = this.mesh.material;
             h.map = t.textureLoader.load(p, (function(t) {
@@ -191603,7 +191621,7 @@ and limitations under the License.
             c.projection = n.crsLocal,
             c.zIndex = 0,
             c.textureLoader = a.getTextureLoader(),
-            c._tilePresenceMap = e.decodeBitStream(c.tiledMapEntity.quadtree),
+            c._tilePresenceMap = e.decodeBitStream(c.tiledMapEntity.quadtree),//包含tile分裂信息,如果写错了会造成tile显示不全
             c
         }
         return r(e, t),
@@ -208435,7 +208453,7 @@ and limitations under the License.
             }
         }
         ,
-        t.prototype.getTransformationMatrix = function(t) {
+        t.prototype.getTransformationMatrix = function(t) {//点云截取   所有点在乘上这个矩阵后, 还能落在 1 * 1 * 1的box内的点就是所裁剪的
             var e = this.ViewService.mainView.getVolumeClippingLayer().getBoxFrame()
               , n = (new o.Matrix4).getInverse(e.matrixWorld)
               , i = t.m2w_;

+ 4 - 4
api/tiled_maps

@@ -1,14 +1,14 @@
 [{
 	"bundle_id": 3,
-	"file_path": "data/building_1/mapTest2",
+	"file_path": "data/building_1/mapTest3",
 	"file_name": "$DEPTH/$X/$Y.png",
 	"floor_id": 11,
 	"id": 5,
-	"map_size_m": 37.10058256252635,
+	"map_size_m": 123.84682999939342,
 	"max_depth": 3,
 	"quadtree": "fccf7fffcff3bf7f",
-	"location": [113.5892056859005,22.367124170442096,0.5987030136375425],
-	"orientation": [1,0,0,0],
+	"location": [113.58819689242937,22.366342173244817,100.5987030136375425],
+	"orientation": [0.7071067811865476, 0, 0, 0.7071067811865475],
 	"tile_size_px": 256,
 	"type": "TILED_PYRAMID"
 }]

+ 47 - 6
css/style.css

@@ -1612,8 +1612,8 @@ navbar-menu .navbar-default {
 
 #insetPanel .swap-views-button {
     position: fixed;
-    top: 7px;
-    right: 110px;
+    top: 6px;
+    right: 122px;
     z-index: 999;
     width: 0;
 }
@@ -1640,8 +1640,8 @@ navbar-menu .navbar-default .navbar-custom>li.navbar-menu-item-user {
 
 .glyphicon-resize-full:before {
     content: "" !important;
-    width: 16px;
-    height: 16px;
+    width: 24px;
+    height: 24px;
     display: block;
     background: url(../img/icon/icon_location_n.png)no-repeat;
     background-size: 100% 100%;
@@ -1649,8 +1649,8 @@ navbar-menu .navbar-default .navbar-custom>li.navbar-menu-item-user {
 
 .glyphicon-resize-full.active:before {
     content: "" !important;
-    width: 16px;
-    height: 16px;
+    width: 24px;
+    height: 24px;
     display: block;
     background: url(../img/icon/icon_location_s.png)no-repeat;
     background-size: 100% 100%;
@@ -1673,6 +1673,21 @@ point-cloud-viewport .view-switcher__holder {
     display: none !important;
 }
 
+.uncollapse-btn .button-padding-left {
+    width: 40px;
+    height: 40px;
+    background: rgba(0, 0, 0, 0.8);
+    border-radius: 50%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.uncollapse-btn .button-padding-leftimg[alt="arrow_icon"] {
+    width: 24px;
+    height: 24px;
+}
+
 .vertical-viewport-separator .btn-resizer {
     display: none !important;
 }
@@ -1746,4 +1761,30 @@ button[title="保存所选"] .material-icons {
     width: 20px;
     height: 20px;
     color: transparent !important;
+}
+
+#view-menu>.panel-body>.checkbox:nth-of-type(3) {
+    display: none!important;
+}
+
+#collapsequality div[ui-slider] {
+    display: none !important;
+}
+
+.measurement-list-items::-webkit-scrollbar {
+    width: 8px;
+}
+
+.measurement-list-items::-webkit-scrollbar-track {
+    background-color: #000;
+    -webkit-border-radius: 1em;
+    -moz-border-radius: 1em;
+    border-radius: 1em;
+}
+
+.measurement-list-items::-webkit-scrollbar-thumb {
+    background-color: rgba(255, 255, 255, .2);
+    -webkit-border-radius: 1em;
+    -moz-border-radius: 1em;
+    border-radius: 1em;
 }

BIN
img/icon/icon_location_n.png


BIN
img/icon/icon_location_s.png


+ 1 - 2
index.html

@@ -22,8 +22,7 @@
 <script type="text/javascript">
     const ossPrefix = 'https://laser.4dkankan.com/data/';
     const ossPrefixDep = 'https://laser.4dkankan.com/public/';
-    // const sceneNum = '@replace';
-    const sceneNum = 't-iksBApb';
+    const sceneNum = '@replace';
 </script>
 <script src="IndoorViewerAPI.js"></script>
 <script type="text/javascript" src="js/OBJExporter.js"></script>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
translations/zh.json


+ 58 - 5
笔记.js

@@ -8,31 +8,84 @@ filter中的:
 数据集校准后不变的值有:
 dataset_orientation(永远存储最初始的点位的quaternion,在旋转时也不变,因此它等于没有旋转时的orientation)---- image.datasetOrientation
 dataset_floor_orientation(一般和dataset_orientation值一样) 
-dataset_location
+dataset_location 真实的三维坐标
 dataset_floor_location
 
 
 
 数据集校准后改变的值有:
 orientation----image.orientation(在旋转时实时变,且是根据模型旋转度数和dataset_orientation来算的,所以如果dataset_orientation不对,就会算错。)
-location----image.location
+location----image.location   xy为经纬度
 floor_location
 
 
 ------------------------------------------------
 
+查看全局: 
+var view = window.IV.getMainView()
+view.currentImage.id  
+view.ImageService.images
 
-MeasurementLineMaterial : 测量线材质, 有蓝色标准实线和灰色透明虚线两种状态
 
 
-this.underlayScene.children[3] 包含32个子mesh, 是全景图sphere   其材质fragment在下方
 
-加载深度图loadDepthImage   获取深度值getDepth(用于更新reticule位置)。深度图用于修改全景图sphere的gl_FragDepthEXT
 
 
+POI: 兴趣点   PoiService  PoiEditorDirective PoiEntity
+t.prototype.isPreviewMenuVisible  ---- canDisplayResultDetails  --- PoiService.openedPoi - setOpenedPoi
+
+MeasurementLineMaterial : 测量线材质, 有蓝色标准实线和灰色透明虚线两种状态
 
 
+数据集校准 saveAlignment =      selectedDatasets
 
+this.underlayScene.children[3] 包含32个子mesh, 是全景图sphere   其材质fragment在下方
+overlayScene 里有marker , name: "location" ?
+
+QuaternionFactory VectorFactory
+ 
+加载深度图loadDepthImage   获取深度值getDepth(用于更新reticule位置)。深度图用于修改全景图sphere的gl_FragDepthEXT
+getCoordinates doPointCloudPicking doDepthImagePicking
+
+t.NORMAL = "normal",
+t.DATASET_ALIGNMENT = "datasetAlignment",
+t.GEO_REGISTRATION = "GeoRegistration",
+t.SITE_MODEL_EDITOR = "SiteModelEditor",
+t.NAV_GRAPH_EDITOR = "NavGraphEditor",
+t.DOWNLOAD_POINT_CLOUD = "DownloadPointCloud",
+t.MEASUREMENTS = "Measurements"
+
+
+//--关于地图和 地图上的图片-------关键词mapSizeM
+updateSubTiles更新地图tile,如果不存在就加载
+
+
+//图片上传https://testlaser.4dkankan.com/maxkk/t-iksBApb/locat/addDataSet.html
+var QuaternionFactory = { // 同 IndoorViewerAPI的 QuaternionFactory.toArray
+    toArray : function(quaternion){ 
+        var rot90 =  (new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1), THREE.Math.degToRad(-90)) //add 转入时旋转90度
+          , rot90Invert = rot90.clone().inverse()//add 转出时旋回90度
+        var t1 = quaternion.clone().multiply(rot90Invert); 
+        var e = t1.toArray();
+        return [e[3], e[0], e[1], e[2]] 
+    }
+}
+//获取旋转:
+var getQuaternion = function(angle){//angle:0-360 角度
+    var quaternion = new THREE.Quaternion().setFromEuler(new THREE.Euler(0,0,THREE.Math.degToRad(-angle)));
+    return QuaternionFactory.toArray(quaternion)
+    
+}
+//获取缩放    
+var getSize = function(imgWidth, scale){//imgWidth:图片宽度, scale缩放值(x==y)
+    var level = imgWidth / 1024;  //以1024为基准
+    return 95.54628610610962 * level * scale; // 95.54628610610962 = 38.21851444244385 * (2+0.5), 其中38.21851444244385 = mapSizeM / Math.pow(2,maxDepth) = 40075017 / Math.pow(2,20) 可能表示地图在缩放zoom为20时的单块宽度
+                                            //0.5是试出来的,因为图片层的bias=0.5, 暂不知道其用处,所以试用了下……
+                                            //另:可能不是*2.5,  也许是*256/100 ?  不知道如何精确测试下
+                                            //有出现过一次错误是2048时的图但是大了一倍,发现是传图的那个网页在缩放值为0.1(即图为1:1显示,函数canvasFunction(extent, scale )时只有1024大小,后来刷新重新操作就是2048然后就正确。所以可能是这个网页出错。
+} 
+//位置直接使用中心点的经纬度               
+//-------------------------------------------------
 
 =======shader=======
 全景图 fragment