public ScriptingNode(VplControl.Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            scriptingControl = new ScriptingControl();


            scriptingControl.HighlightingComboBox.SelectionChanged += HighlightingComboBoxOnSelectionChanged;


            // Create new script File
            scriptingControl.CurrentFile = new CSharpScriptFile2();


            // scriptingControl.Height = 700;
            //scriptingControl.Width = 700;
            //scriptingControl.DockPanel.Height = 400;
            IsResizeable = false;

            //scriptingControl.StartCompilingEventHandler += StartCompilingEventHandler;

            scriptingControl.StartCSharpCompilingEventHandler += StartCSharpCompilation;
            scriptingControl.StartPythonCompilingEventHandler += StartPythonCompilation;

            AddControlToNode(scriptingControl);

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

            AddOutputPortToNode("Output", typeof(object));
        }
Beispiel #2
0
        public IntegerPort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas) : base(name, portType, type, hostCanvas)
        {
            // Set the DataType
            DataType = typeof(int);

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

            if (Data != null)
            {
                integerSlider.SliderValue = (int)Data;
            }

            var binding = new Binding("Data")
            {
                Mode   = BindingMode.OneWayToSource,
                Source = this
            };

            integerSlider.SetBinding(SliderExpanderInteger.SliderValueProperty, binding);
            AddPopupContent(integerSlider);
        }
Beispiel #3
0
        public FilePathPort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas) : base(name, portType, type, hostCanvas)
        {
            // Set the DataType
            DataType = typeof(string);

            Grid grid = new Grid();

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

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

            if (Data != null)
            {
                textBlock.Text = (string)Data;
            }

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

            button.Click += button_Click;

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

            AddPopupContent(grid);
        }
        /// <summary>
        /// This Node may be composed of other Elements (Base Operators and Elements)
        /// </summary>
        /// <param name="hostCanvas"></param>
        public ComposedNode(VplControl.Core.VplControl hostCanvas) : base(hostCanvas)
        {
            // Define the file path
            filePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
                       @"\Nemetschek\bim+\ComposedNodes\" + Guid + ".vpxml";

            if (!File.Exists(filePath))
            {
                File.Create(filePath);
            }

            // Label
            var lbl = new Label()
            {
                Content             = "Composition Node",
                HorizontalAlignment = HorizontalAlignment.Center
            };

            AddControlToNode(lbl);
            // TextBox
            var textBox = new TextBox()
            {
                MinWidth = 150,
                Text     = "Enter Method Name here ..."
            };

            textBox.TextChanged += TextBoxOnTextChanged;
            AddControlToNode(textBox);

            portMap = new Dictionary <Guid, Port>();
        }
        public StringPort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas) : base(name, portType, type, hostCanvas)
        {
            // Set the DataType
            DataType    = typeof(string);
            portControl = new WatchPortControl();

            AddPopupContent(portControl);

            DataChanged += OnDataChanged;
        }
Beispiel #6
0
        public Watch3DPort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas) : base(name, portType, type, hostCanvas)
        {
            watch3DControl = new Watch3DControl();
            DataChanged   += OnDataChanged;

            // Init Viewport
            HelixViewport3D       = watch3DControl.ViewPort3D;
            HelixViewport3D.Title = "Watch3D";

            AddPopupContent(watch3DControl);

            MouseWheel += OnMouseWheel;
        }
Beispiel #7
0
        public ExtendedPort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas, Guid id = new Guid())
            : base(name, portType, type, hostCanvas)
        {
            // DefaultNode for the handling in the mainHostCanvas --> Checking the parentNode which should not be null
            ParentNode = new DefaultNode(hostCanvas);

            // Check (Create a Guid for the Port)
            if (id == Guid.Empty)
            {
                Id = Guid.NewGuid();
            }

            // UI
            PopupGrid = new Grid
            {
                Background          = Brushes.Transparent,
                Opacity             = 1,
                HorizontalAlignment = HorizontalAlignment.Center,
                Margin = new Thickness(2)
            };

            PopupBorder = new Border
            {
                Background      = Brushes.White,
                CornerRadius    = new CornerRadius(5),
                BorderBrush     = new SolidColorBrush(Colors.DarkGray),
                BorderThickness = new Thickness(2),
                Padding         = new Thickness(10)
            };

            // Then add your border to the grid
            PopupGrid.Children.Add(PopupBorder);

            popup = new Popup
            {
                Child              = PopupGrid,
                PlacementTarget    = this,
                PopupAnimation     = PopupAnimation.Fade,
                AllowsTransparency = true,
                ClipToBounds       = true,
            };

            // Turn off the Toolips
            ToolTip = null;

            MouseDown += OnMouseDown;

            MouseEnter           += PortOnMouseEnter;
            MouseLeave           += PortOnMouseLeave;
            PopupGrid.MouseLeave += PopupGridOnMouseLeave;
        }
        public StringPort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas) : base(name, portType, type, hostCanvas)
        {
            // Set the DataType
            DataType = typeof(string);

            var textBox = new TextBox {
                MinWidth = 50
            };

            AddPopupContent(textBox);

            if (Data != null)
            {
                textBox.Text = (string)Data;
            }

            textBox.TextChanged += TextBoxOnTextChanged;
        }
Beispiel #9
0
        public DoublePort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas) : base(name, portType, type, hostCanvas)
        {
            // Set the DataType
            DataType = typeof(double);

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

            var binding = new Binding("Data")
            {
                Mode   = BindingMode.OneWayToSource,
                Source = this
            };

            doubleSlider.SetBinding(SliderExpanderDouble.SliderValueProperty, binding);

            AddPopupContent(doubleSlider);
        }
Beispiel #10
0
 public ObjectPort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas) : base(name, portType, type, hostCanvas)
 {
     DataType = typeof(object);
 }
Beispiel #11
0
 /// <summary>
 /// This Node may be composed of other Elements (Base Operators and Elements)
 /// </summary>
 /// <param name="hostCanvas"></param>
 public DefaultNode(VplControl.Core.VplControl hostCanvas) : base(hostCanvas)
 {
 }