public IfcProjectOutputPort(string name, PortTypes portType, Type type, Core.VplControl hostCanvas, Guid id = new Guid())
            : base(name, portType, type, hostCanvas, id)
        {
            var modelInfo = Data as IfcModel;

            if (modelInfo == null)
            {
                return;
            }
            SaveFileDialog saveFileDialog = new SaveFileDialog
            {
                Filter = "IfcFile |*.ifc",
                Title  = "Save an IFC File"
            };

            saveFileDialog.ShowDialog();
            if (saveFileDialog.FileName != "")
            {
                modelInfo.xModel.SaveAs(saveFileDialog.FileName);
                modelInfo.xModel.Close();
                if (File.Exists(saveFileDialog.FileName))
                {
                    MessageBox.Show("File saved", "My Application", MessageBoxButton.OK);
                }
                else
                {
                    MessageBox.Show("There was an Error \n Please Try again", "My Application", MessageBoxButton.OK);
                }
            }
            else
            {
                MessageBox.Show("Please Connect a Model", "My Application", MessageBoxButton.OK);
            }
        }
예제 #2
0
        public IfcWritePropertyNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            modelController = ModelController.Instance;
            AddInputPortToNode("ModelInfo", typeof(ModelInfo));

            _control = new IfcWritePropertyNodeControl();
        }
        public FilePathNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            AddOutputPortToNode("FilePath", typeof(object));

            var stack = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            textBox = new TextBox()
            {
                MinWidth = 120, MaxWidth = 300, IsHitTestVisible = false, IsEnabled = false
            };
            var button = new Button()
            {
                Content = "Choose a File", HorizontalAlignment = HorizontalAlignment.Right
            };

            stack.Children.Add(textBox);
            stack.Children.Add(button);

            textBox.TextChanged += textBox_TextChanged;
            textBox.KeyUp       += textBox_KeyUp;

            button.Click += ButtonOnClick;

            AddControlToNode(stack);
        }
        private Color TTBigger             = Colors.Red;   //for TT values in the last(bigger) range

        public EnergyVisualisationNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            // Init UI
            IsResizeable = true;

            AddInputPortToNode("Model", typeof(string));
            AddOutputPortToNode("SelectedEntities", typeof(List <IfcGloballyUniqueId>));

            EnergyVisualisationControl energyVisualisationControl = new EnergyVisualisationControl();

            _viewPort = energyVisualisationControl.Viewport3D;

            //create a bar
            //  ProgressBar ColorBarAll = new ProgressBar();//creates a new progress bar, it can be any other control, but this will work
            ProgressBar ColorBar = energyVisualisationControl.ColorBarAll;

            //  ColorBarAll.Height = 20;//defines the height
            //  ColorBarAll.Width = 400;//defines the width
            //ColorBar.Background=new Color(Color)
            ColorBar.Value = 0;//just keeps the progress bar empty
            _Colors        = GetStaticPropertyBag(typeof(Colors)).ToList();

            AddControlToNode(energyVisualisationControl); //#0
                                                          //   AddControlToNode(ColorBarAll);//#1
        }
예제 #5
0
        public ColorNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("Color", typeof(Color));

            expander = new ExpanderColor
            {
                Style = hostCanvas.FindResource("ExpanderColorStyle") as Style
            };

            cc = new ColorCanvas
            {
                Background  = Brushes.White,
                BorderBrush = Brushes.White
            };



            expander.Content         = cc;
            cc.SelectedColorChanged += cc_SelectedColorChanged;

            cc.SelectedColor = Colors.LightGray;

            AddControlToNode(expander);
        }
예제 #6
0
        public BimPlusProjectPort(string name, PortTypes portType, Type type, Core.VplControl hostCanvas)
            : base(name, portType, type, hostCanvas)
        {
            _dataController = DataController.Instance;

            // AddPopupContent(contentGrid);

            Grid grid = new Grid();

            grid.RowDefinitions.Add(new RowDefinition());
            grid.RowDefinitions.Add(new RowDefinition());

            textBlock = new TextBlock()
            {
                MinWidth = 120, MaxWidth = 300, IsHitTestVisible = false
            };

            var button = new Button
            {
                Content = "ProjectSelection",
                Margin  = new Thickness(5)
            };

            button.Click += ButtonOnClick;


            grid.Children.Add(textBlock);
            grid.Children.Add(button);

            AddPopupContent(grid);

            // MouseDown += OnMouseDown;
        }
예제 #7
0
        public FilePathNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("String", typeof(string));

            var grid = new Grid();

            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(60, GridUnitType.Pixel)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(100, GridUnitType.Auto)
            });

            textBlock = new TextBlock {
                IsHitTestVisible = false, VerticalAlignment = VerticalAlignment.Center
            };

            textBlock.SetValue(ColumnProperty, 1);

            var button = new Button {
                Content = "Search"
            };

            button.Click += button_Click;
            button.Width  = 50;

            grid.Children.Add(textBlock);
            grid.Children.Add(button);

            AddControlToNode(grid);
        }
