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>
50#include <QProgressBar>
76 class CustomPointScanDialog;
77 template<
class t_type>
85 class POINT_SCANNER_API PointScannerDialog :
public QWidget,
public ViewportManager
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;
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;
116 void initMeasureTab();
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);
153 void updateScannerState(
int animation_time,
bool force);
154 CustomPointScanDialog* customAnglesWidget();
155 PhotoDrapingSettings* photoDrapingWidget();
158 void updateScanStatusSlot();
159 void updateOrientationSlot();
160 void updateLockAngles();
161 void updateGyroState();
162 void onScanProfileChanged();
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);
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();
183 void stationChangedSlot(UUID
id);
184 void deploymentChangedSlot(UUID
id);
185 void updateFromController();
187 void cameraVisibilityChangedSignal(
bool visible);
188 void requestRemoteWidgetSignal(
bool use_remote);
189 void scannerSetSignal(Scanner3D* scanner);
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;
198 QPointer<DockWidget<CameraView>> m_camera_view;
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;
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;
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;
A LogStream that writes log messages directly to a specified ASCII text file.
A thread that executes a user-provided callback function concurrently.
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.
Provides standard logic shared across all hardware controllers to be used with the software.
A distance encoder is a device that measures distance by generating pulses in response to an object's...
Contains methods for easily reading and writing to an INI file including efficient casting,...
A joystick that allows the user to move around, reporting the vector of the stick,...
A widget for configuring photo draping (texture projection) settings during scanning,...
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...
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.
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.