Programming Reference for VirtualLab Fusion  2022.1
Public Member Functions | Static Public Member Functions | Properties | List of all members
EllipticRegion Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class which describes an elliptic region which may be situated at an arbitrary center and which may be rotated by an arbitrary angle. More...

Inheritance diagram for EllipticRegion:
ElementaryRegion2D Region2D IRegion1D2D IDocument

Public Member Functions

override double CalculateDistanceOfPointToRegionBorder (VectorD point)
 Calculates the distance of a point to the border of this region. More...
 
override object Clone ()
 Deep copy of the object. More...
 
 EllipticRegion ()
 Default constructor, creating a non-rotated ellipse of 10mm x 5mm (diameter in x and y) and centered at (0,0).
 
 EllipticRegion (Ellipse ellipse)
 Constructor which gets an (axis aligned, i.e. non-rotated) ellipse. More...
 
 EllipticRegion (EllipticRegion ellipticRegion)
 Copy constructor More...
 
 EllipticRegion (SerializationInfo info, StreamingContext context)
 Deserialization constructor. See the ISerializable interface for more details. More...
 
 EllipticRegion (VectorD center, double halfAxisX, double halfAxisY, double angle, bool boundaryIsInside=false, PhysicalProperty propertyOfCoordinatesX=PhysicalProperty.Length, PhysicalProperty propertyOfCoordinatesY=PhysicalProperty.Length)
 Constructor with all parameters including the half axes. More...
 
override bool Equals (object obj, EqualityIntent equalityIntent)
 Equality operator. More...
 
override InsideOutside GetInOutRelation (VectorD point, ExtrapolationInfo extrapolation2use=null)
 Method which checks whether or not a point lies inside or outside the 2D region or on its boundary. More...
 
override void MayBeNonzeroOutside (out bool maybeNonZeroLeft, out bool maybeNonZeroRight, out bool maybeNonZeroBottom, out bool maybeNonZeroTop)
 Method which determines whether or not the region can provide "inside" state outside of its boundary interval. This is not the case for extrapolation mode 'ConstantZero', of course. More...
 
override void UpdatePropertyOfCoordinates ()
 Method for handling update after change of the physical property of the coordinate
 
- Public Member Functions inherited from ElementaryRegion2D
abstract double CalculateDistanceOfPointToRegionBorder (VectorD point)
 Calculates the distance of a point to the border of this region. More...
 
 ElementaryRegion2D (bool boundariesAreInside, PhysicalProperty propertyOfCoordinatesX=PhysicalProperty.Length, PhysicalProperty propertyOfCoordinatesY=PhysicalProperty.Length)
 Constructor which gets the _boundariesAreInside flag. To be called from derived classes constructors. More...
 
 ElementaryRegion2D (ElementaryRegion2D region2bCopied)
 Copy constructor. More...
 
 ElementaryRegion2D (SerializationInfo info, StreamingContext context)
 Deserialization constructor. See the ISerializable interface for more details. More...
 
- Public Member Functions inherited from Region2D
override object Clone ()
 Clones the current object. More...
 
override bool Equals (object obj, EqualityIntent equalityIntent)
 Equality operation More...
 
abstract InsideOutside GetInOutRelation (VectorD point, ExtrapolationInfo extrapolation2use=null)
 Method which checks whether or not a point lies inside or outside the 2D region or on its boundary. More...
 
bool IsInside (double pointX, double pointY)
 Method which checks whether or not a point is inside the 2D region. More...
 
bool IsInside (VectorD point)
 Method which checks whether or not a point is inside the 2D region. More...
 
abstract void MayBeNonzeroOutside (out bool maybeNonZeroLeft, out bool maybeNonZeroRight, out bool maybeNonZeroBottom, out bool maybeNonZeroTop)
 Method which determines whether or not the region can provide "inside" state outside of its boundary interval. This is not the case for extrapolation mode 'ConstantZero', of course. More...
 
 Region2D (bool boundariesAreInside, PhysicalProperty propertyOfCoordinatesX=PhysicalProperty.Length, PhysicalProperty propertyOfCoordinatesY=PhysicalProperty.Length)
 Constructor which gets the _boundariesAreInside flag. To be called from derived classes constructors. More...
 
 Region2D (Region2D region2bCopied)
 Copy constructor. More...
 
 Region2D (SerializationInfo info, StreamingContext context)
 Deserialization constructor. See the ISerializable interface for more details. More...
 
virtual void UpdatePropertyOfCoordinates ()
 Method for handling update after change of the physical property of the coordinate
 
bool Equals (object otherObject, EqualityIntent equalityIntent)
 Determines whether the specified Object is equal to this instance. More...
 
- Public Member Functions inherited from IDocument
void Reload ()
 Reload function for the document
 

Static Public Member Functions