예제 #8
0
        public WebProjectSelectionNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            DataContext = this;

            AddOutputPortToNode("Project", typeof(object));
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            IsResizeable = true;

            var webControl = new ProjectSelection(_controller.IntBase);

            {
                Visibility = Visibility.Visible;
            };

            // webControl.ProjectChangedEventHandler += ProjectSelectionViewModelOnProjectChangedEventHandler;
            // webControl.TeamChangedEventHandler += ProjectSelectionViewModelOnTeamChangedEventHandler;

            var pr = new ContentPresenter
            {
                Content   = webControl,
                MinWidth  = 600,
                MinHeight = 600
            };

            AddControlToNode(pr);
        }
        public PropertyNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            DataContext = this;

            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            // Ports
            AddInputPortToNode("Element", typeof(object));
            AddOutputPortToNode("Property", typeof(object));

            // Init the Control
            _control = new PropertyNodeControl
            {
                DataContext = this
            };

            AddControlToNode(_control);
            // EventHandlers
            _control.ElementTypeListBox.SelectionChanged    += ElementTypeListBoxOnSelectionChanged;
            _control.AttributeGroupListBox.SelectionChanged += AttributeGroupListBoxOnSelectionChanged;
            _control.AttributesListBox.SelectionChanged     += AttributesListBoxOnSelectionChanged;

            _control.FilterTextBox.SelectionChanged += FilterTextBoxOnSelectionChanged;
        }
예제 #10
0
        public IntegerSlider(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("Number", typeof(int));

            SliderExpanderInteger expander = new SliderExpanderInteger
            {
                Style       = hostCanvas.FindResource("ExpanderSliderStyleInteger") as Style,
                SliderValue = 5,
                SliderMax   = 10,
                SliderMin   = 0,
                SliderStep  = 1
            };

            var b2 = new Binding("Data")
            {
                Mode   = BindingMode.OneWayToSource,
                Source = OutputPorts[0]
            };

            expander.SetBinding(SliderExpanderInteger.SliderValueProperty, b2);

            Name = "Integer slider";

            AddControlToNode(expander);
        }
        public DoubleSlider(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("Number", typeof(double));

            SliderExpanderDouble expander = new SliderExpanderDouble
            {
                Style       = hostCanvas.FindResource("ExpanderSliderStyleDouble") as Style,
                SliderValue = 5,
                SliderMax   = 10,
                SliderMin   = 2,
                SliderStep  = 0.01
            };

            var b2 = new Binding("Data")
            {
                Mode   = BindingMode.OneWayToSource,
                Source = OutputPorts[0]
            };

            expander.SetBinding(SliderExpanderDouble.SliderValueProperty, b2);

            Name = "Double slider";

            AddControlToNode(expander);
        }
예제 #12
0
        public WatchNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            AddInputPortToNode("Object", typeof(object));

            var textBlock = new TextBlock
            {
                TextWrapping     = TextWrapping.Wrap,
                FontSize         = 14,
                Padding          = new Thickness(5),
                IsHitTestVisible = false
            };

            var scrollViewer = new ScrollViewer
            {
                HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
                VerticalScrollBarVisibility   = ScrollBarVisibility.Auto,
                MinWidth         = 120,
                MinHeight        = 20,
                MaxWidth         = 200,
                MaxHeight        = 400,
                CanContentScroll = true,
                Content          = textBlock
                                   //IsHitTestVisible = false
            };


            AddControlToNode(scrollViewer);
        }
        public ElementTypeNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            DataContext = this;

            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;


            AddOutputPortToNode("ElementType", typeof(object));

            _typeComboBox = new ComboBox
            {
                DisplayMemberPath = "Name",
                Margin            = new Thickness(5, 20, 5, 15)
            };
            _typeComboBox.SelectionChanged += SelectionChanged;

            if (_controller.IntBase.ApiCore != null)
            {
                _typeComboBox.ItemsSource = _controller.IntBase.ApiCore.DtObjects.GetElementTypes();
            }
            AddControlToNode(_typeComboBox);

            QuestButton.Visibility = Visibility.Visible;
            BinButton.Visibility   = Visibility.Visible;

            // TopComment.Visibility = Visibility.Visible;
            // BottomComment.Visibility = Visibility.Visible;
        }
