fixes and polishing
This commit is contained in:
parent
dc6b777b0d
commit
b2903dd021
@ -4,8 +4,8 @@ function Potree () {
|
||||
}
|
||||
Potree.version = {
|
||||
major: 1,
|
||||
minor: 5,
|
||||
suffix: 'RC'
|
||||
minor: 6,
|
||||
suffix: 'RC1'
|
||||
};
|
||||
|
||||
console.log('Potree ' + Potree.version.major + '.' + Potree.version.minor + Potree.version.suffix);
|
||||
|
||||
@ -171,15 +171,12 @@ Potree.ProfileRequest = class ProfileRequest {
|
||||
}
|
||||
}
|
||||
|
||||
//console.log("updateGenerator finished");
|
||||
yield true;
|
||||
};
|
||||
|
||||
* getAccepted(numPoints, buffer, posOffset, matrix, segment, segmentDir, points, totalMileage){
|
||||
* getAccepted(numPoints, node, matrix, segment, segmentDir, points, totalMileage){
|
||||
let checkpoint = performance.now();
|
||||
|
||||
let view = new DataView(buffer.data);
|
||||
|
||||
let accepted = new Uint32Array(numPoints);
|
||||
let mileage = new Float64Array(numPoints);
|
||||
let acceptedPositions = new Float32Array(numPoints * 3);
|
||||
@ -188,12 +185,14 @@ Potree.ProfileRequest = class ProfileRequest {
|
||||
let pos = new THREE.Vector3();
|
||||
let svp = new THREE.Vector3();
|
||||
|
||||
let view = new Float32Array(node.geometry.attributes.position.array);
|
||||
|
||||
for (let i = 0; i < numPoints; i++) {
|
||||
|
||||
pos.set(
|
||||
view.getFloat32(i * buffer.stride + posOffset + 0, true),
|
||||
view.getFloat32(i * buffer.stride + posOffset + 4, true),
|
||||
view.getFloat32(i * buffer.stride + posOffset + 8, true));
|
||||
view[i * 3 + 0],
|
||||
view[i * 3 + 1],
|
||||
view[i * 3 + 2]);
|
||||
|
||||
pos.applyMatrix4(matrix);
|
||||
let distance = Math.abs(segment.cutPlane.distanceToPoint(pos));
|
||||
@ -246,8 +245,7 @@ Potree.ProfileRequest = class ProfileRequest {
|
||||
for (let segment of target.segments) {
|
||||
for (let node of nodes) {
|
||||
let numPoints = node.numPoints;
|
||||
let buffer = node.buffer;
|
||||
let view = new DataView(buffer.data);
|
||||
let geometry = node.geometry;
|
||||
|
||||
if(!numPoints){
|
||||
continue;
|
||||
@ -288,13 +286,12 @@ Potree.ProfileRequest = class ProfileRequest {
|
||||
let matrix = new THREE.Matrix4().multiplyMatrices(
|
||||
this.pointcloud.matrixWorld, nodeMatrix);
|
||||
|
||||
let posOffset = buffer.offset("position");
|
||||
pointsProcessed = pointsProcessed + numPoints;
|
||||
|
||||
let accepted = null;
|
||||
let mileage = null;
|
||||
let acceptedPositions = null;
|
||||
for(let result of this.getAccepted(numPoints, buffer, posOffset, matrix, segment, segmentDir, points,totalMileage)){
|
||||
for(let result of this.getAccepted(numPoints, node, matrix, segment, segmentDir, points,totalMileage)){
|
||||
if(!result){
|
||||
let duration = performance.now() - checkpoint;
|
||||
//console.log(`getPointsInsideProfile yield after ${duration}ms`);
|
||||
@ -314,37 +311,30 @@ Potree.ProfileRequest = class ProfileRequest {
|
||||
|
||||
points.data.position = acceptedPositions;
|
||||
|
||||
let relevantAttributes = buffer.attributes.filter(a => !["position", "index"].includes(a.name));
|
||||
for(let attribute of relevantAttributes){
|
||||
let relevantAttributes = Object.keys(geometry.attributes).filter(a => !["position", "indices"].includes(a));
|
||||
for(let attributeName of relevantAttributes){
|
||||
|
||||
let filteredBuffer = null;
|
||||
if(attribute.type === "FLOAT"){
|
||||
filteredBuffer = new Float32Array(attribute.numElements * accepted.length);
|
||||
}else if(attribute.type === "UNSIGNED_BYTE"){
|
||||
filteredBuffer = new Uint8Array(attribute.numElements * accepted.length);
|
||||
}else if(attribute.type === "UNSIGNED_SHORT"){
|
||||
filteredBuffer = new Uint16Array(attribute.numElements * accepted.length);
|
||||
}else if(attribute.type === "UNSIGNED_INT"){
|
||||
filteredBuffer = new Uint32Array(attribute.numElements * accepted.length);
|
||||
}
|
||||
let attribute = geometry.attributes[attributeName];
|
||||
let numElements = attribute.array.length / numPoints;
|
||||
let Type = attribute.array.constructor;
|
||||
|
||||
let source = new Uint8Array(buffer.data);
|
||||
let target = new Uint8Array(filteredBuffer.buffer);
|
||||
let filteredBuffer = new Type(numElements * accepted.length);
|
||||
|
||||
let offset = buffer.offset(attribute.name);
|
||||
let source = attribute.array;
|
||||
let target = filteredBuffer;
|
||||
|
||||
for(let i = 0; i < accepted.length; i++){
|
||||
|
||||
let index = accepted[i];
|
||||
|
||||
let start = buffer.stride * index + offset;
|
||||
let end = start + attribute.bytes;
|
||||
let start = index * numElements;
|
||||
let end = start + numElements;
|
||||
let sub = source.subarray(start, end);
|
||||
|
||||
target.set(sub, i * attribute.bytes);
|
||||
target.set(sub, i * numElements);
|
||||
}
|
||||
|
||||
points.data[attribute.name] = filteredBuffer;
|
||||
points.data[attributeName] = filteredBuffer;
|
||||
}
|
||||
|
||||
points.data['mileage'] = mileage;
|
||||
|
||||
@ -784,8 +784,8 @@ void main() {
|
||||
|
||||
//vColor = vec3(1.0, 1.0, 1.0) * spacing / 0.05;
|
||||
|
||||
if(getLOD() != uLevel){
|
||||
//if(getLOD() != uLevel){
|
||||
//gl_Position = vec4(100.0, 100.0, 100.0, 1.0);
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@ -428,7 +428,7 @@ body{
|
||||
}
|
||||
|
||||
.ui-widget-content{
|
||||
color: var(--font-color) !important;
|
||||
//color: var(--font-color) !important;
|
||||
}
|
||||
|
||||
.accordion > h3{
|
||||
@ -465,6 +465,23 @@ body{
|
||||
transition: top .35s, left .35s, bottom .35s, right .35s, width .35s;
|
||||
}
|
||||
|
||||
#profile_window{
|
||||
background-color: var(--bg-color);
|
||||
}
|
||||
|
||||
#profile_titlebar{
|
||||
background-color: var(--bg-color-2);
|
||||
color: var(--font-color-2);
|
||||
text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#profile_window_title{
|
||||
position: absolute;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.profile-container-button{
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -615,6 +632,10 @@ body{
|
||||
*/
|
||||
|
||||
|
||||
.ui-spinner-input{
|
||||
color: black;
|
||||
}
|
||||
|
||||
.jstree-themeicon-custom{
|
||||
background-size: 16px !important;
|
||||
}
|
||||
|
||||
@ -7,10 +7,13 @@
|
||||
display: none; box-sizing: border-box; z-index:10000">
|
||||
|
||||
<div id="profile_titlebar" class="pv-titlebar" style="display: flex; position: absolute; height: 30px; width: 100%; box-sizing: border-box;">
|
||||
<span style="padding-right: 10px"><span data-i18n="profile.title"></span></span>
|
||||
<span style="padding-right: 10px">
|
||||
<span id="profile_window_title" data-i18n="profile.title"></span>
|
||||
</span>
|
||||
<span id="profileInfo" style="flex-grow: 1; flex-direction: row"> </span>
|
||||
<!-- <span id="profile_toggle_size_button" class="ui-icon ui-icon-newwin profile-button"> </span> -->
|
||||
<span id="closeProfileContainer" class="ui-icon ui-icon-close profile-button"> </span>
|
||||
<!--<span id="closeProfileContainer" class="ui-icon ui-icon-close profile-button"> </span>-->
|
||||
<img id="closeProfileContainer" class="button-icon" style="width: 24px; height: 24px; margin: 4px"/>
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; top: 30px; width: 100%; height: calc(100% - 30px); box-sizing: border-box;" class="pw_content">
|
||||
|
||||
@ -206,6 +206,9 @@ Potree.ProfileWindow = class ProfileWindow extends THREE.EventDispatcher {
|
||||
let lasIcon = `${Potree.resourcePath}/icons/file_las_3d.svg`;
|
||||
$('#potree_download_las_icon').attr('src', lasIcon);
|
||||
|
||||
let closeIcon = `${Potree.resourcePath}/icons/close.svg`;
|
||||
$('#closeProfileContainer').attr("src", closeIcon);
|
||||
|
||||
this.initTHREE();
|
||||
this.initSVG();
|
||||
this.initListeners();
|
||||
|
||||
@ -43,12 +43,14 @@
|
||||
|
||||
<div class="divider"><span>Other</span></div>
|
||||
|
||||
<!--
|
||||
<li>
|
||||
<selectgroup id="splat_quality_options">
|
||||
<option id="splat_quality_options_standard" value="standard">Standard</option>
|
||||
<option id="splat_quality_options_hq" value="hq">High Quality</option>
|
||||
</selectgroup>
|
||||
</li>
|
||||
-->
|
||||
|
||||
<li><span data-i18n="appearance.min_node_size"></span>: <span id="lblMinNodeSize"></span><div id="sldMinNodeSize"></div></li>
|
||||
<li><label><input id="show_bounding_box" type="checkbox" /><span data-i18n="appearance.box"></span></label></li>
|
||||
|
||||
@ -642,14 +642,6 @@ initSidebar = (viewer) => {
|
||||
}
|
||||
|
||||
function initAppearance () {
|
||||
// $( "#optQuality" ).selectmenu();
|
||||
|
||||
// $("#optQuality").val(viewer.getQuality()).selectmenu("refresh")
|
||||
// $("#optQuality").selectmenu({
|
||||
// change: function(event, ui){
|
||||
// viewer.setQuality(ui.item.value);
|
||||
// }
|
||||
// });
|
||||
|
||||
$('#sldPointBudget').slider({
|
||||
value: viewer.getPointBudget(),
|
||||
@ -693,16 +685,6 @@ initSidebar = (viewer) => {
|
||||
$('#sldFOV').slider({value: viewer.getFOV()});
|
||||
});
|
||||
|
||||
// viewer.addEventListener("quality_changed", e => {
|
||||
//
|
||||
// let name = viewer.quality;
|
||||
//
|
||||
// $( "#optQuality" )
|
||||
// .selectmenu()
|
||||
// .val(name)
|
||||
// .selectmenu("refresh");
|
||||
// });
|
||||
|
||||
viewer.addEventListener('edl_radius_changed', function (event) {
|
||||
$('#lblEDLRadius')[0].innerHTML = viewer.getEDLRadius().toFixed(1);
|
||||
$('#sldEDLRadius').slider({value: viewer.getEDLRadius()});
|
||||
@ -853,21 +835,21 @@ initSidebar = (viewer) => {
|
||||
$('#lblMinNodeSize').html(parseInt(viewer.getMinNodeSize()));
|
||||
}
|
||||
|
||||
{
|
||||
let elSplatQuality = $("#splat_quality_options");
|
||||
elSplatQuality.selectgroup({title: "Splat Quality"});
|
||||
//{
|
||||
// let elSplatQuality = $("#splat_quality_options");
|
||||
// elSplatQuality.selectgroup({title: "Splat Quality"});
|
||||
|
||||
elSplatQuality.find("input").click( (e) => {
|
||||
if(e.target.value === "standard"){
|
||||
viewer.useHQ = false;
|
||||
}else if(e.target.value === "hq"){
|
||||
viewer.useHQ = true;
|
||||
}
|
||||
});
|
||||
// elSplatQuality.find("input").click( (e) => {
|
||||
// if(e.target.value === "standard"){
|
||||
// viewer.useHQ = false;
|
||||
// }else if(e.target.value === "hq"){
|
||||
// viewer.useHQ = true;
|
||||
// }
|
||||
// });
|
||||
|
||||
let currentQuality = viewer.useHQ ? "hq" : "standard";
|
||||
elSplatQuality.find(`input[value=${currentQuality}]`).trigger("click");
|
||||
}
|
||||
// let currentQuality = viewer.useHQ ? "hq" : "standard";
|
||||
// elSplatQuality.find(`input[value=${currentQuality}]`).trigger("click");
|
||||
//}
|
||||
|
||||
$('#show_bounding_box').click(() => {
|
||||
viewer.setShowBoundingBox($('#show_bounding_box').prop("checked"));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user