static EllipticRegion EllipticRegionFromSize (VectorD center, VectorD size, double angle, bool boundaryIsInside=false, PhysicalProperty propertyOfCoordinatesX=PhysicalProperty.Length, PhysicalProperty propertyOfCoordinatesY=PhysicalProperty.Length)
 Static constructor which constructs an ellipse from the overall size, not the half axes. More...
 
static bool operator!= (EllipticRegion o1, EllipticRegion o2)
 Unequals operator. More...
 
static bool operator== (EllipticRegion o1, EllipticRegion o2)
 Equals operator More...
 
static EllipticRegion ScaleToFitIntoRectangle (EllipticRegion ellipse, VectorD sizeOfRectangle)
 Static method for scaling a given ellipse for fitting into a rectangle who's size is given More...
 
- Static Public Member Functions inherited from ElementaryRegion2D
static bool operator!= (ElementaryRegion2D o1, ElementaryRegion2D o2)
 Unequals operator. More...
 
static bool operator== (ElementaryRegion2D o1, ElementaryRegion2D o2)
 Equals operator More...
 
- Static Public Member Functions inherited from Region2D
static Region2D InvertRegion (Region2D region2Invert)
 Creates a new region with inverted in / out regions compared to this. More...
 
static Region2D Load (string fileName)
 Loads the specified file name. Works independently from whether the document has been saved without view settings (as prior to VL 6.0) or with view settings. More...
 
static bool operator!= (Region2D o1, Region2D o2)
 Unequals operator. More...
 
static bool operator== (Region2D o1, Region2D o2)
 Equals operator More...
 

Properties

double Angle [get, set]
 Gets the rotation angle in rad.
 
override RectanglePhysical AxisAlignedBoundingBox [get]
 Gets the bounding box for the elliptic region. Its sides are parallel to the x- and y-axis resp. So this bounding box is identical to the minimum circumscribing rectangle only in case of a rotation angle of 0, 90, 180, or 270 degrees.
 
VectorD Center [get, set]
 Gets the center of the ellipse.
 
double HalfAxisX [get, set]
 The major half axis of the elliptic region.
 
double HalfAxisY [get, set]
 The minor half axis of the elliptic region.
 
virtual List< Parameter > ParameterRunParameters [get]
 Gets all available parameters. For variable parameters (i.e. those double and int parameters which can be used in the Parameter Run, Parametric Optimization and so on) add a VaryParameterInfo object (derived from Parameter class) to the returned list.
 
- Properties inherited from Region2D
abstract RectanglePhysical AxisAlignedBoundingBox [get]
 Gets the bounding box for the 2D region. Its sides are parallel to the x- and y-axis resp.
 
bool BoundariesAreInside [get, set]
 Gets or sets whether or not the boundaries of the region belong to the inner region.
 
string CommentOfCoordinates_X [get, set]
 Gets and sets the comment for the x-coordinates.
 
string CommentOfCoordinates_Y [get, set]
 Gets and sets the comment for the y-coordinates.
 
ExtrapolationInfo ExtrapolationHandling [get, set]
 The extrapolation mode for this region. See ITN.064 for more information on the mode 'border continuation'.
 
bool IsOneD [get]
 Gets whether this IRegion1D2D is 1D or 2D
 
string Name [get, set]
 The name which can be given to the region by the user.
 
PhysicalProperty PropertyOfCoordinatesX [get, set]
 Physical property of the x-coordinates of the region
 
PhysicalProperty PropertyOfCoordinatesY [get, set]
 Physical property of the y-coordinates of the region
 
Region2DType RegionType [get]
 Gets the type of the region
 
SamplingParameters SamplingForUsageWithComplexFields [get, set]
 Sampling parameters which will be used for a coordinate rescaling in case of using the region with a complex field.
 
- Properties inherited from IRegion1D2D
bool BoundariesAreInside [get, set]
 Gets or sets whether or not the boundaries of the region belong to the inner region.
 
bool IsOneD [get]
 Gets whether this IRegion1D2D is 1D or 2D
 
string Name [get, set]
 The name which can be given to the region by the user.
 
SamplingParameters SamplingForUsageWithComplexFields [get, set]
 Sampling parameters which will be used for a coordinate rescaling in case of using the region with a complex field.
 
- Properties inherited from IDocument
VirtualLabSession Session [get, set]
 every documents need to be handled in a session ==> default is the VirtualLab Mainsession
 
NodeVLExplorer TreeStructure [get]
 every document should have a node (maybe with subnodes) in the VirtualLab Explorer
 
DocumentType TypeOfDocument [get]
 Gets an enum entry specifying the type of the document.
 

Additional Inherited Members

- Static Public Attributes inherited from Region2D
const string DefaultDocumentName
 The default document name (= type description) for an Order Collection.
 
static readonly string FileDialogFilterString
 The filter string used in "Open File" dialogs.
 
const string FileExtensionString
 The file extension for an Order Collection.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class which describes an elliptic region which may be situated at an arbitrary center and which may be rotated by an arbitrary angle.

Constructor & Destructor Documentation

◆ EllipticRegion() [1/4]

