Пример #1
0
        ///////////////////////////////////////////

        public TransformTool(EngineViewportControl viewportControl)
        {
            this.viewportControl = viewportControl;

            modeObjects[0] = new ModeClass();
            modeObjects[1] = new PositionModeClass();
            modeObjects[2] = new RotationModeClass();
            modeObjects[3] = new PositionRotationModeClass();
            modeObjects[4] = new ScaleModeClass();
            modeObjects[5] = new ModeClass();
            foreach (var modeObject in modeObjects)
            {
                modeObject.owner = this;
            }

            Mode = ModeEnum.None;

            try
            {
                if (moveCursor == null)
                {
                    var hCursor = PlatformFunctionality.Get().GetSystemCursorByFileName(@"Base\UI\Cursors\Move.cur");
                    if (hCursor != IntPtr.Zero)
                    {
                        moveCursor = new Cursor(hCursor);
                    }
                    else
                    {
                        moveCursor = new Cursor(new MemoryStream(NeoAxis.Properties.Resources.MoveCursor));
                    }
                }

                if (rotateCursor == null)
                {
                    var hCursor = PlatformFunctionality.Get().GetSystemCursorByFileName(@"Base\UI\Cursors\Rotate.cur");
                    if (hCursor != IntPtr.Zero)
                    {
                        rotateCursor = new Cursor(hCursor);
                    }
                    else
                    {
                        rotateCursor = new Cursor(new MemoryStream(NeoAxis.Properties.Resources.RotateCursor));
                    }
                }

                if (scaleCursor == null)
                {
                    var hCursor = PlatformFunctionality.Get().GetSystemCursorByFileName(@"Base\UI\Cursors\Scale.cur");
                    if (hCursor != IntPtr.Zero)
                    {
                        scaleCursor = new Cursor(hCursor);
                    }
                    else
                    {
                        scaleCursor = new Cursor(new MemoryStream(NeoAxis.Properties.Resources.ScaleCursor));
                    }
                }
            }
            catch { }
        }