Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
Position Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class to describe a position object, that is a point in R^3, with reference information added. More...

Inheritance diagram for Position:

Public Member Functions

double CalculateDistance (Position pos)
 Calculates the absolute value of the distance from this position to another position.
 
override object Clone ()
 Clones the current object.
 
override bool Equals (object obj, EqualityIntent equalityIntent)
 Method which checks for equal objects.
 
void OnPositionChanged (Vector3D oldPos, Vector3D newPos, bool refChanged)
 Event throwing method.
 
 Position ()
 Default constructor, creating an absolute position of (0, 0, 0)
 
 Position (double x, double y, double z, IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey)
 Constructor to fill parameters.
 
 Position (IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey)
 Constructor that creates a position in the origin of a given reference coordinate system.
 
 Position (Position pos)
 Copy constructor.
 
 Position (Vector3D coordinates, IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey)
 Constructor to fill parameters.
 
void PositionChangedEventHandler (Position sender, PositionChangedEventArgs e)
 Event handler for position changed events.
 
void SetPositioningReference (IProvidesPositioningReferences referenceProvider, string key)
 Method to set the PositioningReferenceProvider and the key for the coordinate system that serves as positioning reference.
 
override string ToString ()
 Gives the coordinates of this position as String.
 

Static Public Member Functions

static bool operator!= (Position pos1, Position pos2)
 Overloaded unequality operator.
 
static bool operator== (Position pos1, Position pos2)
 Overloaded equality operator.
 

Properties

Vector3D Coordinates [get, set]
 public property to get and set the PositionVector of the Position object
 
List< object > GetAllPositionChangedEventTargets [get]
 Auxiliary method for finding all targets for the invocation of this element's PositionChanged event.
 
CartesianCoordinateSystem GetPositioningReference [get]
 Property to get the coordinate system that serves as reference for this object.
 
bool IsAbsolutePosition [get]
 get a flag, indicating whether the position is relative (FALSE) or absolute (TRUE)
 
bool IsUndefined [get]
 Gets whether the position is undefined.
 
string PositioningReferenceKey [get, set]
 Get or set the key for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position.
 
IProvidesPositioningReferences PositioningReferenceProvider [get]
 Gets the object which provides the coordinate system that serves as reference for this position. It is to be set via the method SetPositioningReference().
 

Events

PositionChangedEventHandler PositionChanged
 Event that is thrown if position is changed.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class to describe a position object, that is a point in R^3, with reference information added.

Constructor & Destructor Documentation

◆ Position() [1/4]

Position ( IProvidesPositioningReferences  positioningReferenceProvider,
string  positioningReferenceKey 
)

Constructor that creates a position in the origin of a given reference coordinate system.

Parameters
positioningReferenceProviderThe object which provides the coordinate system that serves as reference for this position.
positioningReferenceKeyKey for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position.

◆ Position() [2/4]

Position ( Position  pos)

Copy constructor.

Parameters
posPosition to copy

◆ Position() [3/4]

Position ( Vector3D  coordinates,
IProvidesPositioningReferences  positioningReferenceProvider,
string  positioningReferenceKey 
)

Constructor to fill parameters.

Parameters
coordinatesCoordinates of position.
positioningReferenceProviderThe object which provides the coordinate system that serves as reference for this position.
positioningReferenceKeyKey for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position.

◆ Position() [4/4]

Position ( double  x,
double  y,
double  z,
IProvidesPositioningReferences  positioningReferenceProvider,
string  positioningReferenceKey 
)

Constructor to fill parameters.

Parameters
xx-coordinate
yy-coordinate
zz-coordinate
positioningReferenceProviderThe object which provides the coordinate system that serves as reference for this position.
positioningReferenceKeyKey for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position.

Member Function Documentation

◆ CalculateDistance()

double CalculateDistance ( Position  pos)

Calculates the absolute value of the distance from this position to another position.

Parameters
posPosition to calculate the distance to
Returns
Distance to pos

◆ Clone()

override object Clone ( )

Clones the current object.

Returns
Deep copy of this object.

◆ Equals()

override bool Equals ( object  obj,
EqualityIntent  equalityIntent 
)

Method which checks for equal objects.

Parameters
objObject to compare with this.
equalityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns
true if obj and this are equal.

◆ OnPositionChanged()

void OnPositionChanged ( Vector3D  oldPos,
Vector3D  newPos,
bool  refChanged 
)

Event throwing method.

Parameters
oldPosposition before the change
newPosposition after the change
refChangeda flag, indicating whether or not the reference coordinate system is changed

◆ operator!=()

static bool operator!= ( Position  pos1,
Position  pos2 
)
static

Overloaded unequality operator.

Parameters
pos1First Position to compare
pos2Second Position to compare
Returns
Are both positions unequal?

◆ operator==()

static bool operator== ( Position  pos1,
Position  pos2 
)
static

Overloaded equality operator.

Parameters
pos1First Position to compare
pos2Second Position to compare
Returns
Are both positions equal?

◆ PositionChangedEventHandler()

void PositionChangedEventHandler ( Position  sender,
PositionChangedEventArgs  e 
)

Event handler for position changed events.

Parameters
sender
e

◆ SetPositioningReference()

void SetPositioningReference ( IProvidesPositioningReferences  referenceProvider,
string  key 
)

Method to set the PositioningReferenceProvider and the key for the coordinate system that serves as positioning reference.

Parameters
referenceProviderObject which provides the coordinate system that serves as reference for this position.
keyKey for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position

◆ ToString()

override string ToString ( )

Gives the coordinates of this position as String.

Returns

Property Documentation

◆ IsUndefined

bool IsUndefined
get

Gets whether the position is undefined.

Returns
true iff the Coordinates member is undefined.