xzw преди 4 години
родител
ревизия
5b1087a8ab
променени са 2 файла, в които са добавени 82 реда и са изтрити 14 реда
  1. 24 9
      IndoorViewerAPI.js
  2. 58 5
      笔记.js

+ 24 - 9
IndoorViewerAPI.js

@@ -191417,18 +191417,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) {
@@ -191600,7 +191615,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),
@@ -208432,7 +208447,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_;

+ 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