Programming Reference for VirtualLab Fusion  2022.1
Public Member Functions | Static Public Member Functions | Properties | Events | List of all members
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 More...
 
override object Clone ()
 Clones the current object. More...
 
override bool Equals (object obj, EqualityIntent equalityIntent)
 Method which checks for equal objects. More...
 
void OnPositionChanged (Vector3D oldPos, Vector3D newPos, bool refChanged)
 Event throwing method More...
 
 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. More...
 
 Position (IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey)
 Constructor that creates a position in the origin of a given reference coordinate system More...
 
 Position (Position pos)
 Copy constructor More...
 
 Position (Vector3D coordinates, IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey)
 Constructor to fill parameters. More...
 
void PositionChangedEventHandler (Position sender, PositionChangedEventArgs e)
 Event handler for position changed events More...
 
void SetPositioningReference (IProvidesPositioningReferences referenceProvider, string key)
 Method to set the PositioningReferenceProvider and the key for the coordinate system that serves as positioning reference More...
 
override string ToString ()
 Gives the coordinates of this position as String More...
 

Static Public Member Functions

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

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. More...
 
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.