Class HomogeneousMedium
- Namespace
- VirtualLabAPI.Core.OpticalSystems
- Assembly
- VirtualLabAPI.dll
Class representing a homogeneous medium.
[Serializable]
public class HomogeneousMedium : OpticalMedium, ISerializable, IDeserializationCallback, IEquatable<IObjectBase>, ICloneable, IProvidesPositioningReferences
- Inheritance
-
ObjectBaseSerializableObjectBaseManualSerializationHomogeneousMedium
- Implements
-
IEquatable<IObjectBase>
- Inherited Members
Constructors
HomogeneousMedium(Material, double, double, bool)
Constructor that sets a constant material.
public HomogeneousMedium(Material material, double temperatureInDegrees = 20, double pressureInPascal = 101325, bool clone = true)
Parameters
materialMaterialThe material to provide the refractive index.
temperatureInDegreesdoubleThe temperature of the medium in degrees centigrade.
pressureInPascaldoubleThe pressure of the medium in pascal.
cloneboolOptional parameter defining whether the material passed as parameter should be cloned. In principal, cloning should always be done externally if required.
HomogeneousMedium(HomogeneousMedium)
Copy constructor.
public HomogeneousMedium(HomogeneousMedium medium)
Parameters
mediumHomogeneousMediumHomogeneous medium to be copied.
Properties
BaseMaterial
The underlying material.
public override Material BaseMaterial { get; set; }
Property Value
CoordinateSystem
Property which overrides the Coordinate System property of OpticalMedium so that it is always defined absolutely.
public CartesianCoordinateSystem CoordinateSystem { get; set; }
Property Value
DefaultViewRangesWithoutScaling
What view ranges shall be shown in the medium preview by default? Medium scaling is not to be considered in this property!
public override Range3D DefaultViewRangesWithoutScaling { get; }
Property Value
- Range3D
HasFixedPeriod
This returns always false because the user can't make the medium periodical.
public override bool HasFixedPeriod { get; }
Property Value
IsPeriodical
A homogeneous medium has no period, thus this property always returns false. The property HasFixedPeriod just returns true in order to avoid the possibility of setting a finite period.
public override bool IsPeriodical { get; set; }
Property Value
LongName
Gets the long name for the medium.
public override string LongName { get; }
Property Value
RefractiveIndexModulation
Returns always None since a constant refractive index is not modulated in x-, y-, z-direction.
public override RefractiveIndexModulation RefractiveIndexModulation { get; }
Property Value
Methods
Clone()
Creates a new object that is a copy of the current instance.
public override object Clone()
Returns
- object
A new object that is a copy of this instance.
GetComplexRefractiveIndex(double)
Gets the complex refractive index.
public Complex GetComplexRefractiveIndex(double wavelength)
Parameters
wavelengthdoubleThe wavelength needed for calculation.
Returns
- Complex
The complex refractive index.
GetComplexRefractiveIndexWithoutScalingAndPeriodization(Vector3D)
Returns the refractive index on a special point and for a special wavelength. This function does not take the periodization and the scaling into account.
protected override Complex GetComplexRefractiveIndexWithoutScalingAndPeriodization(Vector3D position)
Parameters
positionVector3Dthe position to return the refractive index on. The z-value of the position has to be relative to the start interface on the left side (lower z-position). So the z-position starts always with zero.
Returns
- Complex
The complex refractive index of the base material.
GetMinMaxValuesForAutoScale(double)
Gets the minima and maxima of the real valued refractive index and of the absorption index for a given wavelength.
public override (double nMin, double nMax, double aMin, double aMax) GetMinMaxValuesForAutoScale(double wavelength)
Parameters
wavelengthdouble
Returns
GetRealRefractiveIndex(double)
Gets the real part of the complex refractive index.
public double GetRealRefractiveIndex(double wavelength)
Parameters
wavelengthdoubleThe wavelength needed for calculation.
Returns
- double
The real part of the complex refractive index.
IntegrateImaginaryRefractiveIndex(Vector3D, Vector3D, double)
Calculates the integral of the imaginary part of the refractive index. For homogeneous media it is just refractive index times path length.
public override double IntegrateImaginaryRefractiveIndex(Vector3D startPosition, Vector3D endPosition, double wavelength)
Parameters
startPositionVector3Dlower border of integration interval
endPositionVector3Dupper border of integration interval
wavelengthdoubleThe wavelength needed for calculation.
Returns
- double
The integral of the imaginary part of the refractive index between the two positions.
IntegrateRealRefractiveIndex(Vector3D, Vector3D, double)
Calculates the integral of the real part of the refractive index. For homogeneous media it is just refractive index times path length.
public override double IntegrateRealRefractiveIndex(Vector3D startPosition, Vector3D endPosition, double wavelength)
Parameters
startPositionVector3Dlower border of integration interval
endPositionVector3Dupper border of integration interval
wavelengthdoubleThe wavelength needed for calculation.
Returns
- double
The integral of the real part of the refractive index between the two positions.
SuggestName()
Suggests a name for the medium based on its current parameters.
public override string SuggestName()
Returns
- string
The suggested name.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
Operators
operator ==(HomogeneousMedium, HomogeneousMedium)
Static operator that tells if two media are equal.
public static bool operator ==(HomogeneousMedium m1, HomogeneousMedium m2)
Parameters
m1HomogeneousMediumMedium 1
m2HomogeneousMediumMedium 2
Returns
- bool
trueif m1 and m2 are equal.
operator !=(HomogeneousMedium, HomogeneousMedium)
Static operator that tells if two media are unequal.
public static bool operator !=(HomogeneousMedium m1, HomogeneousMedium m2)
Parameters
m1HomogeneousMediumMedium 1
m2HomogeneousMediumMedium 2
Returns
- bool
trueif m1 and m2 are not equal.