17#ifndef __gui_mrview_window_h__
18#define __gui_mrview_window_h__
50 class CameraInteractor;
64 QSize sizeHint ()
const override;
67 void dragEnterEvent (QDragEnterEvent* event)
override;
68 void dragMoveEvent (QDragMoveEvent* event)
override;
69 void dragLeaveEvent (QDragLeaveEvent* event)
override;
70 void dropEvent (QDropEvent* event)
override;
71 bool event (QEvent* event)
override;
73 void initializeGL ()
override;
74 void paintGL ()
override;
75 void mousePressEvent (QMouseEvent* event)
override;
76 void mouseMoveEvent (QMouseEvent* event)
override;
77 void mouseReleaseEvent (QMouseEvent* event)
override;
78 void wheelEvent (QWheelEvent* event)
override;
92 Qt::KeyboardModifiers
modifiers ()
const {
return modifiers_; }
98 return static_cast<const Image*
> (image_group->checkedAction());
112 const Eigen::Vector3f&
focus ()
const {
return focal_point; }
113 const Eigen::Vector3f&
target ()
const {
return camera_target; }
114 float FOV ()
const {
return field_of_view; }
115 int plane ()
const {
return anatomical_plane; }
129 QList<QAction*> list = image_group->actions();
130 for (
int n = 0; n < list.size(); ++n)
131 static_cast<Image*
> (list[n])->set_windowing (min, max);
148 QImage
image (glarea->grabFramebuffer());
183 void image_open_slot ();
184 void image_import_DICOM_slot ();
185 void image_save_slot ();
186 void image_close_slot ();
187 void image_properties_slot ();
189 void select_mode_slot (QAction* action);
190 void select_mouse_mode_slot (QAction* action);
191 void select_tool_slot (QAction* action);
192 void select_plane_slot (QAction* action);
193 void zoom_in_slot ();
194 void zoom_out_slot ();
195 void invert_scaling_slot ();
196 void full_screen_slot ();
197 void toggle_annotations_slot ();
198 void snap_to_image_slot ();
199 void wrap_volumes_slot ();
203 void hide_image_slot ();
204 void slice_next_slot ();
205 void slice_previous_slot ();
206 void image_next_slot ();
207 void image_previous_slot ();
208 void image_next_volume_slot ();
209 void image_previous_volume_slot ();
210 void image_goto_volume_slot ();
211 void image_next_volume_group_slot ();
212 void image_goto_volume_group_slot ();
213 void image_previous_volume_group_slot ();
214 void image_reset_slot ();
215 void image_interpolate_slot ();
216 void image_select_slot (QAction* action);
218 void reset_view_slot ();
219 void background_colour_slot ();
223 void aboutQt_slot ();
225 void process_commandline_option_slot ();
229 QPoint mouse_position_, mouse_displacement_;
230 Qt::MouseButtons buttons_;
231 Qt::KeyboardModifiers modifiers_;
243 std::unique_ptr<Mode::Base> mode;
247 const Qt::KeyboardModifiers FocusModifier, MoveModifier, RotateModifier;
248 MouseAction mouse_action;
250 Eigen::Vector3f focal_point, camera_target;
251 Eigen::Quaternionf orient;
253 int anatomical_plane, annotations;
255 bool snap_to_image_axes_and_voxel;
256 std::string current_folder;
258 float background_colour[3];
266 QActionGroup *mode_group,
272 QAction *save_action,
277 *invert_scale_action,
278 *extra_controls_action,
279 *snap_to_image_action,
283 *next_image_volume_action,
284 *prev_image_volume_action,
285 *goto_image_volume_action,
289 *next_image_volume_group_action,
290 *prev_image_volume_group_action,
291 *goto_image_volume_group_action,
292 *wrap_volumes_action,
295 *reset_windowing_action,
300 *toggle_annotations_action,
301 *show_comments_action,
302 *show_voxel_info_action,
303 *show_orientation_labels_action,
304 *show_crosshairs_action,
305 *show_colourbar_action,
306 *image_interpolate_action,
319 void keyPressEvent (QKeyEvent* event)
override;
320 void keyReleaseEvent (QKeyEvent* event)
override;
321 void mousePressEventGL (QMouseEvent* event);
322 void mouseMoveEventGL (QMouseEvent* event);
323 void mouseReleaseEventGL (QMouseEvent* event);
324 void wheelEventGL (QWheelEvent* event);
325 bool gestureEventGL (QGestureEvent* event);
327 int get_mouse_mode ();
329 void set_image_menu ();
330 void set_mode_features ();
331 void set_image_navigation_menu ();
333 void closeEvent (QCloseEvent* event)
override;
334 void create_tool (QAction* action,
bool show);
336 void process_commandline_option ();
338 template <
class Event>
void grab_mouse_state (Event* event);
339 template <
class Event>
void update_mouse_state (Event* event);
344 double best_FPS, best_FPS_time;
346 size_t current_option;
a class to hold the list of option groups
void set_scaling_all(float min, float max)
void imageVisibilityChanged(bool)
static void add_commandline_options(MR::App::OptionList &options)
void set_snap_to_image(bool onoff)
const Eigen::Vector3f & focus() const
void on_scaling_changed()
void selected_colourmap(size_t colourmap, const ColourMapButton &) override
const Image * image() const
void set_image_visibility(bool flag)
bool sync_focus_on() const
bool snap_to_image() const
bool show_crosshairs() const
Tool::CameraInteractor * active_camera_interactor()
void set_target(const Eigen::Vector3f &p)
bool get_image_visibility() const
void selected_custom_colour(const QColor &colour, const ColourMapButton &) override
void add_images(vector< std::unique_ptr< MR::Header > > &list)
Qt::MouseButtons mouse_buttons() const
QActionGroup * tools() const
bool show_colourbar() const
ColourBars colourbar_renderer
GL::Area * glwidget() const
const Eigen::Quaternionf & orientation() const
const QPoint & mouse_displacement() const
bool show_voxel_info() const
void set_scaling(float min, float max)
bool show_orientation_labels() const
friend class Window::GLArea
const Eigen::Vector3f & target() const
bool show_comments() const
void register_camera_interactor(Tool::CameraInteractor *agent=nullptr)
void orientationChanged()
void set_FOV(float value)
Mode::Base * get_current_mode() const
void fieldOfViewChanged()
void captureGL(std::string filename)
GL::Lighting & lighting()
void set_orientation(const Eigen::Quaternionf &V)
const QPoint & mouse_position() const
void set_focus(const Eigen::Vector3f &p)
void set_image_volume(size_t axis, ssize_t index)
Qt::KeyboardModifiers modifiers() const
static bool tools_floating
constexpr I round(const T x)
VectorType::Scalar value(const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
QString qstr(const std::string &s)