Programming Reference for VirtualLab Fusion  2026.1
Loading...
Searching...
No Matches
SamplingParameters Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This class contains parameters for proper sampling of a complex field. More...

Inheritance diagram for SamplingParameters:

Public Member Functions

override object Clone ()
 
override bool Equals (object otherObject, EqualityIntent equalityIntent)
 
override int GetHashCode ()
 Returns a hash code for this instance.
 
VectorD GetPositionOfCenter ()
 To avoid numerical errors, it was defined that the physical position (0 m; 0 m) is always at the center of one sampling point. For odd sampling, the geometrical center of the field is in the center of one sampling point. Thus this method returns (0 m; 0 m) in this case. In contrast, for even sampling the geometrical center is at the border between two sampling points and thus the center of the pixel to the top left of the center has the physical position (0 m; 0 m). Consequently, the geometrical center has the physical coordinate (- sampling distance / 2, - sampling distance / 2).
 
 SamplingParameters ()
 Default Constructor. Create a SamplingParameters with the default number of sampling points and the default sampling distance.
 
 SamplingParameters (SamplingParameters samplingParameters)
 Copy Constructor.
 
 SamplingParameters (Vector SamplingPoints, VectorD SamplingDistance)
 Creates SamplingParameters using given sampling points and distance.
 
override string ToString ()
 Converts a SamplingParameters object into a string.
 
string ToString (PhysicalProperty physicalProperty)
 Converts a SamplingParameters object into a string using information about the physical property of sampling distance and diameter.
 

Static Public Member Functions

static bool operator!= (SamplingParameters a, SamplingParameters b)
 Compares two SamplingParameters objects for inequality.
 
static bool operator== (SamplingParameters a, SamplingParameters b)
 Compares two SamplingParameters objects for equality.
 

Properties

VectorD Diameter [get]
 Calculates the diameter of the sampled area described by the sampling parameters. This is SamplingPoints * SamplingDistance.
 
FieldDimensions Dimensionality [get]
 Gets the dimensionality (one- or two-dimensional) of the sampling parameters.
 
long NumberOfSamplingPoints [get]
 Gets the number of sampling points.
 
VectorD SamplingDistance [get, set]
 Sampling distance for x- and y-axis.
 
double SamplingDistanceX [get, set]
 Sampling distance for x-axis. If the sampling distance less or equal zero, then the sampling distance is set to Double.Epsilon.
 
double SamplingDistanceY [get, set]
 Sampling distance for y-axis. If the sampling distance less or equal zero, then the sampling distance is set to Double.Epsilon.
 
Vector SamplingPoints [get, set]
 Number of sampling points in x- and y-axis.
 
int SamplingPointsX [get, set]
 Number of sampling points in x-axis. If the number of sampling points is below 1, then 1 sampling point is assumed.
 
int SamplingPointsY [get, set]
 Number of sampling points in y-axis. If the number of sampling points is below 1, then 1 sampling point is assumed.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This class contains parameters for proper sampling of a complex field.

Constructor & Destructor Documentation

◆ SamplingParameters() [1/2]

SamplingParameters ( Vector SamplingPoints,
VectorD SamplingDistance )

Creates SamplingParameters using given sampling points and distance.

Parameters
SamplingPointsNumber of sampling points.
SamplingDistanceSampling distance.

◆ SamplingParameters() [2/2]

SamplingParameters ( SamplingParameters samplingParameters)

Copy Constructor.

Parameters
samplingParametersSamplingParameters to copy

Member Function Documentation

◆ GetHashCode()

override int GetHashCode ( )

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

◆ GetPositionOfCenter()

VectorD GetPositionOfCenter ( )

To avoid numerical errors, it was defined that the physical position (0 m; 0 m) is always at the center of one sampling point. For odd sampling, the geometrical center of the field is in the center of one sampling point. Thus this method returns (0 m; 0 m) in this case. In contrast, for even sampling the geometrical center is at the border between two sampling points and thus the center of the pixel to the top left of the center has the physical position (0 m; 0 m). Consequently, the geometrical center has the physical coordinate (- sampling distance / 2, - sampling distance / 2).

Returns
The physical position of the center of the field (the location exactly half between the lowest and the highest sampling point). x- and y- direction are considered separately.

◆ operator!=()

static bool operator!= ( SamplingParameters a,
SamplingParameters b )
static

Compares two SamplingParameters objects for inequality.

Parameters
afirst vector
bsecond vector
Returns
.

◆ operator==()

static bool operator== ( SamplingParameters a,
SamplingParameters b )
static

Compares two SamplingParameters objects for equality.

Parameters
afirst sampling parameters
bsecond sampling parameters
Returns
.

◆ ToString() [1/2]

override string ToString ( )

Converts a SamplingParameters object into a string.

Returns
String containing the SamplingParameters information.

◆ ToString() [2/2]

string ToString ( PhysicalProperty physicalProperty)

Converts a SamplingParameters object into a string using information about the physical property of sampling distance and diameter.

Parameters
physicalPropertyPhysical property of sampling distance and diameter.
Returns
String containing the SamplingParameters information.