|
@@ -68,9 +68,8 @@ EditTools.prototype.active = function () {
|
|
|
|
|
|
console.log(`atPanel ${that.atPanel} name ${name}`)
|
|
console.log(`atPanel ${that.atPanel} name ${name}`)
|
|
switch(that.atPanel){//退出
|
|
switch(that.atPanel){//退出
|
|
- case "panoVisible":
|
|
|
|
- permitTranMode(true)
|
|
|
|
- panoVisiSet.finishSetPanoVisible()
|
|
|
|
|
|
+ case "panoVisible":
|
|
|
|
+ VisiSet.finishSetPanoVisible()
|
|
break;
|
|
break;
|
|
case "screen":
|
|
case "screen":
|
|
confirmSnap.addClass("hide").removeClass("unable");
|
|
confirmSnap.addClass("hide").removeClass("unable");
|
|
@@ -80,24 +79,15 @@ EditTools.prototype.active = function () {
|
|
EditOverlay.leave()
|
|
EditOverlay.leave()
|
|
break;
|
|
break;
|
|
case "hotpoint":
|
|
case "hotpoint":
|
|
- $("#hotpointDetail").hasClass("atRight") || $("#hotpointDetail a.close").click()
|
|
|
|
|
|
+ $("#hotpointDetail").hasClass("atRight") || $("#hotpointDetail a.close").click();
|
|
|
|
+ VisiSet.finishSetTagVisible()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
switch(name){
|
|
switch(name){
|
|
- case "panoVisible":
|
|
|
|
- var enter = function(){
|
|
|
|
- if(player.modeTran.split('-')[1] != "floorplan"){
|
|
|
|
- setTimeout(panoVisiSet.beginSetPanoVisible.bind(panoVisiSet), 300)//提前一点出现
|
|
|
|
- }
|
|
|
|
- player.flyToMode("floorplan", panoVisiSet.beginSetPanoVisible.bind(panoVisiSet));
|
|
|
|
- }
|
|
|
|
|
|
+ case "panoVisible":
|
|
|
|
+ VisiSet.enterSet(VisiSet.beginSetPanoVisible.bind(VisiSet))
|
|
$(".toolLeft").addClass("unable")
|
|
$(".toolLeft").addClass("unable")
|
|
- permitTranMode(false)
|
|
|
|
- if(!player.modeTran){
|
|
|
|
- player.afterCModeFuc = ()=>{
|
|
|
|
- enter()
|
|
|
|
- }
|
|
|
|
- }else enter()
|
|
|
|
|
|
+
|
|
break;
|
|
break;
|
|
case "screen":
|
|
case "screen":
|
|
confirmSnap.removeClass("hide");
|
|
confirmSnap.removeClass("hide");
|
|
@@ -143,27 +133,31 @@ EditTools.prototype.saveAll = function () {
|
|
var hots = {}
|
|
var hots = {}
|
|
// 热点数据
|
|
// 热点数据
|
|
Array.from($('.spotList ul li')).forEach(function (dom) {
|
|
Array.from($('.spotList ul li')).forEach(function (dom) {
|
|
-
|
|
|
|
- if(dom.infoAttribute){
|
|
|
|
- delete dom.infoAttribute.position;
|
|
|
|
- delete dom.infoAttribute.quaternion;
|
|
|
|
|
|
+ var sid = dom.hotMesh.belongHot.sid;
|
|
|
|
+ var hot = player.model.hots[sid];
|
|
|
|
+ hots[sid] = {
|
|
|
|
+ position: {
|
|
|
|
+ x: dom.hotMesh.position.x,
|
|
|
|
+ y: dom.hotMesh.position.y,
|
|
|
|
+ z: dom.hotMesh.position.z
|
|
|
|
+ },
|
|
|
|
+ quaternion : hot.isSprite ? hot.quaternion.toObject() : dom.hotMesh.quaternion.toObject()
|
|
|
|
+ ,
|
|
|
|
+ isSprite : hot.isSprite ? 1 : 0,
|
|
|
|
+ infoAttribute: dom.infoAttribute
|
|
|
|
+
|
|
}
|
|
}
|
|
- hots[dom.hotAttribute.belongHot.sid] = {
|
|
|
|
- position: {
|
|
|
|
- x: dom.hotAttribute.position.x,
|
|
|
|
- y: dom.hotAttribute.position.y,
|
|
|
|
- z: dom.hotAttribute.position.z
|
|
|
|
- },
|
|
|
|
- rotation: {
|
|
|
|
- x: dom.hotAttribute.rotation.x,
|
|
|
|
- y: dom.hotAttribute.rotation.y,
|
|
|
|
- z: dom.hotAttribute.rotation.z
|
|
|
|
- },
|
|
|
|
- infoAttribute: dom.infoAttribute
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ if(hot.visiblePanos) hots[sid].visiblePanos = hot.visiblePanos
|
|
|
|
|
|
|
|
|
|
|
|
+ delete dom.infoAttribute.rotation;
|
|
|
|
+ delete dom.infoAttribute.position;
|
|
|
|
+ delete dom.infoAttribute.quaternion;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
var info = {
|
|
var info = {
|
|
name: $('#pjtName').val(),
|
|
name: $('#pjtName').val(),
|
|
@@ -376,8 +370,10 @@ function getSeft(seft) {
|
|
$('#camera-start').on('click', function () {
|
|
$('#camera-start').on('click', function () {
|
|
|
|
|
|
|
|
|
|
- if(panoVisiSet.setPanoVisible){
|
|
|
|
- return panoVisiSet.savePanoVisibles()
|
|
|
|
|
|
+ if(VisiSet.setPanoVisible){
|
|
|
|
+ return VisiSet.savePanoVisibles()
|
|
|
|
+ }else if(VisiSet.setTagVisible){
|
|
|
|
+ return VisiSet.saveTagVisibles()
|
|
}
|
|
}
|
|
|
|
|
|
// 这部分内容需要配合main_2018.js中来进行修改
|
|
// 这部分内容需要配合main_2018.js中来进行修改
|
|
@@ -468,6 +464,7 @@ Hotpoint.prototype.init = function (n) {
|
|
var hot = player.model.hots[spot_id];
|
|
var hot = player.model.hots[spot_id];
|
|
info.position && hot.mesh.position.copy(info.position)
|
|
info.position && hot.mesh.position.copy(info.position)
|
|
info.quaternion && hot.mesh.quaternion.copy(info.quaternion)
|
|
info.quaternion && hot.mesh.quaternion.copy(info.quaternion)
|
|
|
|
+ hot.isSprite = info.isSprite
|
|
}
|
|
}
|
|
that.hotpointDetail.addClass("atRight");
|
|
that.hotpointDetail.addClass("atRight");
|
|
transformControls.detach()
|
|
transformControls.detach()
|
|
@@ -509,7 +506,7 @@ Hotpoint.prototype.editHot = function (target) {
|
|
var info = $layout.targetDOM.infoAttribute || {}
|
|
var info = $layout.targetDOM.infoAttribute || {}
|
|
transformControls.transCtlChangeMode("translate")
|
|
transformControls.transCtlChangeMode("translate")
|
|
|
|
|
|
-
|
|
|
|
|
|
+ this.editSpot = player.model.hots[li_id];
|
|
|
|
|
|
|
|
|
|
// 参数初始化
|
|
// 参数初始化
|
|
@@ -519,18 +516,23 @@ Hotpoint.prototype.editHot = function (target) {
|
|
info.model = info.model || [];
|
|
info.model = info.model || [];
|
|
info.images = info.images || [];
|
|
info.images = info.images || [];
|
|
info.video = info.video || [];
|
|
info.video = info.video || [];
|
|
|
|
+ info.isSprite = this.editSpot.isSprite
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
try{
|
|
try{
|
|
transformControls.attach(player.model.hots[li_id].mesh)
|
|
transformControls.attach(player.model.hots[li_id].mesh)
|
|
player.model.hots[li_id].examine(player,{dontOpen:true})//add
|
|
player.model.hots[li_id].examine(player,{dontOpen:true})//add
|
|
|
|
|
|
- info.position = player.model.hots[li_id].mesh.position.clone()
|
|
|
|
- info.quaternion = player.model.hots[li_id].mesh.quaternion.clone()
|
|
|
|
|
|
+ info.position = player.model.hots[li_id].position.clone()
|
|
|
|
+ info.quaternion = player.model.hots[li_id].quaternion.clone()
|
|
}catch(e){}
|
|
}catch(e){}
|
|
|
|
|
|
initStyle(player.model.hots[li_id])
|
|
initStyle(player.model.hots[li_id])
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ $("#isSprite")[0].checked = this.editSpot.isSprite
|
|
|
|
|
|
var iframesHTML = info.iframe.map(function (iframe) {
|
|
var iframesHTML = info.iframe.map(function (iframe) {
|
|
return this.inputList("请填写网页链接", iframe)
|
|
return this.inputList("请填写网页链接", iframe)
|
|
@@ -835,7 +837,7 @@ Hotpoint.prototype.addHotList = function (data, index) {
|
|
this.spotList.children("ul").append(this.createDom(data, index));
|
|
this.spotList.children("ul").append(this.createDom(data, index));
|
|
//保存热点信息到热点dom元素中
|
|
//保存热点信息到热点dom元素中
|
|
var spotList = $(".spotList ul").children("#ggg_s" + index);
|
|
var spotList = $(".spotList ul").children("#ggg_s" + index);
|
|
- spotList[0].hotAttribute = g_HotMeshes[index];
|
|
|
|
|
|
+ spotList[0].hotMesh = g_HotMeshes[index];
|
|
spotList.attr('data-spid', g_HotMeshes[index].belongHot.sid);
|
|
spotList.attr('data-spid', g_HotMeshes[index].belongHot.sid);
|
|
}
|
|
}
|
|
//添加热点音乐
|
|
//添加热点音乐
|
|
@@ -893,142 +895,156 @@ Hotpoint.prototype.saveHot = function () {
|
|
|
|
|
|
hotpointDetail.find(".tail .submit").on('click', function () {
|
|
hotpointDetail.find(".tail .submit").on('click', function () {
|
|
|
|
|
|
- //获取唯一标识
|
|
|
|
- var spot_id = hotpointDetail.attr("data-id");
|
|
|
|
- var spot = spotList.find("li[data-spid="+spot_id+"]");
|
|
|
|
- var hot = player.model.hots[spot_id];
|
|
|
|
- //显示loading
|
|
|
|
- $layout.removeClass('hide');
|
|
|
|
- var args = {};
|
|
|
|
- //热点标题
|
|
|
|
- var $title = hotpointDetail.find(".info input");
|
|
|
|
- //热点内容
|
|
|
|
- var $content = hotpointDetail.find(".info textarea");
|
|
|
|
- //热点图片
|
|
|
|
- var $images = hotpointDetail.find(".photo .edit-fun-images a.result");
|
|
|
|
- //热点视频
|
|
|
|
- var $videos = hotpointDetail.find(".video .edit-fun-images a.result");
|
|
|
|
- //热点视频的图片
|
|
|
|
- var $thums = hotpointDetail.find(".video .edit-fun-images .upload-thum");
|
|
|
|
- //热点模型
|
|
|
|
- var $modules = hotpointDetail.find(".model input");
|
|
|
|
- //热点内嵌网页
|
|
|
|
- var $iframes = hotpointDetail.find(".webPage input");
|
|
|
|
- //热点音乐
|
|
|
|
- var $miusc = hotpointDetail.find("#upload-hotBgm");
|
|
|
|
-
|
|
|
|
- let $bgName = hotpointDetail.find('.title');
|
|
|
|
|
|
+ //获取唯一标识
|
|
|
|
+ var spot_id = hotpointDetail.attr("data-id");
|
|
|
|
+ var spot = spotList.find("li[data-spid="+spot_id+"]");
|
|
|
|
+ var hot = player.model.hots[spot_id];
|
|
|
|
+ //显示loading
|
|
|
|
+ $layout.removeClass('hide');
|
|
|
|
+ var args = {};
|
|
|
|
+ //热点标题
|
|
|
|
+ var $title = hotpointDetail.find(".info input");
|
|
|
|
+ //热点内容
|
|
|
|
+ var $content = hotpointDetail.find(".info textarea");
|
|
|
|
+ //热点图片
|
|
|
|
+ var $images = hotpointDetail.find(".photo .edit-fun-images a.result");
|
|
|
|
+ //热点视频
|
|
|
|
+ var $videos = hotpointDetail.find(".video .edit-fun-images a.result");
|
|
|
|
+ //热点视频的图片
|
|
|
|
+ var $thums = hotpointDetail.find(".video .edit-fun-images .upload-thum");
|
|
|
|
+ //热点模型
|
|
|
|
+ var $modules = hotpointDetail.find(".model input");
|
|
|
|
+ //热点内嵌网页
|
|
|
|
+ var $iframes = hotpointDetail.find(".webPage input");
|
|
|
|
+ //热点音乐
|
|
|
|
+ var $miusc = hotpointDetail.find("#upload-hotBgm");
|
|
|
|
+
|
|
|
|
+ let $bgName = hotpointDetail.find('.title');
|
|
|
|
|
|
|
|
|
|
- new Promise(function (resolve, reject) {
|
|
|
|
- //获取热点图片所有的路径
|
|
|
|
- upload($images, 'images', resolve)
|
|
|
|
- }).then(function (imgUrls) {
|
|
|
|
- args.images = imgUrls
|
|
|
|
- //获取热点视频所有的路径
|
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
|
- upload($videos, 'videos', resolve)
|
|
|
|
- })
|
|
|
|
- }).then(function (videoUrls) {
|
|
|
|
- args.video = videoUrls
|
|
|
|
- //获取热点视频图片所有的路径
|
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
|
- upload($thums, 'images', resolve)
|
|
|
|
- })
|
|
|
|
- }).then(function (thums) {
|
|
|
|
- args.video = args.video.map(function (video, index) {
|
|
|
|
- return {
|
|
|
|
- url: video,
|
|
|
|
- img: thums[index]
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }).then(function () {
|
|
|
|
- //获取热点音乐所有的路径
|
|
|
|
- //console.log($miusc)
|
|
|
|
- if ($miusc[0].files.length > 0) {
|
|
|
|
- return new Promise(function (resolve) {
|
|
|
|
- upload($miusc, 'miusc', function (res) {
|
|
|
|
- resolve(res[0])
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ new Promise(function (resolve, reject) {
|
|
|
|
+ //获取热点图片所有的路径
|
|
|
|
+ upload($images, 'images', resolve)
|
|
|
|
+ }).then(function (imgUrls) {
|
|
|
|
+ args.images = imgUrls
|
|
|
|
+ //获取热点视频所有的路径
|
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
|
+ upload($videos, 'videos', resolve)
|
|
})
|
|
})
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- return $miusc.attr('data-hotBgm')
|
|
|
|
- }
|
|
|
|
- }).then(function (src) {
|
|
|
|
- args.backgroundMusic = src
|
|
|
|
- args.bgName = $bgName[0].innerHTML;
|
|
|
|
- }).then(function(){//上传style图片
|
|
|
|
- var a = $.Deferred();
|
|
|
|
- var doneNum = 0;
|
|
|
|
- if(currStyle == "user" && currentHotStyleImg.length){
|
|
|
|
- currentHotStyleImg.forEach((img)=>{
|
|
|
|
- if(img.needSave)
|
|
|
|
- uploadImg(img.base64Src, function(rs){
|
|
|
|
- if(rs.code == 0){
|
|
|
|
- img.needSave = false;
|
|
|
|
- img.saveURL = rs.data;
|
|
|
|
- if(++doneNum >= currentHotStyleImg.length){
|
|
|
|
- a.resolve();
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- alert("样式图上传失败");
|
|
|
|
- a.reject();
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- else if(++doneNum >= currentHotStyleImg.length){
|
|
|
|
- a.resolve();
|
|
|
|
- }
|
|
|
|
|
|
+ }).then(function (videoUrls) {
|
|
|
|
+ args.video = videoUrls
|
|
|
|
+ //获取热点视频图片所有的路径
|
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
|
+ upload($thums, 'images', resolve)
|
|
|
|
+ })
|
|
|
|
+ }).then(function (thums) {
|
|
|
|
+ args.video = args.video.map(function (video, index) {
|
|
|
|
+ return {
|
|
|
|
+ url: video,
|
|
|
|
+ img: thums[index]
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }).then(function () {
|
|
|
|
+ //获取热点音乐所有的路径
|
|
|
|
+ //console.log($miusc)
|
|
|
|
+ if ($miusc[0].files.length > 0) {
|
|
|
|
+ return new Promise(function (resolve) {
|
|
|
|
+ upload($miusc, 'miusc', function (res) {
|
|
|
|
+ resolve(res[0])
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- return a.promise()
|
|
|
|
- }else return a.resolve()
|
|
|
|
-
|
|
|
|
- }).then(()=>{ //获取style图的信息
|
|
|
|
-
|
|
|
|
- args.styleImg = [];
|
|
|
|
- if(currStyle == "user" ){
|
|
|
|
- currentHotStyleImg.forEach((img)=>{
|
|
|
|
- args.styleImg.push(img.saveURL || img.src)
|
|
|
|
- })
|
|
|
|
- hot.styleTex = currentHotStyleImg.slice(0)
|
|
|
|
- }else{
|
|
|
|
- hot.styleTex = [];
|
|
|
|
- }
|
|
|
|
- hot.changeTex(); //更新材质
|
|
|
|
- }).then(function () {
|
|
|
|
- //获取热点标题、内容、内嵌网页、模型网页。
|
|
|
|
- args.title = $title.val()
|
|
|
|
- args.content = $content.val()
|
|
|
|
-
|
|
|
|
- var iframes = []
|
|
|
|
- for (var i = 0; i < $iframes.length; i++) {
|
|
|
|
- var iframe = $iframes.eq(i).val()
|
|
|
|
- iframe && iframes.push(iframe)
|
|
|
|
- }
|
|
|
|
- args.iframe = iframes
|
|
|
|
|
|
+ } else {
|
|
|
|
+ return $miusc.attr('data-hotBgm')
|
|
|
|
+ }
|
|
|
|
+ }).then(function (src) {
|
|
|
|
+ args.backgroundMusic = src
|
|
|
|
+ args.bgName = $bgName[0].innerHTML;
|
|
|
|
+ }).then(function(){//上传style图片
|
|
|
|
+ var a = $.Deferred();
|
|
|
|
+ var doneNum = 0;
|
|
|
|
+ if(currStyle == "user" && currentHotStyleImg.length){
|
|
|
|
+ currentHotStyleImg.forEach((img)=>{
|
|
|
|
+ if(img.needSave)
|
|
|
|
+ uploadImg(img.base64Src, function(rs){
|
|
|
|
+ if(rs.code == 0){
|
|
|
|
+ img.needSave = false;
|
|
|
|
+ img.saveURL = rs.data;
|
|
|
|
+ if(++doneNum >= currentHotStyleImg.length){
|
|
|
|
+ a.resolve();
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ alert("样式图上传失败");
|
|
|
|
+ a.reject();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ else if(++doneNum >= currentHotStyleImg.length){
|
|
|
|
+ a.resolve();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return a.promise()
|
|
|
|
+ }else return a.resolve()
|
|
|
|
+
|
|
|
|
+ }).then(()=>{ //获取style图的信息
|
|
|
|
+
|
|
|
|
+ args.styleImg = [];
|
|
|
|
+ if(currStyle == "user" ){
|
|
|
|
+ currentHotStyleImg.forEach((img)=>{
|
|
|
|
+ args.styleImg.push(img.saveURL || img.src)
|
|
|
|
+ })
|
|
|
|
+ hot.styleTex = currentHotStyleImg.slice(0)
|
|
|
|
+ }else{
|
|
|
|
+ hot.styleTex = [];
|
|
|
|
+ }
|
|
|
|
+ hot.changeTex(); //更新材质
|
|
|
|
+ }).then(function () {
|
|
|
|
+ //获取热点标题、内容、内嵌网页、模型网页。
|
|
|
|
+ args.title = $title.val()
|
|
|
|
+ args.content = $content.val()
|
|
|
|
+
|
|
|
|
+ var iframes = []
|
|
|
|
+ for (var i = 0; i < $iframes.length; i++) {
|
|
|
|
+ var iframe = $iframes.eq(i).val()
|
|
|
|
+ iframe && iframes.push(iframe)
|
|
|
|
+ }
|
|
|
|
+ args.iframe = iframes
|
|
|
|
|
|
- var modules = []
|
|
|
|
- for (var i = 0; i < $modules.length; i++) {
|
|
|
|
- var module = $modules.eq(i).val()
|
|
|
|
- module && modules.push(module)
|
|
|
|
- }
|
|
|
|
- args.model = modules
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- args.position = hot.mesh.position.clone()
|
|
|
|
- args.quaternion = hot.mesh.quaternion.clone()
|
|
|
|
-
|
|
|
|
- return args
|
|
|
|
- }).then(function (args) {
|
|
|
|
- console.log(args);
|
|
|
|
- //把获取的所有信息都保存在对应热点的dom元素里面
|
|
|
|
- hotpointDetail[0].targetDOM.infoAttribute = args;
|
|
|
|
- $layout.addClass('hide');
|
|
|
|
- hotpointDetail.addClass("atRight");
|
|
|
|
- spot.find(".title").html(args.title);
|
|
|
|
- transformControls.detach()
|
|
|
|
- })
|
|
|
|
|
|
+ var modules = []
|
|
|
|
+ for (var i = 0; i < $modules.length; i++) {
|
|
|
|
+ var module = $modules.eq(i).val()
|
|
|
|
+ module && modules.push(module)
|
|
|
|
+ }
|
|
|
|
+ args.model = modules
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ args.position = hot.mesh.position.clone()
|
|
|
|
+ args.quaternion = hot.mesh.quaternion.clone()
|
|
|
|
+
|
|
|
|
+ return args
|
|
|
|
+ }).then(function (args) {
|
|
|
|
+ console.log(args);
|
|
|
|
+ //把获取的所有信息都保存在对应热点的dom元素里面
|
|
|
|
+ hotpointDetail[0].targetDOM.infoAttribute = args;
|
|
|
|
+ $layout.addClass('hide');
|
|
|
|
+ hotpointDetail.addClass("atRight");
|
|
|
|
+ spot.find(".title").html(args.title);
|
|
|
|
+ transformControls.detach()
|
|
|
|
+ })
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ var _this = this;
|
|
|
|
+ $("#isSprite").on("change",function(e){
|
|
|
|
+ _this.editSpot.isSprite = this.checked;
|
|
|
|
+ if(this.checked){
|
|
|
|
+ _this.editSpot.update(player.camera)
|
|
|
|
+ }else{
|
|
|
|
+ _this.editSpot.mesh.quaternion.copy(_this.editSpot.quaternion)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2599,21 +2615,48 @@ var EditOverlay = {
|
|
//----------------漫游可见性---------------------------------
|
|
//----------------漫游可见性---------------------------------
|
|
|
|
|
|
|
|
|
|
-var panoVisiSet = {
|
|
|
|
|
|
+var VisiSet = {
|
|
|
|
|
|
|
|
|
|
setPanoVisible : false,
|
|
setPanoVisible : false,
|
|
- //漫游可见性
|
|
|
|
-
|
|
|
|
|
|
+ setTagVisible : false,
|
|
|
|
+
|
|
panoVLines : {},//线条
|
|
panoVLines : {},//线条
|
|
- panoVTemp:null, //修改后还没保存的临时数据
|
|
|
|
|
|
+ panoVTemp:{}, //修改后还没保存的临时数据
|
|
|
|
+
|
|
|
|
+ tagVsetting:null,//正在设置的热点中心点
|
|
|
|
+ tagsVLines : {}, //线条
|
|
|
|
+
|
|
|
|
+ //tagVTemp //修改后还没保存的临时数据
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
//热点可见性
|
|
//热点可见性
|
|
$confirmSnap : $("#camera-start"),
|
|
$confirmSnap : $("#camera-start"),
|
|
colors:{green: "#00c8ae"},
|
|
colors:{green: "#00c8ae"},
|
|
init : function(){
|
|
init : function(){
|
|
this.meshGroup = new THREE.Object3D; this.meshGroup.name = "setVisible-group"
|
|
this.meshGroup = new THREE.Object3D; this.meshGroup.name = "setVisible-group"
|
|
player.model.add(this.meshGroup)
|
|
player.model.add(this.meshGroup)
|
|
|
|
+ $("#hotVisible").on("click",()=>{
|
|
|
|
+ VisiSet.enterSet(VisiSet.beginSetTagVisible.bind(VisiSet))
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
+ enterSet:function(fun){
|
|
|
|
+ var enter = function(){
|
|
|
|
+ if(player.modeTran.split('-')[1] != "floorplan"){
|
|
|
|
+ setTimeout(fun, 300)//提前一点出现
|
|
|
|
+ }
|
|
|
|
+ player.flyToMode("floorplan", fun);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ permitTranMode(false)
|
|
|
|
+ if(!player.modeTran){
|
|
|
|
+ player.afterCModeFuc = ()=>{
|
|
|
|
+ enter()
|
|
|
|
+ }
|
|
|
|
+ }else enter()
|
|
|
|
+
|
|
|
|
+ },
|
|
beginSetPanoVisible : function () {
|
|
beginSetPanoVisible : function () {
|
|
if (this.setPanoVisible ) return;
|
|
if (this.setPanoVisible ) return;
|
|
$(".toolLeft").removeClass("unable")
|
|
$(".toolLeft").removeClass("unable")
|
|
@@ -2746,7 +2789,7 @@ var panoVisiSet = {
|
|
this.panoVTemp = {};
|
|
this.panoVTemp = {};
|
|
player.flyoutType = null
|
|
player.flyoutType = null
|
|
this.$confirmSnap.addClass("hide")
|
|
this.$confirmSnap.addClass("hide")
|
|
-
|
|
|
|
|
|
+ permitTranMode(true)
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -3040,6 +3083,7 @@ var panoVisiSet = {
|
|
var geo = new THREE.PlaneGeometry(scale, scale, 1, 1)
|
|
var geo = new THREE.PlaneGeometry(scale, scale, 1, 1)
|
|
var panos = player.model.panos;
|
|
var panos = player.model.panos;
|
|
for (var r in panos.index) {
|
|
for (var r in panos.index) {
|
|
|
|
+ if(!panos.index[r].isAligned())continue;
|
|
var t = THREE.UniformsUtils.clone(shaders.waypoint.uniforms);
|
|
var t = THREE.UniformsUtils.clone(shaders.waypoint.uniforms);
|
|
t.map.value = footTex1
|
|
t.map.value = footTex1
|
|
t.color.value.set("#ffffff");
|
|
t.color.value.set("#ffffff");
|
|
@@ -3090,7 +3134,7 @@ var panoVisiSet = {
|
|
|
|
|
|
|
|
|
|
checkHasNeighbor : function(pano, state){ //检查当前状态pano点是否有可通行点
|
|
checkHasNeighbor : function(pano, state){ //检查当前状态pano点是否有可通行点
|
|
- var neighbours = this.panoVTemp && this.panoVTemp[pano.id] ? this.panoVTemp[pano.id].neighbourPanos : pano.neighbourPanos;
|
|
|
|
|
|
+ var neighbours = /* this.panoVTemp && */this.panoVTemp[pano.id] ? this.panoVTemp[pano.id].neighbourPanos : pano.neighbourPanos;
|
|
|
|
|
|
if(state != "showFoot" && pano == this.panoVsetting){//是中心点的话。state == "showFoot"代表是showFootIcon时, 这时候线还没创建,无法用线判断中心点有几个相邻点,直接用neighbourPanos
|
|
if(state != "showFoot" && pano == this.panoVsetting){//是中心点的话。state == "showFoot"代表是showFootIcon时, 这时候线还没创建,无法用线判断中心点有几个相邻点,直接用neighbourPanos
|
|
for(var i in this.panoVLines){
|
|
for(var i in this.panoVLines){
|
|
@@ -3175,6 +3219,185 @@ var panoVisiSet = {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //========热点可见性==============
|
|
|
|
+ ,
|
|
|
|
+ beginSetTagVisible : function () {
|
|
|
|
+ if (this.setTagVisible ) return;
|
|
|
|
+ $(".toolTop").addClass("unable")
|
|
|
|
+ $("#hotVisible").addClass("unable")
|
|
|
|
+
|
|
|
|
+ this.setTagVisible = true;
|
|
|
|
+ this.tagVTemp = {};
|
|
|
|
+
|
|
|
|
+ this.$confirmSnap.text('完成设置').removeClass("hide")
|
|
|
|
+
|
|
|
|
+ //objects.tagManager.hideAllTags();
|
|
|
|
+ for(let i in player.model.hots){
|
|
|
|
+ player.model.hots[i]._isSprite = player.model.hots[i].isSprite;
|
|
|
|
+ player.model.hots[i].isSprite = true;
|
|
|
|
+ player.model.hots[i].mesh.material.depthTest = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.updateFootIconSize()//更新一下大小,尤其是上次换了中心点然后退出又进入但是镜头没有变化的话
|
|
|
|
+ },
|
|
|
|
+ SetOneTagVisible : function (tag) {
|
|
|
|
+ //点击某个热点后就对该热点进行设置,或者在热点修改时对其进行设置
|
|
|
|
+ if (this.tagVsetting == tag) return;
|
|
|
|
+ if (this.tagVsetting){
|
|
|
|
+ this.saveLastTagVi(this.tagVsetting);
|
|
|
|
+ //this.tagVsetting.setElemType(this.tagVsetting.style, this.tagVsetting.styleImageURL);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.tagVsetting = tag; //记录正在修改的
|
|
|
|
+ this.delVisibleLines(); //删除线
|
|
|
|
+ this.showFootIcons(player.currentPano);
|
|
|
|
+ this.createTagVisiLines(tag); //创线
|
|
|
|
+
|
|
|
|
+ this.updateFootIconSize()//更新一下大小,尤其是上次换了中心点然后退出又进入但是镜头没有变化的话
|
|
|
|
+ }
|
|
|
|
+ ,
|
|
|
|
+ saveLastTagVi : function () { //保存刚设置过的tag
|
|
|
|
+ var change = false;
|
|
|
|
+ var newVPs = this.tagVTemp[this.tagVsetting.sid] || this.tagVsetting.visiblePanos.slice(0);
|
|
|
|
+ for (var r in this.tagsVLines) {
|
|
|
|
+ var line = this.tagsVLines[r];
|
|
|
|
+ if (line.name.indexOf("new") > -1 && line.visible) {
|
|
|
|
+ //新设置为visible且没有取消
|
|
|
|
+ newVPs.push(r)
|
|
|
|
+ change = true;
|
|
|
|
+ //console.log("add: "+r)
|
|
|
|
+ } else if (line.name.indexOf("new") == -1 && !line.visible) {
|
|
|
|
+ //旧的且已经取消
|
|
|
|
+ var i = newVPs.indexOf(r);
|
|
|
|
+ if (i == -1) {
|
|
|
|
+ console.log("visiblePanos删除error");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ newVPs.splice(i, 1);
|
|
|
|
+ change = true;
|
|
|
|
+ //console.log("sub: "+r)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (change) {
|
|
|
|
+ this.tagVTemp[this.tagVsetting.sid] = newVPs;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ,
|
|
|
|
+ pauseSetTagVisible : function () { //pc保存后删除连线 但还在继续设置 点选热点即开始
|
|
|
|
+ if (!this.setTagVisible || !this.tagVsetting) return;
|
|
|
|
+ //this.tagVsetting.setElemType(this.tagVsetting.style, this.tagVsetting.styleImageURL );
|
|
|
|
+ this.delVisibleLines();
|
|
|
|
+ this.hideFootIcons();
|
|
|
|
+ this.tagVTemp = {};
|
|
|
|
+ this.tagVsetting = null;
|
|
|
|
+ }
|
|
|
|
+ ,
|
|
|
|
+ finishSetTagVisible : function () {
|
|
|
|
+ if (!this.setTagVisible) return;
|
|
|
|
+ $(".toolTop").removeClass("unable")
|
|
|
|
+ $("#hotVisible").removeClass("unable")
|
|
|
|
+ this.pauseSetTagVisible();
|
|
|
|
+ this.setTagVisible = false;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //this.setDisplay(false)
|
|
|
|
+ this.$confirmSnap.addClass("hide")
|
|
|
|
+ permitTranMode(true)
|
|
|
|
+ /* for (var r in objects.tagManager.tags) {
|
|
|
|
+ if(objects.tagManager.tags[r].state == "videoPanoFlag")continue;
|
|
|
|
+ objects.tagManager.tags[r].disc.visible = false;
|
|
|
|
+ objects.tagManager.tags[r].disc.material.depthTest = true;
|
|
|
|
+ } */
|
|
|
|
+ for(let i in player.model.hots){
|
|
|
|
+ player.model.hots[i].isSprite = player.model.hots[i]._isSprite;
|
|
|
|
+ player.model.hots[i].isSprite || player.model.hots[i].mesh.quaternion.copy(player.model.hots[i].quaternion)
|
|
|
|
+ player.model.hots[i].mesh.material.depthTest = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ,
|
|
|
|
+
|
|
|
|
+ /* saveTagVisibles : function () { //保存到服务器
|
|
|
|
+ if (this.tagVsetting) this.saveLastTagVi(this.tagVsetting); //获取最后设置的那个热点的改动
|
|
|
|
+ //可能出现数据没变但保存的情况。比如先改变了然后切换别的热点但切换回来时又改回来。
|
|
|
|
+ var tags = [];
|
|
|
|
+ for (var i in this.tagVTemp) {
|
|
|
|
+ tags.push({
|
|
|
|
+ sid: i,
|
|
|
|
+ value: this.tagVTemp[i]//turnToPanoIndex(this.tagVTemp[i])
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (tags.length == 0) {//没有需要保存的改动
|
|
|
|
+
|
|
|
|
+ this.finishSetTagVisible()
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return tags;
|
|
|
|
+ } */
|
|
|
|
+
|
|
|
|
+ //afterSaveTagVisibles : function(){
|
|
|
|
+ saveTagVisibles : function () {
|
|
|
|
+ if (this.tagVsetting) this.saveLastTagVi(this.tagVsetting);
|
|
|
|
+ for (var i in this.tagVTemp) { //保持成功于是生效
|
|
|
|
+ player.model.hots[i].visiblePanos = this.tagVTemp[i];
|
|
|
|
+ }
|
|
|
|
+ this.finishSetTagVisible()//还是保存完直接结束吧,因为现在热点可视不放在单独的设置页面了
|
|
|
|
+ }
|
|
|
|
+ ,
|
|
|
|
+ createTagVisiLines : function (tag) {
|
|
|
|
+ // 热点可见性线条
|
|
|
|
+ var panos = player.model.panos;
|
|
|
|
+ tag.visiblePanos || tag.setVisiblePanos("get")
|
|
|
|
+
|
|
|
|
+ var visibleList = this.tagVTemp[tag.sid] || tag.visiblePanos;
|
|
|
|
+ //如果是刚在设置的要读取设置过的数据
|
|
|
|
+ for (var r = 0; r < visibleList.length; r++) {
|
|
|
|
+ var pano = panos.index[visibleList[r]];
|
|
|
|
+ this.createTagSingleLine(pano, "old", tag)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ,
|
|
|
|
+ createTagSingleLine : function (pano, type, tag) {
|
|
|
|
+ var panos = player.model.panos;
|
|
|
|
+ var line = LineDraw.createLine([pano.floorPosition.clone()/* .sub(this.position) */, tag.mesh.position.clone()], {
|
|
|
|
+ color: this.colors.green
|
|
|
|
+ });
|
|
|
|
+ this.meshGroup.add(line);
|
|
|
|
+ line.name = "tagVL-" + type + "-" + pano.id;
|
|
|
|
+ this.tagsVLines[pano.id] = line;
|
|
|
|
+ this.changeFIconState(panos.index[pano.id].footIcon, "linked")
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ ,
|
|
|
|
+ dealTagVisible : function (tag, panoName) {
|
|
|
|
+ //外部调用
|
|
|
|
+ var panos = player.model.panos;
|
|
|
|
+ if (this.tagsVLines[panoName]) {
|
|
|
|
+ this.tagsVLines[panoName].visible = !this.tagsVLines[panoName].visible;
|
|
|
|
+ this.changeFIconState(panos.index[panoName].footIcon, this.tagsVLines[panoName].visible?"linked":false)
|
|
|
|
+ } else {
|
|
|
|
+ this.createTagSingleLine(panos.index[panoName], "new", tag)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ,
|
|
|
|
+ delVisibleLines : function () {
|
|
|
|
+ //xzw add 所有线都删除
|
|
|
|
+ for (var i in this.tagsVLines) {
|
|
|
|
+ this.tagsVLines[i].geometry.dispose();
|
|
|
|
+ this.tagsVLines[i].material.dispose();
|
|
|
|
+ this.meshGroup.remove(this.tagsVLines[i]);
|
|
|
|
+ delete this.tagsVLines[i];
|
|
|
|
+ }
|
|
|
|
+ for (var i in this.panoVLines) {
|
|
|
|
+ this.panoVLines[i].geometry.dispose();
|
|
|
|
+ this.panoVLines[i].material.dispose();
|
|
|
|
+ this.meshGroup.remove(this.panoVLines[i]);
|
|
|
|
+ delete this.panoVLines[i];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|