Skip to content

Commit

Permalink
Make mesh visibility options available from context menu #102
Browse files Browse the repository at this point in the history
Add the possibility to isolate mesh #103
  • Loading branch information
kovacsv committed Jul 29, 2021
1 parent 55aafe8 commit 11f4579
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions website/assets/images/context/deisolate.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/assets/images/context/fit.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/assets/images/context/hide.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/assets/images/context/isolate.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/assets/images/context/show.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions website/o3dv/featureset.js
@@ -1,5 +1,4 @@
OV.FeatureSet =
{
SettingsPanel : false,
ContextMenu : false
SettingsPanel : false
};
1 change: 1 addition & 0 deletions website/o3dv/website.css
Expand Up @@ -594,6 +594,7 @@ div.ov_popup div.ov_popup_list_item
div.ov_popup img.ov_popup_list_item_icon
{
margin-right: 10px;
margin-top: 2px;
float: left;
}

Expand Down
9 changes: 5 additions & 4 deletions website/o3dv/website.js
Expand Up @@ -144,22 +144,20 @@ OV.Website = class

OnModelContextMenu (globalMouseCoordinates, mouseCoordinates)
{
if (!OV.FeatureSet.ContextMenu) {
return;
}

let meshUserData = this.viewer.GetMeshUserDataUnderMouse (mouseCoordinates);
let items = [];
if (meshUserData === null) {
items.push ({
name : 'Fit model to window',
icon : 'assets/images/context/fit.svg',
onClick : () => {
this.FitModelToWindow (false);
}
});
if (this.navigator.HasHiddenMesh ()) {
items.push ({
name : 'Show all meshes',
icon : 'assets/images/context/show.svg',
onClick : () => {
this.navigator.ShowAllMeshes ();
}
Expand All @@ -170,18 +168,21 @@ OV.Website = class
let isMeshIsolated = this.navigator.IsMeshIsolated (meshIndex);
items.push ({
name : 'Hide mesh',
icon : 'assets/images/context/hide.svg',
onClick : () => {
this.navigator.ToggleMeshVisibility (meshIndex);
}
});
items.push ({
name : 'Fit mesh to window',
icon : 'assets/images/context/fit.svg',
onClick : () => {
this.navigator.FitMeshToWindow (meshIndex);
}
});
items.push ({
name : isMeshIsolated ? 'Remove isolation' : 'Isolate mesh',
icon : isMeshIsolated ? 'assets/images/context/deisolate.svg' : 'assets/images/context/isolate.svg',
onClick : () => {
this.navigator.IsolateMesh (meshIndex);
}
Expand Down

0 comments on commit 11f4579

Please sign in to comment.