Class Material
- Namespace
- VirtualLabAPI.Core.Materials
- Assembly
- VirtualLabAPI.dll
Base class for all materials.
[Serializable]
public abstract class Material : ManualSerialization, IDeserializationCallback, IEquatable<IObjectBase>, ISerializable, ICloneable
- Inheritance
-
ObjectBaseSerializableObjectBaseManualSerializationMaterial
- Implements
-
IEquatable<IObjectBase>
- Derived
- Inherited Members
Constructors
Material()
Standard constructor
public Material()
Fields
RefractiveIndexDefinedAsAbsolute
Is the given refractive index defined as absolute or as relative to the reference material?
public bool RefractiveIndexDefinedAsAbsolute
Field Value
Properties
CatalogClass
The catalogs are of type MaterialsCatalog
public Type CatalogClass { get; }
Property Value
CatalogName
Name of the catalog the material belongs to
public string CatalogName { get; set; }
Property Value
Categories
Each string in the list represents one category the catalog belongs to. The format is "subcatalog|subsubcatalog...".
public List<string> Categories { get; set; }
Property Value
EditedWithin
Gets and sets how to show the edit dialog of the interface. Must be set prior to calling the edit dialog.
public EditedInType EditedWithin { get; set; }
Property Value
- EditedInType
FixedName
A name describing the parameter provider but which doesn't change if its parameters change.
public virtual string FixedName { get; }
Property Value
HelpChapterPreview
The help chapter for the preview of the ICatalogEntry
public string HelpChapterPreview { get; }
Property Value
IsEditable
Flag which defines whether the catalog entry is editable
public bool IsEditable { get; }
Property Value
Name
Name of the material. Has to be unique if material shall be stored into a catalog.
public string Name { get; set; }
Property Value
ParameterRunParameters
public property to get the parameters used for parameter run
public abstract List<Parameter> ParameterRunParameters { get; }
Property Value
- List<Parameter>
ReferenceMaterial
Get and set the reference material the relative refractive indices are related to (usually air). If a new reference material is set, this material is set to relatively defined refractive indices.
public Material? ReferenceMaterial { get; set; }
Property Value
StateOfMatter
State of matter of this material
public StateOfMatter StateOfMatter { get; set; }
Property Value
- StateOfMatter
Methods
Clone()
Create deep copy of object
public override object Clone()
Returns
- object
the cloned object
Edit()
Calls the edit dialog of the catalog entry.
public abstract bool Edit()
Returns
- bool
TRUE: Editing was successful.
Equals(object, EqualityIntent)
Determines whether two materials are equal, i.e. whether all properties have the same value.
public override bool Equals(object obj, EqualityIntent equalityIntent)
Parameters
objobjectThe material to compare with this material.
equalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns
- bool
Trueif the properties and variables of both materials are equal.
GetAbsorptionCoeff(double)
Returns the absorption for the specified wavelength. If no absorption for this Wavelength is defined an ArgumentException is thrown.
public abstract double GetAbsorptionCoeff(double wavelength)
Parameters
wavelengthdoubleWavelength for that the absorption should be returned.
Returns
- double
Absorption for this wavelength.
GetAbsorptionMinMaxWavelength(out double, out double)
Returns minimum and maximum Wavelength for that a absorption is available.
public abstract void GetAbsorptionMinMaxWavelength(out double minWavelength, out double maxWavelength)
Parameters
GetComplexRefractiveIndex(double, double, double)
Returns the absolutely defined complex refractive index for the given wavelength.
public Complex GetComplexRefractiveIndex(double vacuumWavelength, double temperatureInDegrees, double pressureInPascal)
Parameters
vacuumWavelengthdoubleThe vacuum wavelength needed for the calculation of the refractive index.
temperatureInDegreesdoubleTemperature to get the index for.
pressureInPascaldoublePressure to get the index for.
Returns
- Complex
The complex refractive index
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetMinMaxWavelength(out double, out double)
Returns the valid min/max wavelength of the medium.
public void GetMinMaxWavelength(out double minWavelength, out double maxWavelength)
Parameters
minWavelengthdoubleReturns the larger wavelength of both the minimum wavelength for refractive indices and absorption coefficients.
maxWavelengthdoubleReturns the smaller wavelength of both the maximum wavelength for refractive indices and absorption coefficients.
GetRealRefractiveIndex(double, bool, double, double)
Returns the absolutely defined (!) refractive index for the specified Wavelength. If there is no refractive index for the given vacuum wavelength, an ArgumentException is thrown.
public double GetRealRefractiveIndex(double vacuumWavelength, bool checkForValidWavelengthRange, double temperatureInDegrees, double pressureInPascal)
Parameters
vacuumWavelengthdoubleVacuum wavelength the refractive index should be returned for.
checkForValidWavelengthRangeboolIf
false, no check is done whether the wavelength is valid. This option should ever betrue, except for the case of calculating the vacuum wavelength, where a stack overflow has to be avoided.temperatureInDegreesdoubleThe temperature in degrees Celsius to calculate the refractive index for.
pressureInPascaldoubleThe pressure in pascals to calculate the refractive index for.
Returns
- double
Refractive index for this wavelength.
GetRealRefractiveIndex(double, double, double)
Returns the absolutely defined refractive index for the specified Wavelength. Is no refractive index for this Wavelength given, an ArgumentException is thrown.
public double GetRealRefractiveIndex(double vacuumWavelength, double temperatureInDegrees, double pressureInPascal)
Parameters
vacuumWavelengthdoubleVacuum wavelength the refractive index should be returned for.
temperatureInDegreesdoubleThe temperature in degrees Celsius to calculate the refractive index for.
pressureInPascaldoubleThe pressure in pascals to calculate the refractive index for.
Returns
- double
Refractive index for this wavelength.
GetRealRefractiveIndexAsDefined(double, bool, double, double, double)
Returns the refractive index relative to air for the specified wavelength. Is no refractive index for this wavelength defined an ArgumentException is thrown.
public abstract double GetRealRefractiveIndexAsDefined(double wavelength, bool checkForValidWavelengthRange = true, double vacuumWavelengthIfKnown = 0, double temperatureInDegrees = 20, double pressureInPascal = 101325)
Parameters
wavelengthdoubleWavelength (as measured in reference material) for that the refractive index should be returned.
checkForValidWavelengthRangeboolIf
false, no check is done whether the wavelength is valid. This option should ever betrue, except for the case of calculating the vacuum wavelength, where a stack overflow has to be avoided.vacuumWavelengthIfKnowndoubleIf known and checkForValidWavelengthRange == true, the vacuum wavelength must not be calculated again for checking the valid wavelength range.
temperatureInDegreesdoubleThe temperature in degrees Celsius to calculate the refractive index for.
pressureInPascaldoubleThe pressure in pascals to calculate the refractive index for.
Returns
- double
Refractive index for this wavelength.
GetRealRefractiveIndexMinMaxWavelength(out double, out double, bool)
Returns wavelength range for that a refractive index is available. If giveVacuumWavelengths is true, the values are vacuum wavelengths,
otherwise they refer to the reference material.
public abstract void GetRealRefractiveIndexMinMaxWavelength(out double minWavelength, out double maxWavelength, bool giveVacuumWavelengths)
Parameters
minWavelengthdoubleMinimum Wavelength.
maxWavelengthdoubleMaximum Wavelength.
giveVacuumWavelengthsboolIf true, the wavelength range of the reference material's refractive index will be considered, and vacuum wavelengths will be returned. If the material is defined absolutely, the parameter will be ignored.
GetRealRefractiveIndexWavelengthRange(bool)
Gets the valid wavelength range for calculating real refractive indices.
public PhysicalValueRange GetRealRefractiveIndexWavelengthRange(bool giveVacuumWavelengths = true)
Parameters
giveVacuumWavelengthsboolIf true, the wavelength range of the reference material's refractive index will be considered, and vacuum wavelengths will be returned. If the material is defined absolutely, the parameter will be ignored. This optional parameter is
trueby default.
Returns
- PhysicalValueRange
The valid wavelength range of the medium.
GetTemperatureInducedRefractiveIndexChange(double, double, double)
Method which calculates the change in the real refractive index which is caused by a temperature difference (between the application temperature and the measurement temperature).
public double GetTemperatureInducedRefractiveIndexChange(double temperatureInDegrees, double refractiveIndexAtStandardConditions, double vacuumWavelength)
Parameters
temperatureInDegreesdoubleApplication temperature in degrees Celsius.
refractiveIndexAtStandardConditionsdoubleThe refractive index at standard (i.e. measurement) conditions.
vacuumWavelengthdoubleThe vacuum wavelength to get the refractive index for.
Returns
- double
The refractive index change.
GetWavelengthRange()
Gets the allowed wavelength range which is the intersection of the allowed wavelength range for the real part of the refractive index and for the absorption index.
public PhysicalValueRange GetWavelengthRange()
Returns
- PhysicalValueRange
The allowed wavelength range of the material.
Nullif the two wavelength ranges do not overlap.
IsConsistent(out ArrayList)
Virtual method to check the consistency of the material
public virtual bool IsConsistent(out ArrayList messageList)
Parameters
messageListArrayListArray of ConsistenyErrorOrWarning objects
Returns
- bool
True if there is no error