private SWMM.Matrix3D GetTranslateTransformation(MVMIH.IRotationHandle rh) { var me = rh as IMachineElement; var eleToMove = me.Parent.Parent; var matrix = eleToMove.GetChainTransformation(); return(matrix); }
public RotateEventHandler(MVMIH.IRotationHandle rotationHandle) { _rotationHandle = rotationHandle; _matrix = GetTranslateTransformation(rotationHandle); _eleRotMatrix = Converters.StaticTransformationConverter.Convert((rotationHandle as IMachineElement).Parent.Parent.Transformation); _rotationDirection = _eleRotMatrix.Transform(GetRotationDirection(rotationHandle)); _rotationCenter = _eleRotMatrix.Transform(GetRotationCenter((rotationHandle as IMachineElement).Parent.Parent)); _rotationHandle.StartRotate(); }
private SWMM.Vector3D GetRotationDirection(MVMIH.IRotationHandle rotationHandle) { SWMM.Vector3D n; switch (rotationHandle.Type) { case MVMIH.Type.X: n = new SWMM.Vector3D(1.0, 0.0, 0.0); break; case MVMIH.Type.Y: n = new SWMM.Vector3D(0.0, 1.0, 0.0); break; case MVMIH.Type.Z: n = new SWMM.Vector3D(0.0, 0.0, 1.0); break; default: break; } return(n); }