Ejemplo n.º 1
0
        private SWMM.Matrix3D GetTranslateTransformation(MVMIH.IRotationHandle rh)
        {
            var me        = rh as IMachineElement;
            var eleToMove = me.Parent.Parent;
            var matrix    = eleToMove.GetChainTransformation();

            return(matrix);
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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);
        }