xzw 3 vuotta sitten
vanhempi
commit
0cc03639d2
2 muutettua tiedostoa jossa 46 lisäystä ja 20 poistoa
  1. 40 20
      js/edit.js
  2. 6 0
      js/main_2020_edit.js

+ 40 - 20
js/edit.js

@@ -126,6 +126,7 @@ EditTools.prototype.init = function() {
     
     $(".toolRight .panoVisible [name=autoCompute]").on('click',()=>{
         VisiSet.resetPanosVisiByModel()
+        
     }) 
     
     
@@ -134,7 +135,7 @@ EditTools.prototype.init = function() {
     this.fpAngleOptions = new MenuOptions({
         dom: $(".toolRight .information [data-name=floorPlanAngle]  .MenuOptions"),
         uiCallBack : (o)=>{    
-            var name = o.name || o.$li.attr('index')
+            var name = o.name == void 0 ?  o.$li.attr('index') : o.name
             
             _settings.floorPlanAngle = parseFloat(name) * Math.PI/2  //设置好方向 (0是无效的,将不设置)
              
@@ -1115,7 +1116,7 @@ Hotpoint.prototype.init = function() {
     this.modelMenuOptions = new MenuOptions({
         dom: this.hotpointDetail.find(".MenuOptions[name=modelType]"),
         uiCallBack : (o)=>{ 
-            var name = o.name || o.$li.attr('index')
+            var name = o.name == void 0 ?  o.$li.attr('index') : o.name
                       
             if(name == "default"){ 
                 this.hotpointDetail.find('[name=boxDepthPanel]').removeClass('hide')
@@ -2154,7 +2155,7 @@ Hotpoint.prototype.initListSelect = function(){//热点样式图列表
     this.texTypeMenuOptions = new MenuOptions({
         dom: this.hotpointDetail.find(" li[name=style]  .MenuOptions"),
         uiCallBack : (o)=>{ 
-            var name = o.name || o.$li.attr('index')
+            var name = o.name == void 0 ?  o.$li.attr('index') : o.name
             for(let i in this.texLists){ this.texLists[i].listDom.parent().addClass("hide")} 
             this.texLists[name].listDom.parent().removeClass("hide")
             
@@ -4647,7 +4648,8 @@ var initTransformCtl = function(THREE) {
     transformControls.transformMenuOptions = new MenuOptions({  
         dom:  $(".MenuOptions[name='transform'] "),
         uiCallBack : (o)=>{ 
-            var mode = o.name || o.$li.attr('index')
+      
+            var mode = o.name == void 0 ?  o.$li.attr('index') : o.name
             transformControls.transCtlChangeMode(mode)
             var hotpointDetail = editTool.hotpoint.hotpointDetail
             hotpointDetail.find(" li[name=setPos] button[name=setSpace] ").css('display',mode == 'scale' ? 'none' : 'block') 
@@ -4811,14 +4813,32 @@ var VisiSet = {
         this.updateFootIconSize()
         this.showFootIcons(null, true);
         
+        
         for(let i in player.model.hots){
-            player.model.hots[i].visi_ = player.model.hots[i].visible;
-            player.model.hots[i].visible = false
+            player.model.hots[i].visi_ = player.model.hots[i].mesh.visible;
+            player.model.hots[i].mesh.visible = false
         } 
         
-        
+        this.changePanoVisi(true)
+    },
+     
+    changePanoVisi:function(state){
+        var floor = player.model.allFloorsVisible ? 'all' : player.model.currentFloor
+        if(this.setPanoVisible){
+            if(floor != 'all' && this.panoVsetting && floor != this.panoVsetting.floor){//如果切换到其他楼,取消选中该pano
+                this.pauseSetPanoVisible('unsaved')
+            }
+        }
         player.model.panos.forEach(e=>{
-            e.addTextSprite(e.id, $('#panoIdColorTex').val(), e.footIcon)
+            if(!e.footIcon)return
+                
+            if(state && !e.footIcon.visible && (floor == 'all' || floor == e.floor)){
+                e.footIcon.visible = true
+                if (this.setPanoLog)e.addTextSprite(e.id, $('#panoIdColorTex').val(), e.footIcon)
+            }else if(!state || floor != 'all' && floor != e.floor){
+                e.footIcon.visible = false
+                if (this.setPanoLog)e.removeTextSprite()
+            }
         })
     },
     
@@ -4827,9 +4847,10 @@ var VisiSet = {
         if (!this.setPanoLog)
             return;
         //否则会加多个侦听 
+        this.changePanoVisi(false)
         this.setPanoLog = false;
 
-        this.hideFootIcons();
+        //this.hideFootIcons();
     
         this.recoverAllState2(); 
         this.panosSelect = null
@@ -4839,15 +4860,11 @@ var VisiSet = {
         
         
         for(let i in player.model.hots){ 
-            player.model.hots[i].visible = player.model.hots[i].visi_
+            player.model.hots[i].mesh.visible = player.model.hots[i].visi_
         } 
 
         $("#panosIdShow").val('')
         
-        player.model.panos.forEach(e=>{
-            e.removeTextSprite()
-        })
-        
         
         
     },
@@ -5032,7 +5049,7 @@ var VisiSet = {
         //否则会加多个侦听 
         this.setPanoVisible = false;
 
-        this.hideFootIcons();
+        //this.hideFootIcons();
         this.delVisibleLines();
 
         //objects.tagManager.showAllTags();
@@ -5239,7 +5256,7 @@ var VisiSet = {
  
         player.path.currentPanoMarker.mesh.visible = !state; 
         player.reticule.visible = !state;
-
+        this.changePanoVisi(state)
     },
 
     delVisibleLines: function() {
@@ -5380,8 +5397,9 @@ var VisiSet = {
                 this.footIcons.push(foot)
             }
         }
+        //this.changePanoVisi(true)
         for (var i = 0; i < this.footIcons.length; i++) {
-            this.footIcons[i].visible = true;
+            //this.footIcons[i].visible = true;
             this.changeFIconState(this.footIcons[i], false)
             var panos = player.model.panos;
             if (isPanovisible) {
@@ -5499,10 +5517,10 @@ var VisiSet = {
     
     
     
-    resetPanosVisiByModel: function() {//一键计算所有漫游可行 (计算后自动连接,但不保存)
+    resetPanosVisiByModel: function() {//一键计算所有漫游可行 (计算后自动连接,但不保存) 多楼层还没试过
      
         $('.waiting').addClass('showloading');
-        
+        $('.pinBottom  .allFloorBtn').click()//全部楼层显示
         let begin = ()=>{
             this.pauseSetPanoVisible("unsaved")
             
@@ -5590,6 +5608,7 @@ var VisiSet = {
         this.delVisibleLines();
         //删除线
         this.showFootIcons(player.currentPano);
+        this.changePanoVisi(true)
         this.createTagVisiLines(tag);
         //创线
 
@@ -5629,7 +5648,8 @@ var VisiSet = {
             return;
         //this.tagVsetting.setElemType(this.tagVsetting.style, this.tagVsetting.styleImageURL ); 
         this.delVisibleLines();
-        this.hideFootIcons();
+        //this.hideFootIcons();
+        this.changePanoVisi(false)
         this.tagVTemp = {};
         this.tagVsetting = null;
     },

+ 6 - 0
js/main_2020_edit.js

@@ -6276,6 +6276,12 @@ function o(a, s, l) {
                         interaction_source: "gui"
                     })),
                     n.removeClass("open")
+                    
+                    //add:
+                    if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
+                        VisiSet.changePanoVisi(true)
+                    }
+                    
                 })
             }
             function I(e, t) {