add rotation and transformation of PointClouds in map-view
This commit is contained in:
@@ -70,6 +70,9 @@
|
|||||||
// material.size = 1;
|
// material.size = 1;
|
||||||
// material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
|
// material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
|
||||||
|
|
||||||
|
pc.rotation.set(pointCloud.rotation.x, pointCloud.rotation.y, pointCloud.rotation.z);
|
||||||
|
pc.position.set(pointCloud.transformation.x, pointCloud.transformation.y, pointCloud.transformation.z);
|
||||||
|
|
||||||
loadedPointClouds.push({id: pointCloud.id, pointCloud: pc})
|
loadedPointClouds.push({id: pointCloud.id, pointCloud: pc})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +87,8 @@
|
|||||||
entry.pointCloud.visible = !entry.pointCloud.visible;
|
entry.pointCloud.visible = !entry.pointCloud.visible;
|
||||||
entry.pointCloud.visible = !entry.pointCloud.visible;
|
entry.pointCloud.visible = !entry.pointCloud.visible;
|
||||||
}
|
}
|
||||||
|
entry.pointCloud.rotation.set(pointClouds[i].rotation.x, pointClouds[i].rotation.y, pointClouds[i].rotation.z);
|
||||||
|
entry.pointCloud.position.set(pointClouds[i].transformation.x, pointClouds[i].transformation.y, pointClouds[i].transformation.z);
|
||||||
} else {
|
} else {
|
||||||
loadByPc(pointClouds[i])
|
loadByPc(pointClouds[i])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,33 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<font-awesome-icon class="icon" :icon="iconName" @click="onClickVisible" />
|
<font-awesome-icon class="icon" :icon="iconName" @click="onClickVisible"/>
|
||||||
<p class="caption" @click="onClickEdit()">{{ item.name }}</p>
|
<p class="caption" @click="onClickEdit()">{{ item.name }}</p>
|
||||||
<div id="settings" ref="settings" class="collapsed">
|
<div id="settings" ref="settings" class="collapsed">
|
||||||
<div id="settings-container" ref="settings-container">
|
<div id="settings-container" ref="settings-container">
|
||||||
<div>
|
<div>
|
||||||
<input
|
<input
|
||||||
ref="focusElement"
|
ref="focusElement"
|
||||||
type="text"
|
type="text"
|
||||||
v-model="editPcName"
|
v-model="editPcName"
|
||||||
@keyup.enter="onEnter()"
|
@keyup.enter="onEnter()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<button class="button-delete" @click="onClickDelete()">
|
<button class="button-delete" @click="onClickDelete()">
|
||||||
<font-awesome-icon class="icon" icon="trash"></font-awesome-icon>
|
<font-awesome-icon class="icon" icon="trash"></font-awesome-icon>
|
||||||
<span class="button-text">Delete</span>
|
<span class="button-text">Delete</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<p class="data-caption">Rotation</p>
|
||||||
|
|
||||||
|
<input class="input-num" type="number" v-model="editRotationX" @keyup.enter="onEnter()"/>
|
||||||
|
<input class="input-num" type="number" v-model="editRotationY" @keyup.enter="onEnter()"/>
|
||||||
|
<input class="input-num" type="number" v-model="editRotationZ" @keyup.enter="onEnter()"/>
|
||||||
|
|
||||||
|
<p class="data-caption">Transformation</p>
|
||||||
|
<input class="input-num" type="number" v-model="editTransformationX" @keyup.enter="onEnter()"/>
|
||||||
|
<input class="input-num" type="number" v-model="editTransformationY" @keyup.enter="onEnter()"/>
|
||||||
|
<input class="input-num" type="number" v-model="editTransformationZ" @keyup.enter="onEnter()"/>
|
||||||
|
|
||||||
|
|
||||||
<button @click="onClickSave()">
|
<button @click="onClickSave()">
|
||||||
<font-awesome-icon class="icon" icon="edit"></font-awesome-icon>
|
<font-awesome-icon class="icon" icon="edit"></font-awesome-icon>
|
||||||
<span class="button-text">Save</span>
|
<span class="button-text">Save</span>
|
||||||
@@ -41,6 +52,12 @@ export default {
|
|||||||
isVisible: true,
|
isVisible: true,
|
||||||
isCollapsed: true,
|
isCollapsed: true,
|
||||||
editPcName: "",
|
editPcName: "",
|
||||||
|
editRotationX: 0,
|
||||||
|
editRotationY: 0,
|
||||||
|
editRotationZ: 0,
|
||||||
|
editTransformationX: 0,
|
||||||
|
editTransformationY: 0,
|
||||||
|
editTransformationZ: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -61,8 +78,14 @@ export default {
|
|||||||
this.$refs.settings.style.height = "0";
|
this.$refs.settings.style.height = "0";
|
||||||
} else {
|
} else {
|
||||||
this.editPcName = this.item.name;
|
this.editPcName = this.item.name;
|
||||||
|
this.editRotationX = this.item.rotation.x;
|
||||||
|
this.editRotationY = this.item.rotation.y;
|
||||||
|
this.editRotationZ = this.item.rotation.z;
|
||||||
|
this.editTransformationX = this.item.transformation.x;
|
||||||
|
this.editTransformationY = this.item.transformation.y;
|
||||||
|
this.editTransformationZ = this.item.transformation.z;
|
||||||
this.$refs.settings.style.height =
|
this.$refs.settings.style.height =
|
||||||
this.outerHeight(this.$refs["settings-container"]) + "px";
|
this.outerHeight(this.$refs["settings-container"]) + "px";
|
||||||
setTimeout(() => this.$refs.focusElement.focus(), 100);
|
setTimeout(() => this.$refs.focusElement.focus(), 100);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -70,6 +93,16 @@ export default {
|
|||||||
this.$store.dispatch("pci/updatePointCloud", {
|
this.$store.dispatch("pci/updatePointCloud", {
|
||||||
id: this.item.id,
|
id: this.item.id,
|
||||||
name: this.editPcName,
|
name: this.editPcName,
|
||||||
|
rotation: {
|
||||||
|
x: parseFloat(this.editRotationX),
|
||||||
|
y: parseFloat(this.editRotationY),
|
||||||
|
z: parseFloat(this.editRotationZ)
|
||||||
|
},
|
||||||
|
transformation: {
|
||||||
|
x: parseFloat(this.editTransformationX),
|
||||||
|
y: parseFloat(this.editTransformationY),
|
||||||
|
z: parseFloat(this.editTransformationZ)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.onClickEdit();
|
this.onClickEdit();
|
||||||
},
|
},
|
||||||
@@ -112,7 +145,12 @@ export default {
|
|||||||
|
|
||||||
.button-delete {
|
.button-delete {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 10px;
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-num {
|
||||||
|
display: inline-block;
|
||||||
|
width: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-text {
|
.button-text {
|
||||||
@@ -136,4 +174,10 @@ export default {
|
|||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-color: grey;
|
border-color: grey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.data-caption {
|
||||||
|
font-size: 0.5em;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user