| standard library package SpatialItems { |
| doc |
| |
| |
| |
| |
|
|
| private import Objects::Point; |
| private import SpatialFrames::SpatialFrame; |
| private import Quantities::VectorQuantityValue; |
| private import MeasurementReferences::ThreeDCoordinateFrame; |
| private import MeasurementReferences::nullTransformation; |
| private import Time::Clock; |
| private import Time::TimeInstantValue; |
| private import ScalarValues::Natural; |
| private import ISQ::universalCartesianSpatial3dCoordinateFrame; |
| private import ISQ::Position3dVector; |
| private import ISQ::Displacement3dVector; |
| private import VectorFunctions::isZeroVector; |
| private import SequenceFunctions::isEmpty; |
| private import ControlFunctions::forAll; |
| |
| item def SpatialItem :> SpatialFrame { |
| doc |
| |
| |
| |
| |
| ref item :>> localClock : Clock[1] default Time::universalClock { |
| doc |
| |
| |
| |
| |
| } |
| |
| attribute coordinateFrame : ThreeDCoordinateFrame[1] default universalCartesianSpatial3dCoordinateFrame { |
| doc |
| |
| |
| |
| |
| |
| } |
| |
| item originPoint : Point[1] :> spaceShots { |
| doc |
| |
| |
| |
| } |
| |
| assert constraint originPointConstraint { |
| doc |
| |
| |
| |
| |
| isZeroVector(CurrentPositionOf(originPoint, that)) |
| } |
|
|
| item componentItems : SpatialItem[1..*] :> subitems { |
| doc |
| |
| |
| |
| |
| |
| |
| item :>> localClock default (that as SpatialItem).localClock; |
| attribute :>> coordinateFrame { |
| attribute :>> mRefs default (that.that as SpatialItem).coordinateFrame.mRefs; |
| attribute :>> transformation[1] default nullTransformation { |
| attribute :>> source default (that.that.that as SpatialItem).coordinateFrame; |
| } |
| } |
| } |
|
|
| private attribute cunionNum: Natural [1] = if isEmpty(componentItems) ? 0 else 1; |
| private attribute componentUnion[cunionNum] :> unionsOf { |
| doc |
| |
| |
| |
| |
| item :>> elements : SpatialItem [1..*] = componentItems; |
| } |
| } |
|
|
| calc def PositionOf :> SpatialFrames::PositionOf { |
| doc |
| |
| |
| |
| |
| |
| |
| in point : Point[1]; |
| in timeInstant : TimeInstantValue[1]; |
| in enclosingItem :>> 'frame' : SpatialItem[1]; |
| in clock : Clock[1] default enclosingItem.localClock; |
| return positionVector : Position3dVector[1] { |
| attribute :>> mRef = enclosingItem.coordinateFrame; |
| } |
| } |
|
|
| calc def CurrentPositionOf :> SpatialFrames::CurrentPositionOf { |
| doc |
| |
| |
| |
| |
| |
| in point : Point[1]; |
| in enclosingItem :>> 'frame' : SpatialItem[1]; |
| in clock : Clock[1] default enclosingItem.localClock; |
| return positionVector : Position3dVector[1] { |
| attribute :>> mRef = enclosingItem.coordinateFrame; |
| } |
| } |
|
|
| calc def DisplacementOf :> SpatialFrames::DisplacementOf { |
| doc |
| |
| |
| |
| |
| |
| |
| in point1 : Point[1]; |
| in point2 : Point[1]; |
| in timeInstant : TimeInstantValue[1]; |
| in spatialItem :>> 'frame' : SpatialItem[1]; |
| in clock : Clock[1] default spatialItem.localClock; |
| return displacementVector : Displacement3dVector[1] { |
| attribute :>> mRef = spatialItem.coordinateFrame; |
| } |
| } |
|
|
| calc def CurrentDisplacementOf :> SpatialFrames::CurrentDisplacementOf { |
| doc |
| |
| |
| |
| |
| |
| in point1 : Point[1]; |
| in point2 : Point[1]; |
| in spatialItem :>> 'frame' : SpatialItem[1]; |
| in clock : Clock[1] default spatialItem.localClock; |
| return displacementVector : Displacement3dVector[1] { |
| attribute :>> mRef = spatialItem.coordinateFrame; |
| } |
| } |
|
|
| } |