diff --git a/website/o3dv/css/website.css b/website/o3dv/css/website.css index 4bf07ec..1c021db 100644 --- a/website/o3dv/css/website.css +++ b/website/o3dv/css/website.css @@ -5,7 +5,7 @@ div.ov_color_circle width: 14px; height: 14px; display: inline-block; - margin-right: 5px; + margin-right: 8px; margin-bottom: -2px; border-radius: 10px; } diff --git a/website/o3dv/js/navigator.js b/website/o3dv/js/navigator.js index 474adb7..0422fad 100644 --- a/website/o3dv/js/navigator.js +++ b/website/o3dv/js/navigator.js @@ -77,6 +77,13 @@ OV.Navigator = class this.materialsPanel.Init ({ onMaterialSelected : (materialIndex) => { this.SetSelection (new OV.Selection (OV.SelectionType.Material, materialIndex)); + }, + onMeshTemporarySelected : (meshInstanceId) => { + this.tempSelectedMeshId = meshInstanceId; + this.callbacks.updateMeshesSelection (); + }, + onMeshSelected : (meshInstanceId) => { + this.SetSelection (new OV.Selection (OV.SelectionType.Mesh, meshInstanceId)); } }); @@ -95,6 +102,9 @@ OV.Navigator = class }, onNodeFitToWindow : (nodeId) => { this.FitNodeToWindow (nodeId); + }, + onMaterialSelected : (materialIndex) => { + this.SetSelection (new OV.Selection (OV.SelectionType.Material, materialIndex)); } }); @@ -206,7 +216,7 @@ OV.Navigator = class if (select) { navigator.panelSet.ShowPanel (navigator.materialsPanel); } - navigator.materialsPanel.GetMaterialItem (selection.materialIndex).SetSelected (select); + navigator.materialsPanel.SelectMaterialItem (selection.materialIndex, select); } else if (selection.type === OV.SelectionType.Mesh) { if (select) { navigator.panelSet.ShowPanel (navigator.meshesPanel); @@ -252,9 +262,29 @@ OV.Navigator = class this.callbacks.onMeshSelected (this.selection.meshInstanceId); } } + this.UpdatePanels (); this.Resize (); } + UpdatePanels () + { + let materialIndex = null; + let meshInstanceId = null; + if (this.selection !== null) { + if (this.selection.type === OV.SelectionType.Material) { + materialIndex = this.selection.materialIndex; + } else if (this.selection.type === OV.SelectionType.Mesh) { + meshInstanceId = this.selection.meshInstanceId; + } + } + + let usedByMeshes = this.callbacks.getMeshesForMaterial (materialIndex); + this.materialsPanel.UpdateMeshList (usedByMeshes); + + let usedByMaterials = this.callbacks.getMaterialsForMesh (meshInstanceId); + this.meshesPanel.UpdateMaterialList (usedByMaterials); + } + FitNodeToWindow (nodeId) { let meshInstanceIdSet = new Set (); diff --git a/website/o3dv/js/navigatorpanels.js b/website/o3dv/js/navigatorpanels.js index 9f837a3..c601d38 100644 --- a/website/o3dv/js/navigatorpanels.js +++ b/website/o3dv/js/navigatorpanels.js @@ -1,3 +1,144 @@ +OV.NavigatorPopupButton = class +{ + constructor (parentDiv) + { + this.parentDiv = parentDiv; + this.callbacks = null; + this.popup = null; + + this.button = $('