Example #1
0
        public MoveEventsHandler(MVMIH.IPositionHandle positionHandle)
        {
            _positionHandle = positionHandle;
            _matrix         = GetTranslateTransformation(positionHandle);

            _positionHandle.StartMove();
        }
Example #2
0
        private SWMM.Matrix3D GetTranslateTransformation(MVMIH.IPositionHandle ph)
        {
            var me        = ph as IMachineElement;
            var eleToMove = me.Parent.Parent;
            var matrix    = eleToMove.GetChainTransformation();

            matrix.OffsetX = 0;
            matrix.OffsetY = 0;
            matrix.OffsetZ = 0;

            return(matrix);
        }
Example #3
0
        private SWMM.Vector3D GetMoveDirection(MVMIH.IPositionHandle positionHandle)
        {
            SWMM.Vector3D v;

            switch (_positionHandle.Type)
            {
            case MVMIH.Type.X:
                v = new SWMM.Vector3D(1.0, 0.0, 0.0);
                break;

            case MVMIH.Type.Y:
                v = new SWMM.Vector3D(0.0, 1.0, 0.0);
                break;

            case MVMIH.Type.Z:
                v = new SWMM.Vector3D(0.0, 0.0, 1.0);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(v);
        }