ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
LasOpenDialog.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // ##########################################################################
11 // # #
12 // # CloudViewer PLUGIN: LAS-IO Plugin #
13 // # #
14 // # This program is free software; you can redistribute it and/or modify #
15 // # it under the terms of the GNU General Public License as published by #
16 // # the Free Software Foundation; version 2 of the License. #
17 // # #
18 // # This program is distributed in the hope that it will be useful, #
19 // # but WITHOUT ANY WARRANTY; without even the implied warranty of #
20 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
21 // # GNU General Public License for more details. #
22 // # #
23 // # COPYRIGHT: Thomas Montaigu #
24 // # #
25 // ##########################################################################
26 
27 #include "LasDetails.h"
28 #include "LasExtraScalarField.h"
29 #include "LasScalarField.h"
30 #include "LasTiler.h"
31 
32 // GUI generated by Qt Designer
33 #include <ui_lasopendialog.h>
34 
35 // system
36 #include <string>
37 #include <vector>
38 
39 // CORE
40 #include <CVGeom.h>
41 #include <CVLog.h>
42 
44 class LasOpenDialog : public QDialog
45  , public Ui::LASOpenDialog
46 {
47  Q_OBJECT
48 
49  public:
50  enum class Action
51  {
53  Load,
55  Tile,
56  };
57 
59  explicit LasOpenDialog(QWidget* parent = nullptr);
60 
63  void setInfo(int versionMinor, int pointFormatId, qulonglong numPoints);
64 
68  void setAvailableScalarFields(const std::vector<LasScalarField>& scalarFields,
69  const std::vector<LasExtraScalarField>& extraScalarFields);
70 
73  void filterOutNotChecked(std::vector<LasScalarField>& scalarFields,
74  std::vector<LasExtraScalarField>& extraScalarFields);
75 
79 
82  bool shouldForce8bitColors() const;
83 
88  double timeShiftValue() const;
89 
94  Action action() const;
95 
100 
101  void resetShouldSkipDialog();
102 
103  bool shouldSkipDialog() const;
104 
105  private:
106  bool isChecked(const LasScalarField& lasScalarField) const;
107 
108  bool isChecked(const LasExtraScalarField& lasExtraScalarField) const;
109 
110  void doSelectAll(bool doSelect);
111  void doSelectAllESF(bool doSelect);
112 
118  void onAutomaticTimeShiftToggle(bool checked);
119 
120  void onApplyAll();
121 
122  void onBrowseTilingOutputDir();
123 
124  void onCurrentTabChanged(int index);
125 
126  private:
127  bool m_shouldSkipDialog{false};
128 };
This serves the same purpose as LasScalarField but for extra bytes.
Dialog shown to the user when opening a LAS file.
Definition: LasOpenDialog.h:46
LasTilingOptions tilingOptions() const
bool shouldSkipDialog() const
void setAvailableScalarFields(const std::vector< LasScalarField > &scalarFields, const std::vector< LasExtraScalarField > &extraScalarFields)
double timeShiftValue() const
Action action() const
@ Tile
The user wants to tile the file into multiple smaller ones.
@ Load
The user wants to load the file in ACloudViewer.
bool shouldForce8bitColors() const
void setInfo(int versionMinor, int pointFormatId, qulonglong numPoints)
void filterOutNotChecked(std::vector< LasScalarField > &scalarFields, std::vector< LasExtraScalarField > &extraScalarFields)
bool shouldIgnoreFieldsWithDefaultValues() const
LasOpenDialog(QWidget *parent=nullptr)
Default constructor.
void resetShouldSkipDialog()