Mantid
Loading...
Searching...
No Matches
qt
widgets
plugins
algorithm_dialogs
inc
MantidQtWidgets
Plugins
AlgorithmDialogs
MantidGLWidget.h
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2009 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8
9
//-----------------------------------------
10
// Includes
11
//-----------------------------------------
12
#include <QGLWidget>
13
#include <memory>
14
15
#include "
MantidKernel/V3D.h
"
16
17
//-----------------------------------------
18
// Forward Declarations
19
//-----------------------------------------
20
namespace
Mantid
{
21
namespace
Geometry {
22
class
IObject;
23
}
24
}
// namespace Mantid
25
26
namespace
MantidQt
{
27
namespace
CustomDialogs {
28
36
class
MantidGLWidget
:
public
QGLWidget {
37
38
Q_OBJECT
39
40
public
:
42
MantidGLWidget
(QWidget *parent =
nullptr
);
44
~MantidGLWidget
()
override
;
45
47
void
setDisplayObject
(std::shared_ptr<Mantid::Geometry::IObject>
object
);
48
49
protected
:
51
void
initializeGL
()
override
;
53
void
resizeGL
(
int
width,
int
height
)
override
;
55
void
paintGL
()
override
;
56
57
private
:
59
void
setXRotation
(
int
angle);
61
void
setYRotation
(
int
angle);
63
void
setZRotation
(
int
angle);
65
void
setOrthoProjectionMatrix
(GLdouble aspect_ratio);
66
67
private
:
69
void
normalizeAngle
(
int
*angle);
71
void
mousePressEvent
(QMouseEvent *event)
override
;
73
void
mouseMoveEvent
(QMouseEvent *event)
override
;
75
std::shared_ptr<Mantid::Geometry::IObject>
m_display_object
;
77
GLdouble
m_x_rot
,
m_y_rot
,
m_z_rot
;
79
GLdouble
m_scale_factor
;
81
QPoint
m_click_point
;
83
GLdouble
m_bb_widths
[3];
85
GLdouble
m_bb_centres
[3];
86
};
87
}
// namespace CustomDialogs
88
}
// namespace MantidQt
height
double height
Definition:
GetAllEi.cpp:155
V3D.h
MantidQt::CustomDialogs::MantidGLWidget
This class provides a widget to display a Mantid Geometry object using OpenGL.
Definition:
MantidGLWidget.h:36
MantidQt::CustomDialogs::MantidGLWidget::setYRotation
void setYRotation(int angle)
Set the rotation angle around the Y-axis.
Definition:
MantidGLWidget.cpp:203
MantidQt::CustomDialogs::MantidGLWidget::m_bb_centres
GLdouble m_bb_centres[3]
The centre of the bounding box.
Definition:
MantidGLWidget.h:85
MantidQt::CustomDialogs::MantidGLWidget::paintGL
void paintGL() override
Render the scene.
Definition:
MantidGLWidget.cpp:121
MantidQt::CustomDialogs::MantidGLWidget::resizeGL
void resizeGL(int width, int height) override
Set up the viewport.
Definition:
MantidGLWidget.cpp:152
MantidQt::CustomDialogs::MantidGLWidget::m_x_rot
GLdouble m_x_rot
The current X, Y and Z rotations.
Definition:
MantidGLWidget.h:77
MantidQt::CustomDialogs::MantidGLWidget::m_y_rot
GLdouble m_y_rot
Definition:
MantidGLWidget.h:77
MantidQt::CustomDialogs::MantidGLWidget::m_click_point
QPoint m_click_point
The location of the cursor when the mouse button was clicked.
Definition:
MantidGLWidget.h:81
MantidQt::CustomDialogs::MantidGLWidget::initializeGL
void initializeGL() override
Initialize the renderer.
Definition:
MantidGLWidget.cpp:87
MantidQt::CustomDialogs::MantidGLWidget::setXRotation
void setXRotation(int angle)
Set the rotation angle around the X-axis.
Definition:
MantidGLWidget.cpp:191
MantidQt::CustomDialogs::MantidGLWidget::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override
Handle a MouseMoveEvent.
Definition:
MantidGLWidget.cpp:171
MantidQt::CustomDialogs::MantidGLWidget::m_scale_factor
GLdouble m_scale_factor
The scaling factor to use.
Definition:
MantidGLWidget.h:79
MantidQt::CustomDialogs::MantidGLWidget::~MantidGLWidget
~MantidGLWidget() override
Destructor.
Definition:
MantidGLWidget.cpp:44
MantidQt::CustomDialogs::MantidGLWidget::setOrthoProjectionMatrix
void setOrthoProjectionMatrix(GLdouble aspect_ratio)
Calculate and set the orthographic projection matrix.
Definition:
MantidGLWidget.cpp:223
MantidQt::CustomDialogs::MantidGLWidget::setZRotation
void setZRotation(int angle)
Set the rotation angle around the Z-axis.
Definition:
MantidGLWidget.cpp:215
MantidQt::CustomDialogs::MantidGLWidget::setDisplayObject
void setDisplayObject(std::shared_ptr< Mantid::Geometry::IObject > object)
Set the Mantid geometry object.
Definition:
MantidGLWidget.cpp:50
MantidQt::CustomDialogs::MantidGLWidget::m_bb_widths
GLdouble m_bb_widths[3]
The separation of the bounding box sides in x,y,z respectively.
Definition:
MantidGLWidget.h:83
MantidQt::CustomDialogs::MantidGLWidget::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Handle a MousePressEvent.
Definition:
MantidGLWidget.cpp:165
MantidQt::CustomDialogs::MantidGLWidget::m_z_rot
GLdouble m_z_rot
Definition:
MantidGLWidget.h:77
MantidQt::CustomDialogs::MantidGLWidget::m_display_object
std::shared_ptr< Mantid::Geometry::IObject > m_display_object
A Mantid geometry object.
Definition:
MantidGLWidget.h:75
MantidQt::CustomDialogs::MantidGLWidget::normalizeAngle
void normalizeAngle(int *angle)
Ensure the angle is in the range 0 < angle < 360.
Definition:
MantidGLWidget.cpp:267
MantidQt
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
Definition:
AddWorkspaceDialog.h:20
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition:
AbsorptionCorrection.h:18
Generated on Tue Jan 3 2023 11:58:02 for Mantid by
1.9.5