26 const QString res_func_group_label =
"Type";
27 const QString analyzer_direction_tooltip =
"Direction of the polarization analysis";
28 const QString analyzer_efficiency_tooltip =
"Efficiency of the polarization analysis";
29 const QString analyzer_transmission_tooltip =
"Total transmission of the polarization analysis";
49 QString additional_name = QString::fromStdString(
"Analyzer");
66 result->setResolutionFunction(*resFunc);
71 if (analyzer_dir.
mag() > 0.0)
72 result->setAnalyzerProperties(analyzer_dir, analyzer_eff, analyzer_total_trans);
105 item->setDisplayName(res_func_group_label);
106 item->setToolTip(
"Detector resolution function");
113 if (resfuncItem.modelType() ==
"ResolutionFunction2DGaussian") {
114 QString units =
modelType() ==
"SphericalDetector" ?
"deg" :
"mm";
117 ->setToolTip(
"Resolution along horizontal axis (in " + units +
")");
119 ->setToolTip(
"Resolution along vertical axis (in " + units +
")");
138 for (
int i_row = maskContainer->children().size(); i_row > 0; --i_row) {
139 if (
auto maskItem =
dynamic_cast<MaskItem*
>(maskContainer->children().at(i_row - 1))) {
141 if (maskItem->modelType() ==
"RegionOfInterest") {
149 std::unique_ptr<IShape2D> shape(maskItem->createShape(scale));
151 detector->
addMask(*shape, mask_value);
Defines classes DetectorItems.
Defines interface IDetector2D.
Defines MaskItems classes.
Defines interface IParameterTranslator and subclasses.
Defines class ResolutionFunction2DGaussian.
Defines family of ResolutionFunctionItem.
Defines namespace SessionItemUtils.
Defines class SessionModel.
Defines class VectorItem.
double mag() const
Returns magnitude of the vector.
MaskContainerItem * maskContainerItem() const
DetectorItem(const QString &modelType)
void update_resolution_function_tooltips()
void register_resolution_function()
void importMasks(const MaskContainerItem *maskContainer)
static const QString P_ANALYZER_EFFICIENCY
virtual std::unique_ptr< IDetector2D > createDomainDetector() const =0
std::unique_ptr< IResolutionFunction2D > createResolutionFunction() const
static const QString P_ANALYZER_DIRECTION
virtual double axesToDomainUnitsFactor() const
Scales the values provided by axes (to perform deg->rad conversion on the way to domain).
void addMasksToDomain(IDetector2D *detector) const
static const QString P_RESOLUTION_FUNCTION
static const QString P_ANALYZER_TOTAL_TRANSMISSION
static const QString T_MASKS
std::unique_ptr< IDetector2D > createDetector() const
void createMaskContainer()
Abstract 2D detector interface.
void setRegionOfInterest(double xlow, double ylow, double xup, double yup)
Sets rectangular region of interest with lower left and upper right corners defined.
void addMask(const IShape2D &shape, bool mask_value=true)
Adds mask of given shape to the stack of detector masks.
Container holding various masks as children.
A base class for all mask items.
static const QString P_MASK_VALUE
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=0)
static RealLimits limitless()
Creates an object withoud bounds (default)
static const QString P_XUP
static const QString P_YLOW
static const QString P_YUP
static const QString P_XLOW
static const QString P_SIGMA_Y
static const QString P_SIGMA_X
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
bool registerTag(const QString &name, int min=0, int max=-1, QStringList modelTypes={})
Add new tag to this item with given name, min, max and types.
int rowOfChild(SessionItem *child) const
Returns row index of given child.
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
SessionItem * addGroupProperty(const QString &groupTag, const QString &groupType)
Creates new group item and register new tag, returns GroupItem.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
void setDefaultTag(const QString &tag)
Set default tag.
SessionItem * takeRow(int row)
Removes row from item and returns the item.
void addTranslator(const IPathTranslator &translator)
SessionModel * model() const
Returns model of this item.
T * item(const QString &tag) const
SessionItem & setToolTip(const QString &tooltip)
QString modelType() const
Get model type.
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
SessionItem & setLimits(const RealLimits &value)
T * copyItem(const T *item_to_copy, SessionItem *new_parent=0, const QString &tag="")
T * insertItem(SessionItem *parent=nullptr, int row=-1, QString tag="")
QString const & name(EShape k)