Class OpticalInterface
- Namespace
- VirtualLabAPI.Core.OpticalSystems
- Assembly
- VirtualLabAPI.dll
This is the base class for all optical surfaces.
[Serializable]
public abstract class OpticalInterface : SpreadSheetObject, ISerializable, IDeserializationCallback, IDisposable, IEquatable<IObjectBase>, ICloneable
- Inheritance
-
ObjectBaseSerializableObjectBaseManualSerializationSpreadSheetObjectOpticalInterface
- Implements
-
IEquatable<IObjectBase>
- Derived
- Inherited Members
Constructors
OpticalInterface()
Empty constructor.
public OpticalInterface()
OpticalInterface(VectorD, bool)
Standard constructor.
public OpticalInterface(VectorD apertureDiameter, bool apertureHasEllipticalShape)
Parameters
Properties
ApertureDiameter
public VectorD ApertureDiameter { get; set; }
Property Value
ApertureHasEllipticalShape
Gets and sets whether the outer definition area has a elliptical (true) or rectangular (false) shape. This is actually a shortcut to the shape of the DefinitionArea. This property does not define the shape of the region from which height values are calculated, as this is defined by the DefintionAreaElementaryCell.
public bool ApertureHasEllipticalShape { get; set; }
Property Value
CatalogClass
Type of the class of the dedicated catalogs
public Type CatalogClass { get; }
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
Coated
Gets whether the surface is coated.
public bool Coated { get; }
Property Value
Coating
Gets and sets the coating if there is one.
public FresnelEffectModificatorOnBoundary Coating { get; set; }
Property Value
- FresnelEffectModificatorOnBoundary
CoatingOrientation
Gets and sets the orientation of a coating: Is it on the front side of its surface or on the back side? This has an effect on the order in which the layer sequence will be considered during simulation.
public CoatingOrientation CoatingOrientation { get; set; }
Property Value
- CoatingOrientation
DefinitionArea
Gets and sets the outer definition area (all periods) of the optical surface. Can be overridden in derived classes.
public DefinitionAreaSettings DefinitionArea { get; set; }
Property Value
- DefinitionAreaSettings
DefinitionAreaElementaryCell
Gets and sets the inner definition area (elementary cell = one period) of the optical surface.
public DefinitionAreaSettings DefinitionAreaElementaryCell { get; set; }
Property Value
- DefinitionAreaSettings
Description
Gets the description of the surface (Name + coating indicator + optional VirtualLabAPI.Core.OpticalSystems.SpreadSheetObject.Comment).
public string Description { get; }
Property Value
Name
Name of the document. Has to be unique, because it will serve as key in the SortedList.
public string Name { get; set; }
Property Value
ScalingAlpha
property to set and get scaling factor for scaling in z-direction.
public double ScalingAlpha { get; set; }
Property Value
ScalingBeta
property to set and get scaling factor for scaling in x-direction
public double ScalingBeta { get; set; }
Property Value
ScalingGamma
property to set and get scaling factor for scaling in y-direction
public double ScalingGamma { get; set; }
Property Value
Methods
CalculateMaximumApertureRadius()
Returns the maximum radius for the (circular) definition area of this interface's ProfileHeight function. If not overridden in derived forms, a default value of infinity is taken.
public virtual double CalculateMaximumApertureRadius()
Returns
- double
the maximum radius for the (circular) definition area of this interface's ProfileHeight function.
Clone()
Creates deep copy of object. The ParentSystem member is deleted in the copy of the spread sheet object.
public override object Clone()
Returns
Equals(object?, EqualityIntent)
Determines whether the specified object is equal to this instance in a physical sense.
public override bool Equals(object? otherObject, EqualityIntent equalityIntent)
Parameters
otherObjectobjectThe object to compare with this instance.
equalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns
GetIntersectionPoint(ref Vector3D, bool, bool, out bool, out bool)
Gets the next intersection point between a ray starting from the position and traveling parallel to the optical axis with the interface. The search runs always in positive z-direction. After success it returns the position of the intersection point of the interface. If no intersection point was found the position stays unchanged but the goToNextInterface and the isRightSide property is set to true;
This function is used to determine intersections between two neighbor interfaces within an optical system. Is can be used also by the Thin Element Approximation (TEA) to analyze the interface. For all optical interfaces basing on this base class only one intersection point exists.
public virtual bool GetIntersectionPoint(ref Vector3D position, bool findLeftRightTransition, bool positiveZ, out bool goToNextInterface, out bool isLateralOut)
Parameters
positionVector3DStart position for the search given in the coordinate system of the current optical interface. If an intersection point was found, this is the x,y,z position of the intersection point.
findLeftRightTransitionboolIf true the function tries to find an interface transition between the medium globally on the left side of the interface and the medium globally on the right side of the interface in search direction. If false the function try's to find an interface transition between the medium on the right side of the interface and on the medium on the left side of the interface in search direction.
positiveZboolTrue if the search should be done in positive z-direction beginning with the position as start point. Otherwise the search is done in negative z-direction.
goToNextInterfaceboolInterfaces may have more then one intersection point with a ray. If this parameter is true after the success of the function the ray propagation has to continue with the next interface in the spread sheet. Is it false there are more intersection points with the same interface and it is necessary to call this function for this interface again to find the next intersection point.
isLateralOutboollies position lateral outside
Returns
- bool
True if an intersection point was found.
GetZExtension()
Gets the overall extension of the interface.
public double GetZExtension()
Returns
- double
The total extension.
GetZExtension(out double, out double, bool)
The z-extension of the optical interface. Quantization and pixelation effects are considered.
public void GetZExtension(out double negZDir, out double posZDir, bool applyQuantization = true)
Parameters
negZDirdoubleThe negative z-Extension (less or equal zero)
posZDirdoubleThe positive z-Extension (greater or equal zero)
applyQuantizationboolOptional parameter. If set to
falsethen it is assumed that the interfaces is not quantized to avoid. This parameter should only be set tofalseduring initialization of the quantization to avoid endless recursion resulting in a StackOverflowException.
GetZExtensionOnElementaryCell(out double, out double)
The z-extension of the optical interface on elementary cell.
public void GetZExtensionOnElementaryCell(out double negZCell, out double posCell)
Parameters
negZCelldoubleThe negative z-Extension (less or equal zero)
posCelldoubleThe positive z-Extension (greater or equal zero)
GetZExtensionOnInnerArea(out double, out double)
The z-extension of the optical interface on inner definition area.
public void GetZExtensionOnInnerArea(out double negZArea, out double posArea)
Parameters
negZAreadoubleThe negative z-Extension (less or equal zero)
posAreadoubleThe positive z-Extension (greater or equal zero)
GetZExtensionOnInnerShape(out double, out double, bool)
The z-extension of the optical interface on shape of inner definition area.
public void GetZExtensionOnInnerShape(out double negZDir, out double posZDir, bool includeQuantization)
Parameters
negZDirdoubleThe negative z-Extension (less or equal zero)
posZDirdoubleThe positive z-Extension (greater or equal zero)
includeQuantizationboolIndicates whether the calling function treats the quantization correctly. Needs to be set to
falseif the z-extension of the unquantized interface is determined to calculate the height levels of the quantized surface.
GetZExtensionOnOuterShape(out double, out double, bool)
The z-extension of the optical interface on shape of outer definition area.
public void GetZExtensionOnOuterShape(out double negZDir, out double posZDir, bool includeQuantization)
Parameters
negZDirdoubleThe negative z-Extension (less or equal zero)
posZDirdoubleThe positive z-Extension (greater or equal zero)
includeQuantizationboolIndicates whether the calling function treats the quantization correctly. Needs to be set to
falseif the z-extension of the unquantized interface is determined to calculate the height levels of the quantized surface.
IsConsistent(out List<ConsistenyErrorOrWarning>)
Check consistency of surface.
public override sealed bool IsConsistent(out List<ConsistenyErrorOrWarning> messageList)
Parameters
messageListList<ConsistenyErrorOrWarning>List of error or warning messages.
Returns
- bool
True if there is no error.
MaximumSizeOfInnerDefinitionArea(out bool)
Calculates the recommended maximum size of the (inner) definition area. Possible scaling in x- and y-direction is considered.
public VectorD MaximumSizeOfInnerDefinitionArea(out bool maximumSizeRefersToRectangularShape)
Parameters
maximumSizeRefersToRectangularShapeboolParameter which returns whether the maximum size is of rectangular shape (true) or not.
Returns
- VectorD
The maximum size of the (inner) definition area.
ToString()
Returns a string that represents this instance.
public override string ToString()