コード例 #1
0
        private void BtnContent_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Button  contBox = (Button)sender;
            D3Model d3Model = d3ModelsList.Find((item) => item.Name.Contains(contBox.Content.ToString()));

            clearContent.Content = d3Model.id;
            Model.Children.Clear();
            Model.Children.Add(d3Model.helixViewport3D);
        }
コード例 #2
0
 private void BtnClear_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     if (Model.Children.Count > 0)
     {
         Model.Children.Clear();
         D3Model d3Model = d3ModelsList.Find((item) => item.id.Equals(clearContent.Content));
         if (d3Model != null)
         {
             d3ModelsList.Remove(d3Model);
             ListTasks.ItemsSource = null;
             ListTasks.ItemsSource = d3ModelsList;
         }
     }
 }
コード例 #3
0
        private void BtnLoad_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            D3Model        d3             = new D3Model();

            openFileDialog.Filter = "Obj files (*.obj)|*.obj";
            if (openFileDialog.ShowDialog() == true)
            {
                string          name       = Path.GetFileName(openFileDialog.FileName);
                HelixViewport3D hekixModel = new HelixViewport3D();
                ModelVisual3D   device     = new ModelVisual3D();
                device.Content = getModel(hekixModel, openFileDialog.FileName);
                hekixModel.Children.Add(device);
                Model.Children.Add(hekixModel);

                d3ModelsList.Add(new D3Model()
                {
                    id = d3ModelsList.Count + 1, Name = name.Substring(0, name.Length - 4), helixViewport3D = hekixModel
                });
                ListTasks.ItemsSource = null;
                ListTasks.ItemsSource = d3ModelsList;
            }
        }