123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- using CollaborativePlatformMain.DFEntity.MessageSubUtil;
- using CollaborativePlatformMain.Form.MessageSubPage.CreatLevel;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- namespace CollaborativePlatformMain.Form.MessageSubPage
- {
- /// <summary>
- /// SeconThreeDimensionalPage.xaml 的交互逻辑
- /// </summary>
- public partial class SeconThreeDimensionalPage : Page
- {
- /// <summary>
- /// 父级窗体
- /// </summary>
- public HomepageForm Homepage;
- /// <summary>
- /// 三维模型数据
- /// </summary>
- public List<ThreeModelEntity> ThreeModelEntities = new List<ThreeModelEntity>();
- /// <summary>
- /// 标高信息
- /// </summary>
- public ObservableCollection<LevelTableEntity> LevelTableEntities = new ObservableCollection<LevelTableEntity>();
- public SeconThreeDimensionalPage(HomepageForm homepage)
- {
- InitializeComponent();
- Homepage = homepage;
- }
- /// <summary>
- /// 窗体初始化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Window_Loaded(object sender, RoutedEventArgs e)
- {
- ThreeModelEntities = new List<ThreeModelEntity>();
- ThreeModelEntity threeModelEntity1 = new ThreeModelEntity("自动建模", new List<ThreeModelEntity>());
- ThreeModelEntity subData1 = new ThreeModelEntity("碰撞检查");
- ThreeModelEntity subData2 = new ThreeModelEntity("净高分析");
- ThreeModelEntity subData3 = new ThreeModelEntity("条文审查");
- ThreeModelEntity threeModelEntity2 = new ThreeModelEntity("模型应用", new List<ThreeModelEntity>() { subData1, subData2, subData3 });
- ThreeModelEntity threeModelEntity3 = new ThreeModelEntity("模型服务", new List<ThreeModelEntity>());
- ThreeModelEntities.Add(threeModelEntity1);
- ThreeModelEntities.Add(threeModelEntity2);
- ThreeModelEntities.Add(threeModelEntity3);
- tr_threemodel.ItemsSource = null;
- tr_threemodel.ItemsSource = ThreeModelEntities;
- //bt_autoModel.BorderThickness = new Thickness(0);
- //bt_modelUser.BorderThickness = new Thickness(0);
- //bt_modelEmploy.BorderThickness = new Thickness(0);
- }
- /// <summary>
- /// 创建标高体系
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bt_creatLevel_Click(object sender, RoutedEventArgs e)
- {
- CreatLevelForm creatLevelForm = new CreatLevelForm(this);
- creatLevelForm.Show();
- }
- /// <summary>
- /// 设置标高
- /// </summary>
- public void SetLevelData()
- {
- sp_creatLevel.Children.Clear();
- foreach (var levelTableEntity in LevelTableEntities)
- {
- Label label = new Label();
- label.Content = levelTableEntity.LevelNmae;
- label.BorderThickness = new Thickness(0);
- label.HorizontalAlignment = HorizontalAlignment.Left;
- //label.Width = 80;
- Button button = new Button();
- button.Content = "上传图纸";
- button.BorderThickness = new Thickness(0);
- button.Width = 80;
- button.HorizontalAlignment = HorizontalAlignment.Left;
- button.Click += new RoutedEventHandler(UploadDrawings);
- DockPanel dockPanel = new DockPanel();
- dockPanel.Children.Add(label);
- dockPanel.Children.Add(button);
- sp_creatLevel.Children.Add(dockPanel);
- }
- }
- /// <summary>
- /// 上传图纸-CAD截取
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- public void UploadDrawings(object sender, RoutedEventArgs e)
- {
- }
- /// <summary>
- /// 上传图纸到服务器
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void upDrawing_Click(object sender, RoutedEventArgs e)
- {
- int a = 1;
- }
- private void tr_threemodel_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
- {
- }
- /// <summary>
- /// 点击数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Button button = sender as Button;
- string value = button.Content.ToString();
- if (value == "自动建模")
- {
- sp_autoModel.Visibility = Visibility.Visible;
- sp_modelUser1.Visibility = Visibility.Collapsed;
- sp_modelUser2.Visibility = Visibility.Collapsed;
- sp_modelUser3.Visibility = Visibility.Collapsed;
- sp_modelEmploy.Visibility = Visibility.Collapsed;
- }
- else if (value == "模型应用")
- {
- //sp_autoModel.Visibility = Visibility.Collapsed;
- //sp_modelUser1.Visibility = Visibility.Collapsed;
- //sp_modelUser2.Visibility = Visibility.Collapsed;
- //sp_modelUser3.Visibility = Visibility.Collapsed;
- //sp_modelEmploy.Visibility = Visibility.Collapsed;
- }
- else if (value == "模型服务")
- {
- sp_autoModel.Visibility = Visibility.Collapsed;
- sp_modelUser1.Visibility = Visibility.Collapsed;
- sp_modelUser2.Visibility = Visibility.Collapsed;
- sp_modelUser3.Visibility = Visibility.Collapsed;
- sp_modelEmploy.Visibility = Visibility.Visible;
- }
- else if (value == "碰撞检查")
- {
- sp_autoModel.Visibility = Visibility.Collapsed;
- sp_modelUser1.Visibility = Visibility.Visible;
- sp_modelUser2.Visibility = Visibility.Collapsed;
- sp_modelUser3.Visibility = Visibility.Collapsed;
- sp_modelEmploy.Visibility = Visibility.Collapsed;
- }
- else if (value == "净高分析")
- {
- sp_autoModel.Visibility = Visibility.Collapsed;
- sp_modelUser1.Visibility = Visibility.Collapsed;
- sp_modelUser2.Visibility = Visibility.Visible;
- sp_modelUser3.Visibility = Visibility.Collapsed;
- sp_modelEmploy.Visibility = Visibility.Collapsed;
- }
- else if (value == "条文审查")
- {
- sp_autoModel.Visibility = Visibility.Collapsed;
- sp_modelUser1.Visibility = Visibility.Collapsed;
- sp_modelUser2.Visibility = Visibility.Collapsed;
- sp_modelUser3.Visibility = Visibility.Visible;
- sp_modelEmploy.Visibility = Visibility.Collapsed;
- }
- }
- /// <summary>
- /// 鼠标双击类型
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void TextBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
- {
- bool isSelectDwg = ShowSelectDWGFiles(out string filePath);
- if (isSelectDwg)
- {
- selectModelApplication1.Text = "";
- selectModelApplication1.Text = filePath;
- }
- }
- /// <summary>
- /// 新增
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Button_Click_1(object sender, RoutedEventArgs e)
- {
- TextBox textBox = new TextBox();
- textBox.Width = 80;
- textBox.Margin = new Thickness(0, 5, 0, 0);
- sp_objectName.Children.Add(textBox);
- Button button = new Button();
- button.Width = 80;
- button.Content = "上传";
- button.Margin = new Thickness(0, 5, 0, 0);
- sp_objectDraw.Children.Add(button);
- }
- /// <summary>
- /// 选择单个文件
- /// </summary>
- /// <param name="filePath"></param>
- /// <returns></returns>
- public static bool ShowSelectDWGFiles(out string filePath)
- {
- filePath = "";
- System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
- dlg.Multiselect = false;//等于true表示可以选择多个文件
- dlg.DefaultExt = ".rvt";
- dlg.Filter = "RVT 文件|*.rvt";
- if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) return false;
- filePath = dlg.FileName;
- return true;
- }
- private void SelectmodelServices_MouseDoubleClick(object sender, MouseButtonEventArgs e)
- {
- bool isSelectDwg = ShowSelectDWGFiles(out string filePath);
- if (isSelectDwg)
- {
- selectModelServices.Text = "";
- selectModelServices.Text = filePath;
- selectModelServices.Foreground = Brushes.Black;
- }
- }
- /// <summary>
- /// 碰撞检测
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void TextBox_MouseDoubleClick1(object sender, MouseButtonEventArgs e)
- {
- bool isSelectDwg = ShowSelectDWGFiles(out string filePath);
- if (isSelectDwg)
- {
- selectModelApplication1.Text = "";
- selectModelApplication1.Text = filePath;
- selectModelApplication1.Foreground = Brushes.Black;
- }
- }
- /// <summary>
- /// 净高分析
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void TextBox_MouseDoubleClick2(object sender, MouseButtonEventArgs e)
- {
- bool isSelectDwg = ShowSelectDWGFiles(out string filePath);
- if (isSelectDwg)
- {
- selectModelApplication2.Text = "";
- selectModelApplication2.Text = filePath;
- selectModelApplication2.Foreground = Brushes.Black;
- }
- }
- /// <summary>
- /// 条文审查
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void TextBox_MouseDoubleClick3(object sender, MouseButtonEventArgs e)
- {
- bool isSelectDwg = ShowSelectDWGFiles(out string filePath);
- if (isSelectDwg)
- {
- selectModelApplication3.Text = "";
- selectModelApplication3.Text = filePath;
- selectModelApplication3.Foreground = Brushes.Black;
- }
- }
- }
- }
|