Added ability to display unreferenced point cloud / model in 3d model display

pull/118/head
Piero Toffanin 2017-03-15 10:58:06 -04:00
rodzic ac6c86eb7d
commit 5a7022ca0c
4 zmienionych plików z 19 dodań i 11 usunięć

Wyświetl plik

@ -473,7 +473,6 @@ class Task(models.Model):
if self.orthophoto is None:
assets.remove('geotiff')
assets.remove('ply')
assets.remove('las')
assets.remove('csv')
return assets

Wyświetl plik

@ -45,8 +45,16 @@ class ModelView extends React.Component {
return this.assetsPath() + '/odm_texturing/';
}
hasGeoreferencedAssets(){
return this.props.task.available_assets.indexOf('geotiff') !== -1;
}
objFilePath(){
return this.texturedModelDirectoryPath() + 'odm_textured_model_geo.obj';
let file = this.hasGeoreferencedAssets() ?
'odm_textured_model_geo.obj' :
'odm_textured_model.obj';
return this.texturedModelDirectoryPath() + file;
}
mtlFilename(){
@ -64,7 +72,7 @@ class ModelView extends React.Component {
sizeType: "Adaptive", // options: "Fixed", "Attenuated", "Adaptive"
quality: "Interpolation", // options: "Squares", "Circles", "Interpolation", "Splats"
fov: 75, // field of view in degree
material: "RGB", // options: "RGB", "Height", "Intensity", "Classification"
material: this.hasGeoreferencedAssets() ? "RGB" : "Elevation", // options: "RGB", "Height", "Intensity", "Classification"
pointLimit: 1, // max number of points in millions
navigation: "Orbit", // options: "Earth", "Orbit", "Flight"
pointSize: 1.2

Wyświetl plik

@ -224,7 +224,7 @@ class TaskListItem extends React.Component {
if (!task.processing_node) status = "";
if (task.pending_action !== null) status = pendingActions.description(task.pending_action);
let showAssetsMissingWarning = false;
let showGeotiffMissingWarning = false;
let expanded = "";
if (this.state.expanded){
let actionButtons = [];
@ -239,12 +239,13 @@ class TaskListItem extends React.Component {
addActionButton(" View Orthophoto", "btn-primary", "fa fa-globe", () => {
location.href = `/map/project/${task.project}/task/${task.id}/`;
});
addActionButton(" View 3D Model", "btn-primary", "fa fa-cube", () => {
location.href = `/3d/project/${task.project}/task/${task.id}/`;
});
}else{
showAssetsMissingWarning = true;
showGeotiffMissingWarning = true;
}
addActionButton(" View 3D Model", "btn-primary", "fa fa-cube", () => {
location.href = `/3d/project/${task.project}/task/${task.id}/`;
});
}
// Ability to change options
@ -308,8 +309,8 @@ class TaskListItem extends React.Component {
: ""}
{/* TODO: List of images? */}
{showAssetsMissingWarning ?
<div className="assets-warning"><i className="fa fa-warning"></i> <span>An orthophoto and point cloud could not be generated. To generate them, make sure GPS information is embedded in the EXIF tags of your images.</span></div> : ""}
{showGeotiffMissingWarning ?
<div className="geotiff-warning"><i className="fa fa-warning"></i> <span>An orthophoto could not be generated. To generate one, make sure GPS information is embedded in the EXIF tags of your images.</span></div> : ""}
</div>
<div className="col-md-8">
<Console

Wyświetl plik

@ -59,7 +59,7 @@
padding-bottom: 16px;
padding-left: 16px;
.assets-warning{
.geotiff-warning{
margin-top: 16px;
i.fa{
color: #ff8000;