Save some intermediate stuff before trying a new tree view lib
This commit is contained in:
parent
54e86ccf4f
commit
a8e332cdcb
@ -53,7 +53,30 @@
|
||||
<!-- TOOLS -->
|
||||
<h3 id="menu_tools"><span data-i18n="tb.tools_opt"></span></h3>
|
||||
<div class="pv-menu-list">
|
||||
|
||||
<div class="divider" style="padding: 10px 0px 15px 0px">
|
||||
<span>Measurement</span>
|
||||
</div>
|
||||
<li id="tools"></li>
|
||||
|
||||
<div class="divider" style="padding: 10px 0px 15px 0px">
|
||||
<span>Clipping</span>
|
||||
</div>
|
||||
<li id="clipping_tools">
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<label for="optClipMode" class="pv-select-label">Clip mode</label>
|
||||
<select id="optClipMode" name="optClipMode">
|
||||
<option value="0">Disabled</option>
|
||||
<option value="1">Highlight</option>
|
||||
<option value="2">Inside</option>
|
||||
<option value="3">Outside</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<div class="divider" style="padding: 10px 0px 15px 0px">
|
||||
<span>Navigation</span>
|
||||
@ -74,17 +97,17 @@
|
||||
</div>
|
||||
|
||||
<!-- CLIPPING -->
|
||||
<h3 id="menu_clipping"><span data-i18n="tb.clipping_opt"></span></h3>
|
||||
<!--<h3 id="menu_clipping"><span data-i18n="tb.clipping_opt"></span></h3>
|
||||
<div>
|
||||
<ul class="pv-menu-list">
|
||||
<li>
|
||||
<label for="optClipMode" class="pv-select-label">Clip mode</label>
|
||||
<select id="optClipMode" name="optClipMode">
|
||||
<option value="0">Disabled</option>
|
||||
<option value="1">Highlight</option>
|
||||
<option value="2">Inside</option>
|
||||
<option value="3">Outside</option>
|
||||
</select>
|
||||
<select id="optClipMode" name="optClipMode">
|
||||
<option value="0">Disabled</option>
|
||||
<option value="1">Highlight</option>
|
||||
<option value="2">Inside</option>
|
||||
<option value="3">Outside</option>
|
||||
</select>
|
||||
</li>
|
||||
<div id="clipping_tools_container">
|
||||
<div class="divider">
|
||||
@ -105,7 +128,7 @@
|
||||
</div>
|
||||
<div id="clipping_volumes_list_after" style="margin: 6px 2px 12px 2px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!-- ANNOTATIONS -->
|
||||
<h3 id="menu_annotations"><span data-i18n="tb.annotations_opt"></span></h3>
|
||||
|
||||
@ -108,13 +108,6 @@ initSidebar = (viewer) => {
|
||||
}
|
||||
));
|
||||
|
||||
// CLIP VOLUME
|
||||
elToolbar.append(createToolIcon(
|
||||
Potree.resourcePath + '/icons/clip_volume.svg',
|
||||
'[title]tt.clip_volume',
|
||||
function () { viewer.volumeTool.startInsertion({clip: true}); }
|
||||
));
|
||||
|
||||
// REMOVE ALL
|
||||
elToolbar.append(createToolIcon(
|
||||
Potree.resourcePath + '/icons/reset_tools.svg',
|
||||
@ -125,6 +118,41 @@ initSidebar = (viewer) => {
|
||||
));
|
||||
}
|
||||
|
||||
function initClippingTool() {
|
||||
|
||||
$("#optClipMode").selectmenu();
|
||||
$("#optClipMode").val(1).selectmenu("refresh");
|
||||
$("#optClipMode").selectmenu({
|
||||
change: function(event, ui){
|
||||
viewer.clippingTool.setClipMode(parseInt(ui.item.value));
|
||||
}
|
||||
});
|
||||
|
||||
//viewer.addEventListener("clipper.clipMode_changed", function(event){
|
||||
// $("#optClipMode").val(viewer.clippingTool.clipMode).selectmenu("refresh");
|
||||
//});
|
||||
|
||||
|
||||
let clippingToolBar = $("#clipping_tools");
|
||||
|
||||
// CLIP VOLUME
|
||||
clippingToolBar.append(createToolIcon(
|
||||
Potree.resourcePath + '/icons/clip_volume.svg',
|
||||
'[title]tt.clip_volume',
|
||||
function () { viewer.volumeTool.startInsertion({clip: true}); }
|
||||
));
|
||||
|
||||
// CLIP POLYGON
|
||||
clippingToolBar.append(createToolIcon(
|
||||
Potree.resourcePath + "/icons/clip-polygon.svg",
|
||||
"[title]tt.clip_polygon",
|
||||
function(){
|
||||
viewer.clippingTool.startInsertion({type: "polygon"});
|
||||
}
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
function initClassificationList () {
|
||||
let elClassificationList = $('#classificationList');
|
||||
|
||||
@ -391,542 +419,6 @@ initSidebar = (viewer) => {
|
||||
|
||||
lblMoveSpeed.html(viewer.getMoveSpeed().toFixed(1));
|
||||
}
|
||||
|
||||
function initClippingTool() {
|
||||
$("#clipping_volumes_container").hide();
|
||||
|
||||
$("#optClipMode").selectmenu();
|
||||
$("#optClipMode").val(1).selectmenu("refresh");
|
||||
$("#optClipMode").selectmenu({
|
||||
change: function(event, ui){
|
||||
viewer.clippingTool.setClipMode(parseInt(ui.item.value));
|
||||
}
|
||||
});
|
||||
|
||||
viewer.addEventListener("clipper.clipMode_changed", function(event){
|
||||
$("#optClipMode").val(viewer.clippingTool.clipMode).selectmenu("refresh");
|
||||
});
|
||||
|
||||
|
||||
let clippingToolBar = $("#clipping_tools");
|
||||
|
||||
clippingToolBar.append(createToolIcon(
|
||||
Potree.resourcePath + "/icons/clip-polygon.svg",
|
||||
"[title]tt.clip_polygon",
|
||||
function(){
|
||||
viewer.clippingTool.startInsertion({type: "polygon"});
|
||||
}
|
||||
));
|
||||
|
||||
clippingToolBar.append(createToolIcon(
|
||||
Potree.resourcePath + "/icons/clip-plane-x.svg",
|
||||
"[title]tt.clip_plane_x",
|
||||
function(){
|
||||
viewer.clippingTool.startInsertion({type: "plane", alpha: 0, beta: Math.PI/2, gamma: 0});
|
||||
}
|
||||
));
|
||||
|
||||
clippingToolBar.append(createToolIcon(
|
||||
Potree.resourcePath + "/icons/clip-plane-y.svg",
|
||||
"[title]tt.clip_plane_y",
|
||||
function(){
|
||||
viewer.clippingTool.startInsertion({type: "plane", alpha: Math.PI/2, beta: 0, gamma: 0});
|
||||
}
|
||||
));
|
||||
|
||||
clippingToolBar.append(createToolIcon(
|
||||
Potree.resourcePath + "/icons/clip-plane-z.svg",
|
||||
"[title]tt.clip_plane_z",
|
||||
function(){
|
||||
viewer.clippingTool.startInsertion({type: "plane", alpha: 0, beta: 0, gamma: 0});
|
||||
}
|
||||
));
|
||||
|
||||
clippingToolBar.append(createToolIcon(
|
||||
Potree.resourcePath + "/icons/reset_tools.svg",
|
||||
"[title]tt.remove_all_clipping_volumes",
|
||||
function(){
|
||||
viewer.scene.removeAllClipVolumes();
|
||||
}
|
||||
));
|
||||
|
||||
viewer.scene.addEventListener("polygon_clip_volume_added", function(event) {
|
||||
let pcv = event.volume;
|
||||
$("#clipping_volumes_container").show();
|
||||
|
||||
let cvList = $("#clipping_volumes_list");
|
||||
|
||||
let createPCVitem = (volume) => {
|
||||
let removeIconPath = Potree.resourcePath + "/icons/remove.svg";
|
||||
|
||||
let pcvItem = $(`
|
||||
<div class="clip_volume_body" style="margin: 5px 0px">
|
||||
<div style="display: flex; margin-top: 5px">
|
||||
<span></span>
|
||||
<span style="flex-grow: 1"></span>
|
||||
<img class="clipping_volume_action_remove" src="${removeIconPath}" style="width: 16px; height: 16px">
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
// remove button
|
||||
let pcvRemove = pcvItem.find(".clipping_volume_action_remove");
|
||||
pcvRemove.click(() => {
|
||||
viewer.scene.removePolygonClipVolume(volume)
|
||||
});
|
||||
|
||||
return pcvItem;
|
||||
};
|
||||
|
||||
// wrapper which doesnt change
|
||||
let icon = "/icons/area.svg";
|
||||
let pcvWrapper = $(`
|
||||
<span class="scene_item" id="${pcv.name}">
|
||||
<!-- HEADER -->
|
||||
<div class="scene_header">
|
||||
<span class="scene_icon"><img src="${Potree.resourcePath + icon}" class="scene_item_icon" /></span>
|
||||
<span class="scene_header_title">${pcv.name}</span>
|
||||
</div>
|
||||
|
||||
<!-- DETAIL -->
|
||||
<div class="measurement_content selectable" style="display: none">
|
||||
</div>
|
||||
</span>
|
||||
`);
|
||||
|
||||
pcvWrapper.find(".measurement_content").append(createPCVitem(pcv));
|
||||
|
||||
pcvWrapper.find(".scene_header").click(function(event) {
|
||||
if($(this).next().is(":visible")) {
|
||||
pcv.dispatchEvent({"type": "ui_deselect"});
|
||||
} else {
|
||||
pcv.dispatchEvent({"type": "ui_select"});
|
||||
}
|
||||
$(this).next().slideToggle(200);
|
||||
});
|
||||
|
||||
cvList.append(pcvWrapper);
|
||||
});
|
||||
|
||||
viewer.scene.addEventListener("polygon_clip_volume_removed", function(event) {
|
||||
$("#" + event.volume.name).remove();
|
||||
|
||||
if(viewer.scene.clipVolumes.length == 0 && viewer.scene.polygonClipVolumes.length == 0) {
|
||||
$("#clipping_volumes_container").hide();
|
||||
}
|
||||
});
|
||||
|
||||
viewer.scene.addEventListener("clip_volume_added", function(event) {
|
||||
let cv = event.volume;
|
||||
$("#clipping_volumes_container").show();
|
||||
|
||||
let cvList = $("#clipping_volumes_list");
|
||||
|
||||
let createCVitem = (volume) => {
|
||||
let x = Potree.utils.addCommas(volume.position.x.toFixed(3));
|
||||
let y = Potree.utils.addCommas(volume.position.y.toFixed(3));
|
||||
let z = Potree.utils.addCommas(volume.position.z.toFixed(3));
|
||||
let rot_alpha = (volume.rotation.x * 180/Math.PI).toFixed(0);
|
||||
let rot_beta = (volume.rotation.y * 180/Math.PI).toFixed(0);
|
||||
let rot_gamma = (volume.rotation.z * 180/Math.PI).toFixed(0);
|
||||
let sc_width = Potree.utils.addCommas(volume.children[0].scale.x.toFixed(3));
|
||||
let sc_length = Potree.utils.addCommas(volume.children[0].scale.y.toFixed(3));
|
||||
let sc_thickness = Potree.utils.addCommas(volume.children[0].scale.z.toFixed(3));
|
||||
let removeIconPath = Potree.resourcePath + "/icons/remove.svg";
|
||||
|
||||
let cvItem = $(`
|
||||
<div class="clip_volume_body" style="margin: 5px 0px">
|
||||
<div class="divider">
|
||||
<span>Size</span>
|
||||
</div>
|
||||
<div style="margin: 10px 0px">
|
||||
<span class="coordinates_table_container">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<th>width</th>
|
||||
<th>length</th>
|
||||
<th>thickness</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input class="clip_volume_spinner" id="cv_sp_width_${volume.id}" style="width: 55px" value="${sc_width}" /></td>
|
||||
<td><input class="clip_volume_spinner" id="cv_sp_length_${volume.id}" style="width: 55px" value="${sc_length}" /></td>
|
||||
<td><input class="clip_volume_spinner" id="cv_sp_thickness_${volume.id}" style="width: 55px" value="${sc_thickness}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="divider" style="padding-top: 10px">
|
||||
<span>Position</span>
|
||||
</div>
|
||||
<div style="margin: 10px 0px">
|
||||
<span class="coordinates_table_container">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<th>y</th>
|
||||
<th>z</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${x}</td>
|
||||
<td>${y}</td>
|
||||
<td>${z}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</span>
|
||||
</div>
|
||||
<div style="margin: 10px 0px">
|
||||
<div style="display:flex; margin: 7px 0px">
|
||||
<span style="display:flex; align-items: center; padding-right: 10px">Offset: </span>
|
||||
<input class="clip_volume_spinner" id="cv_sp_offset_${volume.id}" value="${volume.clipOffset}" style="flex-grow: 1; width:100%">
|
||||
</div>
|
||||
<div style="display:flex; margin: 7px 0px">
|
||||
<span style="display:flex; align-items: center; padding-right: 10px; width: 55px">Global: </span>
|
||||
<div style="display:flex; flex-grow: 1; width:100%">
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_global_x_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">x</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_global_x_incr_${volume.id}">></button>
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_global_y_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">y</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_global_y_incr_${volume.id}">></button>
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_global_z_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">z</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_global_z_incr_${volume.id}">></button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex; margin: 7px 0px">
|
||||
<span style="display:flex; align-items: center; padding-right: 10px; width: 55px">Local: </span>
|
||||
<div style="display:flex; flex-grow: 1; width:100%">
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_local_x_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">x</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_local_x_incr_${volume.id}">></button>
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_local_y_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">y</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_local_y_incr_${volume.id}">></button>
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_local_z_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">z</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_local_z_incr_${volume.id}">></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="divider" style="padding-top: 10px">
|
||||
<span>Rotation</span>
|
||||
</div>
|
||||
<div style="margin: 10px 0px;">
|
||||
<span class="coordinates_table_container">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<th>α</th>
|
||||
<th>β</th>
|
||||
<th>γ</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>${rot_alpha}°</td>
|
||||
<td>${rot_beta}°</td>
|
||||
<td>${rot_gamma}°</td>
|
||||
</tr>
|
||||
</table>
|
||||
</span>
|
||||
</div>
|
||||
<div style="margin: 10px 0px; padding-bottom: 10px">
|
||||
<div style="display:flex; margin: 7px 0px">
|
||||
<span style="display:flex; align-items: center; padding-right: 10px">Angle: </span>
|
||||
<input class="clip_volume_spinner" id="cv_sp_rot_offset_${volume.id}" value="${volume.clipRotOffset}" style="flex-grow: 1; width:100%">
|
||||
</div>
|
||||
<div style="display:flex; margin: 7px 0px">
|
||||
<span style="display:flex; align-items: center; padding-right: 10px; width: 55px">Global: </span>
|
||||
<div style="display:flex; flex-grow: 1; width:100%">
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_global_alpha_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">α</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_global_alpha_incr_${volume.id}">></button>
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_global_beta_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">β</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_global_beta_incr_${volume.id}">></button>
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_global_gamma_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">γ</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_global_gamma_incr_${volume.id}">></button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex; margin: 7px 0px">
|
||||
<span style="display:flex; align-items: center; padding-right: 10px; width: 55px">Local: </span>
|
||||
<div style="display:flex; flex-grow: 1; width:100%">
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_local_alpha_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">α</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_local_alpha_incr_${volume.id}">></button>
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_local_beta_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">β</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_local_beta_incr_${volume.id}">></button>
|
||||
<button class="cv_btn_offset cv_btn_offset_decr" id="cv_btn_local_gamma_decr_${volume.id}"><</button>
|
||||
<span style="padding:2px">γ</span>
|
||||
<button class="cv_btn_offset cv_btn_offset_incr" id="cv_btn_local_gamma_incr_${volume.id}">></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; margin-top: 5px">
|
||||
<span></span>
|
||||
<span style="flex-grow: 1"></span>
|
||||
<img class="clipping_volume_action_remove" src="${removeIconPath}" style="width: 16px; height: 16px">
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
// spinner style
|
||||
cvItem.find(".clip_volume_spinner").spinner();
|
||||
|
||||
// button style
|
||||
let cv_btn_offset = cvItem.find(".cv_btn_offset");
|
||||
cv_btn_offset.button();
|
||||
cv_btn_offset.css("padding", "2px");
|
||||
cv_btn_offset.css("margin", "0px 3px");
|
||||
|
||||
// scale spinner
|
||||
let cv_sp_width = cvItem.find("#cv_sp_width_" + volume.id);
|
||||
let cv_sp_length = cvItem.find("#cv_sp_length_" + volume.id);
|
||||
let cv_sp_thickness = cvItem.find("#cv_sp_thickness_" + volume.id);
|
||||
|
||||
cv_sp_width.spinner({
|
||||
min: 0.001,
|
||||
max: 100,
|
||||
step: 0.1,
|
||||
numberFormat: "n",
|
||||
spin: (event, ui) => {
|
||||
let value = cv_sp_width.spinner("value");
|
||||
volume.setScaleX(value);
|
||||
},
|
||||
stop: (event, ui) => {
|
||||
let value = cv_sp_width.spinner("value");
|
||||
volume.setScaleX(value);
|
||||
}
|
||||
});
|
||||
|
||||
cv_sp_length.spinner({
|
||||
min: 0.001,
|
||||
max: 100,
|
||||
step: 0.1,
|
||||
numberFormat: "n",
|
||||
spin: (event, ui) => {
|
||||
let value = cv_sp_length.spinner("value");
|
||||
volume.setScaleY(value);
|
||||
},
|
||||
stop: (event, ui) => {
|
||||
let value = cv_sp_length.spinner("value");
|
||||
volume.setScaleY(value);
|
||||
}
|
||||
});
|
||||
|
||||
cv_sp_thickness.spinner({
|
||||
min: 0.001,
|
||||
max: 100,
|
||||
step: 0.1,
|
||||
numberFormat: "n",
|
||||
spin: (event, ui) => {
|
||||
let value = cv_sp_thickness.spinner("value");
|
||||
volume.setScaleZ(value);
|
||||
},
|
||||
stop: (event, ui) => {
|
||||
let value = cv_sp_thickness.spinner("value");
|
||||
volume.setScaleZ(value);
|
||||
}
|
||||
});
|
||||
|
||||
// offset spinner
|
||||
let cv_sp_offset = cvItem.find("#cv_sp_offset_" + volume.id);
|
||||
cv_sp_offset.spinner({
|
||||
min: 0.001,
|
||||
max: 1000,
|
||||
step: 1.0,
|
||||
numberFormat: "n",
|
||||
spin: (event, ui) => {
|
||||
let value = cv_sp_offset.spinner("value");
|
||||
volume.setClipOffset(value);
|
||||
},
|
||||
stop: (event, ui) => {
|
||||
let value = cv_sp_offset.spinner("value");
|
||||
volume.setClipOffset(value);
|
||||
}
|
||||
});
|
||||
|
||||
// angle offset spinner
|
||||
let cv_sp_rot_offset = cvItem.find("#cv_sp_rot_offset_" + volume.id);
|
||||
cv_sp_rot_offset.spinner({
|
||||
min: 1,
|
||||
max: 360,
|
||||
step: 1,
|
||||
numberFormat: "n",
|
||||
spin: (event, ui) => {
|
||||
let value = cv_sp_rot_offset.spinner("value");
|
||||
volume.setClipRotOffset(value);
|
||||
},
|
||||
stop: (event, ui) => {
|
||||
let value = cv_sp_rot_offset.spinner("value");
|
||||
volume.setClipRotOffset(value);
|
||||
}
|
||||
});
|
||||
|
||||
// global offset buttons
|
||||
let cv_btn_global_x_decr = cvItem.find("#cv_btn_global_x_decr_" + volume.id);
|
||||
let cv_btn_global_x_incr = cvItem.find("#cv_btn_global_x_incr_" + volume.id);
|
||||
let cv_btn_global_y_decr = cvItem.find("#cv_btn_global_y_decr_" + volume.id);
|
||||
let cv_btn_global_y_incr = cvItem.find("#cv_btn_global_y_incr_" + volume.id);
|
||||
let cv_btn_global_z_decr = cvItem.find("#cv_btn_global_z_decr_" + volume.id);
|
||||
let cv_btn_global_z_incr = cvItem.find("#cv_btn_global_z_incr_" + volume.id);
|
||||
|
||||
cv_btn_global_x_decr.click(function(event) {
|
||||
volume.offset({cs: "global", axis: "x", dir: -1});
|
||||
});
|
||||
cv_btn_global_x_incr.click(function(event) {
|
||||
volume.offset({cs: "global", axis: "x", dir: 1});
|
||||
});
|
||||
cv_btn_global_y_decr.click(function(event) {
|
||||
volume.offset({cs: "global", axis: "y", dir: -1});
|
||||
});
|
||||
cv_btn_global_y_incr.click(function(event) {
|
||||
volume.offset({cs: "global", axis: "y", dir: 1});
|
||||
});
|
||||
cv_btn_global_z_decr.click(function(event) {
|
||||
volume.offset({cs: "global", axis: "z", dir: -1});
|
||||
});
|
||||
cv_btn_global_z_incr.click(function(event) {
|
||||
volume.offset({cs: "global", axis: "z", dir: 1});
|
||||
});
|
||||
|
||||
// local offset buttons
|
||||
let cv_btn_local_x_decr = cvItem.find("#cv_btn_local_x_decr_" + volume.id);
|
||||
let cv_btn_local_x_incr = cvItem.find("#cv_btn_local_x_incr_" + volume.id);
|
||||
let cv_btn_local_y_decr = cvItem.find("#cv_btn_local_y_decr_" + volume.id);
|
||||
let cv_btn_local_y_incr = cvItem.find("#cv_btn_local_y_incr_" + volume.id);
|
||||
let cv_btn_local_z_decr = cvItem.find("#cv_btn_local_z_decr_" + volume.id);
|
||||
let cv_btn_local_z_incr = cvItem.find("#cv_btn_local_z_incr_" + volume.id);
|
||||
|
||||
cv_btn_local_x_decr.click(function(event) {
|
||||
volume.offset({cs: "local", axis: "x", dir: -1});
|
||||
});
|
||||
cv_btn_local_x_incr.click(function(event) {
|
||||
volume.offset({cs: "local", axis: "x", dir: 1});
|
||||
});
|
||||
cv_btn_local_y_decr.click(function(event) {
|
||||
volume.offset({cs: "local", axis: "y", dir: -1});
|
||||
});
|
||||
cv_btn_local_y_incr.click(function(event) {
|
||||
volume.offset({cs: "local", axis: "y", dir: 1});
|
||||
});
|
||||
cv_btn_local_z_decr.click(function(event) {
|
||||
volume.offset({cs: "local", axis: "z", dir: -1});
|
||||
});
|
||||
cv_btn_local_z_incr.click(function(event) {
|
||||
volume.offset({cs: "local", axis: "z", dir: 1});
|
||||
});
|
||||
|
||||
// global angle offset
|
||||
let cv_btn_global_alpha_decr = cvItem.find("#cv_btn_global_alpha_decr_" + volume.id);
|
||||
let cv_btn_global_alpha_incr = cvItem.find("#cv_btn_global_alpha_incr_" + volume.id);
|
||||
let cv_btn_global_beta_decr = cvItem.find("#cv_btn_global_beta_decr_" + volume.id);
|
||||
let cv_btn_global_beta_incr = cvItem.find("#cv_btn_global_beta_incr_" + volume.id);
|
||||
let cv_btn_global_gamma_decr = cvItem.find("#cv_btn_global_gamma_decr_" + volume.id);
|
||||
let cv_btn_global_gamma_incr = cvItem.find("#cv_btn_global_gamma_incr_" + volume.id);
|
||||
|
||||
cv_btn_global_alpha_decr.click(function(event) {
|
||||
volume.rotate({cs: "global", axis: "x", dir: -1});
|
||||
});
|
||||
cv_btn_global_alpha_incr.click(function(event) {
|
||||
volume.rotate({cs: "global", axis: "x", dir: 1});
|
||||
});
|
||||
cv_btn_global_beta_decr.click(function(event) {
|
||||
volume.rotate({cs: "global", axis: "y", dir: -1});
|
||||
});
|
||||
cv_btn_global_beta_incr.click(function(event) {
|
||||
volume.rotate({cs: "global", axis: "y", dir: 1});
|
||||
});
|
||||
cv_btn_global_gamma_decr.click(function(event) {
|
||||
volume.rotate({cs: "global", axis: "z", dir: -1});
|
||||
});
|
||||
cv_btn_global_gamma_incr.click(function(event) {
|
||||
volume.rotate({cs: "global", axis: "z", dir: 1});
|
||||
});
|
||||
|
||||
// local angle offset
|
||||
let cv_btn_local_alpha_decr = cvItem.find("#cv_btn_local_alpha_decr_" + volume.id);
|
||||
let cv_btn_local_alpha_incr = cvItem.find("#cv_btn_local_alpha_incr_" + volume.id);
|
||||
let cv_btn_local_beta_decr = cvItem.find("#cv_btn_local_beta_decr_" + volume.id);
|
||||
let cv_btn_local_beta_incr = cvItem.find("#cv_btn_local_beta_incr_" + volume.id);
|
||||
let cv_btn_local_gamma_decr = cvItem.find("#cv_btn_local_gamma_decr_" + volume.id);
|
||||
let cv_btn_local_gamma_incr = cvItem.find("#cv_btn_local_gamma_incr_" + volume.id);
|
||||
|
||||
cv_btn_local_alpha_decr.click(function(event) {
|
||||
volume.rotate({cs: "local", axis: "x", dir: -1});
|
||||
});
|
||||
cv_btn_local_alpha_incr.click(function(event) {
|
||||
volume.rotate({cs: "local", axis: "x", dir: 1});
|
||||
});
|
||||
cv_btn_local_beta_decr.click(function(event) {
|
||||
volume.rotate({cs: "local", axis: "y", dir: -1});
|
||||
});
|
||||
cv_btn_local_beta_incr.click(function(event) {
|
||||
volume.rotate({cs: "local", axis: "y", dir: 1});
|
||||
});
|
||||
cv_btn_local_gamma_decr.click(function(event) {
|
||||
volume.rotate({cs: "local", axis: "z", dir: -1});
|
||||
});
|
||||
cv_btn_local_gamma_incr.click(function(event) {
|
||||
volume.rotate({cs: "local", axis: "z", dir: 1});
|
||||
});
|
||||
|
||||
// remove button
|
||||
let cvRemove = cvItem.find(".clipping_volume_action_remove");
|
||||
cvRemove.click(() => {viewer.scene.removeClipVolume(volume)});
|
||||
|
||||
return cvItem;
|
||||
};
|
||||
|
||||
// update body when clip volume changes
|
||||
cv.addEventListener("clip_volume_changed", function(event) {
|
||||
let cv = event.volume;
|
||||
let prevCVItem = $("span#" + cv.name + " .clip_volume_body");
|
||||
let cvItem = createCVitem(cv);
|
||||
prevCVItem.after(cvItem);
|
||||
prevCVItem.remove();
|
||||
});
|
||||
|
||||
// wrapper which doesnt change
|
||||
let icon = "/icons/clip_volume.svg";
|
||||
let cvWrapper = $(`
|
||||
<span class="scene_item" id="${cv.name}">
|
||||
<!-- HEADER -->
|
||||
<div class="scene_header">
|
||||
<span class="scene_icon"><img src="${Potree.resourcePath + icon}" class="scene_item_icon" /></span>
|
||||
<span class="scene_header_title">${cv.name}</span>
|
||||
</div>
|
||||
|
||||
<!-- DETAIL -->
|
||||
<div class="measurement_content selectable" style="display: none">
|
||||
</div>
|
||||
</span>
|
||||
`);
|
||||
|
||||
cvWrapper.find(".measurement_content").append(createCVitem(cv));
|
||||
|
||||
cvWrapper.find(".scene_header").click(function(event) {
|
||||
if($(this).next().is(":visible")) {
|
||||
cv.dispatchEvent({"type": "ui_deselect"});
|
||||
} else {
|
||||
cv.dispatchEvent({"type": "ui_select"});
|
||||
}
|
||||
$(this).next().slideToggle(200);
|
||||
});
|
||||
|
||||
cvList.append(cvWrapper);
|
||||
});
|
||||
|
||||
viewer.scene.addEventListener("clip_volume_removed", function(event) {
|
||||
$("#" + event.volume.name).remove();
|
||||
|
||||
if(viewer.scene.clipVolumes.length == 0 && viewer.scene.polygonClipVolumes.length == 0) {
|
||||
$("#clipping_volumes_container").hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initAnnotationDetails () {
|
||||
// annotation_details
|
||||
|
||||
@ -795,6 +795,10 @@ Potree.Viewer = class PotreeViewer extends THREE.EventDispatcher{
|
||||
$('#potree_description')[0].innerHTML = value;
|
||||
};
|
||||
|
||||
setClipMode(clipMode){
|
||||
this.clippingTool.setClipMode(clipMode);
|
||||
}
|
||||
|
||||
setNavigationMode (value) {
|
||||
this.scene.view.navigationMode = value;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user