fix measurements and profiles
This commit is contained in:
parent
16673c5947
commit
f712456dbe
@ -43,17 +43,12 @@
|
||||
<div class="potree_container" style="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; ">
|
||||
|
||||
<div id="potree_render_area">
|
||||
<!--
|
||||
<img class="potree_menu_toggle" src="../resources/icons/menu_button.svg" onclick="viewer.toggleSidebar()" />
|
||||
<img id="potree_map_toggle" src="../resources/icons/map_icon.png" onclick="viewer.toggleMap()" style="display: none"/>
|
||||
-->
|
||||
<div id="potree_map" class="mapBox" style="position: absolute; left: 50px; top: 50px; width: 400px; height: 400px; display: none">
|
||||
<div id="potree_map_header" style="position: absolute; width: 100%; height: 25px; top: 0px; background-color: rgba(0,0,0,0.5); z-index: 1000; border-top-left-radius: 3px; border-top-right-radius: 3px;">
|
||||
</div>
|
||||
<div id="potree_map_content" class="map" style="position: absolute; z-index: 100; top: 25px; width: 100%; height: calc(100% - 25px); border: 2px solid rgba(0,0,0,0.5); box-sizing: border-box;"></div>
|
||||
</div>
|
||||
|
||||
<!-- HEADING -->
|
||||
<div id="potree_description" class="potree_info_text"></div>
|
||||
</div>
|
||||
|
||||
@ -99,12 +94,6 @@
|
||||
|
||||
{
|
||||
let measurement = new Potree.Measure();
|
||||
measurement.showDistances = true;
|
||||
measurement.showArea = false;
|
||||
measurement.showAngles = false;
|
||||
measurement.closed = false;
|
||||
measurement.showCoordinates = false;
|
||||
measurement.maxMarkers = Number.MAX_SAFE_INTEGER;
|
||||
measurement.addMarker(new THREE.Vector3(589938.8594970703, 231457.48974609375, 727.9749997901916));
|
||||
measurement.addMarker(new THREE.Vector3(589877.9293823242, 231472.29974365234, 735.1949995803833));
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ Potree.Measure = class{
|
||||
this.points = [];
|
||||
this._showDistances = true;
|
||||
this._showCoordinates = false;
|
||||
this._showArea = true;
|
||||
this._showArea = false;
|
||||
this._closed = true;
|
||||
this._showAngles = false;
|
||||
this.maxMarkers = Number.MAX_SAFE_INTEGER;
|
||||
@ -241,7 +241,9 @@ Potree.Measure = class{
|
||||
let labelPos = position.clone().add(new THREE.Vector3(0,1,0));
|
||||
coordinateLabel.position.copy(labelPos);
|
||||
|
||||
let msg = Potree.utils.addCommas(position.x.toFixed(2)) + " / " + Potree.utils.addCommas(position.y.toFixed(2)) + " / " + Potree.utils.addCommas(position.z.toFixed(2));
|
||||
let msg = Potree.utils.addCommas(position.x.toFixed(2))
|
||||
+ " / " + Potree.utils.addCommas(position.y.toFixed(2))
|
||||
+ " / " + Potree.utils.addCommas(position.z.toFixed(2));
|
||||
coordinateLabel.setText(msg);
|
||||
|
||||
//coordinateLabel.visible = this.showCoordinates && (index < lastIndex || this.closed);
|
||||
@ -329,7 +331,6 @@ Potree.Measure = class{
|
||||
let msg = Potree.utils.addCommas(point.position.x.toFixed(2))
|
||||
+ " / " + Potree.utils.addCommas(point.position.y.toFixed(2))
|
||||
+ " / " + Potree.utils.addCommas(point.position.z.toFixed(2));
|
||||
//let msg = "abc";
|
||||
coordinateLabel.setText(msg);
|
||||
|
||||
coordinateLabel.visible = this.showCoordinates && (index < lastIndex || this.closed);
|
||||
|
||||
@ -383,11 +383,11 @@ Potree.MeasuringTool = class{
|
||||
let scale = (70 / pr);
|
||||
label.scale.set(scale, scale, scale);
|
||||
|
||||
let geoCoord = point.position;
|
||||
let txt = Potree.utils.addCommas(geoCoord.x.toFixed(2)) + " / ";
|
||||
txt += Potree.utils.addCommas((-geoCoord.z).toFixed(2)) + " / ";
|
||||
txt += Potree.utils.addCommas(geoCoord.y.toFixed(2));
|
||||
label.setText(txt);
|
||||
//let geoCoord = point.position;
|
||||
//let txt = Potree.utils.addCommas(geoCoord.x.toFixed(2)) + " / ";
|
||||
//txt += Potree.utils.addCommas((geoCoord.y).toFixed(2)) + " / ";
|
||||
//txt += Potree.utils.addCommas(geoCoord.z.toFixed(2));
|
||||
//label.setText(txt);
|
||||
}
|
||||
|
||||
// areaLabel
|
||||
|
||||
@ -45,8 +45,6 @@
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li><label class="menu-item"><input type="checkbox" onClick="viewer.setShowSkybox(this.checked)"/><span data-i18n="appearance.skybox"></span</label></li>
|
||||
|
||||
<div>
|
||||
<div class="divider">
|
||||
<span>Eye-Dome-Lighting</span>
|
||||
|
||||
@ -60,9 +60,7 @@ function initToolbar(){
|
||||
Potree.resourcePath + "/icons/reset_tools.svg",
|
||||
"[title]tt.remove_all_measurement",
|
||||
function(){
|
||||
viewer.measuringTool.reset();
|
||||
viewer.profileTool.reset();
|
||||
viewer.volumeTool.reset();
|
||||
viewer.scene.removeAllMeasurements();
|
||||
}
|
||||
));
|
||||
}
|
||||
@ -677,7 +675,7 @@ function initMeasurementDetails(){
|
||||
elPanelIcon.src = Potree.resourcePath + "/icons/profile.svg";
|
||||
elPanelStretch.innerHTML = "Profile";
|
||||
|
||||
elPanelRemove.onclick = function(){scene.removeProfile(profile);};
|
||||
elPanelRemove.onclick = function(){scene.removeProfile(measurement);};
|
||||
} else if(measurement instanceof Potree.Volume){
|
||||
elPanelIcon.src = Potree.resourcePath + "/icons/volume.svg";
|
||||
elPanelStretch.innerHTML = "Volume";
|
||||
@ -942,7 +940,7 @@ function initMeasurementDetails(){
|
||||
};
|
||||
} else if(measurement instanceof Potree.Profile){
|
||||
let onremove = function(event){
|
||||
if(event.measurement === measurement){
|
||||
if(event.profile === measurement){
|
||||
scene.dispatcher.removeEventListener("marker_added", updateDisplay);
|
||||
scene.dispatcher.removeEventListener("marker_removed", updateDisplay);
|
||||
scene.dispatcher.removeEventListener("marker_moved", updateDisplay);
|
||||
|
||||
@ -79,9 +79,9 @@ Potree.Scene = class{
|
||||
}
|
||||
|
||||
removeProfile(profile){
|
||||
let index = this.profile.indexOf(profile);
|
||||
let index = this.profiles.indexOf(profile);
|
||||
if (index > -1) {
|
||||
this.profile.splice(index, 1);
|
||||
this.profiles.splice(index, 1);
|
||||
this.dispatcher.dispatchEvent({
|
||||
"type": "profile_removed",
|
||||
"scene": this,
|
||||
@ -90,6 +90,16 @@ Potree.Scene = class{
|
||||
}
|
||||
}
|
||||
|
||||
removeAllMeasurements(){
|
||||
while(this.measurements.length > 0){
|
||||
this.removeMeasurement(this.measurements[0]);
|
||||
}
|
||||
|
||||
while(this.profiles.length > 0){
|
||||
this.removeProfile(this.profiles[0]);
|
||||
}
|
||||
}
|
||||
|
||||
initialize(){
|
||||
|
||||
this.referenceFrame = new THREE.Object3D();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user