Esempio n. 1
0
        public void SwitchTool(EnumTool targetToolType)
        {
            if (this.Mesh == null)
                return;

            AbstractTool targetTool = null;
            switch (targetToolType)
            {
                case EnumTool.View :
                    targetTool = new ToolView(Width, Height);
                    break;
                case EnumTool.VertexByPoint:
                    targetTool = new ToolVertexByPoint( Width,  Height, this.Mesh);
                    break;
                case EnumTool.VertexByCicle:
                    targetTool = new ToolVertexByCircle( Width,  Height, this.Mesh);
                    break;
                case EnumTool.VertexByRectangle:
                    targetTool = new ToolVertexByRectangle( Width,  Height, this.Mesh);
                    break;
                case EnumTool.VertexByCurve:
                    targetTool = new ToolPointByCurve( Width,  Height, this.Mesh);
                    break;
                case EnumTool.EdgeByCicle:
                    targetTool = new ToolEdgeByCircle( Width, Height, this.Mesh);
                    break;
                case EnumTool.EdgeByRectangle:
                    targetTool = new ToolEdgeByRectangle( Width,  Height, this.Mesh);
                    break;
                case EnumTool.EdgeByCurve:
                    targetTool = new ToolEdgeByCurve(Width, Height, this.Mesh);
                    break;
                case EnumTool.EdgeByPoint:
                    targetTool = new ToolEdgeByPoint( Width, Height, this.Mesh);
                    break;
                case EnumTool.FaceByCicle:
                    targetTool = new ToolFaceByCircle( Width,  Height, this.Mesh);
                    break;
                case EnumTool.FaceByRectangle:
                    targetTool = new ToolFaceByRectangle( Width, Height, this.Mesh);
                    break;
                case EnumTool.FaceByPoint:
                    targetTool = new ToolFaceByPoint( Width,  Height, this.Mesh);
                    break;
                case EnumTool.PointMove:
                    targetTool = new ToolMovePoint( Width,  Height, this.Mesh);
                    break; 

                case EnumTool.PointSingleMove:
                    targetTool = new ToolMoveSinglePoint(Width, Height, this.Mesh);
                    break;
                
            }

             
            this.Tool = targetTool;
            this.tool.Changed += new AbstractTool.ChangedEventHandlerTool(tool_ChangedTool);
        }
Esempio n. 2
0
        public void SwitchTool(EnumTool targetToolType)
        {
            if (this.Mesh == null)
            {
                return;
            }

            AbstractTool targetTool = null;

            switch (targetToolType)
            {
            case EnumTool.View:
                targetTool = new ToolView(Width, Height);
                break;

            case EnumTool.VertexByPoint:
                targetTool = new ToolVertexByPoint(Width, Height, this.Mesh);
                break;

            case EnumTool.VertexByCicle:
                targetTool = new ToolVertexByCircle(Width, Height, this.Mesh);
                break;

            case EnumTool.VertexByRectangle:
                targetTool = new ToolVertexByRectangle(Width, Height, this.Mesh);
                break;

            case EnumTool.VertexByCurve:
                targetTool = new ToolPointByCurve(Width, Height, this.Mesh);
                break;

            case EnumTool.EdgeByCicle:
                targetTool = new ToolEdgeByCircle(Width, Height, this.Mesh);
                break;

            case EnumTool.EdgeByRectangle:
                targetTool = new ToolEdgeByRectangle(Width, Height, this.Mesh);
                break;

            case EnumTool.EdgeByCurve:
                targetTool = new ToolEdgeByCurve(Width, Height, this.Mesh);
                break;

            case EnumTool.EdgeByPoint:
                targetTool = new ToolEdgeByPoint(Width, Height, this.Mesh);
                break;

            case EnumTool.FaceByCicle:
                targetTool = new ToolFaceByCircle(Width, Height, this.Mesh);
                break;

            case EnumTool.FaceByRectangle:
                targetTool = new ToolFaceByRectangle(Width, Height, this.Mesh);
                break;

            case EnumTool.FaceByPoint:
                targetTool = new ToolFaceByPoint(Width, Height, this.Mesh);
                break;

            case EnumTool.PointMove:
                targetTool = new ToolMovePoint(Width, Height, this.Mesh);
                break;

            case EnumTool.PointSingleMove:
                targetTool = new ToolMoveSinglePoint(Width, Height, this.Mesh);
                break;
            }


            this.Tool          = targetTool;
            this.tool.Changed += new AbstractTool.ChangedEventHandlerTool(tool_ChangedTool);
        }