BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
Canvas () | |
~Canvas () override | |
Camera * | cam () |
void | defaultView () |
Model * | getModel () |
void | horizontalCameraTurn (float angle) |
void | setBgColor (QColor const &) |
void | setCamera (Camera *) |
void | setModel (Model *) |
void | setProgram (Program *) |
void | sideView () |
void | topView () |
void | verticalCameraTurn (float angle) |
Private Types | |
enum | { btnNONE , btnTURN , btnZOOM } |
Private Member Functions | |
void | cleanup () |
void | draw (QColor const &, QMatrix4x4 const &, Geometry const &) |
void | initializeGL () override |
bool | isInitialized () const |
void | mouseMoveEvent (QMouseEvent *) override |
void | mousePressEvent (QMouseEvent *) override |
void | mouseReleaseEvent (QMouseEvent *) override |
void | paintGL () override |
void | releaseBuffer (Geometry const *) |
void | releaseBuffers () |
void | resizeGL (int, int) override |
void | setCamera (bool full=true) |
QVector3D | unproject (QPoint const &) |
void | wheelEvent (QWheelEvent *) override |
Private Attributes | |
float | aspectRatio |
QHash< Geometry const *, Buffer * > | buffers |
Camera * | camera |
float | colorBgB |
float | colorBgG |
float | colorBgR |
int | currentZoomLevel |
QPoint | e_last |
bool | m_isInitializedGL |
QMatrix4x4 | matModel |
QMatrix4x4 | matProj |
Model * | model |
QMetaObject::Connection | modelUpdated |
enum GUI::RealSpace::Canvas:: { ... } | mouseButton |
Program * | program |
QRect | viewport |
Friends | |
class | Object |
|
private |
GUI::RealSpace::Canvas::Canvas | ( | ) |
Definition at line 53 of file canvas.cpp.
References GUI::RealSpace::GeometryStore::deletingGeometry(), GUI::RealSpace::geometryStore(), and releaseBuffer().
|
override |
Definition at line 67 of file canvas.cpp.
References cleanup().
|
inline |
Definition at line 59 of file canvas.h.
References camera.
Referenced by GUI::RealSpace::Widget3D::cam(), and RealSpaceCanvas::updateScene().
|
private |
Definition at line 297 of file canvas.cpp.
References camera, m_isInitializedGL, program, and releaseBuffers().
Referenced by ~Canvas(), and initializeGL().
void GUI::RealSpace::Canvas::defaultView | ( | ) |
Definition at line 317 of file canvas.cpp.
References GUI::RealSpace::Vector3D::_z, camera, currentZoomLevel, GUI::RealSpace::Camera::endTransform(), isInitialized(), GUI::RealSpace::Camera::lookAt(), and GUI::RealSpace::Camera::lookAt3DAxes().
Referenced by GUI::RealSpace::Widget3D::defaultView(), RealSpaceCanvas::defaultView(), and RealSpaceCanvas::showEvent().
|
private |
Definition at line 282 of file canvas.cpp.
References buffers, GUI::RealSpace::Buffer::draw(), program, and GUI::RealSpace::Program::set().
Referenced by GUI::RealSpace::Object::draw().
Model * GUI::RealSpace::Canvas::getModel | ( | ) |
Definition at line 112 of file canvas.cpp.
References model.
Referenced by GUI::RealSpace::Widget3D::model().
void GUI::RealSpace::Canvas::horizontalCameraTurn | ( | float | angle | ) |
Definition at line 391 of file canvas.cpp.
References camera, GUI::RealSpace::cross(), GUI::RealSpace::Camera::Position::ctr, GUI::RealSpace::dot(), GUI::RealSpace::Camera::endTransform(), GUI::RealSpace::Camera::Position::eye, GUI::RealSpace::Camera::getPos(), GUI::RealSpace::Camera::getPos3DAxes(), isInitialized(), GUI::RealSpace::Camera::lookAt(), GUI::RealSpace::Camera::lookAt3DAxes(), GUI::RealSpace::Vector3D::normalized(), and GUI::RealSpace::Camera::Position::up.
Referenced by mouseMoveEvent().
|
overrideprivate |
Definition at line 128 of file canvas.cpp.
References camera, cleanup(), m_isInitializedGL, program, setCamera(), and setProgram().
|
private |
Definition at line 312 of file canvas.cpp.
References m_isInitializedGL, and model.
Referenced by defaultView(), horizontalCameraTurn(), sideView(), topView(), and verticalCameraTurn().
|
overrideprivate |
Definition at line 214 of file canvas.cpp.
References btnTURN, btnZOOM, camera, e_last, horizontalCameraTurn(), mouseButton, verticalCameraTurn(), viewport, and GUI::RealSpace::Camera::zoomBy().
|
overrideprivate |
Definition at line 193 of file canvas.cpp.
References btnNONE, btnTURN, btnZOOM, camera, e_last, GUI::RealSpace::Camera::matModel, matModel, GUI::RealSpace::Camera::matProj, matProj, and mouseButton.
|
overrideprivate |
Definition at line 244 of file canvas.cpp.
References camera, and GUI::RealSpace::Camera::endTransform().
|
overrideprivate |
Definition at line 149 of file canvas.cpp.
References camera, colorBgB, colorBgG, colorBgR, GUI::RealSpace::Model::draw(), GUI::RealSpace::Model::drawBlend(), GUI::RealSpace::Program::init(), GUI::RealSpace::Camera::matModel3DAxes, model, GUI::RealSpace::Model::modelIsEmpty(), program, GUI::RealSpace::Program::set(), GUI::RealSpace::Program::setAxis(), GUI::RealSpace::Program::setMatModel(), and viewport.
|
private |
|
private |
Definition at line 275 of file canvas.cpp.
References buffers.
Referenced by cleanup(), and setModel().
|
overrideprivate |
Definition at line 141 of file canvas.cpp.
References aspectRatio, setCamera(), and viewport.
void GUI::RealSpace::Canvas::setBgColor | ( | QColor const & | c | ) |
Definition at line 72 of file canvas.cpp.
References colorBgB, colorBgG, and colorBgR.
Referenced by GUI::RealSpace::Widget3D::setBackground().
|
private |
Definition at line 117 of file canvas.cpp.
References aspectRatio, camera, GUI::RealSpace::Model::defCamPos, GUI::RealSpace::Camera::lookAt(), model, and GUI::RealSpace::Camera::setAspectRatio().
void GUI::RealSpace::Canvas::setCamera | ( | Camera * | c | ) |
Definition at line 80 of file canvas.cpp.
References camera.
Referenced by initializeGL(), resizeGL(), and setModel().
void GUI::RealSpace::Canvas::setModel | ( | Model * | m | ) |
Definition at line 94 of file canvas.cpp.
References camera, model, modelUpdated, releaseBuffers(), GUI::RealSpace::Camera::set(), setCamera(), and GUI::RealSpace::Model::updated().
Referenced by RealSpaceCanvas::resetScene(), GUI::RealSpace::Widget3D::setModel(), and RealSpaceCanvas::updateScene().
void GUI::RealSpace::Canvas::setProgram | ( | Program * | p | ) |
Definition at line 86 of file canvas.cpp.
References GUI::RealSpace::Program::needsInit(), and program.
Referenced by initializeGL().
void GUI::RealSpace::Canvas::sideView | ( | ) |
Definition at line 336 of file canvas.cpp.
References GUI::RealSpace::Vector3D::_z, camera, currentZoomLevel, GUI::RealSpace::Camera::endTransform(), isInitialized(), GUI::RealSpace::Camera::lookAt(), GUI::RealSpace::Camera::lookAt3DAxes(), and GUI::RealSpace::Vector3D::y.
Referenced by GUI::RealSpace::Widget3D::sideView(), and RealSpaceCanvas::sideView().
void GUI::RealSpace::Canvas::topView | ( | ) |
Definition at line 363 of file canvas.cpp.
References GUI::RealSpace::Vector3D::_z, camera, currentZoomLevel, GUI::RealSpace::Camera::endTransform(), isInitialized(), GUI::RealSpace::Camera::lookAt(), GUI::RealSpace::Camera::lookAt3DAxes(), and GUI::RealSpace::Vector3D::z.
Referenced by GUI::RealSpace::Widget3D::topView(), and RealSpaceCanvas::topView().
|
private |
void GUI::RealSpace::Canvas::verticalCameraTurn | ( | float | angle | ) |
Definition at line 436 of file canvas.cpp.
References camera, GUI::RealSpace::cross(), GUI::RealSpace::Camera::Position::ctr, GUI::RealSpace::dot(), GUI::RealSpace::Camera::endTransform(), GUI::RealSpace::Camera::Position::eye, GUI::RealSpace::Camera::getPos(), GUI::RealSpace::Camera::getPos3DAxes(), isInitialized(), GUI::RealSpace::Camera::lookAt(), GUI::RealSpace::Camera::lookAt3DAxes(), GUI::RealSpace::Vector3D::normalized(), and GUI::RealSpace::Camera::Position::up.
Referenced by mouseMoveEvent().
|
overrideprivate |
Definition at line 252 of file canvas.cpp.
References camera, currentZoomLevel, GUI::RealSpace::Camera::endTransform(), and GUI::RealSpace::Camera::zoomBy().
|
private |
Definition at line 63 of file canvas.h.
Referenced by resizeGL(), and setCamera().
Definition at line 88 of file canvas.h.
Referenced by draw(), releaseBuffer(), and releaseBuffers().
|
private |
Definition at line 82 of file canvas.h.
Referenced by cam(), cleanup(), defaultView(), horizontalCameraTurn(), initializeGL(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), paintGL(), setCamera(), setModel(), sideView(), topView(), verticalCameraTurn(), and wheelEvent().
|
private |
Definition at line 63 of file canvas.h.
Referenced by paintGL(), and setBgColor().
|
private |
Definition at line 63 of file canvas.h.
Referenced by paintGL(), and setBgColor().
|
private |
Definition at line 63 of file canvas.h.
Referenced by paintGL(), and setBgColor().
|
private |
Definition at line 64 of file canvas.h.
Referenced by defaultView(), sideView(), topView(), and wheelEvent().
|
private |
Definition at line 72 of file canvas.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
private |
Definition at line 97 of file canvas.h.
Referenced by cleanup(), initializeGL(), and isInitialized().
|
private |
Definition at line 73 of file canvas.h.
Referenced by mousePressEvent(), and unproject().
|
private |
Definition at line 73 of file canvas.h.
Referenced by mousePressEvent(), and unproject().
|
private |
Definition at line 84 of file canvas.h.
Referenced by getModel(), isInitialized(), paintGL(), setCamera(), and setModel().
|
private |
Definition at line 86 of file canvas.h.
Referenced by setModel().
enum { ... } GUI::RealSpace::Canvas::mouseButton |
Referenced by mouseMoveEvent(), and mousePressEvent().
|
private |
Definition at line 83 of file canvas.h.
Referenced by cleanup(), draw(), initializeGL(), paintGL(), and setProgram().
|
private |
Definition at line 62 of file canvas.h.
Referenced by mouseMoveEvent(), paintGL(), resizeGL(), and unproject().