Remove information from navigator info panel.
This commit is contained in:
parent
730e7d96fa
commit
7b8cdb79a6
@ -75,7 +75,6 @@
|
||||
"website/o3dv/quantitiesdialog.js",
|
||||
"website/o3dv/cookiedialog.js",
|
||||
"website/o3dv/modeldata.js",
|
||||
"website/o3dv/info.js",
|
||||
"website/o3dv/navigator.js",
|
||||
"website/o3dv/hashhandler.js",
|
||||
"website/o3dv/website.css",
|
||||
|
||||
@ -89,7 +89,6 @@
|
||||
<script type="text/javascript" src="o3dv/quantitiesdialog.js"></script>
|
||||
<script type="text/javascript" src="o3dv/cookiedialog.js"></script>
|
||||
<script type="text/javascript" src="o3dv/modeldata.js"></script>
|
||||
<script type="text/javascript" src="o3dv/info.js"></script>
|
||||
<script type="text/javascript" src="o3dv/navigator.js"></script>
|
||||
<script type="text/javascript" src="o3dv/hashhandler.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="o3dv/website.css">
|
||||
|
||||
@ -89,7 +89,6 @@
|
||||
<script type="text/javascript" src="o3dv/quantitiesdialog.js"></script>
|
||||
<script type="text/javascript" src="o3dv/cookiedialog.js"></script>
|
||||
<script type="text/javascript" src="o3dv/modeldata.js"></script>
|
||||
<script type="text/javascript" src="o3dv/info.js"></script>
|
||||
<script type="text/javascript" src="o3dv/navigator.js"></script>
|
||||
<script type="text/javascript" src="o3dv/hashhandler.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="o3dv/website.css">
|
||||
|
||||
@ -13,6 +13,105 @@ OV.Selection = class
|
||||
}
|
||||
};
|
||||
|
||||
OV.NavigatorInfoPanel = class
|
||||
{
|
||||
constructor (parentDiv)
|
||||
{
|
||||
this.parentDiv = parentDiv;
|
||||
this.popup = null;
|
||||
}
|
||||
|
||||
FillWithMaterialInfo (info, callbacks)
|
||||
{
|
||||
this.Clear ();
|
||||
if (info === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let meshItems = [];
|
||||
for (let i = 0; i < info.usedByMeshes.length; i++) {
|
||||
let meshInfo = info.usedByMeshes[i];
|
||||
meshItems.push ({
|
||||
name : OV.GetMeshName (meshInfo.name)
|
||||
});
|
||||
}
|
||||
|
||||
let obj = this;
|
||||
let meshesText = 'Meshes (' + meshItems.length + ')';
|
||||
this.CreateButton (this.parentDiv, meshesText, function (button) {
|
||||
if (meshItems.length === 0) {
|
||||
return;
|
||||
}
|
||||
obj.popup = OV.ShowListPopup (button, meshItems, {
|
||||
onHoverStart : function (index) {
|
||||
const meshItem = info.usedByMeshes[index];
|
||||
callbacks.onMeshHover (meshItem.index);
|
||||
},
|
||||
onHoverStop : function (index) {
|
||||
callbacks.onMeshHover (null);
|
||||
},
|
||||
onClick : function (index) {
|
||||
const meshItem = info.usedByMeshes[index];
|
||||
callbacks.onMeshSelect (meshItem.index);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
FillWithModelInfo (info, callbacks)
|
||||
{
|
||||
this.Clear ();
|
||||
if (info === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let materialItems = [];
|
||||
for (let i = 0; i < info.usedMaterials.length; i++) {
|
||||
let usedMaterial = info.usedMaterials[i];
|
||||
materialItems.push ({
|
||||
name : OV.GetMaterialName (usedMaterial.name),
|
||||
color : OV.ColorToHexString (usedMaterial.diffuse)
|
||||
});
|
||||
}
|
||||
|
||||
let obj = this;
|
||||
if (OV.FeatureSet.CalculateQuantities) {
|
||||
this.CreateButton (this.parentDiv, 'Calculate Quantities', function (button) {
|
||||
obj.popup = OV.ShowQuantitiesPopup (button, info.element);
|
||||
});
|
||||
}
|
||||
|
||||
let materialsText = 'Materials (' + materialItems.length + ')';
|
||||
this.CreateButton (this.parentDiv, materialsText, function (button) {
|
||||
obj.popup = OV.ShowListPopup (button, materialItems, {
|
||||
onClick : function (index) {
|
||||
let usedMaterial = info.usedMaterials[index];
|
||||
callbacks.onMaterialSelect (usedMaterial.index);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
CreateButton (parentDiv, buttonText, onClick)
|
||||
{
|
||||
let button = $('<div>').addClass ('ov_navigator_info_button').appendTo (parentDiv);
|
||||
$('<div>').addClass ('ov_navigator_info_button_text').html (buttonText).appendTo (button);
|
||||
$('<img>').addClass ('ov_navigator_info_button_icon').attr ('src', 'assets/images/tree/arrow_right.svg').appendTo (button);
|
||||
button.click (function () {
|
||||
onClick (button);
|
||||
});
|
||||
}
|
||||
|
||||
Clear ()
|
||||
{
|
||||
if (this.popup !== null) {
|
||||
this.popup.Hide ();
|
||||
this.popup = null;
|
||||
}
|
||||
this.parentDiv.empty ();
|
||||
}
|
||||
};
|
||||
|
||||
OV.Navigator = class
|
||||
{
|
||||
constructor (parentDiv)
|
||||
@ -23,7 +122,7 @@ OV.Navigator = class
|
||||
this.treeDiv = $('<div>').addClass ('ov_navigator_tree_panel').addClass ('ov_thin_scrollbar').appendTo (parentDiv);
|
||||
this.infoDiv = $('<div>').addClass ('ov_navigator_info_panel').addClass ('ov_thin_scrollbar').appendTo (parentDiv);
|
||||
this.treeView = new OV.TreeView (this.treeDiv);
|
||||
this.infoPanel = new OV.InfoPanel (this.infoDiv);
|
||||
this.infoPanel = new OV.NavigatorInfoPanel (this.infoDiv);
|
||||
this.modelData = new OV.ModelData ();
|
||||
this.selection = null;
|
||||
this.tempSelectedMeshIndex = null;
|
||||
@ -31,11 +130,7 @@ OV.Navigator = class
|
||||
|
||||
Init (callbacks)
|
||||
{
|
||||
let obj = this;
|
||||
this.callbacks = callbacks;
|
||||
this.infoPanel.SetOpenCloseHandler (function () {
|
||||
obj.Resize ();
|
||||
});
|
||||
}
|
||||
|
||||
Resize ()
|
||||
|
||||
@ -217,88 +217,7 @@ div.ov_navigator_info_panel
|
||||
border-top: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_panel_main
|
||||
{
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_panel_content
|
||||
{
|
||||
padding: 5px 0px 0px 5px;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box
|
||||
{
|
||||
margin-bottom: 10px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_column
|
||||
{
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_title
|
||||
{
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_content
|
||||
{
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_content_big
|
||||
{
|
||||
font-size: 21px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_details
|
||||
{
|
||||
font-size: 14px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_row
|
||||
{
|
||||
padding: 2px 0px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_row_name
|
||||
{
|
||||
width: 40%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_row_value
|
||||
{
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_rgbbox
|
||||
{
|
||||
width : 32px;
|
||||
height: 16px;
|
||||
margin-right: 10px;
|
||||
border: 1px solid #222222;
|
||||
border-radius: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_rgbtext
|
||||
{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_button
|
||||
div.ov_navigator_info_panel div.ov_navigator_info_button
|
||||
{
|
||||
cursor: pointer;
|
||||
margin-top: 10px;
|
||||
@ -307,13 +226,13 @@ div.ov_navigator_info_panel div.ov_info_box_button
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_button_text
|
||||
div.ov_navigator_info_panel div.ov_navigator_info_button_text
|
||||
{
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel img.ov_info_box_button_icon
|
||||
div.ov_navigator_info_panel img.ov_navigator_info_button_icon
|
||||
{
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
@ -747,7 +666,7 @@ div.ov_popup div.ov_popup_list_item:hover
|
||||
background: #e4f4ff;
|
||||
}
|
||||
|
||||
div.ov_navigator_info_panel div.ov_info_box_button:hover
|
||||
div.ov_navigator_info_panel div.ov_navigator_info_button:hover
|
||||
{
|
||||
background: #e4f4ff;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user