Add mesh icons to the tree.
This commit is contained in:
parent
2851808e13
commit
23fb36b2d0
2
assets/icons/tree_mesh.svg
Normal file
2
assets/icons/tree_mesh.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" viewBox="0 0 18 18" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><circle cx="9" cy="9" r="2.5" fill="none" stroke="#263238" stroke-linecap="round" stroke-linejoin="round" style="paint-order:normal"/></svg>
|
||||
|
After Width: | Height: | Size: 275 B |
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
@font-face {
|
||||
font-family: "O3DVIcons";
|
||||
src: url("O3DVIcons/O3DVIcons.woff?7e92836aa72dd0e49d33f09f3c4728fb") format("woff");
|
||||
src: url("O3DVIcons/O3DVIcons.woff?45cf3bb91600f61daa0fca4c07103488") format("woff");
|
||||
}
|
||||
|
||||
i[class^="icon-"]:before, i[class*=" icon-"]:before {
|
||||
@ -107,18 +107,21 @@ i[class^="icon-"]:before, i[class*=" icon-"]:before {
|
||||
.icon-theme:before {
|
||||
content: "\f11f";
|
||||
}
|
||||
.icon-tree_view:before {
|
||||
.icon-tree_mesh:before {
|
||||
content: "\f120";
|
||||
}
|
||||
.icon-up_y:before {
|
||||
.icon-tree_view:before {
|
||||
content: "\f121";
|
||||
}
|
||||
.icon-up_z:before {
|
||||
.icon-up_y:before {
|
||||
content: "\f122";
|
||||
}
|
||||
.icon-visible:before {
|
||||
.icon-up_z:before {
|
||||
content: "\f123";
|
||||
}
|
||||
.icon-warning:before {
|
||||
.icon-visible:before {
|
||||
content: "\f124";
|
||||
}
|
||||
.icon-warning:before {
|
||||
content: "\f125";
|
||||
}
|
||||
|
||||
@ -54,6 +54,11 @@ div.ov_tree_view div.ov_tree_view_children
|
||||
margin-left: 28px;
|
||||
}
|
||||
|
||||
div.ov_tree_view.tight div.ov_tree_view_children
|
||||
{
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
@media (hover)
|
||||
{
|
||||
|
||||
|
||||
@ -11,9 +11,9 @@ OV.MaterialItem = class extends OV.TreeViewSingleItem
|
||||
|
||||
OV.MeshItem = class extends OV.TreeViewButtonItem
|
||||
{
|
||||
constructor (name, meshInstanceId, callbacks)
|
||||
constructor (name, icon, meshInstanceId, callbacks)
|
||||
{
|
||||
super (name);
|
||||
super (name, icon);
|
||||
|
||||
this.meshInstanceId = meshInstanceId;
|
||||
this.visible = true;
|
||||
|
||||
@ -338,6 +338,7 @@ OV.NavigatorMeshesPanel = class extends OV.NavigatorPanel
|
||||
this.showHideButton = null;
|
||||
this.isHierarchical = false;
|
||||
|
||||
this.treeView.AddClass ('tight');
|
||||
this.buttonsDiv = $('<div>').addClass ('ov_navigator_buttons').insertBefore (this.treeDiv);
|
||||
|
||||
this.popupDiv = $('<div>').addClass ('ov_navigator_info_panel').addClass ('ov_thin_scrollbar').appendTo (this.panelDiv);
|
||||
@ -462,12 +463,13 @@ OV.NavigatorMeshesPanel = class extends OV.NavigatorPanel
|
||||
|
||||
FillMeshTree (model)
|
||||
{
|
||||
function AddMeshToNodeTree (navigator, model, node, meshIndex, parentItem)
|
||||
function AddMeshToNodeTree (navigator, model, node, meshIndex, parentItem, isHierarchical)
|
||||
{
|
||||
let mesh = model.GetMesh (meshIndex);
|
||||
let meshName = OV.GetMeshName (mesh.GetName ());
|
||||
let meshInstanceId = new OV.MeshInstanceId (node.GetId (), meshIndex);
|
||||
let meshItem = new OV.MeshItem (meshName, meshInstanceId, {
|
||||
let meshItemIcon = isHierarchical ? 'tree_mesh' : null;
|
||||
let meshItem = new OV.MeshItem (meshName, meshItemIcon, meshInstanceId, {
|
||||
onShowHide : (selectedMeshId) => {
|
||||
navigator.callbacks.onMeshShowHide (selectedMeshId);
|
||||
},
|
||||
@ -530,7 +532,7 @@ OV.NavigatorMeshesPanel = class extends OV.NavigatorPanel
|
||||
}
|
||||
|
||||
for (let meshIndex of node.GetMeshIndices ()) {
|
||||
AddMeshToNodeTree (navigator, model, node, meshIndex, parentItem);
|
||||
AddMeshToNodeTree (navigator, model, node, meshIndex, parentItem, isHierarchical);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,12 +37,15 @@ OV.TreeViewButton = class
|
||||
|
||||
OV.TreeViewItem = class
|
||||
{
|
||||
constructor (name)
|
||||
constructor (name, icon)
|
||||
{
|
||||
this.name = name;
|
||||
this.parent = null;
|
||||
this.mainElement = $('<div>').addClass ('ov_tree_item').attr ('title', this.name);
|
||||
this.nameElement = $('<div>').addClass ('ov_tree_item_name').html (this.name).appendTo (this.mainElement);
|
||||
if (OV.IsDefined (icon)) {
|
||||
OV.CreateSvgIcon (icon, 'ov_tree_item_icon').insertBefore (this.nameElement);
|
||||
}
|
||||
}
|
||||
|
||||
OnClick (onClick)
|
||||
@ -65,9 +68,9 @@ OV.TreeViewItem = class
|
||||
|
||||
OV.TreeViewSingleItem = class extends OV.TreeViewItem
|
||||
{
|
||||
constructor (name)
|
||||
constructor (name, icon)
|
||||
{
|
||||
super (name);
|
||||
super (name, icon);
|
||||
this.selected = false;
|
||||
}
|
||||
|
||||
@ -95,9 +98,9 @@ OV.TreeViewSingleItem = class extends OV.TreeViewItem
|
||||
|
||||
OV.TreeViewButtonItem = class extends OV.TreeViewSingleItem
|
||||
{
|
||||
constructor (name)
|
||||
constructor (name, icon)
|
||||
{
|
||||
super (name);
|
||||
super (name, icon);
|
||||
this.buttonsDiv = $('<div>').addClass ('ov_tree_item_button_container').insertBefore (this.nameElement);
|
||||
}
|
||||
|
||||
@ -114,9 +117,9 @@ OV.TreeViewButtonItem = class extends OV.TreeViewSingleItem
|
||||
|
||||
OV.TreeViewGroupItem = class extends OV.TreeViewItem
|
||||
{
|
||||
constructor (name, iconPath)
|
||||
constructor (name, icon)
|
||||
{
|
||||
super (name);
|
||||
super (name, icon);
|
||||
this.children = [];
|
||||
this.isVisible = true;
|
||||
this.isChildrenVisible = false;
|
||||
@ -126,9 +129,6 @@ OV.TreeViewGroupItem = class extends OV.TreeViewItem
|
||||
this.closeButtonIcon = 'arrow_right';
|
||||
|
||||
this.openCloseButton = OV.CreateSvgIcon (this.openButtonIcon, 'ov_tree_item_icon').insertBefore (this.nameElement);
|
||||
if (OV.IsDefined (iconPath)) {
|
||||
OV.CreateSvgIcon (iconPath, 'ov_tree_item_icon').insertBefore (this.nameElement);
|
||||
}
|
||||
}
|
||||
|
||||
AddChild (child)
|
||||
@ -196,9 +196,9 @@ OV.TreeViewGroupItem = class extends OV.TreeViewItem
|
||||
|
||||
OV.TreeViewGroupButtonItem = class extends OV.TreeViewGroupItem
|
||||
{
|
||||
constructor (name, iconPath)
|
||||
constructor (name, icon)
|
||||
{
|
||||
super (name, iconPath);
|
||||
super (name, icon);
|
||||
this.buttonsDiv = $('<div>').addClass ('ov_tree_item_button_container').insertBefore (this.nameElement);
|
||||
}
|
||||
|
||||
@ -221,6 +221,11 @@ OV.TreeView = class
|
||||
this.children = [];
|
||||
}
|
||||
|
||||
AddClass (className)
|
||||
{
|
||||
this.mainDiv.addClass (className);
|
||||
}
|
||||
|
||||
AddChild (child)
|
||||
{
|
||||
child.AddDomElements (this.mainDiv);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user