NDEVR
API Documentation
PointScannerDialog.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: NDEVR
28File: PointScannerDialog
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#if NDEVR_SCAN
35#include <NDEVR/PointScannerOptions.h>
36#include <NDEVR/Scanner3D.h>
37#include <NDEVR/PhysicalCameraView.h>
38#include <NDEVR/ViewportManager.h>
39#include <NDEVR/Button.h>
40#include <NDEVR/ProgressWidget.h>
41#include <NDEVR/OrientationSensor.h>
42#include <NDEVR/Deployment.h>
43#include <NDEVR/KeyController.h>
44#include <NDEVR/UUID.h>
45#include <NDEVR/Buffer.h>
46#include <NDEVR/Dictionary.h>
47#include <NDEVR/INIInterface.h>
48#include <QWidget>
49#include <QPointer>
50#include <QProgressBar>
51class QTableWidget;
52namespace Ui
53{
54 class PointScannerUI;
55}
56namespace NDEVR
57{
60 class Scanner3D;
61 class Joystick;
63 class INIFactory;
65 class ContainerWidget;
66 class BasicThread;
67 class QTModelManager;
69 class UUID;
70 class StationEditor;
72 class Button;
73 class DeploymentWidget;
74 class DistanceEncoder;
76 class CustomPointScanDialog;
77 template<class t_type>
78 class DockWidget;
79 enum class ScanMode;
80
85 class POINT_SCANNER_API PointScannerDialog : public QWidget, public ViewportManager
86 {
87 Q_OBJECT
88 public:
89 PointScannerDialog(QTModelManager* manager, QWidget* parent = nullptr);
90 virtual ~PointScannerDialog();
91 virtual void findDevices();
92 virtual void setCurrentScanner(Scanner3D* scanner);
93 virtual void setDeploymentEncoder(DistanceEncoder* encoder);
94 ContainerWidget* viewContainer() const;
95
96 bool useRemoteWidgets() const { return m_remote_widget; }
97 Buffer<QPointer<QWidget>> remoteWidgets();
98 QSize sizeHint() const override;
99 bool cameraVisible() const { return m_camera_visible; }
100 bool showCameraDuringScan() const { return options().allow_camera_during_scan.get(); }
101 PointScannerOptions& options();
102 const PointScannerOptions& options() const;
103 virtual void requestStation(UUID id);
104 virtual void requestDeployment(UUID id);
105 virtual bool processKeyEvent(const StringView& id, const KeyEvent& key_event, DesignObjectLookup* lookup, Camera* camera);
106 virtual void returnToBaseAction(PopupInfo info);
107 Bounds<2, Angle<fltp08>> getPolarScanBounds(UUID mode) const;
108 Bounds<3, fltp08> getCartesianScanBounds(UUID mode) const;
109 UUID scanCamera() const;
110 void swapToScannerCamera();
111 PhysicalCameraView* pCameraView();
112 virtual void onGlobalLayoutUpdated(Buffer<QPointer<DockWidget<CameraView>>>& removed_views) override;
113 virtual bool removeView(QPointer<DockWidget<CameraView>> view) override;
114 virtual bool addView(QPointer<DockWidget<CameraView>> view) override;
115 protected:
116 void initMeasureTab();
117 //Prevents double clicking buttons
118 bool checkAndSetCommandTime();
119 StringAllocatingView videoRecordName();
120 bool hasActiveDeployment() const;
121 void updateEncoderState();
122 void updateAutoCameraSwap();
123 bool preferDockedCamera() const;
124 void setupDeploymentScanButton(ScanProfile profile);
125 void setupBoretrakWidget();
126 void addQuickCommands();
127 void setupScanProfiles();
128 void speakCurrentDepth(fltp08 depth, uint04 count = Constant<uint04>::Invalid);
129 void setupScanObjectWidget();
130 void updateScanButtons(bool scanning, bool paused);
131 void resizeEvent(QResizeEvent* event) override;
132 virtual void hideEvent(QHideEvent *event) override;
133 virtual void showEvent(QShowEvent *event) override;
134 bool event(QEvent* event) override;
135 Buffer<Angle<fltp08>> polarStepOptions() const;
136 Buffer<fltp08> cartesianStepOptions() const;
137 ScanProfile currentScanProfile() const;
138 Angle<fltp08> currentPolarStep() const;
139 fltp08 currentCartesianStep() const;
140 fltp04 currentSpeed() const;
141 void updateInfoBox();
142 void setToNewStation(bool show_dialog);
143 void updateWidgets(int animation_time, bool force);
144 void updateStation(UUID station, int animation_time);
145 void updateDeployment(UUID deployment, int animation_time);
146 void updateOrientationLabels();
147 bool shouldShowVideo() const;
148 void setupForSearchScanners(const Buffer<QPointer<Connection>>& connections_to_test);
149 void endSetupForSearchScanners(const Buffer<Scanner3D*>& scanners_found);
150 void setProgressFormat(const TranslatedString& format);
151 void setProgress(fltp04 percent);
152 void initJoystick();
153 void updateScannerState(int animation_time, bool force);
154 CustomPointScanDialog* customAnglesWidget();
155 PhotoDrapingSettings* photoDrapingWidget();
156 void markAction();
157 public slots:
158 void updateScanStatusSlot();
159 void updateOrientationSlot();
160 void updateLockAngles();
161 void updateGyroState();
162 void onScanProfileChanged();
163 void updateWidget();
164 void startScan();
165 void onLaserToggle(bool is_on);
166 void onLastHitToggle();
167 void modelDeletedSlot(UUID id);
168 void objectsUpdatedSlot(Buffer<UUID> id);
169 void scanEndedSlot(UUID id);
170 void clearAllSlot();
171 void boretrakRemovedSlot();
172 void boretrakAddedSlot();
173 void scanStartedSlot();
174 void performImageDrape();
175 void onConnectionStatusChanged(bool connected);
176 void setShowStationOnNew(bool show_station) { m_show_station_on_new = show_station; }
177 void setRemoteWidget(bool use_remote);
178 void setCameraVisible(bool visible);
179 void setButtonsActive(bool active);
180 void updateDeploymentPosition();
181 void updateConnectedController();
182 protected slots:
183 void stationChangedSlot(UUID id);
184 void deploymentChangedSlot(UUID id);
185 void updateFromController();
186 signals:
187 void cameraVisibilityChangedSignal(bool visible);
188 void requestRemoteWidgetSignal(bool use_remote);
189 void scannerSetSignal(Scanner3D* scanner);
190 protected:
191 QTModelManager* m_model_manager = nullptr;
192 CameraLocationCombo* m_station_zoom_combo = nullptr;
193 DeploymentWidget* m_popup_deployment_widget = nullptr;
194 Joystick* m_joystick = nullptr;
195 CustomPointScanDialog* m_popup_custom_point_dialog = nullptr;
196 PhotoDrapingSettings* m_popup_photo_draping_settings = nullptr;
197 //CameraLocationCombo* m_scanner_zoom_combo;
198 QPointer<DockWidget<CameraView>> m_camera_view;
199
200 ControllerInterface* m_controller = nullptr;
201 Scanner3D* m_scanner = nullptr;
202 Scanner3D* m_try_scanner = nullptr;
203 DistanceEncoder* m_current_encoder = nullptr;
204 Motor* m_deployment_motor = nullptr;
205 Resource<uint04> m_search_attempt_count;
206 QTimer* m_image_drape_timer = nullptr;
207 QTimer* m_button_action_timer = nullptr;
208 Ui::PointScannerUI* ui;
209 Dictionary<String, ConnectionStatusWidget*> m_connection_widgets;
210 UUID m_last_scan_object;
211 Vector<2, fltp04> m_joy_location;
212 QPointer<Button> m_remote_find_scanner_button = nullptr;
213 QPointer<Button> m_remote_play_button = nullptr;
214 QPointer<Button> m_remote_pause_button = nullptr;
215 QPointer<Button> m_remote_stop_button = nullptr;
216 QPointer<Button> m_remote_circle_scan = nullptr;
217 QPointer<Button> m_joystick_circle_scan = nullptr;
218 QPointer<Button> m_remote_deployment_action_button = nullptr;
219 QPointer<Button> m_camera_view_light_button = nullptr;
220 QPointer<Button> m_joystick_record_button = nullptr;
221 QPointer<Button> m_joystick_light_button = nullptr;
222 QPointer<Button> m_joystick_go_home_button = nullptr;
223
224 QPointer<ProgressWidget> m_remote_progress_bar = nullptr;
225 Time m_last_command_time = Constant<Time>::Invalid;
226 StationEditor* m_station_editor = nullptr;
227 ScannerState m_last_scanner_state;
228 BasicThread* m_scan_finder_thread = nullptr;
229 BasicThread* m_station_creater_thread = nullptr;
230 Buffer<QPointer<Button>> m_remote_buttons;
231 GyroState m_last_gyro_state;
232 UUID m_requested_station;
233 UUID m_requested_deployment;
234 fltp08 m_last_reading_interval = Constant<fltp08>::Invalid;
235 bool m_show_station_on_new = true;
236 bool m_zoom_station_on_new = true;
237 bool m_showing_scan_ended_message = false;
238 bool m_remote_widget = false;
239 bool m_last_was_scanning = false;
240 bool m_last_was_paused = false;
241 bool m_camera_visible = false;
242 bool m_is_showing_calibrate = false;
243 bool m_stop_video_on_finish = false;
244 bool m_action_buttons_enabled = true;
245
246 };
247}
248#endif
A LogStream that writes log messages directly to a specified ASCII text file.
A thread that executes a user-provided callback function concurrently.
Definition BasicThread.h:47
A core widget that allows the user to click one of many button types.
Definition Button.h:68
Sets up a button to be a combobox with the various snap locations of a camera.
Allows the user to select a method to color a particular channel.
A dial and information text that shows the current status of a connection.
manages a series of SectionContent that can share the same space or lay out in various patterns inclu...
Provides standard logic shared across all hardware controllers to be used with the software.
A widget used for allowing the user to quickly setup an OrientationSensor for a Deployment.
A distance encoder is a device that measures distance by generating pulses in response to an object's...
A type-safe dock widget that wraps a specific widget type.
Contains methods for easily reading and writing to an INI file including efficient casting,...
Definition INIReader.h:107
A joystick that allows the user to move around, reporting the vector of the stick,...
Definition Joystick.h:88
A widget for configuring photo draping (texture projection) settings during scanning,...
Provides a wrapper for a widget that can be docked inside a Container or floated as a top-level windo...
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
A popup Editor dialog for showing options or information related to StationModel objects.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
Logic for placing Viewports or Camera Views into widgets.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
ScanMode
The mode that a scanner will collect data in.
Definition ScanMode.h:8
double fltp08
Defines an alias representing an 8 byte floating-point number.
GyroState
Used by OrientationSensor to display the current state of any available gyro.