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

Factory to construct views out of MaskItems for MaskGraphicsScene. More...

Static Public Member Functions

static IShape2DViewcreateMaskView (SessionItem *item, ISceneAdaptor *adaptor=0)
 

Detailed Description

Factory to construct views out of MaskItems for MaskGraphicsScene.

Definition at line 26 of file MaskViewFactory.h.

Member Function Documentation

◆ createMaskView()

IShape2DView * MaskViewFactory::createMaskView ( SessionItem item,
ISceneAdaptor adaptor = 0 
)
static

Definition at line 27 of file MaskViewFactory.cpp.

28 {
29  IShape2DView* result(0);
30  QString model_type = item->modelType();
31 
32  if (model_type == "MaskContainer") {
33  result = new MaskContainerView();
34  }
35 
36  else if (model_type == "ProjectionContainer") {
37  result = new MaskContainerView();
38  }
39 
40  else if (model_type == "RectangleMask") {
41  result = new RectangleView();
42  }
43 
44  else if (model_type == "PolygonMask") {
45  result = new PolygonView();
46  }
47 
48  else if (model_type == "PolygonPoint") {
49  result = new PolygonPointView();
50  }
51 
52  else if (model_type == "VerticalLineMask") {
53  result = new VerticalLineView();
54  }
55 
56  else if (model_type == "HorizontalLineMask") {
57  result = new HorizontalLineView();
58  }
59 
60  else if (model_type == "EllipseMask") {
61  result = new EllipseView();
62  }
63 
64  else if (model_type == "MaskAllMask") {
65  result = new MaskAllView();
66  }
67 
68  else if (model_type == "RegionOfInterest") {
69  result = new RegionOfInterestView();
70  }
71 
72  else {
73  throw GUIHelpers::Error("MaskViewFactory::createSampleView() -> Error! "
74  "Can't create a view for "
75  + model_type);
76  }
77 
78  result->setParameterizedItem(item);
79  result->setSceneAdaptor(adaptor);
80 
81  return result;
82 }
This is a View of ellipse mask (represented by EllipseItem) on GraphicsScene.
Definition: EllipseView.h:23
This is a view of HorizontalLineItem mask.
Definition: LineViews.h:42
Main interface class for views representing MaskItems, Projections on graphics scene.
Definition: IShape2DView.h:27
This is a view of MaskAllItem which covers whole detector plane with mask value=true.
Definition: MaskAllView.h:22
The MaskContainerView is nothing move than just transparent rectangle to cover axes area of ColorMapP...
This is a View of polygon point for PolygonMaskItem.
This is a View of polygon mask (represented by PolygonItem) on GraphicsScene.
Definition: PolygonView.h:23
This is a View of rectangular mask (represented by RectangleItem) on GraphicsScene.
Definition: RectangleView.h:23
The RegionOfInterest class represent view of RegionOfInterestItem on graphics scene.
QString modelType() const
Get model type.
This is a view of VerticalLineItem mask.
Definition: LineViews.h:22
std::string model_type
Definition: types.h:23

References SessionItem::modelType(), IShape2DView::setParameterizedItem(), and IShape2DView::setSceneAdaptor().

Referenced by MaskGraphicsScene::addViewForItem().

Here is the call graph for this function:

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