EllipticRegion ( Ellipse  ellipse)

Constructor which gets an (axis aligned, i.e. non-rotated) ellipse.

Parameters
ellipse

◆ EllipticRegion() [2/4]

EllipticRegion ( VectorD  center,
double  halfAxisX,
double  halfAxisY,
double  angle,
bool  boundaryIsInside = false,
PhysicalProperty  propertyOfCoordinatesX = PhysicalProperty.Length,
PhysicalProperty  propertyOfCoordinatesY = PhysicalProperty.Length 
)

Constructor with all parameters including the half axes.

Parameters
centerThe center of the ellipse.
halfAxisXThe half axis in x-direction.
halfAxisYThe half axis in y-direction.
angleThe angle between the halfAxisX and the x-axis.
boundaryIsInsideFlag which says whether or not the boundary is part of the inner region or not.
propertyOfCoordinatesXOptional physical property of the x-coordinates (length by default).
propertyOfCoordinatesYOptional physical property of the y-coordinates (length by default).

◆ EllipticRegion() [3/4]

EllipticRegion ( EllipticRegion  ellipticRegion)

Copy constructor

Parameters
ellipticRegionThe elliptic region to be copied.

◆ EllipticRegion() [4/4]

EllipticRegion ( SerializationInfo  info,
StreamingContext  context 
)

Deserialization constructor. See the ISerializable interface for more details.

Parameters
infoSerializationInfo
contextStreamingContext

Member Function Documentation

◆ CalculateDistanceOfPointToRegionBorder()

override double CalculateDistanceOfPointToRegionBorder ( VectorD  point)
virtual

Calculates the distance of a point to the border of this region.

Parameters
pointPoint to calculate the distance for.
Returns
The distance of the given point to the border of this region

Implements ElementaryRegion2D.

◆ Clone()

override object Clone ( )

Deep copy of the object.

Returns
A deep copy of this.

◆ EllipticRegionFromSize()

static EllipticRegion EllipticRegionFromSize ( VectorD  center,
VectorD  size,
double  angle,
bool  boundaryIsInside = false,
PhysicalProperty  propertyOfCoordinatesX = PhysicalProperty.Length,
PhysicalProperty  propertyOfCoordinatesY = PhysicalProperty.Length 
)
static

Static constructor which constructs an ellipse from the overall size, not the half axes.

Parameters
centerThe center of the ellipse.
sizeThe overall extension of the ellipse along the two principal axes of the ellipse (x- and y-axis for an unrotated ellipse).
angleThe angle between the size.X and the x-axis.
boundaryIsInsideFlag which says whether or not the boundary is part of the inner region or not.
propertyOfCoordinatesXOptional physical property of the x-coordinates (length by default).
propertyOfCoordinatesYOptional physical property of the y-coordinates (length by default).
Returns
The created ellipse

◆ Equals()

override bool Equals ( object  obj,
EqualityIntent  equalityIntent 
)

Equality operator.

Parameters
obj
equalityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns

Implements IRegion1D2D.

◆ GetInOutRelation()

override InsideOutside GetInOutRelation ( VectorD  point,
ExtrapolationInfo  extrapolation2use = null 
)
virtual

Method which checks whether or not a point lies inside or outside the 2D region or on its boundary.

Parameters
pointThe point to be checked whether it lies inside.
extrapolation2useExtrapolation info actually to be used.
Returns
Information where the point lies in relation to the region.

Implements Region2D.

◆ MayBeNonzeroOutside()

override void MayBeNonzeroOutside ( out bool  maybeNonZeroLeft,
out bool  maybeNonZeroRight,
out bool  maybeNonZeroBottom,
out bool  maybeNonZeroTop 
)
virtual

Method which determines whether or not the region can provide "inside" state outside of its boundary interval. This is not the case for extrapolation mode 'ConstantZero', of course.

Parameters
maybeNonZeroLeftTrue, if there may be nonzero values left of the bounding box.
maybeNonZeroRightTrue, if there may be nonzero values right of the bounding box.
maybeNonZeroBottomTrue, if there may be nonzero values below the bottom of the bounding box.
maybeNonZeroTopTrue, if there may be nonzero values above the top of the bounding box.

Implements Region2D.

◆ operator!=()

static bool operator!= ( EllipticRegion  o1,
EllipticRegion  o2 
)
static

Unequals operator.

Parameters
o1
o2
Returns

◆ operator==()

static bool operator== ( EllipticRegion  o1,
EllipticRegion  o2 
)
static

Equals operator

Parameters
o1
o2
Returns

◆ ScaleToFitIntoRectangle()

static EllipticRegion ScaleToFitIntoRectangle ( EllipticRegion  ellipse,
VectorD  sizeOfRectangle 
)
static

Static method for scaling a given ellipse for fitting into a rectangle who's size is given

Parameters
ellipseEllipse to be scaled.
sizeOfRectangleSize of the rectangle the ellipse has to fit in
Returns
The scaled, fitting ellipse.