XToolControl.cs
上传用户:lslight
上传日期:2022-01-10
资源大小:14248k
文件大小:5k
- ////////////////////////////////////////////////////////////////////////
- // ■■■■ ■■■■■ ■■■■ ■ ■ //
- // ■ ■ ■ ■ ■ //
- // ■ ■ ■ ■■■ ■ ■ //
- // ■ ■ ■ ■ ■ ■ //
- // ■■■■ ■ ■■■■ ■■■■ //
- // Copyright (c) 三峡大学水利与环境学院 肖泽云. All rights reserved. //
- ////////////////////////////////////////////////////////////////////////
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Text;
- using System.Windows.Forms;
- namespace CTGU.XZY
- {
- public partial class XToolControl : UserControl
- {
- public XSceneControl xSceneControl;
- public XToolControl()
- {
- InitializeComponent();
- }
- [Description("设置三维控件对象")] //显示在属性设计视图中的描述
- [Browsable(true)]//指定是否在属性栏可见
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]//指定属性对设计时序列化程序所具有的可见性。
- public XSceneControl SceneControl
- {
- get
- {
- return xSceneControl;
- }
- set
- {
- this.xSceneControl = value;
- }
- }
- private bool CheckControl()//用于检查是否链接到三维控件
- {
- if (xSceneControl == null)
- {
- return false;
- }
- else
- {
- return true;
- }
- }
- private void originViewTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.ResetView();
- }
- private void refreshViewTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.Render();
- }
- private void zoomInTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.ZoomIn();
- }
- private void zoomOutTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.ZoomOut();
- }
- private void lastViewTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.LastScene();
- }
- private void nextViewTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.NextScene();
- }
- private void rotateLeftTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.RotateLeft();
- }
- private void rotateRightTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.RotateRight();
- }
- private void rotateUpTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.RotateUp();
- }
- private void rotateDownTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.RotateDown();
- }
- private void viewTopTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.TopView();
- }
- private void viewFrontButton_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.FrontView();
- }
- private void viewLeftTool_Click(object sender, EventArgs e)
- {
- if (!CheckControl())
- {
- return;
- }
- xSceneControl.LeftView();
- }
- }
- }