BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides 3D object generation for RealSpace presentation.
Definition at line 42 of file RealSpaceCanvas.h.
Public Types | |
using | ItemForRealSpace = std::variant< MultiLayerItem *, LayerItem *, ParticleLayoutItem *, ItemWithParticles * > |
Defines the item types which can be the "current item". More... | |
Public Member Functions | |
RealSpaceCanvas (QWidget *parent=nullptr) | |
void | changeLayerSize (double layerSizeChangeScale) |
template<typename T > | |
T | currentItemAs () const |
void | defaultView () |
void | resetScene () |
void | savePicture () |
void | setCurrentItem (MultiLayerItem *containingMultiLayerItem, ItemForRealSpace item) |
void | sideView () |
void | topView () |
void | updateScene () |
Protected Member Functions | |
void | showEvent (QShowEvent *) override |
Private Member Functions | |
void | savePicture (const QPixmap &pixmap) |
Private Attributes | |
CautionSign * | m_cautionSign |
MultiLayerItem * | m_containingMultiLayerItem |
std::optional< ItemForRealSpace > | m_currentItem |
bool | m_firstView |
std::unique_ptr< GUI::RealSpace::Model > | m_realSpaceModel |
SceneGeometry | m_sceneGeometry |
GUI::RealSpace::Canvas * | m_view |
using RealSpaceCanvas::ItemForRealSpace = std::variant<MultiLayerItem*, LayerItem*, ParticleLayoutItem*, ItemWithParticles*> |
Defines the item types which can be the "current item".
Definition at line 47 of file RealSpaceCanvas.h.
RealSpaceCanvas::RealSpaceCanvas | ( | QWidget * | parent = nullptr | ) |
Definition at line 31 of file RealSpaceCanvas.cpp.
References m_view.
void RealSpaceCanvas::changeLayerSize | ( | double | layerSizeChangeScale | ) |
Definition at line 60 of file RealSpaceCanvas.cpp.
References SceneGeometry::layerSize, m_currentItem, m_sceneGeometry, and updateScene().
Referenced by RealSpacePanel::RealSpacePanel().
T RealSpaceCanvas::currentItemAs |
Definition at line 79 of file RealSpaceCanvas.h.
References m_currentItem.
Referenced by SampleView::onAboutToRemoveItem().
void RealSpaceCanvas::defaultView | ( | ) |
Definition at line 152 of file RealSpaceCanvas.cpp.
References GUI::RealSpace::Canvas::defaultView(), and m_view.
Referenced by RealSpacePanel::RealSpacePanel(), and setCurrentItem().
void RealSpaceCanvas::resetScene | ( | ) |
Definition at line 144 of file RealSpaceCanvas.cpp.
References m_containingMultiLayerItem, m_currentItem, m_realSpaceModel, m_view, and GUI::RealSpace::Canvas::setModel().
Referenced by setCurrentItem().
void RealSpaceCanvas::savePicture | ( | ) |
|
private |
Definition at line 85 of file RealSpaceCanvas.cpp.
References appSettings, gSessionData, SessionData::projectDocument, ApplicationSettings::useNativeFileDialog(), and GUI::View::Helpers::warning().
void RealSpaceCanvas::setCurrentItem | ( | MultiLayerItem * | containingMultiLayerItem, |
ItemForRealSpace | item | ||
) |
Definition at line 45 of file RealSpaceCanvas.cpp.
References defaultView(), m_containingMultiLayerItem, m_currentItem, resetScene(), and updateScene().
Referenced by SampleView::onRequestViewInRealSpace().
|
overrideprotected |
Definition at line 77 of file RealSpaceCanvas.cpp.
References GUI::RealSpace::Canvas::defaultView(), m_firstView, m_view, and updateScene().
void RealSpaceCanvas::sideView | ( | ) |
Definition at line 157 of file RealSpaceCanvas.cpp.
References m_view, and GUI::RealSpace::Canvas::sideView().
Referenced by RealSpacePanel::RealSpacePanel().
void RealSpaceCanvas::topView | ( | ) |
Definition at line 162 of file RealSpaceCanvas.cpp.
References m_view, and GUI::RealSpace::Canvas::topView().
Referenced by RealSpacePanel::RealSpacePanel().
void RealSpaceCanvas::updateScene | ( | ) |
Definition at line 111 of file RealSpaceCanvas.cpp.
References GUI::RealSpace::Canvas::cam(), CautionSign::clear(), MaterialItem::color(), GUI::RealSpace::Camera::getPos(), m_cautionSign, m_containingMultiLayerItem, m_currentItem, m_realSpaceModel, m_sceneGeometry, m_view, MaterialItems::materialFromName(), MultiLayerItem::materialItems(), RealSpaceBuilder::populate(), CautionSign::setCautionMessage(), and GUI::RealSpace::Canvas::setModel().
Referenced by SampleView::SampleView(), changeLayerSize(), setCurrentItem(), and showEvent().
|
private |
Definition at line 72 of file RealSpaceCanvas.h.
Referenced by updateScene().
|
private |
Definition at line 74 of file RealSpaceCanvas.h.
Referenced by resetScene(), setCurrentItem(), and updateScene().
|
private |
Definition at line 73 of file RealSpaceCanvas.h.
Referenced by changeLayerSize(), currentItemAs(), resetScene(), setCurrentItem(), and updateScene().
|
private |
Definition at line 75 of file RealSpaceCanvas.h.
Referenced by showEvent().
|
private |
Definition at line 70 of file RealSpaceCanvas.h.
Referenced by resetScene(), and updateScene().
|
private |
Definition at line 71 of file RealSpaceCanvas.h.
Referenced by changeLayerSize(), and updateScene().
|
private |
Definition at line 69 of file RealSpaceCanvas.h.
Referenced by RealSpaceCanvas(), defaultView(), resetScene(), showEvent(), sideView(), topView(), and updateScene().