+
-
+
diff --git a/website/o3dv/css/panelset.css b/website/o3dv/css/panelset.css
index 53f3ae1..216a312 100644
--- a/website/o3dv/css/panelset.css
+++ b/website/o3dv/css/panelset.css
@@ -1,21 +1,33 @@
-div.ov_panel_set_menu
+div.ov_panel_set_container div.ov_panel_set_menu
{
float: left;
}
+div.ov_panel_set_right_container div.ov_panel_set_menu
+{
+ float: right;
+}
+
div.ov_panel_set_menu div.ov_panel_set_menu_button
{
padding: 6px;
cursor: pointer;
}
-div.ov_panel_set_content
+div.ov_panel_set_container div.ov_panel_set_content
{
padding-left: 10px;
border-left: 1px solid var(--ov_border_color);
overflow: auto;
}
+div.ov_panel_set_right_container div.ov_panel_set_content
+{
+ padding-right: 10px;
+ border-right: 1px solid var(--ov_border_color);
+ overflow: auto;
+}
+
@media (hover)
{
diff --git a/website/o3dv/css/website.css b/website/o3dv/css/website.css
index 1c021db..70cc748 100644
--- a/website/o3dv/css/website.css
+++ b/website/o3dv/css/website.css
@@ -125,14 +125,14 @@ div.main_viewer
div.main_sidebar
{
width: 300px;
- margin: 10px 10px 10px 0px;
+ margin: 10px 0px 10px 10px;
overflow: none;
float: right;
}
div.main_viewer canvas
{
- margin: 10px 10px 10px 0px;
+ margin: 10px 0px 10px 0px;
border: 1px solid var(--ov_border_color);
outline: none;
display: block;
diff --git a/website/o3dv/js/detailssidebarpanel.js b/website/o3dv/js/detailssidebarpanel.js
deleted file mode 100644
index b1ddaf0..0000000
--- a/website/o3dv/js/detailssidebarpanel.js
+++ /dev/null
@@ -1,159 +0,0 @@
-OV.DetailsSidebarPanel = class extends OV.SidebarPanel
-{
- constructor (parentDiv)
- {
- super (parentDiv);
- }
-
- GetTitle ()
- {
- return 'Details';
- }
-
- AddObject3DProperties (object3D)
- {
- this.Clear ();
- let table = $('
').addClass ('ov_property_table').appendTo (this.contentDiv);
- let boundingBox = OV.GetBoundingBox (object3D);
- let size = OV.SubCoord3D (boundingBox.max, boundingBox.min);
- this.AddProperty (table, new OV.Property (OV.PropertyType.Integer, 'Vertex Count', object3D.VertexCount ()));
- this.AddProperty (table, new OV.Property (OV.PropertyType.Integer, 'Triangle Count', object3D.TriangleCount ()));
- this.AddProperty (table, new OV.Property (OV.PropertyType.Number, 'Size X', size.x));
- this.AddProperty (table, new OV.Property (OV.PropertyType.Number, 'Size Y', size.y));
- this.AddProperty (table, new OV.Property (OV.PropertyType.Number, 'Size Z', size.z));
- this.AddCalculatedProperty (table, 'Volume', () => {
- const volume = OV.CalculateVolume (object3D);
- if (volume === null) {
- return null;
- }
- return new OV.Property (OV.PropertyType.Number, null, volume);
- });
- this.AddCalculatedProperty (table, 'Surface Area', () => {
- const volume = OV.CalculateSurfaceArea (object3D);
- if (volume === null) {
- return null;
- }
- return new OV.Property (OV.PropertyType.Number, null, volume);
- });
- if (object3D.PropertyGroupCount () > 0) {
- let customTable = $('
').addClass ('ov_property_table ov_property_table_custom').appendTo (this.contentDiv);
- for (let i = 0; i < object3D.PropertyGroupCount (); i++) {
- const propertyGroup = object3D.GetPropertyGroup (i);
- this.AddPropertyGroup (customTable, propertyGroup);
- for (let j = 0; j < propertyGroup.PropertyCount (); j++) {
- const property = propertyGroup.GetProperty (j);
- this.AddPropertyInGroup (customTable, property);
- }
- }
- }
- this.Resize ();
- }
-
- AddMaterialProperties (material)
- {
- function AddTextureMap (obj, table, name, map)
- {
- if (map === null || map.name === null) {
- return;
- }
- let fileName = OV.GetFileName (map.name);
- obj.AddProperty (table, new OV.Property (OV.PropertyType.Text, name, fileName));
- }
-
- this.Clear ();
- let table = $('
').addClass ('ov_property_table').appendTo (this.contentDiv);
- let typeString = null;
- if (material.type === OV.MaterialType.Phong) {
- typeString = 'Phong';
- } else if (material.type === OV.MaterialType.Physical) {
- typeString = 'Physical';
- }
- this.AddProperty (table, new OV.Property (OV.PropertyType.Text, 'Source', material.isDefault ? 'Default' : 'Model'));
- this.AddProperty (table, new OV.Property (OV.PropertyType.Text, 'Type', typeString));
- this.AddProperty (table, new OV.Property (OV.PropertyType.Color, 'Color', material.color));
- if (material.type === OV.MaterialType.Physical) {
- this.AddProperty (table, new OV.Property (OV.PropertyType.Percent, 'Metalness', material.metalness));
- this.AddProperty (table, new OV.Property (OV.PropertyType.Percent, 'Roughness', material.roughness));
- }
- this.AddProperty (table, new OV.Property (OV.PropertyType.Percent, 'Opacity', material.opacity));
- AddTextureMap (this, table, 'Diffuse Map', material.diffuseMap);
- AddTextureMap (this, table, 'Specular Map', material.specularMap);
- AddTextureMap (this, table, 'Bump Map', material.bumpMap);
- AddTextureMap (this, table, 'Normal Map', material.normalMap);
- AddTextureMap (this, table, 'Emissive Map', material.emissiveMap);
- AddTextureMap (this, table, 'Metallic Map', material.metalnessMap);
- this.Resize ();
- }
-
- AddPropertyGroup (table, propertyGroup)
- {
- let row = $('
').addClass ('ov_property_table_row group').appendTo (table);
- row.html (propertyGroup.name).attr ('title', propertyGroup.name);
- }
-
- AddProperty (table, property)
- {
- let row = $('
').addClass ('ov_property_table_row').appendTo (table);
- let nameColum = $('
').addClass ('ov_property_table_cell ov_property_table_name').appendTo (row);
- let valueColumn = $('
').addClass ('ov_property_table_cell ov_property_table_value').appendTo (row);
- nameColum.html (property.name + ':').attr ('title', property.name);
- this.DisplayPropertyValue (property, valueColumn);
- return row;
- }
-
- AddPropertyInGroup (table, property)
- {
- let row = this.AddProperty (table, property);
- row.addClass ('ingroup');
- }
-
- AddCalculatedProperty (table, name, calculateValue)
- {
- let row = $('
').addClass ('ov_property_table_row').appendTo (table);
- let nameColum = $('
').addClass ('ov_property_table_cell ov_property_table_name').appendTo (row);
- let valueColumn = $('
').addClass ('ov_property_table_cell ov_property_table_value').appendTo (row);
- nameColum.html (name + ':').attr ('title', name);
-
- let calculateButton = $('
').addClass ('ov_property_table_button').html ('Calculate...').appendTo (valueColumn);
- calculateButton.click (() => {
- valueColumn.empty ();
- valueColumn.html ('Please wait...');
- OV.RunTaskAsync (() => {
- let propertyValue = calculateValue ();
- if (propertyValue === null) {
- valueColumn.html ('-');
- } else {
- this.DisplayPropertyValue (propertyValue, valueColumn);
- }
- });
- });
- }
-
- DisplayPropertyValue (property, targetDiv)
- {
- targetDiv.empty ();
- let valueText = null;
- if (property.type === OV.PropertyType.Text) {
- valueText = property.value;
- } else if (property.type === OV.PropertyType.Integer) {
- valueText = property.value.toLocaleString ();
- } else if (property.type === OV.PropertyType.Number) {
- valueText = property.value.toLocaleString (undefined, {
- minimumFractionDigits: 2,
- maximumFractionDigits: 2
- });
- } else if (property.type === OV.PropertyType.Boolean) {
- valueText = property.value ? 'True' : 'False';
- } else if (property.type === OV.PropertyType.Percent) {
- valueText = parseInt (property.value * 100, 10).toString () + '%';
- } else if (property.type === OV.PropertyType.Color) {
- let hexString = '#' + OV.ColorToHexString (property.value);
- let colorCircle = OV.CreateInlineColorCircle (property.value);
- colorCircle.appendTo (targetDiv);
- $('').html (hexString).appendTo (targetDiv);
- }
- if (valueText !== null) {
- targetDiv.html (valueText).attr ('title', valueText);
- }
- }
-};
diff --git a/website/o3dv/js/navigatorpanels.js b/website/o3dv/js/navigatorpanels.js
index c601d38..49a5570 100644
--- a/website/o3dv/js/navigatorpanels.js
+++ b/website/o3dv/js/navigatorpanels.js
@@ -149,11 +149,13 @@ OV.NavigatorPanel = class extends OV.Panel
this.titleDiv = $('
').addClass ('ov_navigator_tree_title').appendTo (this.panelDiv);
this.treeDiv = $('
').addClass ('ov_navigator_tree_panel').addClass ('ov_thin_scrollbar').appendTo (this.panelDiv);
this.treeView = new OV.TreeView (this.treeDiv);
+
+ let panelName = this.GetName ();
+ this.titleDiv.html (panelName).attr ('title', panelName);
}
Clear ()
{
- this.titleDiv.empty ();
this.treeView.Clear ();
}
@@ -169,8 +171,7 @@ OV.NavigatorPanel = class extends OV.Panel
Fill (importResult)
{
- let panelName = this.GetName ();
- this.titleDiv.html (panelName).attr ('title', panelName);
+
}
};
@@ -181,6 +182,11 @@ OV.NavigatorFilesPanel = class extends OV.NavigatorPanel
super (parentDiv);
}
+ GetName ()
+ {
+ return 'Files';
+ }
+
GetIcon ()
{
return 'files';
@@ -198,11 +204,6 @@ OV.NavigatorFilesPanel = class extends OV.NavigatorPanel
super.Clear ();
}
- GetName ()
- {
- return 'Files';
- }
-
Fill (importResult)
{
super.Fill (importResult);
@@ -248,6 +249,11 @@ OV.NavigatorMaterialsPanel = class extends OV.NavigatorPanel
this.meshesButton = new OV.NavigatorMeshesPopupButton (this.popupDiv);
}
+ GetName ()
+ {
+ return 'Materials';
+ }
+
GetIcon ()
{
return 'materials';
@@ -268,11 +274,6 @@ OV.NavigatorMaterialsPanel = class extends OV.NavigatorPanel
this.materialIndexToItem = new Map ();
}
- GetName ()
- {
- return 'Materials';
- }
-
Init (callbacks)
{
super.Init (callbacks);
@@ -333,6 +334,11 @@ OV.NavigatorMeshesPanel = class extends OV.NavigatorPanel
this.materialsButton = new OV.NavigatorMaterialsPopupButton (this.popupDiv);
}
+ GetName ()
+ {
+ return 'Meshes';
+ }
+
GetIcon ()
{
return 'meshes';
@@ -370,11 +376,6 @@ OV.NavigatorMeshesPanel = class extends OV.NavigatorPanel
});
}
- GetName ()
- {
- return 'Meshes';
- }
-
Fill (importResult)
{
super.Fill (importResult);
@@ -542,40 +543,4 @@ OV.NavigatorMeshesPanel = class extends OV.NavigatorPanel
return true;
});
}
-
- UpdatePopupButton ()
- {
- // if (this.selection === null) {
- // let usedMaterials = this.callbacks.getMaterialsForModel ();
- // this.popupButton.FillWithModelInfo (usedMaterials, {
- // onMaterialSelect : (materialIndex) => {
- // this.SetSelection (new OV.Selection (OV.SelectionType.Material, materialIndex));
- // }
- // });
- // this.callbacks.onModelSelected ();
- // } else {
- // if (this.selection.type === OV.SelectionType.Material) {
- // let usedByMeshes = this.callbacks.getMeshesForMaterial (this.selection.materialIndex);
- // this.popupButton.FillWithMaterialInfo (usedByMeshes, {
- // onMeshHover : (meshInstanceId) => {
- // this.tempSelectedMeshId = meshInstanceId;
- // this.callbacks.updateMeshesSelection ();
- // },
- // onMeshSelect : (meshInstanceId) => {
- // this.SetSelection (new OV.Selection (OV.SelectionType.Mesh, meshInstanceId));
- // }
- // });
- // this.callbacks.onMaterialSelected (this.selection.materialIndex);
- // } else if (this.selection.type === OV.SelectionType.Mesh) {
- // let usedMaterials = this.callbacks.getMaterialsForMesh (this.selection.meshInstanceId);
- // this.popupButton.FillWithModelInfo (usedMaterials, {
- // onMaterialSelect : (materialIndex) => {
- // this.SetSelection (new OV.Selection (OV.SelectionType.Material, materialIndex));
- // }
- // });
- // this.callbacks.onMeshSelected (this.selection.meshInstanceId);
- // }
- // }
- // this.Resize ();
- }
};
diff --git a/website/o3dv/js/settingssidebarpanel.js b/website/o3dv/js/settingssidebarpanel.js
deleted file mode 100644
index 9250fac..0000000
--- a/website/o3dv/js/settingssidebarpanel.js
+++ /dev/null
@@ -1,167 +0,0 @@
-OV.SettingsSidebarPanel = class extends OV.SidebarPanel
-{
- constructor (parentDiv)
- {
- super (parentDiv);
- this.backgroundColorInput = null;
- this.defaultColorInput = null;
- this.defaultColorWarning = null;
- this.themeInput = null;
- }
-
- GetTitle ()
- {
- return 'Settings';
- }
-
- HidePopups ()
- {
- this.backgroundColorInput.pickr.hide ();
- this.defaultColorInput.pickr.hide ();
- }
-
- InitSettings (settings, defaultSettings, callbacks)
- {
- this.backgroundColorInput = this.AddColorParameter (
- 'Background Color',
- 'Background color affects only the visualization of the model.',
- null,
- ['#ffffff', '#e3e3e3', '#c9c9c9', '#898989', '#5f5f5f', '#494949', '#383838', '#0f0f0f'],
- settings.backgroundColor,
- callbacks.onBackgroundColorChange
- );
- this.defaultColorInput = this.AddColorParameter (
- 'Default Color',
- 'Default color appears when the model doesn\'t contain materials.',
- 'This setting has no effect on the currently loaded file.',
- ['#ffffff', '#e3e3e3', '#cc3333', '#fac832', '#4caf50', '#3393bd', '#9b27b0', '#fda4b8'],
- settings.defaultColor,
- callbacks.onDefaultColorChange
- );
- this.themeInput = this.AddThemeParameter (settings.themeId, callbacks.onThemeChange);
- this.AddResetToDefaultsButton (defaultSettings, callbacks);
- }
-
- UpdateSettings (settings)
- {
- this.backgroundColorInput.pickr.setColor ('#' + OV.ColorToHexString (settings.backgroundColor));
- this.defaultColorInput.pickr.setColor ('#' + OV.ColorToHexString (settings.defaultColor));
- }
-
- Update (model)
- {
- let hasDefaultMaterial = OV.HasDefaultMaterial (model);
- if (!hasDefaultMaterial) {
- this.defaultColorInput.warning.show ();
- } else {
- this.defaultColorInput.warning.hide ();
- }
- this.Resize ();
- }
-
- AddColorParameter (title, description, warningText, predefinedColors, defaultValue, onChange)
- {
- let contentDiv = $('
').addClass ('ov_sidebar_settings_content').appendTo (this.contentDiv);
- let titleDiv = $('
').addClass ('ov_sidebar_subtitle').appendTo (contentDiv);
- let colorInput = $('
').addClass ('color-picker').appendTo (titleDiv);
- $('').html (title).appendTo (titleDiv);
- const pickr = Pickr.create ({
- el : colorInput.get (0),
- theme : 'monolith',
- position : 'left-start',
- swatches : predefinedColors,
- comparison : false,
- default : '#' + OV.ColorToHexString (defaultValue),
- components : {
- preview : false,
- opacity : false,
- hue : true,
- interaction: {
- hex : false,
- rgba : false,
- hsla : false,
- hsva : false,
- cmyk : false,
- input : true,
- clear : false,
- save : false
- }
- }
- });
- pickr.on ('change', (color, source, instance) => {
- let rgbaColor = color.toRGBA ();
- let ovColor = new OV.Color (
- parseInt (rgbaColor[0], 10),
- parseInt (rgbaColor[1], 10),
- parseInt (rgbaColor[2], 10)
- );
- onChange (ovColor);
- });
- $('
').addClass ('ov_sidebar_settings_padded').html (description).appendTo (contentDiv);
- let warningDiv = null;
- if (warningText !== null) {
- warningDiv = $('
').addClass ('ov_sidebar_settings_padded').appendTo (contentDiv);
- OV.AddSvgIcon (warningDiv, 'warning', 'left_inline light');
- $('
').addClass ('ov_sidebar_settings_warning').html (warningText).appendTo (warningDiv);
- }
- return {
- pickr : pickr,
- warning : warningDiv
- };
- }
-
- AddThemeParameter (defaultValue, onChange)
- {
- function AddRadioButton (contentDiv, themeId, themeName, onChange)
- {
- let row = $('
').addClass ('ov_sidebar_settings_row').appendTo (contentDiv);
- let label = $('