BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Helper class for MaskGraphicsScene to hold drawing conditions. More...
Public Member Functions | |
MaskDrawingContext () | |
QString | activityToModelType () const |
Returns model type corresponding to current activity. More... | |
int | activityToRow () const |
Returns model row corresponding to given activity. More... | |
MaskEditorFlags::Activity | getActivityType () const |
bool | getMaskValue () const |
bool | isActivityRequiresDrawingCancel (MaskEditorFlags::Activity proposed_new_activity) |
return true, if proposed activity requires the cancel of drawing i.e. More... | |
bool | isDrawingInProgress () const |
bool | isEllipseMode () const |
bool | isHorizontalLineMode () const |
bool | isInZoomMode () const |
bool | isLineMode () const |
bool | isMaskAllMode () const |
bool | isPolygonMode () const |
bool | isRectangleMode () const |
bool | isRectangleShapeMode () const |
bool | isROIMode () const |
bool | isSelectionMode () const |
bool | isVerticalLineMode () const |
void | setActivityType (MaskEditorFlags::Activity value) |
void | setDrawingInProgress (bool value) |
void | setMaskValue (MaskEditorFlags::MaskValue value) |
Private Attributes | |
MaskEditorFlags::Activity | m_current_activity |
bool | m_drawing_in_progress |
MaskEditorFlags::MaskValue | m_mask_value |
Helper class for MaskGraphicsScene to hold drawing conditions.
Definition at line 22 of file MaskDrawingContext.h.
MaskDrawingContext::MaskDrawingContext | ( | ) |
Definition at line 17 of file MaskDrawingContext.cpp.
QString MaskDrawingContext::activityToModelType | ( | ) | const |
Returns model type corresponding to current activity.
Definition at line 124 of file MaskDrawingContext.cpp.
References isEllipseMode(), isRectangleMode(), and isROIMode().
Referenced by MaskGraphicsScene::processRectangleShapeItem().
int MaskDrawingContext::activityToRow | ( | ) | const |
Returns model row corresponding to given activity.
All shapes, except ROI, will be added on top of each other. ROI shape will be added at the bottom.
Definition at line 138 of file MaskDrawingContext.cpp.
References isROIMode().
Referenced by MaskGraphicsScene::processRectangleShapeItem().
MaskEditorFlags::Activity MaskDrawingContext::getActivityType | ( | ) | const |
Definition at line 24 of file MaskDrawingContext.cpp.
References m_current_activity.
bool MaskDrawingContext::getMaskValue | ( | ) | const |
Definition at line 106 of file MaskDrawingContext.cpp.
References m_mask_value.
Referenced by MaskGraphicsScene::processLineItem(), MaskGraphicsScene::processPolygonItem(), and MaskGraphicsScene::processRectangleShapeItem().
bool MaskDrawingContext::isActivityRequiresDrawingCancel | ( | MaskEditorFlags::Activity | proposed_new_activity | ) |
return true, if proposed activity requires the cancel of drawing i.e.
there is an ungoing polygon drawing, but user wants to start other drawing
Definition at line 113 of file MaskDrawingContext.cpp.
References isDrawingInProgress(), isPolygonMode(), and MaskEditorFlags::PAN_ZOOM_MODE.
Referenced by MaskGraphicsScene::onActivityModeChanged().
bool MaskDrawingContext::isDrawingInProgress | ( | ) | const |
Definition at line 96 of file MaskDrawingContext.cpp.
References m_drawing_in_progress.
Referenced by isActivityRequiresDrawingCancel(), and MaskGraphicsScene::isDrawingInProgress().
bool MaskDrawingContext::isEllipseMode | ( | ) | const |
Definition at line 61 of file MaskDrawingContext.cpp.
References MaskEditorFlags::ELLIPSE_MODE, and m_current_activity.
Referenced by activityToModelType().
bool MaskDrawingContext::isHorizontalLineMode | ( | ) | const |
Definition at line 81 of file MaskDrawingContext.cpp.
References MaskEditorFlags::HORIZONTAL_LINE_MODE, and m_current_activity.
Referenced by MaskGraphicsScene::drawForeground(), isLineMode(), and MaskGraphicsScene::processLineItem().
bool MaskDrawingContext::isInZoomMode | ( | ) | const |
Definition at line 44 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::PAN_ZOOM_MODE.
Referenced by MaskGraphicsScene::onActivityModeChanged(), and MaskGraphicsScene::updateCursors().
bool MaskDrawingContext::isLineMode | ( | ) | const |
Definition at line 71 of file MaskDrawingContext.cpp.
References isHorizontalLineMode(), and isVerticalLineMode().
Referenced by MaskGraphicsScene::drawForeground(), MaskGraphicsScene::isValidForLineDrawing(), and MaskGraphicsScene::mouseMoveEvent().
bool MaskDrawingContext::isMaskAllMode | ( | ) | const |
Definition at line 86 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::MASKALL_MODE.
Referenced by MaskGraphicsScene::isValidForMaskAllDrawing().
bool MaskDrawingContext::isPolygonMode | ( | ) | const |
Definition at line 66 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::POLYGON_MODE.
Referenced by MaskGraphicsScene::currentPolygon(), isActivityRequiresDrawingCancel(), MaskGraphicsScene::isValidForPolygonDrawing(), MaskGraphicsScene::mouseMoveEvent(), and MaskGraphicsScene::processPolygonItem().
bool MaskDrawingContext::isRectangleMode | ( | ) | const |
Definition at line 56 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::RECTANGLE_MODE.
Referenced by activityToModelType().
bool MaskDrawingContext::isRectangleShapeMode | ( | ) | const |
Definition at line 49 of file MaskDrawingContext.cpp.
References MaskEditorFlags::ELLIPSE_MODE, m_current_activity, MaskEditorFlags::RECTANGLE_MODE, and MaskEditorFlags::ROI_MODE.
Referenced by MaskGraphicsScene::isValidForRectangleShapeDrawing(), MaskGraphicsScene::mouseMoveEvent(), and MaskGraphicsScene::mouseReleaseEvent().
bool MaskDrawingContext::isROIMode | ( | ) | const |
Definition at line 91 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::ROI_MODE.
Referenced by activityToModelType(), activityToRow(), MaskGraphicsScene::isValidForRectangleShapeDrawing(), and MaskGraphicsScene::processRectangleShapeItem().
bool MaskDrawingContext::isSelectionMode | ( | ) | const |
Definition at line 39 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::SELECTION_MODE.
bool MaskDrawingContext::isVerticalLineMode | ( | ) | const |
Definition at line 76 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::VERTICAL_LINE_MODE.
Referenced by MaskGraphicsScene::drawForeground(), isLineMode(), and MaskGraphicsScene::processLineItem().
void MaskDrawingContext::setActivityType | ( | MaskEditorFlags::Activity | value | ) |
Definition at line 29 of file MaskDrawingContext.cpp.
References m_current_activity.
Referenced by MaskGraphicsScene::onActivityModeChanged().
void MaskDrawingContext::setDrawingInProgress | ( | bool | value | ) |
Definition at line 101 of file MaskDrawingContext.cpp.
References m_drawing_in_progress.
Referenced by MaskGraphicsScene::setDrawingInProgress().
void MaskDrawingContext::setMaskValue | ( | MaskEditorFlags::MaskValue | value | ) |
Definition at line 34 of file MaskDrawingContext.cpp.
References m_mask_value.
Referenced by MaskGraphicsScene::onMaskValueChanged().
|
private |
Definition at line 53 of file MaskDrawingContext.h.
Referenced by getActivityType(), isEllipseMode(), isHorizontalLineMode(), isInZoomMode(), isMaskAllMode(), isPolygonMode(), isRectangleMode(), isRectangleShapeMode(), isROIMode(), isSelectionMode(), isVerticalLineMode(), and setActivityType().
|
private |
Definition at line 55 of file MaskDrawingContext.h.
Referenced by isDrawingInProgress(), and setDrawingInProgress().
|
private |
Definition at line 54 of file MaskDrawingContext.h.
Referenced by getMaskValue(), and setMaskValue().