예제 #14
0
        public InsertFunction(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            AddOutputPortToNode("function", typeof(string));

            var label = new Label
            {
                Content  = "f(x)=",
                FontSize = 14,
                HorizontalContentAlignment = HorizontalAlignment.Left,
            };

            var function = new TextBox
            {
                MinWidth            = 200,
                FontSize            = 14,
                HorizontalAlignment = HorizontalAlignment.Stretch
            };

            function.TextChanged += function_TextChanged;
            function.KeyUp       += function_KeyUp;

            MouseEnter += InsertFunction_MouseEnter;
            MouseLeave += InsertFunction_MouseLeave;

            AddControlToNode(label);
            AddControlToNode(function);
        }
        public FilePathNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("String", typeof(string));

            Grid grid = new Grid();

            grid.ColumnDefinitions.Add(new ColumnDefinition());
            grid.ColumnDefinitions.Add(new ColumnDefinition());

            textBlock = new TextBlock()
            {
                MinWidth = 120, MaxWidth = 300, IsHitTestVisible = false
            };

            var button = new Button {
                Content = "Search"
            };

            button.Click += button_Click;
            button.Width  = 50;

            grid.Children.Add(textBlock);
            grid.Children.Add(button);

            AddControlToNode(grid);
        }
예제 #16
0
 public WriteAdvisoryNode(Core.VplControl hostCanvas) : base(hostCanvas)
 {
     AddControlToNode(new RichTextBox()
     {
         MinWidth = 100, MaxWidth = 400, Width = 150
     });
     AddInputPortToNode("Object", typeof(object));
 }
예제 #17
0
        public DrawFunction(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            Control = new DrawFunctionControl();

            AddInputPortToNode("function", typeof(string));

            AddOutputPortToNode("table", typeof(double));
        }
        public JoinNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddInputPortToNode("Relation", typeof(Relation));
            AddInputPortToNode("Relation", typeof(Relation));

            AddOutputPortToNode("Relation3", typeof(Relation3));
            BinButton.Visibility = Visibility.Hidden;
        }
        public BimPlusWatch3DNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            HelixViewport3D.Title = "BimPlus Viewer";

            // Refresh the selected Models
            SelectedModels = new List <GeometryModel3D>();
        }
예제 #20
0
        public TemplateNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddInputPortToNode("Test", typeof(object));
            AddOutputPortToNode("Test", typeof(object));

            AddControlToNode(new Label {
                Content = "TemplateNode"
            });
        }
예제 #21
0
        public FilePathNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            AddOutputPortToNode("String", typeof(string));

            FilePathControl filePathControl = new FilePathControl();

            filePathControl.Button.Click += button_Click;

            AddControlToNode(filePathControl);
        }
예제 #22
0
        public IfcMvdFilter(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddInputPortToNode("Mvd", typeof(object), true);
            AddInputPortToNode("Ifc", typeof(object), true);

            AddOutputPortToNode("FilteredProducts", typeof(object));

            // AddControlToNode();
        }
예제 #23
0
        public TobiasKnoten(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            AddInputPortToNode("function", typeof(string));

            IsResizeable = true;
            var KoordSys = new DataGrid();


            AddControlToNode(KoordSys);
        }
예제 #24
0
 public ANode(Core.VplControl hostCanvas)
     : base(hostCanvas)
 {
     AddControlToNode(new Label {
         Content = "ANode测试"
     });
     AddInputPortToNode("AInput1", typeof(string));
     AddOutputPortToNode("AOutput1", typeof(string));
     BottomComment.Text = "测试节点,左边表示输入端口,右边表示输出端口";
 }
예제 #25
0
        public IssueContainerNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            AddInputPortToNode("Project", typeof(object));
            AddOutputPortToNode("Issues", typeof(object));
            DataContext = this;
        }
 protected DataObjectNode(Core.VplControl hostCanvas)
     : base(hostCanvas)
 {
     if (Border == null)
     {
         return;
     }
     Border.BorderBrush     = Brushes.Blue;
     Border.BorderThickness = new Thickness(2);
     Border.CornerRadius    = new CornerRadius(0);
 }
        public IfcOperationalSpaces(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            IsResizeable = true;

            AddInputPortToNode("ModelInfo", typeof(ModelInfo));

            modelController = ModelController.Instance;

            _control = new IfcOperationalSpacesControl();
            AddControlToNode(_control);
        }
예제 #28
0
        public IfcAccessibilityGraph(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            IsResizeable = true;

            AddInputPortToNode("ModelInfo", typeof(ModelInfo));

            modelController = ModelController.Instance;

            control = new IFCViewerControl();
            AddControlToNode(control);
        }
        public IfcOperationalSpacesNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            IsResizeable = true;

            AddInputPortToNode("ModelInfo", typeof(object));

            modelController = ModelController.Instance;

            control = new IFCViewerControl();
            AddControlToNode(control);
        }
예제 #30
0
 protected UtilityNode(Core.VplControl hostCanvas)
     : base(hostCanvas)
 {
     if (Border == null)
     {
         return;
     }
     Border.BorderBrush     = Brushes.Green;
     Border.BorderThickness = new Thickness(2);
     Border.CornerRadius    = new CornerRadius(0);
 }
예제 #31
0
 public Theme(Core.VplControl hostCanvas)
 {
     this.hostCanvas = hostCanvas;
 }