BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskEditorHelper Class Reference

Static class to provide MaskEditor with common settings (colors, gradients, etc) More...

Public Types

enum  EViewTypes {
  IMASKVIEW = QGraphicsItem::UserType + 1 , RECTANGLEBASE , RECTANGLE , SIZEHANDLE ,
  POLYGON , POLYGONPOINT , VERTICALLINE , HORIZONTALLINE ,
  ELLIPSE , MASKALL , REGIONOFINTEREST , MASKCONTAINER ,
  MASKGRAPHICSPROXY
}
 

Static Public Member Functions

static QRectF getMarkerRectangle (const QPointF &pos)
 
static QBrush getMaskBrush (bool mask_value)
 
static QPen getMaskPen (bool mask_value)
 
static QBrush getSelectionMarkerBrush ()
 
static QPen getSelectionMarkerPen ()
 

Detailed Description

Static class to provide MaskEditor with common settings (colors, gradients, etc)

Definition at line 27 of file MaskEditorHelper.h.

Member Enumeration Documentation

◆ EViewTypes

Enumerator
IMASKVIEW 
RECTANGLEBASE 
RECTANGLE 
SIZEHANDLE 
POLYGON 
POLYGONPOINT 
VERTICALLINE 
HORIZONTALLINE 
ELLIPSE 
MASKALL 
REGIONOFINTEREST 
MASKCONTAINER 
MASKGRAPHICSPROXY 

Definition at line 29 of file MaskEditorHelper.h.

Member Function Documentation

◆ getMarkerRectangle()

QRectF MaskEditorHelper::getMarkerRectangle ( const QPointF &  pos)
static

Definition at line 55 of file MaskEditorHelper.cpp.

56 {
57  QRectF result(0, 0, 7, 7);
58  result.moveCenter(pos);
59  return result;
60 }

◆ getMaskBrush()

QBrush MaskEditorHelper::getMaskBrush ( bool  mask_value)
static

Definition at line 34 of file MaskEditorHelper.cpp.

35 {
36  QBrush result;
37  result.setStyle(Qt::SolidPattern);
38  if (mask_value) {
39  result.setColor(QColor(209, 109, 97)); // deep red
40  } else {
41  result.setColor(QColor(0, 213, 106)); // deep green
42  }
43  return result;
44 }

Referenced by EllipseView::paint(), VerticalLineView::paint(), HorizontalLineView::paint(), PolygonView::paint(), and RectangleView::paint().

◆ getMaskPen()

QPen MaskEditorHelper::getMaskPen ( bool  mask_value)
static

Definition at line 46 of file MaskEditorHelper.cpp.

47 {
48  if (mask_value) {
49  return QPen(QColor(165, 80, 76)); // dark red
50  } else {
51  return QPen(QColor(0, 140, 70)); // dark green
52  }
53 }

Referenced by EllipseView::paint(), VerticalLineView::paint(), HorizontalLineView::paint(), PolygonView::paint(), and RectangleView::paint().

◆ getSelectionMarkerBrush()

QBrush MaskEditorHelper::getSelectionMarkerBrush ( )
static

Definition at line 21 of file MaskEditorHelper.cpp.

22 {
23  QBrush result;
24  result.setStyle(Qt::SolidPattern);
25  result.setColor(QColor(226, 235, 244));
26  return result;
27 }

Referenced by PolygonPointView::paint(), and SizeHandleElement::paint().

◆ getSelectionMarkerPen()

QPen MaskEditorHelper::getSelectionMarkerPen ( )
static

Definition at line 29 of file MaskEditorHelper.cpp.

30 {
31  return QPen(QColor(99, 162, 217));
32 }

Referenced by PolygonPointView::paint(), and SizeHandleElement::paint().


The documentation for this class was generated from the following files: