@vitrosoftware/common-ui-ts 1.1.186 → 1.1.188
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/std/controls/action-handler/confirm-dialog.css +0 -6
- package/css/std/controls/bim-viewer/bim-viewer-index.css +13 -0
- package/css/std/controls/bim-viewer/bim-viewer.css +13 -0
- package/css/std/controls/bim-viewer/img/add-model.svg +5 -0
- package/css/std/controls/close-button/close-button.css +13 -0
- package/css/std/controls/close-button/img/cancel-dark-grey.svg +5 -0
- package/css/std/controls/close-button/img/cancel-white.svg +10 -0
- package/css/std/controls/command-menu/command-menu-dropdown-button.css +4 -0
- package/css/std/controls/component-loader/component-loader.css +1 -1
- package/css/std/controls/dialog/dialog-content.css +2 -2
- package/css/std/controls/dialog/dialog-footer.css +16 -6
- package/css/std/controls/dialog/dialog-header.css +22 -3
- package/css/std/controls/dropdown-button/dropdown-button.css +21 -4
- package/css/std/controls/label/label.css +20 -15
- package/css/std/controls/lookup-picker/img/library.svg +17 -0
- package/css/std/controls/lookup-picker/lookup-picker-selected-item.css +1 -1
- package/css/std/controls/lookup-picker/lookup-picker-value-list.css +2 -4
- package/css/std/controls/lookup-picker/lookup-picker.css +30 -17
- package/css/std/controls/micro-frontend/micro-frontend.css +4 -0
- package/css/std/controls/overlay/overlay.css +4 -0
- package/css/std/controls/separator/separator.css +15 -0
- package/css/std/controls/table-view/treegrid-context-menu.css +1 -0
- package/dist/index.css +170 -74
- package/dist/index.js +879 -722
- package/dist/index.js.map +1 -1
- package/dist/src/controls/BimViewer/services/BimViewerService.d.ts +1 -0
- package/dist/src/controls/CloseButton/CloseButton.d.ts +7 -0
- package/dist/src/controls/Dialog/Dialog.d.ts +6 -0
- package/dist/src/controls/Dialog/DialogHeader.d.ts +6 -0
- package/dist/src/controls/ImageButton/ImageButton.d.ts +1 -2
- package/dist/src/controls/Label/Label.d.ts +2 -1
- package/dist/src/controls/LookupPicker/LookupPicker.d.ts +4 -0
- package/dist/src/controls/LookupPicker/RightButtonGroup.d.ts +19 -0
- package/dist/src/controls/MicroFrontend/MicroFrontend.d.ts +1 -0
- package/dist/src/controls/Overlay/Overlay.d.ts +2 -0
- package/dist/src/controls/Overlay/OverlayConstants.d.ts +3 -0
- package/dist/src/controls/Separator/Separator.d.ts +6 -0
- package/dist/src/controls/SiteSelect/SiteSelect.d.ts +2 -2
- package/dist/src/controls/TabGroup/TabGroup.d.ts +4 -2
- package/dist/src/controls/TabGroup/TabGroupComponent.d.ts +4 -2
- package/dist/src/controls/TabGroup/services/TabGroupService.d.ts +3 -0
- package/dist/src/controls/TableView/TableView.d.ts +2 -2
- package/dist/src/controls/TableView/TableViewConstants.d.ts +2 -1
- package/dist/src/controls/TableView/services/TableViewService.d.ts +4 -3
- package/dist/src/controls/TableView/services/impl/TableViewServiceImpl.d.ts +3 -2
- package/dist/src/controls/View/View.d.ts +4 -2
- package/dist/src/index.d.ts +4 -0
- package/dist/src/services.d.ts +3 -0
- package/package.json +1 -1
- package/src/controls/BimViewer/js/bim-viewer-models.js +55 -21
- package/src/controls/BimViewer/js/bim-viewer.js +340 -517
- package/src/controls/DxfViewer/js/dxf-viewer.js +14 -14
- package/src/controls/PdfViewer/js/pdf-viewer.js +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BIMModel, BIMCommon, BIMAnnotation } from '/resource/bimViewer/js/bim-viewer-models.js?version=1.1.
|
|
1
|
+
import { BIMModel, BIMCommon, BIMAnnotation } from '/resource/bimViewer/js/bim-viewer-models.js?version=1.1.188';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Viewer, XKTLoaderPlugin, NavCubePlugin, SectionPlanesPlugin, math, BCFViewpointsPlugin, AnnotationsPlugin,
|
|
5
5
|
ContextMenu, TreeViewPlugin, StoreyViewsPlugin, AngleMeasurementsPlugin, CameraMemento, DistanceMeasurementsPlugin,
|
|
6
6
|
GLTFLoaderPlugin, utils, FastNavPlugin, MetaObject, parsers
|
|
7
7
|
}
|
|
8
|
-
from '/resource/bimViewer/js/xeokit/xeokit-sdk.es.js?version=1.1.
|
|
8
|
+
from '/resource/bimViewer/js/xeokit/xeokit-sdk.es.js?version=1.1.188';
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
//----------------------------------------------------------------------------------------------------------------------
|
|
@@ -540,7 +540,9 @@ class VitroTreeViewPlugin extends TreeViewPlugin
|
|
|
540
540
|
propertySetIds,
|
|
541
541
|
external: metaObjectData.external,
|
|
542
542
|
});
|
|
543
|
-
|
|
543
|
+
metaObject.childCount = metaObjectData.childCount;
|
|
544
|
+
metaObject.modelId = metaModel.id;
|
|
545
|
+
|
|
544
546
|
metaModel.metaScene.metaObjects[id] = metaObject;
|
|
545
547
|
}
|
|
546
548
|
//metaObject.metaModels.push(metaModel);
|
|
@@ -577,20 +579,21 @@ class VitroTreeViewPlugin extends TreeViewPlugin
|
|
|
577
579
|
const nodeId = parentElement.id;
|
|
578
580
|
const switchNode = this._nodeNodes[nodeId];
|
|
579
581
|
const childNodes = switchNode.children;
|
|
582
|
+
const object = this._viewer.metaScene.metaObjects[switchNode.objectId];
|
|
580
583
|
if(childNodes.length > 0){
|
|
581
584
|
this.createChildElement(parentElement, childNodes, switchElement)
|
|
582
585
|
}
|
|
583
|
-
|
|
584
|
-
|
|
586
|
+
else {
|
|
587
|
+
this.loadChildNodes(object.modelId, switchNode.objectId, parentElement, switchElement);
|
|
585
588
|
}
|
|
586
589
|
}
|
|
587
590
|
|
|
588
|
-
loadChildNodes(objectId, parentElement, switchElement){
|
|
591
|
+
loadChildNodes(modelId, objectId, parentElement, switchElement){
|
|
589
592
|
viewer.scene.canvas.spinner.processes++;
|
|
590
593
|
|
|
591
594
|
const callback = (metaObjects) =>
|
|
592
595
|
{
|
|
593
|
-
|
|
596
|
+
const metaModel = viewer.metaScene.metaModels[modelId];
|
|
594
597
|
const metaObjectList = this.addObjectsToMetaModel(metaObjects, metaModel);
|
|
595
598
|
const nodeId =`${this._id}-${objectId}`;
|
|
596
599
|
const parentNode = this._nodeNodes[nodeId];
|
|
@@ -666,6 +669,11 @@ class VitroTreeViewPlugin extends TreeViewPlugin
|
|
|
666
669
|
this._onCanvasBoundary = viewer.scene.canvas.on("boundary", culledSmallModelList);
|
|
667
670
|
this._onCameraMatrix = viewer.scene.camera.on("matrix", culledSmallModelList);
|
|
668
671
|
|
|
672
|
+
this._onSceneTick = viewer.scene.on("reloadSmallScenes", () =>
|
|
673
|
+
{
|
|
674
|
+
culledSmallModelList();
|
|
675
|
+
});
|
|
676
|
+
|
|
669
677
|
this._onSceneTick = viewer.scene.on("tick", (tickEvent) => {
|
|
670
678
|
if (!fastMode) {
|
|
671
679
|
return;
|
|
@@ -770,8 +778,6 @@ class VitroTreeViewPlugin extends TreeViewPlugin
|
|
|
770
778
|
|
|
771
779
|
culledSmallModelList();
|
|
772
780
|
});
|
|
773
|
-
|
|
774
|
-
|
|
775
781
|
}
|
|
776
782
|
|
|
777
783
|
culledModels() {
|
|
@@ -786,8 +792,6 @@ class VitroTreeViewPlugin extends TreeViewPlugin
|
|
|
786
792
|
this.isDeleteModelList = true;
|
|
787
793
|
}
|
|
788
794
|
|
|
789
|
-
|
|
790
|
-
|
|
791
795
|
deleteModels() {
|
|
792
796
|
this.smallModelList.forEach(model => {
|
|
793
797
|
model.destroy();
|
|
@@ -804,13 +808,14 @@ class VitroTreeViewPlugin extends TreeViewPlugin
|
|
|
804
808
|
}
|
|
805
809
|
|
|
806
810
|
var sceneModel = this.load({
|
|
807
|
-
id: Date.now() + '_' + this.
|
|
811
|
+
id: Date.now() + '_' + this.vitroModel.FileItemId + this.vitroModel.FileVersion + '_' + numPart,
|
|
808
812
|
xkt: data,
|
|
809
813
|
edges: true,
|
|
810
814
|
backfaces: true,
|
|
811
815
|
position: this.position,
|
|
812
816
|
});
|
|
813
817
|
|
|
818
|
+
sceneModel.largeModel = this.largeModel;
|
|
814
819
|
this.smallModelList.push(sceneModel);
|
|
815
820
|
|
|
816
821
|
sceneModel.on('loaded', () => {
|
|
@@ -833,7 +838,6 @@ class VitroTreeViewPlugin extends TreeViewPlugin
|
|
|
833
838
|
});
|
|
834
839
|
}
|
|
835
840
|
|
|
836
|
-
|
|
837
841
|
loadData() {
|
|
838
842
|
this.controller = new AbortController();
|
|
839
843
|
if (this.startSmallLoad) {
|
|
@@ -856,13 +860,193 @@ class VitroTreeViewPlugin extends TreeViewPlugin
|
|
|
856
860
|
sceneOptions.sectionPlanes.push(sectionPlane);
|
|
857
861
|
});
|
|
858
862
|
|
|
859
|
-
BIMCommon.GetSmallModel(this.viewer.scene,
|
|
863
|
+
BIMCommon.GetSmallModel(this.viewer.scene, BIMCommon.ModelList, sceneOptions, this.controller.signal, this.loadSmallPart.bind(this));
|
|
860
864
|
}
|
|
861
865
|
}
|
|
862
866
|
}
|
|
863
867
|
|
|
864
868
|
/*! jquery-dialogextend 2.0.3 2014-07-08 */
|
|
865
|
-
(function(){var i;i=jQuery,i.widget("ui.dialogExtend",{version:"2.0.0",modes:{},options:{closable:!0,dblclick:!1,titlebar:!1,icons:{close:"ui-icon-closethick",restore:"ui-icon-newwin"},load:null,beforeRestore:null,restore:null},_create:function(){return this._state="normal",i(this.element[0]).data("ui-dialog")||i.error("jQuery.dialogExtend Error : Only jQuery UI Dialog element is accepted"),this._verifyOptions(),this._initStyles(),this._initButtons(),this._initTitleBar(),this._setState("normal"),this._on("load",function(i){return console.log("test",i)}),this._trigger("load")},_setState:function(t){return i(this.element[0]).removeClass("ui-dialog-"+this._state).addClass("ui-dialog-"+t),this._state=t},_verifyOptions:function(){var t,e,o;!this.options.dblclick||this.options.dblclick in this.modes||(i.error("jQuery.dialogExtend Error : Invalid <dblclick> value '"+this.options.dblclick+"'"),this.options.dblclick=!1),this.options.titlebar&&"none"!==(e=this.options.titlebar)&&"transparent"!==e&&(i.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+this.options.titlebar+"'"),this.options.titlebar=!1),o=[];for(t in this.modes)this["_verifyOptions_"+t]?o.push(this["_verifyOptions_"+t]()):o.push(void 0);return o},_initStyles:function(){var t,e,o;i(".dialog-extend-css").length||(e="",e+='<style class="dialog-extend-css" type="text/css">',e+=".ui-dialog .ui-dialog-titlebar-buttonpane>a { float: right; }",e+=".ui-dialog .ui-dialog-titlebar-restore { width: 19px; height: 18px; }",e+=".ui-dialog .ui-dialog-titlebar-restore span { display: block; margin: 1px; }",e+=".ui-dialog .ui-dialog-titlebar-restore:hover,",e+=".ui-dialog .ui-dialog-titlebar-restore:focus { padding: 0; }",e+=".ui-dialog .ui-dialog-titlebar ::selection { background-color: transparent; }",e+="</style>",i(e).appendTo("body")),o=[];for(t in this.modes)o.push(this["_initStyles_"+t]());return o},_initButtons:function(){var t,e,o,n,a,l=this;n=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar"),t=i('<div class="ui-dialog-titlebar-buttonpane"></div>').appendTo(n),t.css({position:"absolute",top:"50%",right:"0.3em","margin-top":"-10px",height:"18px"}),n.find(".ui-dialog-titlebar-close").css({position:"relative","float":"right",top:"auto",right:"auto",margin:0}).find(".ui-icon").removeClass("ui-icon-closethick").addClass(this.options.icons.close).end().appendTo(t).end(),t.append('<a class="ui-dialog-titlebar-restore ui-corner-all ui-state-default" href="#"><span class="ui-icon '+this.options.icons.restore+'" title="restore">restore</span></a>').find(".ui-dialog-titlebar-restore").attr("role","button").mouseover(function(){return i(this).addClass("ui-state-hover")}).mouseout(function(){return i(this).removeClass("ui-state-hover")}).focus(function(){return i(this).addClass("ui-state-focus")}).blur(function(){return i(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-close").toggle(this.options.closable).end().find(".ui-dialog-titlebar-restore").hide().click(function(i){return i.preventDefault(),l.restore()}).end(),a=this.modes;for(o in a)e=a[o],this._initModuleButton(o,e);return n.dblclick(function(){return l.options.dblclick?"normal"!==l._state?l.restore():l[l.options.dblclick]():void 0}).select(function(){return!1})},_initModuleButton:function(t,e){var o,n=this;return o=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-buttonpane"),o.append('<a class="ui-dialog-titlebar-'+t+' ui-corner-all ui-state-default" href="#" title="'+t+'"><span class="ui-icon '+this.options.icons[t]+'">'+t+"</span></a>").find(".ui-dialog-titlebar-"+t).attr("role","button").mouseover(function(){return i(this).addClass("ui-state-hover")}).mouseout(function(){return i(this).removeClass("ui-state-hover")}).focus(function(){return i(this).addClass("ui-state-focus")}).blur(function(){return i(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-"+t).toggle(this.options[e.option]).click(function(i){return i.preventDefault(),n[t]()}).end()},_initTitleBar:function(){var t;switch(this.options.titlebar){case!1:return 0;case"none":return i(this.element[0]).dialog("option","draggable")&&(t=i("<div />").addClass("ui-dialog-draggable-handle").css("cursor","move").height(5),i(this.element[0]).dialog("widget").prepend(t).draggable("option","handle",t)),i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").find(".ui-dialog-title").html(" ").end().css({"background-color":"transparent","background-image":"none",border:0,position:"absolute",right:0,top:0,"z-index":9999}).end();case"transparent":return i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css({"background-color":"transparent","background-image":"none",border:0});default:return i.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+this.options.titlebar+"'")}},state:function(){return this._state},restore:function(){return this._trigger("beforeRestore"),this._restore(),this._toggleButtons(),this._trigger("restore")},_restore:function(){return"normal"!==this._state?(this["_restore_"+this._state](),this._setState("normal"),i(this.element[0]).dialog("widget").focus()):void 0},_saveSnapshot:function(){return"normal"===this._state?(this.original_config_resizable=i(this.element[0]).dialog("option","resizable"),this.original_config_draggable=i(this.element[0]).dialog("option","draggable"),this.original_size_height=i(this.element[0]).dialog("widget").outerHeight(),this.original_size_width=i(this.element[0]).dialog("option","width"),this.original_size_maxHeight=i(this.element[0]).dialog("option","maxHeight"),this.original_position_mode=i(this.element[0]).dialog("widget").css("position"),this.original_position_left=i(this.element[0]).dialog("widget").offset().left-i("body").scrollLeft(),this.original_position_top=i(this.element[0]).dialog("widget").offset().top-i("body").scrollTop(),this.original_titlebar_wrap=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css("white-space")):void 0},_loadSnapshot:function(){return{config:{resizable:this.original_config_resizable,draggable:this.original_config_draggable},size:{height:this.original_size_height,width:this.original_size_width,maxHeight:this.original_size_maxHeight},position:{mode:this.original_position_mode,left:this.original_position_left,top:this.original_position_top},titlebar:{wrap:this.original_titlebar_wrap}}},_toggleButtons:function(t){var e,o,n,a,l,s;n=t||this._state,i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").toggle("normal"!==n).css({right:"1.4em"}).end(),a=this.modes;for(o in a)e=a[o],i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-"+o).toggle(n!==e.state&&this.options[e.option]);l=this.modes,s=[];for(o in l)e=l[o],e.state===n?s.push(i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").insertAfter(i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-"+o)).end()):s.push(void 0);return s}})}).call(this),function(){var i;i=jQuery,i.extend(!0,i.ui.dialogExtend.prototype,{modes:{collapse:{option:"collapsable",state:"collapsed"}},options:{collapsable:!1,icons:{collapse:"ui-icon-triangle-1-s"},beforeCollapse:null,collapse:null},collapse:function(){var t,e;return t=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").height()+15,this._trigger("beforeCollapse"),"normal"!==this._state&&this._restore(),this._saveSnapshot(),e=i(this.element[0]).dialog("widget").position(),i(this.element[0]).dialog("option",{resizable:!1,height:t,maxHeight:t,position:[e.left-i(document).scrollLeft(),e.top-i(document).scrollTop()]}).on("dialogclose",this._collapse_restore).hide().dialog("widget").find(".ui-dialog-buttonpane:visible").hide().end().find(".ui-dialog-titlebar").css("white-space","nowrap").end().find(".ui-dialog-content"),this._setState("collapsed"),this._toggleButtons(),this._trigger("collapse")},_restore_collapsed:function(){var t;return t=this._loadSnapshot(),i(this.element[0]).show().dialog("widget").find(".ui-dialog-buttonpane:hidden").show().end().find(".ui-dialog-titlebar").css("white-space",t.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:t.config.resizable,height:t.size.height,maxHeight:t.size.maxHeight}).off("dialogclose",this._collapse_restore)},_initStyles_collapse:function(){var t;return i(".dialog-extend-collapse-css").length?void 0:(t="",t+='<style class="dialog-extend-collapse-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-collapse { width: 19px; height: 18px; }",t+=".ui-dialog .ui-dialog-titlebar-collapse span { display: block; margin: 1px; }",t+=".ui-dialog .ui-dialog-titlebar-collapse:hover,",t+=".ui-dialog .ui-dialog-titlebar-collapse:focus { padding: 0; }",t+="</style>",i(t).appendTo("body"))},_collapse_restore:function(){return i(this).dialogExtend("restore")}})}.call(this),function(){var i;i=jQuery,i.extend(!0,i.ui.dialogExtend.prototype,{modes:{maximize:{option:"maximizable",state:"maximized"}},options:{maximizable:!1,icons:{maximize:"ui-icon-extlink"},beforeMaximize:null,maximize:null},maximize:function(){var t,e;return t=i(window).height()-11,e=i(window).width()-11,this._trigger("beforeMaximize"),"normal"!==this._state&&this._restore(),this._saveSnapshot(),i(this.element[0]).dialog("option","draggable")&&i(this.element[0]).dialog("widget").draggable("option","handle",null).find(".ui-dialog-draggable-handle").css("cursor","text").end(),i(this.element[0]).dialog("widget").css("position","fixed").find(".ui-dialog-content").show().dialog("widget").find(".ui-dialog-buttonpane").show().end().find(".ui-dialog-content").dialog("option",{resizable:!1,draggable:!1,height:t,width:e,position:{my:"left top",at:"left top",of:window}}),this._setState("maximized"),this._toggleButtons(),this._trigger("maximize")},_restore_maximized:function(){var t;return t=this._loadSnapshot(),i(this.element[0]).dialog("widget").css("position",t.position.mode).find(".ui-dialog-titlebar").css("white-space",t.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:t.config.resizable,draggable:t.config.draggable,height:t.size.height,width:t.size.width,maxHeight:t.size.maxHeight,position:{my:"left top",at:"left+"+t.position.left+" top+"+t.position.top,of:window}}),i(this.element[0]).dialog("option","draggable")?i(this.element[0]).dialog("widget").draggable("option","handle",i(this.element[0]).dialog("widget").find(".ui-dialog-draggable-handle").length?i(this.element[0]).dialog("widget").find(".ui-dialog-draggable-handle"):".ui-dialog-titlebar").find(".ui-dialog-draggable-handle").css("cursor","move"):void 0},_initStyles_maximize:function(){var t;return i(".dialog-extend-maximize-css").length?void 0:(t="",t+='<style class="dialog-extend-maximize-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-maximize { width: 19px; height: 18px; }",t+=".ui-dialog .ui-dialog-titlebar-maximize span { display: block; margin: 1px; }",t+=".ui-dialog .ui-dialog-titlebar-maximize:hover,",t+=".ui-dialog .ui-dialog-titlebar-maximize:focus { padding: 0; }",t+="</style>",i(t).appendTo("body"))}})}.call(this),function(){var i;i=jQuery,i.extend(!0,i.ui.dialogExtend.prototype,{modes:{minimize:{option:"minimizable",state:"minimized"}},options:{minimizable:!1,minimizeLocation:"left",icons:{minimize:"ui-icon-minus"},beforeMinimize:null,minimize:null},minimize:function(){var t,e,o;return this._trigger("beforeMinimize"),"normal"!==this._state&&this._restore(),o=200,i("#dialog-extend-fixed-container").length?e=i("#dialog-extend-fixed-container"):(e=i('<div id="dialog-extend-fixed-container"></div>').appendTo("body"),e.css({position:"fixed",bottom:1,left:1,right:1,"z-index":9999})),this._toggleButtons("minimized"),t=i(this.element[0]).dialog("widget").clone().children().remove().end(),i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").clone(!0,!0).appendTo(t),t.css({"float":this.options.minimizeLocation,margin:1}),e.append(t),i(this.element[0]).data("dialog-extend-minimize-controls",t),i(this.element[0]).dialog("option","draggable")&&t.removeClass("ui-draggable"),t.css({height:"auto",width:o,position:"static"}),i(this.element[0]).on("dialogbeforeclose",this._minimize_restoreOnClose).dialog("widget").hide(),this._setState("minimized"),this._trigger("minimize")},_restore_minimized:function(){return i(this.element[0]).dialog("widget").show(),i(this.element[0]).off("dialogbeforeclose",this._minimize_restoreOnClose),i(this.element[0]).data("dialog-extend-minimize-controls").remove(),i(this.element[0]).removeData("dialog-extend-minimize-controls")},_initStyles_minimize:function(){var t;return i(".dialog-extend-minimize-css").length?void 0:(t="",t+='<style class="dialog-extend-minimize-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-minimize { width: 19px; height: 18px; }",t+=".ui-dialog .ui-dialog-titlebar-minimize span { display: block; margin: 1px; }",t+=".ui-dialog .ui-dialog-titlebar-minimize:hover,",t+=".ui-dialog .ui-dialog-titlebar-minimize:focus { padding: 0; }",t+="</style>",i(t).appendTo("body"))},_verifyOptions_minimize:function(){var t;return!this.options.minimizeLocation||"left"!==(t=this.options.minimizeLocation)&&"right"!==t?(i.error("jQuery.dialogExtend Error : Invalid <minimizeLocation> value '"+this.options.minimizeLocation+"'"),this.options.minimizeLocation="left"):void 0},_minimize_restoreOnClose:function(){return i(this).dialogExtend("restore")}})}.call(this);window.initBimViewer = function(context) {var angleMeasurementsData = [
|
|
869
|
+
(function(){var i;i=jQuery,i.widget("ui.dialogExtend",{version:"2.0.0",modes:{},options:{closable:!0,dblclick:!1,titlebar:!1,icons:{close:"ui-icon-closethick",restore:"ui-icon-newwin"},load:null,beforeRestore:null,restore:null},_create:function(){return this._state="normal",i(this.element[0]).data("ui-dialog")||i.error("jQuery.dialogExtend Error : Only jQuery UI Dialog element is accepted"),this._verifyOptions(),this._initStyles(),this._initButtons(),this._initTitleBar(),this._setState("normal"),this._on("load",function(i){return console.log("test",i)}),this._trigger("load")},_setState:function(t){return i(this.element[0]).removeClass("ui-dialog-"+this._state).addClass("ui-dialog-"+t),this._state=t},_verifyOptions:function(){var t,e,o;!this.options.dblclick||this.options.dblclick in this.modes||(i.error("jQuery.dialogExtend Error : Invalid <dblclick> value '"+this.options.dblclick+"'"),this.options.dblclick=!1),this.options.titlebar&&"none"!==(e=this.options.titlebar)&&"transparent"!==e&&(i.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+this.options.titlebar+"'"),this.options.titlebar=!1),o=[];for(t in this.modes)this["_verifyOptions_"+t]?o.push(this["_verifyOptions_"+t]()):o.push(void 0);return o},_initStyles:function(){var t,e,o;i(".dialog-extend-css").length||(e="",e+='<style class="dialog-extend-css" type="text/css">',e+=".ui-dialog .ui-dialog-titlebar-buttonpane>a { float: right; }",e+=".ui-dialog .ui-dialog-titlebar-restore { width: 19px; height: 18px; }",e+=".ui-dialog .ui-dialog-titlebar-restore span { display: block; margin: 1px; }",e+=".ui-dialog .ui-dialog-titlebar-restore:hover,",e+=".ui-dialog .ui-dialog-titlebar-restore:focus { padding: 0; }",e+=".ui-dialog .ui-dialog-titlebar ::selection { background-color: transparent; }",e+="</style>",i(e).appendTo("body")),o=[];for(t in this.modes)o.push(this["_initStyles_"+t]());return o},_initButtons:function(){var t,e,o,n,a,l=this;n=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar"),t=i('<div class="ui-dialog-titlebar-buttonpane"></div>').appendTo(n),t.css({position:"absolute",top:"50%",right:"0.3em","margin-top":"-10px",height:"18px"}),n.find(".ui-dialog-titlebar-close").css({position:"relative","float":"right",top:"auto",right:"auto",margin:0}).find(".ui-icon").removeClass("ui-icon-closethick").addClass(this.options.icons.close).end().appendTo(t).end(),t.append('<a class="ui-dialog-titlebar-restore ui-corner-all ui-state-default" href="#"><span class="ui-icon '+this.options.icons.restore+'" title="restore">restore</span></a>').find(".ui-dialog-titlebar-restore").attr("role","button").mouseover(function(){return i(this).addClass("ui-state-hover")}).mouseout(function(){return i(this).removeClass("ui-state-hover")}).focus(function(){return i(this).addClass("ui-state-focus")}).blur(function(){return i(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-close").toggle(this.options.closable).end().find(".ui-dialog-titlebar-restore").hide().click(function(i){return i.preventDefault(),l.restore()}).end(),a=this.modes;for(o in a)e=a[o],this._initModuleButton(o,e);return n.dblclick(function(){return l.options.dblclick?"normal"!==l._state?l.restore():l[l.options.dblclick]():void 0}).select(function(){return!1})},_initModuleButton:function(t,e){var o,n=this;return o=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-buttonpane"),o.append('<a class="ui-dialog-titlebar-'+t+' ui-corner-all ui-state-default" href="#" title="'+t+'"><span class="ui-icon '+this.options.icons[t]+'">'+t+"</span></a>").find(".ui-dialog-titlebar-"+t).attr("role","button").mouseover(function(){return i(this).addClass("ui-state-hover")}).mouseout(function(){return i(this).removeClass("ui-state-hover")}).focus(function(){return i(this).addClass("ui-state-focus")}).blur(function(){return i(this).removeClass("ui-state-focus")}).end().find(".ui-dialog-titlebar-"+t).toggle(this.options[e.option]).click(function(i){return i.preventDefault(),n[t]()}).end()},_initTitleBar:function(){var t;switch(this.options.titlebar){case!1:return 0;case"none":return i(this.element[0]).dialog("option","draggable")&&(t=i("<div />").addClass("ui-dialog-draggable-handle").css("cursor","move").height(5),i(this.element[0]).dialog("widget").prepend(t).draggable("option","handle",t)),i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").find(".ui-dialog-title").html(" ").end().css({"background-color":"transparent","background-image":"none",border:0,position:"absolute",right:0,top:0,"z-index":9999}).end();case"transparent":return i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css({"background-color":"transparent","background-image":"none",border:0});default:return i.error("jQuery.dialogExtend Error : Invalid <titlebar> value '"+this.options.titlebar+"'")}},state:function(){return this._state},restore:function(){return this._trigger("beforeRestore"),this._restore(),this._toggleButtons(),this._trigger("restore")},_restore:function(){return"normal"!==this._state?(this["_restore_"+this._state](),this._setState("normal"),i(this.element[0]).dialog("widget").focus()):void 0},_saveSnapshot:function(){return"normal"===this._state?(this.original_config_resizable=i(this.element[0]).dialog("option","resizable"),this.original_config_draggable=i(this.element[0]).dialog("option","draggable"),this.original_size_height=i(this.element[0]).dialog("widget").outerHeight(),this.original_size_width=i(this.element[0]).dialog("option","width"),this.original_size_maxHeight=i(this.element[0]).dialog("option","maxHeight"),this.original_position_mode=i(this.element[0]).dialog("widget").css("position"),this.original_position_left=i(this.element[0]).dialog("widget").offset().left-i("body").scrollLeft(),this.original_position_top=i(this.element[0]).dialog("widget").offset().top-i("body").scrollTop(),this.original_titlebar_wrap=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").css("white-space")):void 0},_loadSnapshot:function(){return{config:{resizable:this.original_config_resizable,draggable:this.original_config_draggable},size:{height:this.original_size_height,width:this.original_size_width,maxHeight:this.original_size_maxHeight},position:{mode:this.original_position_mode,left:this.original_position_left,top:this.original_position_top},titlebar:{wrap:this.original_titlebar_wrap}}},_toggleButtons:function(t){var e,o,n,a,l,s;n=t||this._state,i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").toggle("normal"!==n).css({right:"1.4em"}).end(),a=this.modes;for(o in a)e=a[o],i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-"+o).toggle(n!==e.state&&this.options[e.option]);l=this.modes,s=[];for(o in l)e=l[o],e.state===n?s.push(i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-restore").insertAfter(i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar-"+o)).end()):s.push(void 0);return s}})}).call(this),function(){var i;i=jQuery,i.extend(!0,i.ui.dialogExtend.prototype,{modes:{collapse:{option:"collapsable",state:"collapsed"}},options:{collapsable:!1,icons:{collapse:"ui-icon-triangle-1-s"},beforeCollapse:null,collapse:null},collapse:function(){var t,e;return t=i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").height()+15,this._trigger("beforeCollapse"),"normal"!==this._state&&this._restore(),this._saveSnapshot(),e=i(this.element[0]).dialog("widget").position(),i(this.element[0]).dialog("option",{resizable:!1,height:t,maxHeight:t,position:[e.left-i(document).scrollLeft(),e.top-i(document).scrollTop()]}).on("dialogclose",this._collapse_restore).hide().dialog("widget").find(".ui-dialog-buttonpane:visible").hide().end().find(".ui-dialog-titlebar").css("white-space","nowrap").end().find(".ui-dialog-content"),this._setState("collapsed"),this._toggleButtons(),this._trigger("collapse")},_restore_collapsed:function(){var t;return t=this._loadSnapshot(),i(this.element[0]).show().dialog("widget").find(".ui-dialog-buttonpane:hidden").show().end().find(".ui-dialog-titlebar").css("white-space",t.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:t.config.resizable,height:t.size.height,maxHeight:t.size.maxHeight}).off("dialogclose",this._collapse_restore)},_initStyles_collapse:function(){var t;return i(".dialog-extend-collapse-css").length?void 0:(t="",t+='<style class="dialog-extend-collapse-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-collapse { width: 19px; height: 18px; }",t+=".ui-dialog .ui-dialog-titlebar-collapse span { display: block; margin: 1px; }",t+=".ui-dialog .ui-dialog-titlebar-collapse:hover,",t+=".ui-dialog .ui-dialog-titlebar-collapse:focus { padding: 0; }",t+="</style>",i(t).appendTo("body"))},_collapse_restore:function(){return i(this).dialogExtend("restore")}})}.call(this),function(){var i;i=jQuery,i.extend(!0,i.ui.dialogExtend.prototype,{modes:{maximize:{option:"maximizable",state:"maximized"}},options:{maximizable:!1,icons:{maximize:"ui-icon-extlink"},beforeMaximize:null,maximize:null},maximize:function(){var t,e;return t=i(window).height()-11,e=i(window).width()-11,this._trigger("beforeMaximize"),"normal"!==this._state&&this._restore(),this._saveSnapshot(),i(this.element[0]).dialog("option","draggable")&&i(this.element[0]).dialog("widget").draggable("option","handle",null).find(".ui-dialog-draggable-handle").css("cursor","text").end(),i(this.element[0]).dialog("widget").css("position","fixed").find(".ui-dialog-content").show().dialog("widget").find(".ui-dialog-buttonpane").show().end().find(".ui-dialog-content").dialog("option",{resizable:!1,draggable:!1,height:t,width:e,position:{my:"left top",at:"left top",of:window}}),this._setState("maximized"),this._toggleButtons(),this._trigger("maximize")},_restore_maximized:function(){var t;return t=this._loadSnapshot(),i(this.element[0]).dialog("widget").css("position",t.position.mode).find(".ui-dialog-titlebar").css("white-space",t.titlebar.wrap).end().find(".ui-dialog-content").dialog("option",{resizable:t.config.resizable,draggable:t.config.draggable,height:t.size.height,width:t.size.width,maxHeight:t.size.maxHeight,position:{my:"left top",at:"left+"+t.position.left+" top+"+t.position.top,of:window}}),i(this.element[0]).dialog("option","draggable")?i(this.element[0]).dialog("widget").draggable("option","handle",i(this.element[0]).dialog("widget").find(".ui-dialog-draggable-handle").length?i(this.element[0]).dialog("widget").find(".ui-dialog-draggable-handle"):".ui-dialog-titlebar").find(".ui-dialog-draggable-handle").css("cursor","move"):void 0},_initStyles_maximize:function(){var t;return i(".dialog-extend-maximize-css").length?void 0:(t="",t+='<style class="dialog-extend-maximize-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-maximize { width: 19px; height: 18px; }",t+=".ui-dialog .ui-dialog-titlebar-maximize span { display: block; margin: 1px; }",t+=".ui-dialog .ui-dialog-titlebar-maximize:hover,",t+=".ui-dialog .ui-dialog-titlebar-maximize:focus { padding: 0; }",t+="</style>",i(t).appendTo("body"))}})}.call(this),function(){var i;i=jQuery,i.extend(!0,i.ui.dialogExtend.prototype,{modes:{minimize:{option:"minimizable",state:"minimized"}},options:{minimizable:!1,minimizeLocation:"left",icons:{minimize:"ui-icon-minus"},beforeMinimize:null,minimize:null},minimize:function(){var t,e,o;return this._trigger("beforeMinimize"),"normal"!==this._state&&this._restore(),o=200,i("#dialog-extend-fixed-container").length?e=i("#dialog-extend-fixed-container"):(e=i('<div id="dialog-extend-fixed-container"></div>').appendTo("body"),e.css({position:"fixed",bottom:1,left:1,right:1,"z-index":9999})),this._toggleButtons("minimized"),t=i(this.element[0]).dialog("widget").clone().children().remove().end(),i(this.element[0]).dialog("widget").find(".ui-dialog-titlebar").clone(!0,!0).appendTo(t),t.css({"float":this.options.minimizeLocation,margin:1}),e.append(t),i(this.element[0]).data("dialog-extend-minimize-controls",t),i(this.element[0]).dialog("option","draggable")&&t.removeClass("ui-draggable"),t.css({height:"auto",width:o,position:"static"}),i(this.element[0]).on("dialogbeforeclose",this._minimize_restoreOnClose).dialog("widget").hide(),this._setState("minimized"),this._trigger("minimize")},_restore_minimized:function(){return i(this.element[0]).dialog("widget").show(),i(this.element[0]).off("dialogbeforeclose",this._minimize_restoreOnClose),i(this.element[0]).data("dialog-extend-minimize-controls").remove(),i(this.element[0]).removeData("dialog-extend-minimize-controls")},_initStyles_minimize:function(){var t;return i(".dialog-extend-minimize-css").length?void 0:(t="",t+='<style class="dialog-extend-minimize-css" type="text/css">',t+=".ui-dialog .ui-dialog-titlebar-minimize { width: 19px; height: 18px; }",t+=".ui-dialog .ui-dialog-titlebar-minimize span { display: block; margin: 1px; }",t+=".ui-dialog .ui-dialog-titlebar-minimize:hover,",t+=".ui-dialog .ui-dialog-titlebar-minimize:focus { padding: 0; }",t+="</style>",i(t).appendTo("body"))},_verifyOptions_minimize:function(){var t;return!this.options.minimizeLocation||"left"!==(t=this.options.minimizeLocation)&&"right"!==t?(i.error("jQuery.dialogExtend Error : Invalid <minimizeLocation> value '"+this.options.minimizeLocation+"'"),this.options.minimizeLocation="left"):void 0},_minimize_restoreOnClose:function(){return i(this).dialogExtend("restore")}})}.call(this);window.initBimViewer = function(context) {function showPropertyInspector(pickResult) {
|
|
870
|
+
//var metaObject;
|
|
871
|
+
//var model = getPickResultModel(pickResult);
|
|
872
|
+
var objectId = pickResult.entity.id;
|
|
873
|
+
|
|
874
|
+
collapseSidebarIssueDetail();
|
|
875
|
+
collapseSidebarNotes();
|
|
876
|
+
$('#btnToggleSidebarNotes').removeClass('toggled');
|
|
877
|
+
|
|
878
|
+
setPropertyBDSets(objectId);
|
|
879
|
+
|
|
880
|
+
return false;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
function getPickResultModel(pickResult) {
|
|
884
|
+
var modelId = getPickResultModelId(pickResult);
|
|
885
|
+
if (modelId) {
|
|
886
|
+
if (window.model.id == modelId) {
|
|
887
|
+
return window.model;
|
|
888
|
+
} else if (window.model2 && window.model2.id == modelId) {
|
|
889
|
+
return window.model2;
|
|
890
|
+
} else {
|
|
891
|
+
return false;
|
|
892
|
+
}
|
|
893
|
+
} else {
|
|
894
|
+
return false;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
function getPickResultModelId(pickResult) {
|
|
899
|
+
if (pickResult.entity.model && pickResult.entity.model.id) {
|
|
900
|
+
return pickResult.entity.model.id;
|
|
901
|
+
} else if (pickResult.entity._owner && pickResult.entity._owner.id) {
|
|
902
|
+
return pickResult.entity._owner.id;
|
|
903
|
+
} else {
|
|
904
|
+
return false;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
function getPropertyValue(property) {
|
|
909
|
+
if (property.valueBool != null && property.valueBool != undefined) {
|
|
910
|
+
return property.valueBool;
|
|
911
|
+
}
|
|
912
|
+
else if (property.valueInt != null && property.valueInt != undefined) {
|
|
913
|
+
return property.valueInt;
|
|
914
|
+
}
|
|
915
|
+
else if (property.valueText != null && property.valueText != undefined) {
|
|
916
|
+
return property.valueText;
|
|
917
|
+
}
|
|
918
|
+
else if (property.valueReal != null && property.valueReal != undefined) {
|
|
919
|
+
return property.valueReal;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
function convertProperty(data) {
|
|
923
|
+
let groups = [];
|
|
924
|
+
|
|
925
|
+
for (let property of data) {
|
|
926
|
+
let existingGroups = groups.filter(group => group.name == property.groupName);
|
|
927
|
+
if (existingGroups.length > 0) {
|
|
928
|
+
existingGroups[0].properties.push({ name: property.name, value: getPropertyValue(property) });
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
let newGroup = {
|
|
932
|
+
name: property.groupName,
|
|
933
|
+
properties: [],
|
|
934
|
+
};
|
|
935
|
+
newGroup.properties.push({ name: property.name, value: getPropertyValue(property) });
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
groups.push(newGroup);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
return groups;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
function setPropertyBDSets(id) {
|
|
946
|
+
const html = [];
|
|
947
|
+
|
|
948
|
+
html.push('<div class="element-attributes">');
|
|
949
|
+
html.push('</div>');
|
|
950
|
+
|
|
951
|
+
viewer.scene.canvas.spinner.processes++;
|
|
952
|
+
|
|
953
|
+
BIMModel.GetPropertyList(id,
|
|
954
|
+
(data) => {
|
|
955
|
+
const propertySets = convertProperty(data);
|
|
956
|
+
addPropertySet(propertySets, html);
|
|
957
|
+
viewer.scene.canvas.spinner.processes--;
|
|
958
|
+
},
|
|
959
|
+
(error) => {
|
|
960
|
+
viewer.scene.canvas.spinner.processes--;
|
|
961
|
+
}
|
|
962
|
+
);
|
|
963
|
+
|
|
964
|
+
$('#propInspector .prop-inspector-content')[0].innerHTML = html.join("");
|
|
965
|
+
$('.xeokit-accordion-container').accordion({
|
|
966
|
+
collapsible: true,
|
|
967
|
+
heightStyle: "content"
|
|
968
|
+
});
|
|
969
|
+
$('#propInspector').show();
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
function addPropertySet(propertySets, html) {
|
|
973
|
+
if (!propertySets || propertySets.length == 0) {
|
|
974
|
+
html.push('<p class="subtitle">No properties sets found.</p>');
|
|
975
|
+
}
|
|
976
|
+
else {
|
|
977
|
+
html.push('<div class="xeokit-accordion">');
|
|
978
|
+
for (let i = 0, len = propertySets.length; i < len; i++) {
|
|
979
|
+
const propertySet = propertySets[i];
|
|
980
|
+
const properties = propertySet.properties || propertySet.p || [];
|
|
981
|
+
if (properties.length > 0) {
|
|
982
|
+
html.push('<div class="xeokit-accordion-container">' +
|
|
983
|
+
'<h3><span>' + (propertySet.name ? propertySet.name : propertySet.propertySetName) + '</span></h3>' +
|
|
984
|
+
'<div class="xeokit-accordion-panel">' +
|
|
985
|
+
'<table class="xeokit-table"><tbody>'
|
|
986
|
+
);
|
|
987
|
+
for (let i = 0, len = properties.length; i < len; i++) {
|
|
988
|
+
const property = properties[i];
|
|
989
|
+
html.push('<tr><td class="td1">' + (property.Name || property.name || property.label) + ':</td><td class="td2">' + (property.v || property.Value || property.value) + '</td></tr>');
|
|
990
|
+
}
|
|
991
|
+
html.push('</tbody></table>' +
|
|
992
|
+
'</div>' +
|
|
993
|
+
'</div>');
|
|
994
|
+
} else {
|
|
995
|
+
html.push('<p class="subtitle">No properties sets found.</p>');
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
html.push('</div>');
|
|
999
|
+
}
|
|
1000
|
+
$('#propInspector .prop-inspector-content')[0].innerHTML = html.join("");
|
|
1001
|
+
$('.xeokit-accordion-container').accordion({
|
|
1002
|
+
collapsible: true,
|
|
1003
|
+
heightStyle: "content"
|
|
1004
|
+
});
|
|
1005
|
+
$('#propInspector').show();
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
function setPropertySets(metaObject, dictionaryName = []) {
|
|
1009
|
+
const html = [];
|
|
1010
|
+
var propertySets = metaObject.propertySets || metaObject.ps;
|
|
1011
|
+
|
|
1012
|
+
html.push('<div class="element-attributes">');
|
|
1013
|
+
if (!metaObject) {
|
|
1014
|
+
html.push('<p class="subsubtitle">No object selected</p>');
|
|
1015
|
+
} else {
|
|
1016
|
+
html.push('<table class="xeokit-table">');
|
|
1017
|
+
html.push('<tr><td class="td1">Name:</td><td class="td2">' + metaObject.name + '</td></tr>');
|
|
1018
|
+
if (metaObject.type) {
|
|
1019
|
+
html.push('<tr><td class="td1">Class:</td><td class="td2">' + metaObject.type + '</td></tr>');
|
|
1020
|
+
}
|
|
1021
|
+
html.push('<tr><td class="td1">UUID:</td><td class="td2">' + metaObject.id + '</td></tr>');
|
|
1022
|
+
html.push('</table>');
|
|
1023
|
+
|
|
1024
|
+
addPropertySet(propertySets, html);
|
|
1025
|
+
}
|
|
1026
|
+
$('#propInspector .prop-inspector-content')[0].innerHTML = html.join("");
|
|
1027
|
+
$('.xeokit-accordion-container').accordion({
|
|
1028
|
+
collapsible: true,
|
|
1029
|
+
heightStyle: "content"
|
|
1030
|
+
});
|
|
1031
|
+
$('#propInspector').show();
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
function bindPropInspectorClose() {
|
|
1035
|
+
$('.prop-inspector-close').on('click', function () {
|
|
1036
|
+
$('#propInspector').hide();
|
|
1037
|
+
})
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
1041
|
+
// PropertySets resizable
|
|
1042
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
1043
|
+
function initPropertySetsResizable() {
|
|
1044
|
+
$('#propInspector').resizable({
|
|
1045
|
+
handles: "w",
|
|
1046
|
+
minWidth: 150
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
var angleMeasurementsData = [
|
|
866
1050
|
|
|
867
1051
|
];
|
|
868
1052
|
var bcfData = {};
|
|
@@ -871,8 +1055,6 @@ var distanceMeasurementsData = [
|
|
|
871
1055
|
];
|
|
872
1056
|
|
|
873
1057
|
var notes = [];
|
|
874
|
-
var srcModel = undefined;
|
|
875
|
-
var srcMetaModelData = undefined;
|
|
876
1058
|
var fileVersion = undefined;
|
|
877
1059
|
var fileVersionPath = undefined;
|
|
878
1060
|
|
|
@@ -894,8 +1076,6 @@ const viewer = new Viewer({
|
|
|
894
1076
|
// Arrange the camera
|
|
895
1077
|
//------------------------------------------------------------------------------------------------------------------
|
|
896
1078
|
|
|
897
|
-
const camera = viewer.camera;
|
|
898
|
-
// TODO
|
|
899
1079
|
viewer.camera.eye = [-5.02, 2.22, 15.09];
|
|
900
1080
|
viewer.camera.look = [4.97, 2.79, 9.89];
|
|
901
1081
|
viewer.camera.up = [-0.05, 0.99, 0.02];
|
|
@@ -933,7 +1113,7 @@ var treeView = new VitroTreeViewPlugin(viewer, {
|
|
|
933
1113
|
autoExpandDepth: 1,
|
|
934
1114
|
hierarchy: "containment",
|
|
935
1115
|
autoAddModels: false,
|
|
936
|
-
|
|
1116
|
+
});
|
|
937
1117
|
|
|
938
1118
|
//------------------------------------------------------------------------------------------------------------------
|
|
939
1119
|
// Create two ContextMenus - one for right-click on empty space, the other for right-click on an Entity
|
|
@@ -1303,10 +1483,10 @@ function addModelToTreeView() {
|
|
|
1303
1483
|
|
|
1304
1484
|
const callback = (metaObjects, status, jqXHR) =>
|
|
1305
1485
|
{
|
|
1306
|
-
|
|
1486
|
+
const metaModel = viewer.metaScene.metaModels[viewer.scene.modelIds[0]];
|
|
1307
1487
|
|
|
1308
1488
|
treeView.addObjectsToMetaModel(metaObjects, metaModel);
|
|
1309
|
-
treeView.addModel(
|
|
1489
|
+
treeView.addModel(viewer.scene.modelIds[0]);
|
|
1310
1490
|
|
|
1311
1491
|
$('body').addClass('treeview-expanded');
|
|
1312
1492
|
$('#treeViewContainerWrap').show();
|
|
@@ -1371,40 +1551,38 @@ function onAnnotationsMarkerClickedHandler(annotation) {
|
|
|
1371
1551
|
//------------------------------------------------------------------------------------------------------------------
|
|
1372
1552
|
// Load Model
|
|
1373
1553
|
//------------------------------------------------------------------------------------------------------------------
|
|
1374
|
-
function doLoadModel() {
|
|
1375
|
-
|
|
1376
|
-
var modelUrl = srcModel;// + disableCacheStr; //VitroDelete
|
|
1377
|
-
var metaModelDataUrl = srcMetaModelData + disableCacheStr;
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
window.model = xktLoader.load({
|
|
1554
|
+
function doLoadModel(srcModel, isMain) {
|
|
1555
|
+
const model = xktLoader.load({
|
|
1381
1556
|
id: Date.now(),
|
|
1382
|
-
src:
|
|
1557
|
+
src: srcModel.FilePath,
|
|
1383
1558
|
edges: true,
|
|
1384
1559
|
backfaces: true,
|
|
1385
1560
|
});
|
|
1386
1561
|
|
|
1387
|
-
|
|
1388
|
-
modelOnLoaded();
|
|
1389
|
-
});
|
|
1562
|
+
srcModel.id = model.id;
|
|
1390
1563
|
|
|
1564
|
+
model.vitroModel = srcModel;
|
|
1565
|
+
model.isLarge = true;
|
|
1566
|
+
model.on('loaded', () => {
|
|
1567
|
+
if (isMain) {
|
|
1568
|
+
modelOnLoaded();
|
|
1569
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
1570
|
+
// Load Small Scene
|
|
1571
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
1572
|
+
model.vitroModelLoader = new VitroXKTLoaderPlugin(viewer);
|
|
1391
1573
|
|
|
1574
|
+
model.vitroModelLoader.largeModel = model;
|
|
1575
|
+
model.vitroModelLoader.vitroModel = srcModel;
|
|
1576
|
+
model.vitroModelLoader.startSmallLoad = true;
|
|
1392
1577
|
|
|
1393
|
-
const fastNavPlugin = new FastNavPlugin(viewer, {
|
|
1394
|
-
hideEdges: true, // Don't show edges while we interact (default is true)
|
|
1395
|
-
hideSAO: true, // Don't show ambient shadows while we interact (default is true)
|
|
1396
|
-
hideColorTexture: true, // No color textures while we interact (default is true)
|
|
1397
|
-
hidePBR: true, // No physically-based rendering while we interact (default is true)
|
|
1398
|
-
hideTransparentObjects: true, // Hide transparent objects while we interact (default is false)
|
|
1399
|
-
scaleCanvasResolution: true, // Scale canvas resolution while we interact (default is false)
|
|
1400
|
-
scaleCanvasResolutionFactor: 0.5, // Factor by which we scale canvas resolution when we interact (default is 0.6)
|
|
1401
|
-
delayBeforeRestore: true, // When we stop interacting, delay before restoring normal render (default is true)
|
|
1402
|
-
delayBeforeRestoreSeconds: 1, // The delay duration, in seconds (default is 0.5)
|
|
1403
|
-
hideTempObj: false,
|
|
1404
|
-
maxTreeDepth: 20,
|
|
1405
|
-
});
|
|
1406
1578
|
|
|
1407
|
-
|
|
1579
|
+
$('#btnToggleSectionPlan').addClass('toggled');
|
|
1580
|
+
}
|
|
1581
|
+
else {
|
|
1582
|
+
viewer.scene.fire("reloadSmallScenes");
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
return model;
|
|
1408
1586
|
}
|
|
1409
1587
|
|
|
1410
1588
|
function getDisableCacheStr() {
|
|
@@ -1414,18 +1592,11 @@ function getDisableCacheStr() {
|
|
|
1414
1592
|
|
|
1415
1593
|
function modelOnLoaded() {
|
|
1416
1594
|
|
|
1417
|
-
window.model.fileVersion = fileVersion;
|
|
1418
|
-
window.model.filename = srcModel.substring(srcModel.lastIndexOf('/') + 1).replace('.xkt', '');
|
|
1419
1595
|
//------------------------------------------------------------------------------------------------------------------
|
|
1420
1596
|
// Create some Annotations
|
|
1421
1597
|
//------------------------------------------------------------------------------------------------------------------
|
|
1422
1598
|
loadAnnotations();
|
|
1423
1599
|
|
|
1424
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
1425
|
-
// Custom Colorize Entity
|
|
1426
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
1427
|
-
viewer.scene.setObjectsColorized(['2O2Fr$t4X7Zf8NOew3FLPP'], [1.0, 0.0, 0.8]); // entityId, color
|
|
1428
|
-
|
|
1429
1600
|
//----------------------------------------------------------------------------------------------------------
|
|
1430
1601
|
// Angle Measurements
|
|
1431
1602
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -1434,15 +1605,10 @@ function modelOnLoaded() {
|
|
|
1434
1605
|
//----------------------------------------------------------------------------------------------------------
|
|
1435
1606
|
// Storey Views
|
|
1436
1607
|
//----------------------------------------------------------------------------------------------------------
|
|
1437
|
-
//
|
|
1438
|
-
//
|
|
1608
|
+
// ????????! ???? ?? initStoreyViews ????? ?????? SectionPlane -> ???????? ?????? ?????? ????? ????????? ? "??????????" ????
|
|
1609
|
+
// ?? ??? ????? ?????? ??????? ????? ??????????? ???????? ??????????? SectionPlane
|
|
1439
1610
|
initStoreyViews();
|
|
1440
1611
|
|
|
1441
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
1442
|
-
// Load predefined SectionPlanes
|
|
1443
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
1444
|
-
createSectionPlane();
|
|
1445
|
-
|
|
1446
1612
|
//----------------------------------------------------------------------------------------------------------
|
|
1447
1613
|
// Distance Measurements
|
|
1448
1614
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -1451,11 +1617,6 @@ function modelOnLoaded() {
|
|
|
1451
1617
|
ViewFitAll(viewer);
|
|
1452
1618
|
}
|
|
1453
1619
|
|
|
1454
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
1455
|
-
// Create a couple of cross-section planes
|
|
1456
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
1457
|
-
function createSectionPlane() {}
|
|
1458
|
-
|
|
1459
1620
|
//------------------------------------------------------------------------------------------------------------------
|
|
1460
1621
|
// Clear SectionPlanes
|
|
1461
1622
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -1467,22 +1628,13 @@ function clearSectionPanes() {
|
|
|
1467
1628
|
// Load Annotations
|
|
1468
1629
|
//------------------------------------------------------------------------------------------------------------------
|
|
1469
1630
|
function loadAnnotations() {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
$.each(noteList, function (key, note) {
|
|
1478
|
-
notes.push(note);
|
|
1479
|
-
});
|
|
1480
|
-
$.each(notes, function (key, val) {
|
|
1481
|
-
val.entity = viewer.scene.objects[val.entity];
|
|
1482
|
-
annotations.createAnnotation(val);
|
|
1483
|
-
});
|
|
1484
|
-
}
|
|
1485
|
-
});
|
|
1631
|
+
context.getIssueList().then(issueList => {
|
|
1632
|
+
issueList.map(issue => {
|
|
1633
|
+
let data = getMarkupData(issue.item);
|
|
1634
|
+
data.occludable = false;
|
|
1635
|
+
annotations.createAnnotation(data);
|
|
1636
|
+
})
|
|
1637
|
+
})
|
|
1486
1638
|
}
|
|
1487
1639
|
|
|
1488
1640
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -1525,8 +1677,6 @@ function createSectionPlaneByClick(pickResult) {
|
|
|
1525
1677
|
}
|
|
1526
1678
|
}
|
|
1527
1679
|
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
1680
|
//------------------------------------------------------------------------------------------------------------------
|
|
1531
1681
|
// Add Note
|
|
1532
1682
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -1962,18 +2112,28 @@ function fixNotesTextareaBlur() {
|
|
|
1962
2112
|
}
|
|
1963
2113
|
});
|
|
1964
2114
|
}
|
|
1965
|
-
|
|
1966
2115
|
function highlightSidebarNote(noteId) {
|
|
1967
|
-
$('
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
2116
|
+
var noteWrap = $('#vitro-issue-tile-' + noteId);
|
|
2117
|
+
|
|
2118
|
+
if (!noteWrap.position()) {
|
|
2119
|
+
setTimeout(() => {
|
|
2120
|
+
highlightSidebarNote(noteId);
|
|
2121
|
+
}, 500);
|
|
2122
|
+
|
|
2123
|
+
return;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
doHighlightSidebarNote(noteWrap);
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
function doHighlightSidebarNote(noteWrap) {
|
|
1972
2130
|
var sidebarContent = $('.sidebar-content');
|
|
2131
|
+
sidebarContent.children().removeClass('vitro-active');
|
|
2132
|
+
noteWrap.addClass('vitro-active');
|
|
1973
2133
|
var sidebarOffsetTop = parseInt(sidebarContent[0].offsetTop);
|
|
1974
2134
|
var sidebarScrollTop = parseInt(sidebarContent[0].scrollTop);
|
|
1975
2135
|
sidebarContent.animate({
|
|
1976
|
-
scrollTop:
|
|
2136
|
+
scrollTop: noteWrap.position().top - sidebarOffsetTop + sidebarScrollTop
|
|
1977
2137
|
}, 1000);
|
|
1978
2138
|
}
|
|
1979
2139
|
|
|
@@ -2494,8 +2654,8 @@ function bindBtnCompareSideBySide() {
|
|
|
2494
2654
|
}
|
|
2495
2655
|
$(this).addClass('toggled');
|
|
2496
2656
|
});
|
|
2497
|
-
}
|
|
2498
2657
|
|
|
2658
|
+
}
|
|
2499
2659
|
function bindBtnClearComparison() {
|
|
2500
2660
|
$(document).on('click', '#btnClearComparison', function() {
|
|
2501
2661
|
$('#btnCompareOneOverOne').removeClass('toggled');
|
|
@@ -2503,6 +2663,7 @@ function bindBtnClearComparison() {
|
|
|
2503
2663
|
$('#btnToggleCompare').removeClass('toggled');
|
|
2504
2664
|
|
|
2505
2665
|
doRemoveComparison();
|
|
2666
|
+
|
|
2506
2667
|
});
|
|
2507
2668
|
}
|
|
2508
2669
|
|
|
@@ -2556,7 +2717,6 @@ function compareModels(isSideBySide) {
|
|
|
2556
2717
|
}
|
|
2557
2718
|
|
|
2558
2719
|
function doCompareModels(isSideBySide) {
|
|
2559
|
-
|
|
2560
2720
|
BIMModel.Compare(function (result) {
|
|
2561
2721
|
var objResult = JSON.parse(result);
|
|
2562
2722
|
compareModelsResult = objResult;
|
|
@@ -2572,6 +2732,9 @@ function doCompareModels(isSideBySide) {
|
|
|
2572
2732
|
|
|
2573
2733
|
highlightModelsDifference(objResult, isSideBySide);
|
|
2574
2734
|
createComparisonResultPopup();
|
|
2735
|
+
|
|
2736
|
+
$('#btnAddModel').hide();
|
|
2737
|
+
|
|
2575
2738
|
viewer.scene.canvas.spinner.processes--;
|
|
2576
2739
|
},
|
|
2577
2740
|
function () {
|
|
@@ -2712,36 +2875,24 @@ function highlightModelsDifference(result, isSideBySide) {
|
|
|
2712
2875
|
color = [1.0, 0.0, 0.8];
|
|
2713
2876
|
} else {
|
|
2714
2877
|
color = [0.9, 0.9, 0.9]; // TODO: old Model unique-objects color -> gray
|
|
2715
|
-
setOpacityArObject(arObjId, opacity);
|
|
2878
|
+
setOpacityArObject(window.model, arObjId, opacity);
|
|
2716
2879
|
}
|
|
2717
|
-
colorizeArObject(arObjId, color); // TODO: old Model unique-objects change color
|
|
2880
|
+
colorizeArObject(window.model, arObjId, color); // TODO: old Model unique-objects change color
|
|
2718
2881
|
}
|
|
2719
2882
|
|
|
2720
2883
|
// Make old Model not unique-objects unvisible
|
|
2721
2884
|
if (result['old']['notUnique'].length && !isSideBySide) {
|
|
2722
2885
|
arObjId = result['old']['notUnique'];
|
|
2723
|
-
setVisibilityArObject(arObjId, false);
|
|
2886
|
+
setVisibilityArObject(window.model, arObjId, false);
|
|
2724
2887
|
}
|
|
2725
2888
|
|
|
2726
2889
|
if (result['new'].length) {
|
|
2727
2890
|
arObjId = result['new'];
|
|
2728
2891
|
color = [1.0, 0.0, 0.8]; // TODO: new Model unique-objects color
|
|
2729
|
-
colorizeArObject(arObjId, color);
|
|
2892
|
+
colorizeArObject(window.model2, arObjId, color);
|
|
2730
2893
|
}
|
|
2731
2894
|
}
|
|
2732
2895
|
|
|
2733
|
-
// Xkt
|
|
2734
|
-
/*function highlightModelsDifference(result) {
|
|
2735
|
-
var color = [1.0, 0.0, 0.8];
|
|
2736
|
-
$.each(result, function(modelId, arObj) {
|
|
2737
|
-
if(arObj.length > 0) {
|
|
2738
|
-
$.each(arObj, function(index, obj) {
|
|
2739
|
-
colorizeObject(obj.id, color);
|
|
2740
|
-
});
|
|
2741
|
-
}
|
|
2742
|
-
});
|
|
2743
|
-
}*/
|
|
2744
|
-
|
|
2745
2896
|
function colorizeArObject(arObjId, color) {
|
|
2746
2897
|
viewer.scene.setObjectsColorized(arObjId, color);
|
|
2747
2898
|
}
|
|
@@ -2898,213 +3049,34 @@ function disableDistanceMeasurements() {
|
|
|
2898
3049
|
}
|
|
2899
3050
|
|
|
2900
3051
|
//------------------------------------------------------------------------------------------------------------------
|
|
2901
|
-
//
|
|
3052
|
+
// FastNavPlugin
|
|
2902
3053
|
//------------------------------------------------------------------------------------------------------------------
|
|
2903
|
-
function showPropertyInspector(pickResult) {
|
|
2904
|
-
var metaObject;
|
|
2905
|
-
var model = getPickResultModel(pickResult);
|
|
2906
|
-
var objectId = pickResult.entity.id;
|
|
2907
3054
|
|
|
2908
|
-
|
|
3055
|
+
const fastNavPlugin = new FastNavPlugin(viewer, {
|
|
3056
|
+
hideEdges: true, // Don't show edges while we interact (default is true)
|
|
3057
|
+
hideSAO: true, // Don't show ambient shadows while we interact (default is true)
|
|
3058
|
+
hideColorTexture: true, // No color textures while we interact (default is true)
|
|
3059
|
+
hidePBR: true, // No physically-based rendering while we interact (default is true)
|
|
3060
|
+
hideTransparentObjects: true, // Hide transparent objects while we interact (default is false)
|
|
3061
|
+
scaleCanvasResolution: true, // Scale canvas resolution while we interact (default is false)
|
|
3062
|
+
scaleCanvasResolutionFactor: 0.5, // Factor by which we scale canvas resolution when we interact (default is 0.6)
|
|
3063
|
+
delayBeforeRestore: true, // When we stop interacting, delay before restoring normal render (default is true)
|
|
3064
|
+
delayBeforeRestoreSeconds: 1, // The delay duration, in seconds (default is 0.5)
|
|
3065
|
+
hideTempObj: false,
|
|
3066
|
+
maxTreeDepth: 20,
|
|
3067
|
+
});
|
|
2909
3068
|
|
|
3069
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
3070
|
+
//
|
|
3071
|
+
//------------------------------------------------------------------------------------------------------------------
|
|
3072
|
+
|
|
3073
|
+
var notesDescriptionVisibleList = {};
|
|
2910
3074
|
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
metaObject = window.model.customMeta[pickResult.entity._parentNode.id];
|
|
2915
|
-
}
|
|
3075
|
+
BIMAnnotation.GetNote = (callback) => {
|
|
3076
|
+
callback([]);
|
|
3077
|
+
}
|
|
2916
3078
|
|
|
2917
|
-
|
|
2918
|
-
setPropertySets(metaObject, model.dictionaryName);
|
|
2919
|
-
} else {
|
|
2920
|
-
return false;
|
|
2921
|
-
}
|
|
2922
|
-
} else {
|
|
2923
|
-
setPropertyBDSets(pickResult.entity.id, model.fileVersion);
|
|
2924
|
-
|
|
2925
|
-
return false;
|
|
2926
|
-
}
|
|
2927
|
-
}
|
|
2928
|
-
|
|
2929
|
-
function getPickResultModel(pickResult) {
|
|
2930
|
-
var modelId = getPickResultModelId(pickResult);
|
|
2931
|
-
if (modelId) {
|
|
2932
|
-
if (window.model.id == modelId) {
|
|
2933
|
-
return window.model;
|
|
2934
|
-
} else if (window.model2 && window.model2.id == modelId) {
|
|
2935
|
-
return window.model2;
|
|
2936
|
-
} else {
|
|
2937
|
-
return false;
|
|
2938
|
-
}
|
|
2939
|
-
} else {
|
|
2940
|
-
return false;
|
|
2941
|
-
}
|
|
2942
|
-
}
|
|
2943
|
-
|
|
2944
|
-
function getPickResultModelId(pickResult) {
|
|
2945
|
-
if (pickResult.entity.model && pickResult.entity.model.id) {
|
|
2946
|
-
return pickResult.entity.model.id;
|
|
2947
|
-
} else if(pickResult.entity._owner && pickResult.entity._owner.id) {
|
|
2948
|
-
return pickResult.entity._owner.id;
|
|
2949
|
-
} else {
|
|
2950
|
-
return false;
|
|
2951
|
-
}
|
|
2952
|
-
}
|
|
2953
|
-
|
|
2954
|
-
function getPropertyValue(property) {
|
|
2955
|
-
if (property.value_bool != null && property.value_bool != undefined) {
|
|
2956
|
-
return property.value_bool;
|
|
2957
|
-
}
|
|
2958
|
-
else if (property.value_int != null && property.value_int != undefined) {
|
|
2959
|
-
return property.value_int;
|
|
2960
|
-
}
|
|
2961
|
-
else if (property.value_text != null && property.value_text != undefined) {
|
|
2962
|
-
return property.value_text;
|
|
2963
|
-
}
|
|
2964
|
-
else if (property.value_real != null && property.value_real != undefined) {
|
|
2965
|
-
return property.value_real;
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2969
|
-
function convertProperty(data) {
|
|
2970
|
-
let groups = [];
|
|
2971
|
-
|
|
2972
|
-
for (let property of data) {
|
|
2973
|
-
let existingGroups = groups.filter(group => group.name == property.group_name);
|
|
2974
|
-
if (existingGroups.length > 0) {
|
|
2975
|
-
existingGroups[0].properties.push({ name: property.name, value: getPropertyValue(property) });
|
|
2976
|
-
}
|
|
2977
|
-
else {
|
|
2978
|
-
let newGroup = {
|
|
2979
|
-
name: property.group_name,
|
|
2980
|
-
properties: [],
|
|
2981
|
-
};
|
|
2982
|
-
newGroup.properties.push({ name: property.name, value: getPropertyValue(property) });
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
groups.push(newGroup);
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
|
|
2989
|
-
return groups;
|
|
2990
|
-
}
|
|
2991
|
-
|
|
2992
|
-
function setPropertyBDSets(id, version) {
|
|
2993
|
-
const html = [];
|
|
2994
|
-
|
|
2995
|
-
html.push('<div class="element-attributes">');
|
|
2996
|
-
html.push('</div>');
|
|
2997
|
-
|
|
2998
|
-
viewer.scene.canvas.spinner.processes++;
|
|
2999
|
-
|
|
3000
|
-
BIMModel.GetPropertyList(id,
|
|
3001
|
-
(data) => {
|
|
3002
|
-
const propertySets = convertProperty(data);
|
|
3003
|
-
addPropertySet(propertySets, html);
|
|
3004
|
-
viewer.scene.canvas.spinner.processes--;
|
|
3005
|
-
},
|
|
3006
|
-
(error) => {
|
|
3007
|
-
viewer.scene.canvas.spinner.processes--;
|
|
3008
|
-
}
|
|
3009
|
-
);
|
|
3010
|
-
|
|
3011
|
-
$('#propInspector .prop-inspector-content')[0].innerHTML = html.join("");
|
|
3012
|
-
$('.xeokit-accordion-container').accordion({
|
|
3013
|
-
collapsible: true,
|
|
3014
|
-
heightStyle: "content"
|
|
3015
|
-
});
|
|
3016
|
-
$('#propInspector').show();
|
|
3017
|
-
}
|
|
3018
|
-
|
|
3019
|
-
function addPropertySet(propertySets, html)
|
|
3020
|
-
{
|
|
3021
|
-
if(!propertySets || propertySets.length == 0){
|
|
3022
|
-
html.push('<p class="subtitle">No properties sets found.</p>');
|
|
3023
|
-
}
|
|
3024
|
-
else{
|
|
3025
|
-
html.push('<div class="xeokit-accordion">');
|
|
3026
|
-
for (let i = 0, len = propertySets.length; i < len; i++) {
|
|
3027
|
-
const propertySet = propertySets[i];
|
|
3028
|
-
const properties = propertySet.properties || propertySet.p || [];
|
|
3029
|
-
if (properties.length > 0) {
|
|
3030
|
-
html.push('<div class="xeokit-accordion-container">' +
|
|
3031
|
-
'<h3><span>' + (propertySet.name ? propertySet.name : propertySet.propertySetName) + '</span></h3>' +
|
|
3032
|
-
'<div class="xeokit-accordion-panel">' +
|
|
3033
|
-
'<table class="xeokit-table"><tbody>'
|
|
3034
|
-
);
|
|
3035
|
-
for (let i = 0, len = properties.length; i < len; i++) {
|
|
3036
|
-
const property = properties[i];
|
|
3037
|
-
html.push('<tr><td class="td1">' + (property.Name || property.name || property.label) + ':</td><td class="td2">' + (property.v || property.Value || property.value ) + '</td></tr>');
|
|
3038
|
-
}
|
|
3039
|
-
html.push('</tbody></table>' +
|
|
3040
|
-
'</div>' +
|
|
3041
|
-
'</div>');
|
|
3042
|
-
} else {
|
|
3043
|
-
html.push('<p class="subtitle">No properties sets found.</p>');
|
|
3044
|
-
}
|
|
3045
|
-
}
|
|
3046
|
-
html.push('</div>');
|
|
3047
|
-
}
|
|
3048
|
-
$('#propInspector .prop-inspector-content')[0].innerHTML = html.join("");
|
|
3049
|
-
$('.xeokit-accordion-container').accordion({
|
|
3050
|
-
collapsible: true,
|
|
3051
|
-
heightStyle: "content"
|
|
3052
|
-
});
|
|
3053
|
-
$('#propInspector').show();
|
|
3054
|
-
}
|
|
3055
|
-
function setPropertySets(metaObject, dictionaryName = []) {
|
|
3056
|
-
const html = [];
|
|
3057
|
-
var propertySets = metaObject.propertySets || metaObject.ps;
|
|
3058
|
-
|
|
3059
|
-
html.push('<div class="element-attributes">');
|
|
3060
|
-
if (!metaObject) {
|
|
3061
|
-
html.push('<p class="subsubtitle">No object selected</p>');
|
|
3062
|
-
} else {
|
|
3063
|
-
html.push('<table class="xeokit-table">');
|
|
3064
|
-
html.push('<tr><td class="td1">Name:</td><td class="td2">' + metaObject.name + '</td></tr>');
|
|
3065
|
-
if (metaObject.type) {
|
|
3066
|
-
html.push('<tr><td class="td1">Class:</td><td class="td2">' + metaObject.type + '</td></tr>');
|
|
3067
|
-
}
|
|
3068
|
-
html.push('<tr><td class="td1">UUID:</td><td class="td2">' + metaObject.id + '</td></tr>');
|
|
3069
|
-
html.push('</table>');
|
|
3070
|
-
|
|
3071
|
-
addPropertySet(propertySets, html);
|
|
3072
|
-
}
|
|
3073
|
-
$('#propInspector .prop-inspector-content')[0].innerHTML = html.join("");
|
|
3074
|
-
$('.xeokit-accordion-container').accordion({
|
|
3075
|
-
collapsible: true,
|
|
3076
|
-
heightStyle: "content"
|
|
3077
|
-
});
|
|
3078
|
-
$('#propInspector').show();
|
|
3079
|
-
}
|
|
3080
|
-
|
|
3081
|
-
function bindPropInspectorClose() {
|
|
3082
|
-
$('.prop-inspector-close').on('click', function() {
|
|
3083
|
-
$('#propInspector').hide();
|
|
3084
|
-
})
|
|
3085
|
-
}
|
|
3086
|
-
|
|
3087
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3088
|
-
// PropertySets resizable
|
|
3089
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3090
|
-
function initPropertySetsResizable() {
|
|
3091
|
-
$('#propInspector').resizable({
|
|
3092
|
-
handles: "w",
|
|
3093
|
-
minWidth: 150
|
|
3094
|
-
});
|
|
3095
|
-
}
|
|
3096
|
-
|
|
3097
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3098
|
-
//
|
|
3099
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3100
|
-
|
|
3101
|
-
var notesDescriptionVisibleList = {};
|
|
3102
|
-
|
|
3103
|
-
BIMAnnotation.GetNote = (callback) => {
|
|
3104
|
-
callback([]);
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
|
-
function saveNote(pickResult) {
|
|
3079
|
+
function saveNote(pickResult) {
|
|
3108
3080
|
|
|
3109
3081
|
}
|
|
3110
3082
|
|
|
@@ -3356,73 +3328,9 @@ function collapseSidebarIssueDetail() {
|
|
|
3356
3328
|
$('body').removeClass('sidebar-expanded');
|
|
3357
3329
|
}
|
|
3358
3330
|
|
|
3359
|
-
function showPropertyInspector(pickResult) {
|
|
3360
|
-
var metaObject;
|
|
3361
|
-
var model = getPickResultModel(pickResult);
|
|
3362
|
-
var objectId = pickResult.entity.id;
|
|
3363
|
-
|
|
3364
|
-
collapseSidebarIssueDetail();
|
|
3365
|
-
collapseSidebarNotes();
|
|
3366
|
-
$('#btnToggleSidebarNotes').removeClass('toggled');
|
|
3367
|
-
|
|
3368
|
-
if (model && model.customMeta) {
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
if (model.customMeta[objectId]) {
|
|
3372
|
-
metaObject = window.model.customMeta[objectId];
|
|
3373
|
-
} else if (pickResult.entity._parentNode && pickResult.entity._parentNode.id && model.customMeta[pickResult.entity._parentNode.id]) {
|
|
3374
|
-
metaObject = window.model.customMeta[pickResult.entity._parentNode.id];
|
|
3375
|
-
}
|
|
3376
|
-
|
|
3377
|
-
if (metaObject) {
|
|
3378
|
-
setPropertySets(metaObject, model.dictionaryName);
|
|
3379
|
-
} else {
|
|
3380
|
-
return false;
|
|
3381
|
-
}
|
|
3382
|
-
} else {
|
|
3383
|
-
setPropertyBDSets(pickResult.entity.id, model.fileVersion);
|
|
3384
|
-
|
|
3385
|
-
return false;
|
|
3386
|
-
}
|
|
3387
|
-
}
|
|
3388
|
-
|
|
3389
3331
|
//------------------------------------------------------------------------------------------------------------------
|
|
3390
3332
|
// Load Annotations
|
|
3391
3333
|
//------------------------------------------------------------------------------------------------------------------
|
|
3392
|
-
function loadAnnotations() {
|
|
3393
|
-
context.getIssueList().then(issueList => {
|
|
3394
|
-
issueList.map(issue => {
|
|
3395
|
-
let data = getMarkupData(issue.item);
|
|
3396
|
-
data.occludable = false;
|
|
3397
|
-
annotations.createAnnotation(data);
|
|
3398
|
-
})
|
|
3399
|
-
})
|
|
3400
|
-
}
|
|
3401
|
-
function highlightSidebarNote(noteId) {
|
|
3402
|
-
var noteWrap = $('#vitro-issue-tile-' + noteId);
|
|
3403
|
-
|
|
3404
|
-
if (!noteWrap.position()) {
|
|
3405
|
-
setTimeout(() => {
|
|
3406
|
-
highlightSidebarNote(noteId);
|
|
3407
|
-
}, 500);
|
|
3408
|
-
|
|
3409
|
-
return;
|
|
3410
|
-
}
|
|
3411
|
-
|
|
3412
|
-
doHighlightSidebarNote(noteWrap);
|
|
3413
|
-
}
|
|
3414
|
-
|
|
3415
|
-
function doHighlightSidebarNote(noteWrap) {
|
|
3416
|
-
var sidebarContent = $('.sidebar-content');
|
|
3417
|
-
sidebarContent.children().removeClass('vitro-active');
|
|
3418
|
-
noteWrap.addClass('vitro-active');
|
|
3419
|
-
var sidebarOffsetTop = parseInt(sidebarContent[0].offsetTop);
|
|
3420
|
-
var sidebarScrollTop = parseInt(sidebarContent[0].scrollTop);
|
|
3421
|
-
sidebarContent.animate({
|
|
3422
|
-
scrollTop: noteWrap.position().top - sidebarOffsetTop + sidebarScrollTop
|
|
3423
|
-
}, 1000);
|
|
3424
|
-
}
|
|
3425
|
-
|
|
3426
3334
|
function createSidebarNotesItemHeader(noteData) {
|
|
3427
3335
|
|
|
3428
3336
|
}
|
|
@@ -3686,35 +3594,6 @@ function getComparisonResulItemsListElm(sceneModel, resultData, cssClass, allIte
|
|
|
3686
3594
|
return itemsList;
|
|
3687
3595
|
}
|
|
3688
3596
|
|
|
3689
|
-
// Gltf
|
|
3690
|
-
function highlightModelsDifference(result, isSideBySide) {
|
|
3691
|
-
var color, arObjId;
|
|
3692
|
-
|
|
3693
|
-
if (result['old']['unique'].length) {
|
|
3694
|
-
arObjId = result['old']['unique'];
|
|
3695
|
-
var opacity = 0.4; // TODO: old Model unique-objects opacity
|
|
3696
|
-
if (isSideBySide) {
|
|
3697
|
-
color = [1.0, 0.0, 0.8];
|
|
3698
|
-
} else {
|
|
3699
|
-
color = [0.9, 0.9, 0.9]; // TODO: old Model unique-objects color -> gray
|
|
3700
|
-
setOpacityArObject(window.model, arObjId, opacity);
|
|
3701
|
-
}
|
|
3702
|
-
colorizeArObject(window.model, arObjId, color); // TODO: old Model unique-objects change color
|
|
3703
|
-
}
|
|
3704
|
-
|
|
3705
|
-
// Make old Model not unique-objects unvisible
|
|
3706
|
-
if (result['old']['notUnique'].length && !isSideBySide) {
|
|
3707
|
-
arObjId = result['old']['notUnique'];
|
|
3708
|
-
setVisibilityArObject(window.model, arObjId, false);
|
|
3709
|
-
}
|
|
3710
|
-
|
|
3711
|
-
if (result['new'].length) {
|
|
3712
|
-
arObjId = result['new'];
|
|
3713
|
-
color = [1.0, 0.0, 0.8]; // TODO: new Model unique-objects color
|
|
3714
|
-
colorizeArObject(window.model2, arObjId, color);
|
|
3715
|
-
}
|
|
3716
|
-
}
|
|
3717
|
-
|
|
3718
3597
|
function withObjects(sceneModel, dbObjs, callback) {
|
|
3719
3598
|
let changed = false;
|
|
3720
3599
|
for (let i = 0, len = dbObjs.length; i < len; i++) {
|
|
@@ -3817,113 +3696,6 @@ function doRemoveComparison() {
|
|
|
3817
3696
|
restoreObjectColorsAfterCompare();
|
|
3818
3697
|
}
|
|
3819
3698
|
|
|
3820
|
-
function getPropertyValue(property) {
|
|
3821
|
-
if (property.valueBool != null && property.valueBool != undefined) {
|
|
3822
|
-
return property.valueBool;
|
|
3823
|
-
}
|
|
3824
|
-
else if (property.valueInt != null && property.valueInt != undefined) {
|
|
3825
|
-
return property.valueInt;
|
|
3826
|
-
}
|
|
3827
|
-
else if (property.valueText != null && property.valueText != undefined) {
|
|
3828
|
-
return property.valueText;
|
|
3829
|
-
}
|
|
3830
|
-
else if (property.valueReal != null && property.valueReal != undefined) {
|
|
3831
|
-
return property.valueReal;
|
|
3832
|
-
}
|
|
3833
|
-
}
|
|
3834
|
-
function convertProperty(data) {
|
|
3835
|
-
let groups = [];
|
|
3836
|
-
|
|
3837
|
-
for (let property of data) {
|
|
3838
|
-
let existingGroups = groups.filter(group => group.name == property.groupName);
|
|
3839
|
-
if (existingGroups.length > 0) {
|
|
3840
|
-
existingGroups[0].properties.push({ name: property.name, value: getPropertyValue(property) });
|
|
3841
|
-
}
|
|
3842
|
-
else {
|
|
3843
|
-
let newGroup = {
|
|
3844
|
-
name: property.groupName,
|
|
3845
|
-
properties: [],
|
|
3846
|
-
};
|
|
3847
|
-
newGroup.properties.push({ name: property.name, value: getPropertyValue(property) });
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
groups.push(newGroup);
|
|
3851
|
-
}
|
|
3852
|
-
}
|
|
3853
|
-
|
|
3854
|
-
return groups;
|
|
3855
|
-
}
|
|
3856
|
-
|
|
3857
|
-
function modelOnLoaded() {
|
|
3858
|
-
|
|
3859
|
-
window.model.fileVersion = fileVersion;
|
|
3860
|
-
window.model.filename = srcModel.substring(srcModel.lastIndexOf('/') + 1).replace('.xkt', '');
|
|
3861
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3862
|
-
// Create some Annotations
|
|
3863
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3864
|
-
loadAnnotations();
|
|
3865
|
-
|
|
3866
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3867
|
-
// Custom Colorize Entity
|
|
3868
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3869
|
-
viewer.scene.setObjectsColorized(['2O2Fr$t4X7Zf8NOew3FLPP'], [1.0, 0.0, 0.8]); // entityId, color
|
|
3870
|
-
|
|
3871
|
-
//----------------------------------------------------------------------------------------------------------
|
|
3872
|
-
// Angle Measurements
|
|
3873
|
-
//----------------------------------------------------------------------------------------------------------
|
|
3874
|
-
const angleMeasurements = createAngleMeasurements(angleMeasurementsData);
|
|
3875
|
-
|
|
3876
|
-
//----------------------------------------------------------------------------------------------------------
|
|
3877
|
-
// Storey Views
|
|
3878
|
-
//----------------------------------------------------------------------------------------------------------
|
|
3879
|
-
// ????????! ???? ?? initStoreyViews ????? ?????? SectionPlane -> ???????? ?????? ?????? ????? ????????? ? "??????????" ????
|
|
3880
|
-
// ?? ??? ????? ?????? ??????? ????? ??????????? ???????? ??????????? SectionPlane
|
|
3881
|
-
initStoreyViews();
|
|
3882
|
-
|
|
3883
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3884
|
-
// Load predefined SectionPlanes
|
|
3885
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3886
|
-
createSectionPlane();
|
|
3887
|
-
|
|
3888
|
-
//----------------------------------------------------------------------------------------------------------
|
|
3889
|
-
// Distance Measurements
|
|
3890
|
-
//----------------------------------------------------------------------------------------------------------
|
|
3891
|
-
const distanceMeasurements = createDistanceMeasurements(distanceMeasurementsData);
|
|
3892
|
-
|
|
3893
|
-
ViewFitAll(viewer);
|
|
3894
|
-
|
|
3895
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3896
|
-
// Load Small Scene
|
|
3897
|
-
//------------------------------------------------------------------------------------------------------------------
|
|
3898
|
-
|
|
3899
|
-
var vitroModelLoader = new VitroXKTLoaderPlugin(viewer);
|
|
3900
|
-
|
|
3901
|
-
vitroModelLoader.version = BIMCommon.FileVersion;
|
|
3902
|
-
vitroModelLoader.startSmallLoad = true;
|
|
3903
|
-
}
|
|
3904
|
-
|
|
3905
|
-
function convertProperty(data) {
|
|
3906
|
-
let groups = [];
|
|
3907
|
-
|
|
3908
|
-
for (let property of data) {
|
|
3909
|
-
let existingGroups = groups.filter(group => group.name == property.groupName);
|
|
3910
|
-
if (existingGroups.length > 0) {
|
|
3911
|
-
existingGroups[0].properties.push({ name: property.name, value: getPropertyValue(property) });
|
|
3912
|
-
}
|
|
3913
|
-
else {
|
|
3914
|
-
let newGroup = {
|
|
3915
|
-
name: property.groupName,
|
|
3916
|
-
properties: [],
|
|
3917
|
-
};
|
|
3918
|
-
newGroup.properties.push({ name: property.name, value: getPropertyValue(property) });
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
groups.push(newGroup);
|
|
3922
|
-
}
|
|
3923
|
-
}
|
|
3924
|
-
|
|
3925
|
-
return groups;
|
|
3926
|
-
}
|
|
3927
3699
|
|
|
3928
3700
|
function onAnnotationsMarkerClickedHandler(annotation) {
|
|
3929
3701
|
showNoteDesc(annotation.id);
|
|
@@ -4026,7 +3798,57 @@ function initIssueDetailResizable() {
|
|
|
4026
3798
|
$('#sectionPlanesOverviewCanvas').css('right', $('#issueDetail').width() + 10);
|
|
4027
3799
|
}
|
|
4028
3800
|
});
|
|
4029
|
-
}
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
function addToTreeView(model, sceneModelId) {
|
|
3804
|
+
if (treeView && treeView._rootNodes.length > 0) {
|
|
3805
|
+
const callback = (metaObjects, status, jqXHR) => {
|
|
3806
|
+
const metaModel = viewer.metaScene.metaModels[sceneModelId];
|
|
3807
|
+
|
|
3808
|
+
treeView.addObjectsToMetaModel(metaObjects, metaModel);
|
|
3809
|
+
treeView.addModel(sceneModelId);
|
|
3810
|
+
|
|
3811
|
+
viewer.scene.canvas.spinner.processes--;
|
|
3812
|
+
};
|
|
3813
|
+
|
|
3814
|
+
const error = () => {
|
|
3815
|
+
viewer.scene.canvas.spinner.processes--;
|
|
3816
|
+
};
|
|
3817
|
+
|
|
3818
|
+
BIMModel.GetElementChildList(model.FileItemId, model.FileVersion, "-1", false, null, callback, error);
|
|
3819
|
+
}
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3822
|
+
function bindBtnAddModel() {
|
|
3823
|
+
$(document).on('click', '#btnAddModel', function () {
|
|
3824
|
+
context.showItemSelectDialog().then(itemIdList => {
|
|
3825
|
+
itemIdList.forEach(itemId =>
|
|
3826
|
+
{
|
|
3827
|
+
BIMCommon.GetFileItem(itemId, undefined, function (modelId) {
|
|
3828
|
+
context.getItem(modelId).then(item => {
|
|
3829
|
+
const filePath = context.getFilePath(item.id);
|
|
3830
|
+
const fileName = context.file.fieldValueMap?.name;
|
|
3831
|
+
const model = new BIMCommon.VitroModel(itemId, versionStr, filePath, fileName);
|
|
3832
|
+
|
|
3833
|
+
BIMCommon.ModelList.push(model);
|
|
3834
|
+
|
|
3835
|
+
const sceneModel = doLoadModel(model, false);
|
|
3836
|
+
addToTreeView(model, sceneModel.id);
|
|
3837
|
+
|
|
3838
|
+
$('#btnToggleCompare').hide();
|
|
3839
|
+
})
|
|
3840
|
+
|
|
3841
|
+
}, function () {
|
|
3842
|
+
alert("The file is being processed");
|
|
3843
|
+
});
|
|
3844
|
+
|
|
3845
|
+
})
|
|
3846
|
+
});
|
|
3847
|
+
});
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3850
|
+
|
|
3851
|
+
|
|
4030
3852
|
//------------------------------------------------------------------------------------------------------------------
|
|
4031
3853
|
// Do action wherever we click on an object
|
|
4032
3854
|
//------------------------------------------------------------------------------------------------------------------
|
|
@@ -4078,16 +3900,15 @@ BIMCommon.GetFileItem(context.file.id, versionStr, function (modelId) {
|
|
|
4078
3900
|
var fileName = context.file.fieldValueMap?.name;
|
|
4079
3901
|
|
|
4080
3902
|
document.title += " - " + fileName;
|
|
4081
|
-
srcModel = filePath;
|
|
4082
|
-
srcMetaModelData = '';
|
|
4083
3903
|
fileVersion = '';
|
|
4084
3904
|
fileVersionPath = filePath;
|
|
4085
3905
|
hideXeokitSpinner();
|
|
4086
3906
|
|
|
4087
|
-
BIMCommon.
|
|
4088
|
-
BIMCommon.FileItemId = context.file.id;
|
|
3907
|
+
const model = new BIMCommon.VitroModel(context.file.id, versionStr, filePath, fileName);
|
|
4089
3908
|
|
|
4090
|
-
|
|
3909
|
+
BIMCommon.ModelList.push(model);
|
|
3910
|
+
|
|
3911
|
+
doLoadModel(model, true);
|
|
4091
3912
|
})
|
|
4092
3913
|
|
|
4093
3914
|
}, function () {
|
|
@@ -4132,6 +3953,8 @@ function init() {
|
|
|
4132
3953
|
bindBtnCompareSideBySide();
|
|
4133
3954
|
bindBtnClearComparison();
|
|
4134
3955
|
|
|
3956
|
+
bindBtnAddModel();
|
|
3957
|
+
|
|
4135
3958
|
initCompare();
|
|
4136
3959
|
bindSelectList();
|
|
4137
3960
|
}
|