Commit b6edece5 authored by xioln's avatar xioln

图标名称修改和详情问题修改

parent 29c4c545
/*
* @Descripttion:
* @version:
* @Author: zp
* @Date: 2019-10-22 09:22:12
* @LastEditors: zp
* @LastEditTime: 2020-03-09 20:32:14
*/
// import * as BIM from "./BIM3DViewer"; // react里的用法
// import "./BIM3DViewer.js";
/**
* @description:
* @param {type} dom
* @param {number} BMcubeSize 罗盘大小,默认35
* @param {array} cubeImageUrl 罗盘图片路,数组,例["../../img/home.png", "../../img/up.png", "../../img/down.png"];(不传时则不创建罗盘)
* @param {object} options json对象。相关系统配置,参数见下面。
* @param {string} options.wasmURL wasm文件目录,将图形包的wasm文件放服务器后,将能通过url访问到该wasm文件的地址传入。当wasmURL属性有值时,licenseContent必须传入。
* 当控制台出现Error: wasm file is error时,表示传入的wasmURL无效。
* @param {string} options.licenseContent 授权文件内容,将授权文件的内容获取到以字符串形式传入该值。当licenseContent属性有值时,wasmURL必须传入。
* @param {boolean} options.HRender 让场景渲染更有立体感,但是很占用cpu,建议性能好的电脑开启,默认为false。
* @param {number} options.near 近平面值,当该值不传时默认为0.01
* @param {number} options.far 远平面值,当该值不传时默认为100000
* @param {string} options.pmiFont pmi字体路径,当需要加载PMI的模型时,使用图形包里的PMIFont.ttf并配置路径。
*/
var BIM3DInterface = function(dom, BMcubeSize, cubeImageUrl, options) {
this.viewer = new BIM.BimViewer(dom, BMcubeSize, cubeImageUrl, options)
this.domElement = this.viewer.container
}
BIM3DInterface.prototype = {
/**
* 销毁BIMViewer。
*/
dispose: function() {
this.viewer.dispose()
},
/**
* 重置窗口大小,创建BIM3DInterface对象后调用下该方法,浏览器窗口大小改变时也应调用此方法。
* @param {number} height 窗口高度,当为undefined时使用100%;
* @param {number} width 窗口宽度,当为undefined时使用100%;
*/
resize: function(height, width) {
this.viewer.onWindowResize(height, width)
},
/**
* 加载模型文件。支持glb和gltf格式。
* @param {*} filenames 文件的url地址。支持数组对象,例如["url1","url2"]。
* @param {*} isHide 是否隐藏,true隐藏加载的模型,false不隐藏。
* @param {*} requestHeader {name:"",value:token};
*/
appendFile: function(filenames, isHide, requestHeader) {
this.viewer.appendFile(filenames, isHide, requestHeader)
},
/**
* 移除模型。
* @param {*} filenames 需要移除场景里模型的url地址。支持数组对象,例如["url1","url2"]。
*/
removeFile: function(filenames) {
this.viewer.removeFile(filenames)
},
/**
* 清空场景。
* @param {*} callback
*/
clearScene: function() {
this.viewer.removeScene()
},
/**
* 添加模型加载完毕回调。当调用appendFile接口加载的模型文件加载完毕则调用改回调。。
* @param {*} callback 文件加载成功后调用的回调方法,第一个参数为当前加载的文件url,第二个参数整数值,0失败,1成功。
*/
addAppendFileCallBack: function(callback) {
this.viewer.AddAppendFileCallBack(callback)
},
/**
* 添加选中模型回调方法。
* @param {*} callback 选中模型调用的方法。该方法需要定义一个函数参数。返回为object对象,
* 可用该对象调用接口来控制颜色,透明度等模型操作。可以使用该对象的name属性,该属性为字符串。为模型的名字id。
* 注意:针对实例化PMI,选中实例化PMI模型是,选中单个实例化PMI,返回的对象name属性包含实例化id,则为"#实例化id#pmi的id"。
*/
addSelectObjectCallBack: function(callback) {
this.viewer.AddSelectObjectCallBack(callback)
},
/**
* 设置场景裁剪。
* @param {number} value 裁剪值,系统默认为0。
*/
setOptionCullingThreshold: function(value) {
this.viewer.setOptionCullingThreshold(value)
},
/**
* 设置场景背面剔除。
* @param {cull} cull 是否剔除背面渲染,当模型三角面数量大时开启能提升渲染性能。true为开启,false为关闭,默认关闭。
*/
setOptionBackfaceCull: function(cull) {
this.viewer.setOptionBackfaceCull(cull)
},
/**
* 设置模型高亮。
* @param {*} id string类型 需要高亮的模型id,多个则传数组。
* @param {*} whetherAdd 是否增加到当前高亮对象。true则将传入id追加到当前高亮对象,false则取消当前场景高亮的对象,高亮当前传入对象。
* 当id为"",whetherAdd为false时候,清除场景里的所有选中。
* 注意:针对实例化PMI,传入的id值则为"#实例化id#pmi的id"。
*/
setModelSelection: function(id, whetherAdd) {
this.viewer.setModelSelection(id, whetherAdd)
},
/**
* 设置模型显示隐藏。
* @param {*} id 需要显示隐藏的模型id。
* @param {*} visible 是否可见,true显示,false隐藏。
* @param {*} option 操作类型,传入0表示对传入的对象进行操作。传入1表示对传入的对象之外的对象进行操作。
* 注意:针对实例化PMI,传入的id值则为"#实例化id#pmi的id"。
*/
setModelVisible: function(id, visible, option) {
this.viewer.setModelVisibleNew(id, visible, option)
},
/**
* 设置标准视图。
* @param {*} type 视图的类型。0-主视图,1-前视图,2-后视图,3-左视图,4-右视图,5-顶视图,6-底视图。
*/
setStandardView: function(type) {
this.viewer.setStandardView(type)
},
/**
* 根据RGB值设置模型颜色。
* @param {*} ids 需要修改颜色的模型id。支持传入数组。
* @param {*} red 红色值,取值范围0-255。
* @param {*} green 绿色值,取值范围0-255。
* @param {*} blue 蓝色值,取值范围0-255。
* @param {*} option 操作类型,传入0表示对传入的对象进行操作。传入1表示对传入的对象之外的对象进行操作。
* 注意:针对实例化PMI,传入的id值则为"#实例化id#pmi的id"。
*/
setModelColorByRGB: function(ids, red, green, blue, option) {
this.viewer.setModelColorByRGB(ids, red, green, blue, option)
},
/**
* 根据十六进制值设置模型颜色。
* @param {*} ids 需要修改颜色的模型id。支持传入数组。
* @param {*} hexColor 十六进制颜色值,例如红色0xff0000。
* @param {*} option 操作类型,传入0表示对传入的对象进行操作。传入1表示对传入的对象之外的对象进行操作。
* 注意:针对实例化PMI,传入的id值则为"#实例化id#pmi的id"。
*/
setModelColorByHex: function(ids, hexColor, option) {
this.viewer.setModelColorByHex(ids, hexColor, option)
},
/**
* 恢复模型颜色。
* @param {*} ids 需要恢复颜色的模型id。支持传入数组。
* @param {*} option 操作类型,传入0表示对传入的对象进行操作。传入1表示对传入的对象之外的对象进行操作。
*/
restoreModelColor: function(ids, option) {
this.viewer.restoreModelColor(ids, option)
},
/**
* 设置模型透明度。
* @param {*} ids 需要设置透明度的模型id。支持传入数组。
* @param {*} alpha 透明度值。取值范围0到1。0-不透明,1透明。
* @param {*} option 操作类型,传入0表示对传入的对象进行操作。传入1表示对传入的对象之外的对象进行操作。
* 注意:针对实例化PMI,传入的id值则为"#实例化id#pmi的id"。
*/
setModelAlpha: function(ids, alpha, option) {
this.viewer.setModelAlpha(ids, alpha, option)
},
/**
* 恢复模型透明度。
* @param {*} ids 需要恢复透明度的模型id。支持传入数组。
* @param {*} option 操作类型,传入0表示对传入的对象进行操作。传入1表示对传入的对象之外的对象进行操作。
*/
restoreModelAlpha: function(ids, option) {
this.viewer.restoreModelAlpha(ids, option)
},
/**
* 根据id创建文字标签。
* @param {*} ids 需要创建文字标签的id。支持传入数组。
* @param {*} height 文字线的高度。
* @param {*} isWorldHeight 是否是世界坐标高度。
* @param {*} text 文字标签内容。
* @returns 返回数组对象,每个元素为html的a元素对象。可用来设置自定义风格以及添加事件。切记在调用dispose接口之前将返回的数组清空,否则回造成内存泄露。
*/
setModelTextLabel: function(ids, height, isWorldHeight, text) {
return this.viewer.setModelTextLabel(ids, height, isWorldHeight, text)
},
/**
* 移除文本标签。
* @param {Array?} ids 需要移除文字标签关联的id数组,当不传值时清除所有标签。
*/
removeModelTextLabelByIDs: function(ids) {
this.viewer.removeModelTextLabelByIDs(ids)
},
/**
* 移除文本标签。
* @param {Array?} divs 该参数由setModelTextLabel接口返回,当不传值时清除所有标签。
*/
removeModelTextLabelByDivs: function(divs) {
this.viewer.removeModelTextLabelByDivs(divs)
},
/**
* 根据id创建图像标签。
* @param {*} ids 需要创建图像标签的id。支持传入数组。
* @param {*} image_url 图像url地址。
* @param {*} image_width 图像标签宽度。
* @param {*} image_height 图像标签高度。
* @returns 返回数组对象,每个元素为html的img元素对象。可用来设置自定义风格以及添加事件。切记在调用dispose接口之前将返回的数组清空,否则回造成内存泄露。
*/
setModelImageLabel: function(ids, image_url, image_width, image_height) {
return this.viewer.setModelImageLabel(
ids,
image_url,
image_width,
image_height
)
},
/**
* 移除图像标签。
* @param {Array?} ids 需要移除图像标签关联的id数组,当不传值时清除所有标签。
*/
removeModelImageLabelByIDs: function(ids) {
this.viewer.removeModelImageLabelByIDs(ids)
},
/**
* 移除图像标签。
* @param {Array?} divs 该参数由setModelImageLabel接口返回,当不传值时清除所有标签。
*/
removeModelImageLabelByDivs: function(divs) {
this.viewer.removeModelImageLabelByDivs(divs)
},
/**
* 根据id创建任意html标签。
* @param {*} ids 需要创建图像标签的id。支持传入数组。
* @param {*} htmlValues html的字符串。
* @returns 返回数组对象,每个元素为html的根元素对象。可用来设置自定义风格以及添加事件。切记在调用dispose接口之前将返回的数组清空,否则回造成内存泄露。
*/
setModelAnyLabel: function(ids, htmlValues) {
return this.viewer.setModelAnyLabel(ids, htmlValues)
},
/**
* 移除html标签。
* @param {Array?} ids 需要移除html标签关联的id数组,当不传值时清除所有标签。
*/
removeModelAnyLabelByIDs: function(ids) {
this.viewer.removeModelAnyLabelByIDs(ids)
},
/**
* 移除html标签。
* @param {Array?} divs 该参数由setModelAnyLabel接口返回,当不传值时清除所有标签。
*/
removeModelAnyLabelByDivs: function(divs) {
this.viewer.removeModelAnyLabelByDivs(divs)
},
/**
* 设置轮廓线显示隐藏。
* @param {bool} visible true为显示,false为隐藏。默认为false。在场景过大时建议关闭该效果。
*/
setOutlineVisible: function(visible) {
this.viewer.setOutlineVisible(visible)
},
/**
* 设置轮廓线颜色
* @param {*} hexColor 十六进制颜色值,例如红色0xff0000。
*/
setOutlineColor: function(hexColor) {
this.viewer.setOutlineColor(hexColor)
},
/**
* 设置轮廓线宽度
* @param {*} width 轮廓线条宽度,该值最小为0.1。默认为4。
*/
setOutlineWidth: function(width) {
this.viewer.setOutlineWidth(width)
},
/**
* 获取摄像机信息。
* @returns 返回当前摄像机信息,格式为json对象。例如
* {
cmPosition:{x:0.0,y:0.0,z:0.0},cmTarget:{x:10.0,y:10.0,z:10.0},cmUp:{x:0.0,y:0.0,z:1.0}
};
*/
getCamera: function() {
return this.viewer.getCamera()
},
/**
* 设置摄像机信息。
* @param {*} cameraInfo 摄像机信息的json格式对象。
*/
setCamera: function(cameraInfo) {
this.viewer.setCamera(cameraInfo)
},
/**
* 设置控件背景。
* @param {*} topColor 顶部颜色值。css字符串。例如"#FF0000"红色。
* @param {*} bottomColor 底部颜色值。css字符串。例如"#00FF00"绿色。
*/
setBackground: function(topColor, bottomColor) {
this.viewer.setBackground(1, topColor, bottomColor)
},
/**
* 设置模型隔离。
* @param {*} ids 需要隔离对象的id,支持数组。
* @param {*} bQuarantine 是否隔离对象,true隔离,false取消隔离。
* @param {*} option 操作类型,传入0表示对传入的对象进行操作。传入1表示对传入的对象之外的对象进行操作。
* 注:当ids传入""时,bQuarantine传入false,option传入1时取消所有隔离。
* 注意:针对实例化PMI,传入的id值则为"#实例化id#pmi的id"。
*/
setModelQuarantine: function(ids, bQuarantine, option) {
this.viewer.setModelQuarantine(ids, bQuarantine, option)
},
/**
* 获取视点。视点内容包括标注信息。
* @returns 返回json对象。
*/
getViewpoint: function() {
return this.viewer.getViewpoint()
},
/**
* 恢复视点。视点信息包括标注信息。
* @param {*} viewpoint 视点信息,getViewpoint接口返回的json对象。
* @param {*} needsUpdate 是否需要恢复后可更改视点信息(标注的修改等),当为true时默认进入标注状态,场景没法旋转等操作。传入false则不进入标注状态。
*/
setViewpoint: function(viewpoint, needsUpdate) {
this.viewer.setViewpoint(viewpoint, needsUpdate)
},
/**
* 截图功能,返回 Promise
* 回调包含图片展示的data URI。数据头为data:image/png;
*/
screenshots: function() {
return this.viewer.screenshots()
},
/**
* 箭头标注(有弹窗)
* @param {function} con 用于获取返回值的回调函数。如 const con = a => {console.log(a)} a为返回值
*
*/
arrowMarkWithPanel: function(con) {
this.viewer.arrowMark(con)
},
/**
* 箭头标注(无弹窗)。
* @param {*} color 颜色 #ffffff(str)
* @param {*} width 线宽 线的粗细(单位像素)
*/
arrowMark: function(color, width) {
this.viewer._arrowMark(color, width)
},
/**
* 圆形标注(有弹窗)
* @param {function} con 用于获取返回值的回调函数。如 const con = a => {console.log(a)} a为返回值
*
*/
circleMarkWithPanel: function(con) {
this.viewer.circleMark(con)
},
/**
* 圆形标注(无弹窗)
* @param {*} color 颜色 #ffffff(str)
* @param {*} width 线宽 线的粗细(单位像素)
*/
circleMark: function(color, width) {
this.viewer._circleMark(color, width)
},
/**
* 椭圆形标注(有弹窗)
* @param {function} con 用于获取返回值的回调函数。如 const con = a => {console.log(a)} a为返回值
*
*/
ellipseMarkWithPanel: function(con) {
this.viewer.ellipseMark(con)
},
/**
* 椭圆形标注(无弹窗)
* @param {*} color 颜色 #ffffff(str)
* @param {*} width 线宽 线的粗细(单位像素)
*/
ellipseMark: function(color, width) {
this.viewer._ellipseMark(color, width)
},
/**
* 矩形标注(有弹窗)
* @param {function} con 用于获取返回值的回调函数。如 const con = a => {console.log(a)} a为返回值
*
*/
rectMarkWithPanel: function(con) {
this.viewer.rectMark(con)
},
/**
* 矩形标注(无弹窗)
* @param {*} color 颜色 #ffffff(str)
* @param {*} width 线宽 线的粗细(单位像素)
*/
rectMark: function(color, width) {
this.viewer._rectMark(color, width)
},
/**
* 简单箭头标注(有弹窗)
* @param {function} con 用于获取返回值的回调函数。如 const con = a => {console.log(a)} a为返回值
*
*/
simpleArrowMarkWithPanel: function(con) {
this.viewer.simpleArrowMark(con)
},
/**
* 简单箭头标注(无弹窗)
* @param {*} color 颜色 #ffffff(str)
* @param {*} width 线宽 线的粗细(单位像素)
*/
simpleArrowMark: function(color, width) {
this.viewer._simpleArrowMark(color, width)
},
/**
* @description: 正多边形标注(有弹窗)
* @param {type} con 用于获取返回值的回调函数。如 const con = a => {console.log(a)} a为返回值
* @return:
*/
regularPolygonMarkWithPanel: function(con) {
this.viewer.regularPolygonMark(con)
},
/**
* @description: 正多边形标注(无弹窗)
* @param {*} color 颜色 #ffffff(str)
* @param {*} width 线宽 线的粗细(单位像素)
* @param {*} segments 边数 线的粗细(单位像素)
* @return:
*/
regularPolygonMark: function(color, width, segments) {
this.viewer._regularPolygonMark(color, width, segments)
},
/**
* @description: 任意多边形标注(有弹窗)
* @param {type} con 用于获取返回值的回调函数。如 const con = a => {console.log(a)} a为返回值
* @return:
*/
polygonMarkWithPanel: function(con) {
this.viewer.polygonMark(con)
},
/**
* @description: 任意多边形标注(无弹窗)
* @param {*} color 颜色 #ffffff(str)
* @param {*} width 线宽 线的粗细(单位像素)
* @return:
*/
polygonMark: function(color, width) {
this.viewer._polygonMark(color, width)
},
/**
* 文字标注
* @param {*} text 文字内容 str
* @param {*} color 文字颜色 例如:#ffffff(str)
* @param {*} bgColor 背景颜色 例如:#ffffff(str)
* @param {*} fontSize 字体大小 int
* @param {*} lineWidth 标注宽度(行宽)int
*/
textMark: function(text, color, bgColor, fontSize, lineWidth) {
this.viewer.textMark(text, color, bgColor, fontSize, lineWidth)
},
/**
* 退出标注
*/
endMark: function() {
this.viewer.endMark()
},
// 清空标注
clearMark: function() {
this.viewer.disposeMark()
},
/**
* 获取选中标注信息
*/
getSelectMarkInfo: function() {
return this.viewer.bimMark.getSelectMarkInfo()
},
// ToDO
/**
* 设置标注 除文字标注外的其他所有标注
* @param {*} color 颜色 #ffffff(str)
* @param {*} width 线宽 线的粗细(单位像素)
*/
setSelectMark: function(color, width) {
this.viewer.bimMark.setSelectMark(color, width)
},
/**
* 设置文字标注
* @param {*} text 文字内容 str
* @param {*} color 文字颜色 例如:#ffffff(str)
* @param {*} bgColor 背景颜色 例如:#ffffff(str)
* @param {*} fontSize 字体大小 number
* @param {*} lineWidth 标注宽度(行宽) number
*/
setSelectText: function(text, color, bgColor, fontSize, lineWidth) {
this.viewer.bimMark.setSelectText(
text,
color,
bgColor,
fontSize,
lineWidth
)
},
/**
* 获取面片
*/
getModelInfo: function() {
return this.viewer.getModelInfo()
},
/**
* 炸开
* @param {*} offset 偏移倍数 number 一般设为1
* @param {*} time 时间 number 毫秒计 1000为1秒
* @param {number} 系数取0-1的值。当time为0时候,该值有效。
*/
explodeModels: function(offset, time, factor) {
this.viewer.explodeModels(offset, time, factor)
},
/**
* 炸开归位
*/
backHomeModels: function() {
this.viewer.backHomeModels()
},
/**
* 设置模型是否闪烁
* @param {*} object 需操作的模型对象,支持传入数组。
* @param {*} color 颜色 0xffffff 十六进制
* @param {*} time 间隔时间 number,单位为毫秒。
*/
setModelFlicker: function(object, color, time) {
this.viewer.setModelFlicker(object, color, time)
},
/**
* 取消闪烁
* @param {*} object 需操作的模型对象,支持传入数组。传入''表示清除所有闪烁。
* 注意:当调用removeFile文件时,请先调用stopModelFlicker接口,移除闪烁,否则会造成内存泄漏。
*/
stopModelFlicker: function(object) {
this.viewer.stopModelFlicker(object)
},
/**
* 设置测量标签文本显示的小数点位数。系统默认为2。需要在控件初始化或者调用测量接口之前调用。
* @param {number} length 文本小数点长度,非负数。当传入小于0的值则等于0
*/
setMeasureTextDecimalPlaces: function(length) {
this.viewer.setMeasureTextDecimalPlaces(length)
},
/**
* 点测量 激活点测量状态 传入isOnlyZ true 为高程测量 undefined为点测量
*/
measurePoint: function(isOnlyZ) {
this.viewer.measurePoint(isOnlyZ)
},
/**
* 点点测量 激活点点测量状态
*/
measurePtop: function() {
this.viewer.measurePtop()
},
/**
* 边点测量 激活边点测量状态
*/
measureLtop: function() {
this.viewer.measureLtop()
},
/**
* @description: 面点测量 激活面点测量状态
* @param {type}
* @return:
*/
measureFtop: function() {
this.viewer.measureFtop()
},
/**
* @description: 边边测量 激活面点测量状态
* @param {type}
* @return:
*/
measureLtol: function() {
this.viewer.measureLtol()
},
/**
* @description: 三点角度测量 激活三点角度测量
* @param {type}
* @return:
*/
measureAngleByPoints: function() {
this.viewer.measureAngleByPoints()
},
/**
* @description: 开始半径测量
* @param {type}
* @return:
*/
measureRadius: function() {
this.viewer.measureRadius()
},
/**
* @description: 体积测量。调用endMeasure结束。
* @return: 无。
*/
measureVolume: function() {
this.viewer.measureVolume()
},
/**
* @description: 面积测量 。调用endMeasure结束。
* @return: 无。
*/
measureArea: function() {
this.viewer.measureArea()
},
/**
* 计算体积。
* @param {string} id 需要计算体积的模型id。
*/
computeVolume: function(id) {
return this.viewer.computeVolume(id)
},
/**
* 退出测量状态
*/
endMeasure: function() {
this.viewer.endMeasure()
},
/**
* @description: 配置测量
* @param {type} Object类型
* {boardFill:[177,201,237],数值面板填充色
boardStroke:[221,221,221],数值面板描边色
textStroke:[255,255,255],数值颜色
hoverPointColor:[255,0,0],测量时顶点选中颜色
selectPointColor:[255,255,0],测量点确认后、测量时顶点未选中颜色
hoverLineColor:[255,0,0],测量边未选择颜色
selectLineColor:[255,255,0],测量边确认后颜色
lineColor:[255,255,255],虚线颜色
boardFont:'宋体',数值面板字体
可传undefined,默认如上
* @return:
*/
setMeasureColor: function(object) {
this.viewer.setMeasureColor(object)
},
/**
* 删除视点
*/
deleteViewPoint: function() {
this.viewer.deleteViewPoint()
},
/**
* 删除选中标注
*/
deleteSelectMark: function() {
this.viewer.bimMark.deleteSelectMark()
},
// 清空标注
disposeMark: function() {
this.viewer.disposeMark()
},
/**
* 设置环境光颜色、强度。
* @param {*} color 环境光颜色。css字符串。例如"#FFFFFF"白色。系统默认"#888888"
* @param {*} intensity 默认强度1.0
*/
setAmbientLight: function(color, intensity) {
this.viewer.setAmbientLight(color, intensity)
},
/**
* 设置相机光颜色、强度
* @param {*} color 摄像机灯光颜色。css字符串。例如"#FFFFFF"白色。系统默认"#f4f8f9"
* @param {*} intensity 默认强度0.25
*/
setCameraLight: function(color, intensity) {
this.viewer.setDirectionalLight(color, intensity)
},
/**
* 是否使用遮蔽效果,该效果会使模型更有层次感,但是会对渲染效率有影响。
* @param {boolean} enable true开启,false关闭。默认关闭。
*/
setEffectOcclusion: function(enable) {
this.viewer.setEffectOcclusion(enable)
},
/**
* 根据id来zoomfit 不传参数就是重置视口
* @param {*} id 模型对象id 可是string数组
* @param {*} factor 距离因子,传入大于0的值,当传入undefine时该值为1。该值越大,居中后的模型看到越小,也就是摄像机距离该居中对象越远。
*/
zoomFit: function(id, factor) {
this.viewer.zoomFit(id, factor)
},
/**
* 设置选中高光颜色和强度
* @param {*} color 默认0x0000ff
* @param {*} intensity 默认1
*/
setSelectColorIntensity: function(color, intensity) {
this.viewer.setSelectColorIntensity(color, intensity)
},
// 更改描边颜色
setOutLineColor: function(color) {
this.viewer.setOutLineColor(color)
},
/**
* 高亮边开关
* @param {*} bool bool变量 true打开,false关闭
*/
setHighlightedLine: function(bool) {
this.viewer.setHighlightedLine(bool)
},
/**
* 高亮面开关
* @param {*} bool bool变量 true打开,false关闭
*/
setHighlightedFace: function(bool) {
this.viewer.setHighlightedFace(bool)
},
/**
* @description: 设置点测量偏移点 默认为[0,0,0] 顺序对应xyz
* @param {type} Array
* @return:
*/
setOffsetPoint: function(arr) {
this.viewer.setOffsetPoint(arr)
},
/**
* @description: 是否隐藏剖切参考面 (参考面默认是显示状态)
* @param {type} bool true隐藏 false显示 必须处于剖切状态才可调用
* @return:
*/
hiddenCap: function(bool) {
this.viewer.hiddenCap(bool)
},
/**
* @description: 打开剖切盒
* @param {type}
* @return:
*/
startBoxClip: function() {
this.viewer.startBoxClip()
},
/**
* @description: 关闭剖切盒
* @param {type}
* @return:
*/
endBoxClip: function() {
this.viewer.endBoxClip()
},
/**
* 设置轴剖切。
* @param {number} type 0-yz平面剖切,1-xz平面剖切,2-xy平面剖切。
* @param {boolean} visible true创建,false删除。
*/
setAxisClip: function(type, visible) {
this.viewer.setAxisClip(type, visible)
},
/**
* @description: 是否隐藏剖切参考面操作轴 (参考面操作轴默认是显示状态)
* @param {type} bool true隐藏 false显示 必须处于剖切状态才可调用
* @return:
*/
hiddenCapGizmo: function(bool) {
this.viewer.hiddenCapGizmo(bool)
},
/**
* 根据传入数据实例化模型。
* @param {*} modelValue 模型参数。
* 参数格式为json对象
{
"asset":[
{"file":"文件路径","id":"实例id","matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},
{...}
]
}
* @param {*} callback 回调方法,在加载完该次所有加载的模型后调用该回调,回调方法参数为callbackValue传入的值,如果没值则返回undefined。
* @param {*} callbackValue 回调方法参数。在处理完改次所有数据后,如果传入回调方法,则在回调方法参数里传入该值。
*/
instanceModel: function(modelValue, callback, callbackValue) {
this.viewer.instanceModel(modelValue, callback, callbackValue)
},
/**
* 移除实例化的模型。
* @param {*} ids 需要移除的模型id,根据instanceModel第一参数传入的id值。可传单个字符串以及字符串数组。
*/
removeInstanceModel: function(ids) {
this.viewer.removeInstanceModel(ids)
},
/**
* @description: 传入bool值来控制是否更新
* @param {type} 布尔
* @return:
*/
enableRender: function(bool) {
this.viewer.enableRender(bool)
},
/**
* 设置摄像机进入模型内部的最短距离。
* @param {number} distance 穿入模型的最短距离。大场景建议0.5,小场景建议0.005即可。根据用户自定义适配。
*/
setMinEnterDistance: function(distance) {
this.viewer.setMinEnterDistance(distance)
},
/**
* 清除场景里所有测量。
*/
clearMeasures: function() {
this.viewer.clearMeasures()
},
/**
* @description: 剖切新接口 进入剖切状态
* @param {type} mode 拾取模式 1为直线法 2为自由
* @return {type}
*/
startClip: function(mode) {
this.viewer.startClip(mode)
},
/**
* @description: 剖切新接口 退出剖切状态
* @param {type}
* @return {type}
*/
endClip: function() {
this.viewer.endClip()
},
/**
* @description: 清空剖切
* @param {type}
* @return {type}
*/
clearClip: function() {
this.viewer.clearClip()
},
/**
* @description: 对模型id进行碰撞检测
* @param {string} firstId 需要碰撞的模型的id
* @param {string} secondID 需要碰撞的模型的id
* @return: true碰撞,false没碰撞。
*/
collisionDetection: function(firstId, secondID) {
return this.viewer.collisionDetectionByName(firstId, secondID)
},
/**
* @description: 使用异步的方式进行两组数据的碰撞检测。当需要进行碰撞的模型多的时候可以使用这个方法,
* 由于浏览器的异步不是真正的多线程,所以单个数组对象不要传入多了。
* @param {array} idArr1 id数组1
* @param {array} idArr2 id数组2
* @param {function} callback(result) 回调 碰撞检测结束后执行 返回[{id1:id1,id2:id2},...]互相碰撞的id对。
* @return 无:
*/
collisionDetectionByIdsAsync: function(idArr1, idArr2, callback) {
this.viewer.collisionDetectionByIdsAsync(idArr1, idArr2, callback)
},
/**
* 根据建模软件导出的视图信息来创建webgl视图。注意,相同的数据可以多次创建,且返回的id不同。所以在使用的时候外部注意判断。
* @param {object} cameraInfo 摄像机信息对象,由*_pmi.xml里的数据组成。
* @param {string} cameraInfo.Position 摄像机位置信息,将xml里Camera下的Position字段的内容赋值给该对象。
* @param {string} cameraInfo.Target 摄像机位置信息,将xml里Camera下的Target字段的内容赋值给该对象。
* @param {string} cameraInfo.Up 摄像机位置信息,将xml里Camera下的Up字段的内容赋值给该对象,
* 从Catia转出的xml中有该值,UG转出的xml中是没有该值的,如没有则不传即可。
* @param {string} cameraInfo.matrix 摄像机矩阵,将xml里Camera下的Matrix字段的内容赋值给该对象,
* 从Catia转出的xml中没有该值,UG转出的xml中有该值。如果没有则不传。
* 例如:从Catia中转出的xml,则cameraInfo对象为
* {
* Position:"35.052445 -0.585720 0.962783",
* Target:"34.834989 0.142819 1.697220",
* Up:"-0.000459 -0.000695 0.000554"
* }
* @param {string} pmiIds 关联的PMI信息的id,为*_pmi.xml中View字段的PMIIds字段内容。
* @param {string} modelIds 关联模型的id,为*_pmi.xml中View字段的ModelIds字段内容。
* @param {array} matrix 矩阵对象,如果是对实例化的模型设置捕获,可将实例化传入的矩阵数组传入该参数。可不传此参数。
* @returns {string|number} 返回创建该视图关联的id,可使该id调用restoreView接口恢复,
* 如果有错则返回整数值,其中-1表示cameraInfo对象无效,-2表示cameraInfo没有Position或者Target或者Up,
* -3表示cameraInfo的Position或者Target或者Up不是string类型,-4表示传入的matrix不是数组。
*/
createView: function(cameraInfo, pmiIds, modelIds, matrix) {
return this.viewer.createView(cameraInfo, pmiIds, modelIds, matrix)
},
/**
* 恢复视图。因为需要恢复Catia,UG等导出的视图与默认操作器冲突,所以当调用该接口的时,操作器会修改为类似Catia的可任意轴旋转的操作器。
* @param {string} id 需要恢复的视图id,该id由createView接口返回。
* @param {boolean} useAnimate 是否使用动画,该值传true表示使用动画切换,false表示不使用动画切换,当模型面片数量很多时建议传false。
* @param {number} duration 切换到新视图持续时长,单位为毫秒。该值可不传,当不传时则默认为300。
* @returns number -1表示传入的id没有找到,1表示成功。
*/
restoreView: function(id, useAnimate, duration) {
return this.viewer.restoreView(id, useAnimate, duration)
},
/**
* 清除所有视图,当不需要视图时可调用该接口,能节约内存。
*/
clearView: function() {
this.viewer.clearView()
},
/**
* 移除创建好的视图对象。
* @param {string} id createView接口返回的id,
* @returns -1表示没有找到,1表示成功
*/
removeView: function(id) {
return this.viewer.removeView(id)
},
/**
* 设置操作类型。
* @param {number} type 类型值,1为默认的球体操作器,2为可任意轴旋转的操作器。
*/
setOperatorType: function(type) {
this.viewer.setOperatorType(type)
},
/**
* 解析PMI里的TextContent字段
* @param {string} textContent pmi中TextContents字段的内容
* @returns 返回长度为7的数组对象,索引0表示数据内容,索引1表示公差的上文本,索引2公差的下文本,
* 索引3表示左文本,索引4表示上文本,索引5表示右文本,索引6表示下文本。
*/
parseTextContent: function(textContent) {
return this.viewer.parseTextContent(textContent)
}
}
// export {BIM3DInterface};
This source diff could not be displayed because it is too large. You can view the blob instead.
html,body {
width:100%;
height: 100%;
padding:0;
margin:0;
}
/* body {
background:linear-gradient(0deg,rgba(249,250,251,1),rgba(167,179,203,1)) no-repeat;
} */
#webgl_out {
left: 0px;
top: 0px;
width: 100%;
height: 100%;
position: absolute;
opacity: 0;
z-index: 98;
display: none;
}
#cubeDom {
opacity: 0.25;
}
.webgl_sign {
width: 260px;
height: 200px;
background:#fff;
border:1px solid rgba(224,231,236,1);
border-radius:4px;
position: fixed;
top: 20%;
left: 10%;
user-select: none;
display: none;
z-index: 99;
}
.webgl_sign_title {
width: 100%;
height: 37px;
padding: 0 10px;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
border-bottom: 1px solid rgba(224,231,236,1);
font-size:14px;
font-family:FZLanTingHei-L-GBK;
font-weight:400;
color:rgba(56,56,56,1);
cursor:move;
}
#cubeDom:hover {
opacity: 1.0;
}
.webgl_signClose {
position: relative;
width: 12px;
height: 12px;
cursor: pointer;
}
.webgl_signClose >:first-child {
width: 13px;
height:2px;
position: absolute;
top:5px;
left: 0px;
background:#ccc;
transform: rotateZ(45deg)
}
.webgl_signClose >:last-child {
width: 13px;
height:2px;
position: absolute;
top:5px;
left: 0px;
background:#ccc;
transform: rotateZ(-45deg)
}
.webgl_content {
width: 100%;
padding: 10px 18px 0;
box-sizing: border-box;
}
.webgl_row {
margin-top:10px;
width: 100%;
height: 24px;
display: flex;
justify-content: space-between;
font-size:13px;
font-family:FZLanTingHei-L-GBK;
font-weight:400;
color:rgba(56,56,56,1);
}
.webgl_label {
line-height: 24px;
}
.webgl_func {
width: 160px;
height: 24px;
background:rgba(224,231,236,1);
border-radius:2px;
padding: 0 10px;
display: flex;
align-items: center;
box-sizing: border-box;
}
.webgl_switch {
width: 40px;
height: 18px;
background: #1890ff;
position: relative;
display: flex;
cursor: pointer;
}
.webgl_slider {
width: 18px;
height: 16px;
position: absolute;
top:1px;
right: 1px;
background:#fff;
}
.webgl_status {
width: 20px;
height: 18px;
color:#fff;
text-align: center;
line-height: 18px;
}
.webgl_count {
width: 110px;
height:2px;
background:rgba(179,179,179,1);
border-radius:1px;
position: relative;
}
.webgl_drag {
width:6px;
height:10px;
background:rgba(0,151,137,1);
position: absolute;
top:-4px;
left:24.5px;
cursor: pointer;
}
.webgl_blockCount {
font-size:12px;
font-family:FZLanTingHei-L-GBK;
font-weight:400;
color:rgba(56,56,56,1);
margin-left: 10px;
}
#webgl_input,#webgl_inputWord,#webgl_inputBackground,#webgl_inputSetBackground,#webgl_inputSetLightBackground,#webgl_inputSetBackground1,#webgl_inputSetLightBackgroundFace {
display: none;
}
#webgl_color {
background: #ED1C24;
}
#webgl_colorWord{
background: #ED1C24;
}
#webgl_setBackground{
background: #123456;
}
#webgl_setBackground1{
background: #eee;
}
#webgl_setLightBackground{
background: #ffc000;
}
#webgl_setLightBackgroundFace{
background: #009789;
}
.webgl_span {
display: inline-flex;
width: 140px;
height: 24px;
/* line-height: 24px; */
font-size:12px;
font-family:FZLanTingHei-L-GBK;
font-weight:400;
color:rgba(56,56,56,1);
/* padding-top:3px; */
box-sizing: border-box;
align-items: center;
}
.webgl_color {
display: inline-block;
width:80px;
height:18px;
background:#fff;
border-radius:2px;
margin-right: 10px;
border:1px solid #000000;
box-sizing: border-box;
}
.webgl_footer {
width: 100%;
padding: 0 18px;
box-sizing: border-box;
display: flex;
justify-content: flex-end;
padding-top: 30px;
}
.webgl_cancel, .webgl_ok {
width: 60px;
height: 28px;
text-align: center;
line-height: 28px;
border:1px solid rgba(224,231,236,1);
border-radius:4px;
font-size:14px;
font-family:FZLanTingHei-L-GBK;
font-weight:400;
color:rgba(26,26,26,1);
cursor: pointer;
}
.webgl_ok {
border:none;
background:rgba(0,151,137,1);
color:#fff;
margin-left: 10px;
}
/* 文字标注模块 */
.webgl_word {
width: 260px;
height: 430px;
position: fixed;
top: 20%;
left: 10%;
background:rgba(255,255,255,1);
border:1px solid rgba(224,231,236,1);
border-radius:4px;
user-select: none;
display: none;
z-index: 99;
}
.webgl_edit {
width: 100%;
height:80px;
display: flex;
justify-content: space-between;
padding-top: 10px;
box-sizing: border-box;
color:rgba(56,56,56,1);
font-family:FZLanTingHei-L-GBK;
}
.webgl_area {
font-size: 13px;
}
.webgl_tt {
width: 160px;
height: 80px;
padding: 5px;
box-sizing: border-box;
border:1px solid rgba(224,231,236,1);
border-radius:2px;
font-size:12px;
font-family:FZLanTingHei-L-GBK;
overflow: hidden;
}
/* 设置 */
.webgl_set {
width: 320px;
height: 375px;
/* height: 330px; */
background:#fff;
border:1px solid rgba(224,231,236,1);
border-radius:4px;
position: fixed;
top: 20%;
left: 10%;
user-select: none;
display: none;
z-index: 99;
}
\ No newline at end of file
/** 授权信息 */
// eslint-disable-next-line no-unused-vars
var licenseContent =
`<?xml version="1.0" encoding="UTF-8"?>
<license>
<productname>CG-Web3DViewer</productname>
<productcode>CG-Web3DViewer</productcode>
<productversion>1.0</productversion>
<clientname>西安阳易信息技术有限公司</clientname>
<clientcomputercode>00000000000000000000000000000000</clientcomputercode>
<startdate>2021/04/19</startdate>
<enddate>2099/12/31</enddate>
<maxusercount>1</maxusercount>
<checkcode>41185CDF6996587A7E2F974C038DA19C4394BD0C25D5768607A34BCE9E014C116B37A28EECF4118876FE108184214AD573CA3047669532720E763F78474B0485FECF7AAF0DE25E64DF5C331B09E2FCA835E2B25640D21687546E4E00112C4370B5A0918CD6BFB1EEF80045B769280A9DA81AC64B6A43973393FB7C14970E4DBAE0950773968176D8FDBE988BADE77B5DF466A109239C161A02284646184736515EAB325595946E0CC67C1A12785A874BB99FF052E3A19BCE44BD2B05C1786521E24A97C192E49E34456F6564EF466423A06CD4699D1574AE46E9BC15C202303AA7C91468F0751B257FD2CD9083B02ECF7E78D9CF000C40408ECEA6456A01D10A5C4395CE303EDCCDFCD5072DAFB66DACABB587C213155610AAB9B55568A0DD83C275D7E5EC455203A3000067F2489C3F9193314B0C9B84D33EC7BE10EDD916B5E55EE1E47E96AFB84CFA2FEC90F33F0532879318DBB35A8E9B1D95E2C5694EFB03C97CA04CF220A997781B40EC6104F395763D2E2200E140EF455D05923749601895F2AD3CCE504060CA0C8475B91417374D5499227A60B961D6E8CE47134CB3DA383932BCAF55EC6017E6CADC26A3ADDFBA104844BA857C6BE80433AC02528969E43F72B6F93B9FBD4F5D766E475735748E4299FDDD841B1EBA9ADA57384AF899B59BAA96A1432596C3E4E124BB37DA489EBBE554BBF89021A8092796D22AB789A3ECEE28F8DB5BB1252C4CEB306D019BBA0D572076F6AC6D569244FF179DA1D5040EF30BAF6CC917AA7926E11C1A3BF32B4004238CE0CCFE687B5E6B6133F8445B3BC2A44F5FEF231CFE5D5BCDD947FFD87D23965488FC617FD7D40D6576D2708C36DCB1BA806D0192A4AC8CC2383AA2D2ABDD87C50CD20233F41F0D5FF5FC0A0513943EACCD6FE63A9722A8D4A32154D427C0C3638F9F7350026DD6A62FFAAC0D1FFFCE6FB4E2915A13AF6EC2284A0242ECE694D8833E24924A8BA71C18BA52867E867F38266F1C1D58DAFD02FB99158B16184B12EA44F790DFFE9E0F8ADCB6159D9DE007C086DB89B9E9395BB375E1AA0BD38202584941539750609D547CD1D8B863139DBBA17F07B969F0D30EFC9FFD2F0D0F83AE013C7BE4D483B09CCD3B5C65FABC8F11B5D611E0FDCD6BE8A38390A88E509BA64B346F2A06A9ED3E1995D067FE17279BFA67C3F0DC3AE036F44A7F80360C9A6DBB851C2DBAD2FDF72952E27B0A3EC7FC46AB912017CDF4DEFDDE1CA2A3CEC6F1BF35C49DEC02C7833DC488C64D2B5EAC9751694938A9BDE3C9</checkcode>
</license>`
......@@ -277,7 +277,6 @@ export default {
}
this.formData.push(fd)
} else if (item.title !== '附件') {
const that = this
const fd = {
title: item.title,
split: 1,
......
......@@ -222,7 +222,7 @@ export default {
path: `/InfoDetail-${itemObj.id}`,
query: {
oid: itemObj.id,
title: itemObj.name,
title: itemObj.name || itemObj.materialGrade,
dxClassname: dxClassname,
type: 'MESSAGE'
}
......
......@@ -47,31 +47,31 @@ export default {
return {
images: [
require('@/assets/home/banner.png'),
require('@/assets/home/1.png'),
require('@/assets/home/2.png'),
require('@/assets/home/3.png')
require('@/assets/home/tu1.png'),
require('@/assets/home/tu2.png'),
require('@/assets/home/tu3.png')
],
modelArr: [
{
title: '待办',
key: 'toDo',
icon: require('../../assets/home/待办@2x.png'),
icon: require('../../assets/home/daiban2x.png'),
path: '/todoList'
},
{
title: '已办',
key: 'done',
icon: require('../../assets/home/已办.png'),
icon: require('../../assets/home/yiban.png'),
path: '/todoList'
},
{
title: '我发起的',
key: 'launch',
icon: require('../../assets/home/我发起的@2x.png'),
icon: require('../../assets/home/wofaqi2x.png'),
path: '/todoList'
}
],
noticeIcon: require('../../assets/home/最新公告@2x.png'),
noticeIcon: require('../../assets/home/zuixingonggao2x.png'),
list: [],
loading: false,
finished: false,
......@@ -145,7 +145,7 @@ export default {
.header {
width: 100%;
// height: calc(100% / 3);
height: 36px;
height: 50px;
background: linear-gradient(197deg, #2ab1f4 0%, #3693e6 100%);
// overflow: hidden;
display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment