Skip to content
Snippets Groups Projects
Commit 21fe2f69 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

add parDefs to many clases

parent 6d4cad6b
No related branches found
No related tags found
1 merge request!594Depend on libformfactor; rename pyramid classes; add formfactors of Platonic 4 and 8-hedra
Showing
with 115 additions and 14 deletions
......@@ -27,7 +27,6 @@ public:
PoissonNoiseBackground* clone() const override;
std::string className() const final { return "PoissonNoiseBackground"; }
// const auto tooltip = "class_tooltip";
std::vector<ParaMeta> parDefs() const final { return {}; }
double addBackground(double intensity) const override;
};
......
......@@ -41,12 +41,11 @@ public:
RectangularDetector(size_t nxbins, double width, size_t nybins, double height);
RectangularDetector(const RectangularDetector& other);
~RectangularDetector() override;
RectangularDetector* clone() const override;
std::string className() const final { return "RectangularDetector"; }
~RectangularDetector() override;
void setDetectorNormal(const Direction& direction) override;
void setDetectorPosition(R3 normal_to_detector, double u0, double v0,
......
......@@ -45,12 +45,11 @@ public:
SphericalDetector(size_t n_bin, double width, double phi, double alpha);
SphericalDetector(const SphericalDetector& other);
~SphericalDetector() override = default;
SphericalDetector* clone() const override;
std::string className() const override { return "SphericalDetector"; }
~SphericalDetector() override = default;
//! return default axes units
Axes::Coords defaultCoords() const override { return Axes::Coords::RADIANS; }
......
......@@ -35,6 +35,11 @@ public:
~PolFilter() override = default;
std::string className() const final { return "PolFilter"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Efficiency", "", "efficiency", 0, 1, 1},
{"Transmission", "", "total transmission", 0, 1, 1}};
}
//! Sets the polarization analyzer characteristics of the detector
void setDirEffTra(R3 direction, double efficiency, double total_transmission);
......
......@@ -28,6 +28,10 @@ public:
return new ResolutionFunction2DGaussian(m_sigma_x, m_sigma_y);
}
std::string className() const final { return "ResolutionFunction2DGaussian"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Sigma_x", "?", "sigma_x", 0, +INF, 0}, {"Sigma_y", "?", "sigma_y", 0, +INF, 0}};
}
double evaluateCDF(double x, double y) const override;
......
......@@ -50,12 +50,6 @@ void INode::checkNodeArgs() const
}
}
std::vector<ParaMeta> INode::parDefs() const
{
ASSERT(m_parDefs);
return m_parDefs.value();
}
std::vector<const INode*> INode::nodeChildren() const
{
return {};
......
......@@ -48,7 +48,7 @@ public:
virtual std::string className() const = 0;
//! Returns the parameter definitions, to be hard-coded in each leaf class.
virtual std::vector<ParaMeta> parDefs() const;
virtual std::vector<ParaMeta> parDefs() const { return {}; }
//! Raises exception if a parameter value is invalid.
void checkNodeArgs() const;
......@@ -61,7 +61,6 @@ public:
protected:
std::vector<double> m_P;
std::optional<std::vector<ParaMeta>> m_parDefs;
};
// ************************************************************************************************
......
......@@ -29,6 +29,11 @@ public:
Interference1DLattice* clone() const override;
std::string className() const final { return "Interference1DLattice"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Length", "nm", "lattice constant", 0, +INF, 0},
{"Xi", "rad", "angle x axis and lattice vector??", -INF, +INF, 0}};
}
void setDecayFunction(const IFTDecayFunction1D& decay);
......
......@@ -35,6 +35,12 @@ public:
Interference2DParaCrystal* clone() const override;
std::string className() const final { return "Interference2DParaCrystal"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"DampingLength", "nm", "damping length Lambda", 0, +INF, 0},
{"DomainSize 1", "nm", "domain size in lattice direction 1", 0, +INF, 0},
{"DomainSize 2", "nm", "domain size in lattice direction 2", 0, +INF, 0}};
}
void setDomainSizes(double size_1, double size_2);
......
......@@ -31,6 +31,13 @@ public:
Interference2DSuperLattice* clone() const override;
std::string className() const final { return "Interference2DSuperLattice"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Length1", "nm", "lattice constant 1", 0, +INF, 0},
{"Length2", "nm", "lattice constant 2", 0, +INF, 0},
{"Alpha", "rad", "angle between lattice vectors 1 and 2", -INF, +INF, 0},
{"Xi", "rad", "angle between x axis and lattice vector 1", -INF, +INF, 0}};
}
void setSubstructureIFF(const IInterference& sub_iff);
const IInterference& substructureIFF() const;
......
......@@ -28,6 +28,12 @@ class InterferenceHardDisk : public IInterference {
public:
InterferenceHardDisk(double radius, double density, double position_var = 0);
~InterferenceHardDisk() override = default;
std::vector<ParaMeta> parDefs() const final
{
return {{"Radius", "nm", "particle radius", 0, +INF, 0},
{"Density", "nm^-2", "particle density", 0, +INF, 0},
{"Variance", "nm?", "position variance", 0, +INF, 0}};
}
InterferenceHardDisk* clone() const override;
std::string className() const final { return "InterferenceHardDisk"; }
......
......@@ -28,6 +28,11 @@ public:
InterferenceRadialParaCrystal(double peak_distance, double damping_length);
InterferenceRadialParaCrystal* clone() const override;
std::string className() const final { return "InterferenceRadialParaCrystal"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"PeakDistance", "nm", "peak distance", 0, +INF, 0},
{"DampingLength", "nm", "damping length", 0, +INF, 0}};
}
void setKappa(double kappa);
double kappa() const;
......
......@@ -19,6 +19,7 @@
//! Interference function for two particles at a mean distance and given standard deviation
//! from each other in a given direction.
//! TODO: RENAME (has nothing to do with crystallographic twin)
//! @ingroup interference
class InterferenceTwin : public IInterference {
......@@ -27,6 +28,11 @@ public:
InterferenceTwin* clone() const override;
std::string className() const final { return "InterferenceTwin"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"MeanDistance", "nm", "mean distance", 0, +INF, 0},
{"StdDeviation", "nm", "standard deviation of distance", 0, +INF, 0}};
}
R3 direction() const;
double meanDistance() const;
......
......@@ -34,6 +34,10 @@ public:
ParticleLayout* clone() const override;
std::string className() const final { return "ParticleLayout"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Abundance", "", "e.g. surface fraction covered by this layout", 0, +INF, -1}};
}
std::vector<const INode*> nodeChildren() const override;
void addParticle(const IParticle& particle, double abundance = -1.0, R3 position = {},
......
......@@ -48,6 +48,11 @@ public:
IsotropicGaussPeakShape* clone() const override;
std::string className() const final { return "IsotropicGaussPeakShape"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"MaxIntensity", "", "maximum intensity", 0, +INF, -1},
{"DomainSize", "nm", "domain size", 0, +INF, -1}};
}
double evaluate(R3 q, R3 q_lattice_point) const override;
......@@ -66,6 +71,11 @@ public:
IsotropicLorentzPeakShape* clone() const override;
std::string className() const final { return "IsotropicLorentzPeakShape"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"MaxIntensity", "", "maximum intensity", 0, +INF, -1},
{"DomainSize", "nm", "domain size", 0, +INF, -1}};
}
double evaluate(R3 q, R3 q_lattice_point) const override;
......@@ -85,6 +95,12 @@ public:
GaussFisherPeakShape* clone() const override;
std::string className() const final { return "GaussFisherPeakShape"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"MaxIntensity", "", "maximum intensity", 0, +INF, -1},
{"DomainSize", "nm", "domain size", 0, +INF, -1},
{"Kappa", "", "?", 0, +INF, -1}};
}
double evaluate(R3 q, R3 q_lattice_point) const override;
......@@ -106,6 +122,12 @@ public:
LorentzFisherPeakShape* clone() const override;
std::string className() const final { return "LorentzFisherPeakShape"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"MaxIntensity", "", "maximum intensity", 0, +INF, -1},
{"DomainSize", "nm", "domain size", 0, +INF, -1},
{"Kappa", "", "?", 0, +INF, -1}};
}
double evaluate(R3 q, R3 q_lattice_point) const override;
......@@ -128,6 +150,13 @@ public:
MisesFisherGaussPeakShape* clone() const override;
std::string className() const final { return "MisesFisherGaussPeakShape"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"MaxIntensity", "", "maximum intensity", 0, +INF, -1},
{"Radial Size", "nm", "radial size", 0, +INF, -1},
{"Kappa1", "", "?", 0, +INF, -1},
{"Kappa2", "", "?", 0, +INF, -1}};
}
double evaluate(R3 q, R3 q_lattice_point) const override;
......@@ -149,6 +178,12 @@ public:
MisesGaussPeakShape* clone() const override;
std::string className() const final { return "MisesGaussPeakShape"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"MaxIntensity", "", "maximum intensity", 0, +INF, -1},
{"Radial Size", "nm", "radial size", 0, +INF, -1},
{"Kappa", "", "?", 0, +INF, -1}};
}
double evaluate(R3 q, R3 q_lattice_point) const override;
......
......@@ -36,6 +36,12 @@ public:
return new LayerRoughness(m_sigma, m_hurstParameter, m_lateralCorrLength);
}
std::string className() const final { return "LayerRoughness"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Sigma", "", "roughness amplitude", 0, +INF, 0},
{"Hurst", "", "Power law exponent??", 0, +INF, 0},
{"CorrLength", "nm", "lateral correlation length", 0, +INF, 0}};
}
//! Returns power spectral density of the surface roughness
double spectralFunction(R3 kvec) const;
......
......@@ -54,6 +54,12 @@ public:
BasicLattice2D* clone() const override;
std::string className() const final { return "BasicLattice2D"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Length1", "nm", "lattice constant 1", 0, +INF, 0},
{"Length2", "nm", "lattice constant 2", 0, +INF, 0},
{"Alpha", "rad", "angle between lattice vectors 1 and 2", -INF, +INF, 0}};
}
double length1() const override { return m_length1; }
double length2() const override { return m_length2; }
......@@ -73,6 +79,10 @@ public:
SquareLattice2D* clone() const override;
std::string className() const final { return "SquareLattice2D"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Length", "nm", "lattice constant", 0, +INF, 0}};
}
double length1() const override { return m_length; }
double length2() const override { return m_length; }
......@@ -91,6 +101,11 @@ public:
HexagonalLattice2D* clone() const override;
std::string className() const final { return "HexagonalLattice2D"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Length", "nm", "lattice constant", 0, +INF, 0},
{"Xi", "rad", "angle between x axis and lattice vector", -INF, +INF, 0}};
}
double length1() const override { return m_length; }
double length2() const override { return m_length; }
......
......@@ -30,6 +30,10 @@ public:
Layer* clone() const override;
std::string className() const final { return "Layer"; }
std::vector<ParaMeta> parDefs() const final
{
return {{"Thickness", "nm", "thickness", 0, +INF, 0}};
}
std::vector<const INode*> nodeChildren() const override;
const Material* material() const override { return &m_material; }
......
......@@ -39,6 +39,10 @@ public:
Crystal* clone() const override;
std::string className() const final { return "Crystal"; }
std::vector<const INode*> nodeChildren() const override;
std::vector<ParaMeta> parDefs() const final
{
return {{"Variance", "nm?", "position variance", 0, +INF, 0}};
}
const IParticle* basis() const { return m_basis.get(); }
const Lattice3D* lattice() const { return m_lattice.get(); }
......
......@@ -62,7 +62,6 @@ public:
IdentityRotation* clone() const override { return new IdentityRotation(); }
std::string className() const final { return "IdentityRotation"; }
// const auto tooltip = "Identity rotation, does nothing";
std::vector<ParaMeta> parDefs() const final { return {}; }
IdentityRotation* createInverse() const override { return new IdentityRotation(); }
RotMatrix rotMatrix() const override;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment