BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Helper class for MaskGraphicsScene to hold drawing conditions.
Definition at line 22 of file MaskDrawingContext.h.
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. All shapes, except ROI, will be added on top of each other. ROI shape will be added at the bottom. More... | |
MaskEditorFlags::Activity | getActivityType () const |
bool | getMaskValue () const |
bool | isActivityRequiresDrawingCancel (MaskEditorFlags::Activity proposed_new_activity) const |
Returns true, if proposed activity requires the cancel of drawing i.e. there is an ungoing polygon drawing, but user wants to start other drawing. 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 |
MaskDrawingContext::MaskDrawingContext | ( | ) |
Definition at line 18 of file MaskDrawingContext.cpp.
QString MaskDrawingContext::activityToModelType | ( | ) | const |
Returns model type corresponding to current activity.
Definition at line 123 of file MaskDrawingContext.cpp.
References isEllipseMode(), isRectangleMode(), isROIMode(), RectangleItem::M_TYPE, RegionOfInterestItem::M_TYPE, and EllipseItem::M_TYPE.
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 137 of file MaskDrawingContext.cpp.
References isROIMode().
Referenced by MaskGraphicsScene::processRectangleShapeItem().
MaskEditorFlags::Activity MaskDrawingContext::getActivityType | ( | ) | const |
Definition at line 25 of file MaskDrawingContext.cpp.
References m_current_activity.
bool MaskDrawingContext::getMaskValue | ( | ) | const |
Definition at line 107 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 | ) | const |
Returns 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 114 of file MaskDrawingContext.cpp.
References isDrawingInProgress(), isPolygonMode(), and MaskEditorFlags::PAN_ZOOM_MODE.
Referenced by MaskGraphicsScene::onActivityModeChanged().
bool MaskDrawingContext::isDrawingInProgress | ( | ) | const |
Definition at line 97 of file MaskDrawingContext.cpp.
References m_drawing_in_progress.
Referenced by isActivityRequiresDrawingCancel(), and MaskGraphicsScene::isDrawingInProgress().
bool MaskDrawingContext::isEllipseMode | ( | ) | const |
Definition at line 62 of file MaskDrawingContext.cpp.
References MaskEditorFlags::ELLIPSE_MODE, and m_current_activity.
Referenced by activityToModelType().
bool MaskDrawingContext::isHorizontalLineMode | ( | ) | const |
Definition at line 82 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 45 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 72 of file MaskDrawingContext.cpp.
References isHorizontalLineMode(), and isVerticalLineMode().
Referenced by MaskGraphicsScene::drawForeground(), MaskGraphicsScene::isValidForLineDrawing(), and MaskGraphicsScene::mouseMoveEvent().
bool MaskDrawingContext::isMaskAllMode | ( | ) | const |
Definition at line 87 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::MASKALL_MODE.
Referenced by MaskGraphicsScene::isValidForMaskAllDrawing().
bool MaskDrawingContext::isPolygonMode | ( | ) | const |
Definition at line 67 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 57 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::RECTANGLE_MODE.
Referenced by activityToModelType().
bool MaskDrawingContext::isRectangleShapeMode | ( | ) | const |
Definition at line 50 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 92 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 40 of file MaskDrawingContext.cpp.
References m_current_activity, and MaskEditorFlags::SELECTION_MODE.
bool MaskDrawingContext::isVerticalLineMode | ( | ) | const |
Definition at line 77 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 30 of file MaskDrawingContext.cpp.
References m_current_activity.
Referenced by MaskGraphicsScene::onActivityModeChanged().
void MaskDrawingContext::setDrawingInProgress | ( | bool | value | ) |
Definition at line 102 of file MaskDrawingContext.cpp.
References m_drawing_in_progress.
Referenced by MaskGraphicsScene::setDrawingInProgress().
void MaskDrawingContext::setMaskValue | ( | MaskEditorFlags::MaskValue | value | ) |
Definition at line 35 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().