Beispiel #1
0
        public dynColorBrightness()
        {
            InPortData.Add(new PortData("c", "The color", typeof(object)));
            OutPortData = new PortData("mag", "The magnitude of the color's vector", typeof(double));

            base.RegisterInputsAndOutputs();
        }
Beispiel #2
0
        public dynCurvesFromPS()
        {
            InPortData.Add(new PortData("ps", "Particle System", typeof(ParticleSystem)));
            OutPortData = new PortData("curves", "geometry curves.", typeof(object));

            base.RegisterInputsAndOutputs();
        }
Beispiel #3
0
        public dynTransaction()
        {
            InPortData.Add(new PortData("expr", "Expression to run in a transaction.", typeof(object)));
            OutPortData = new PortData("result", "Result of the expression.", typeof(object));

            base.RegisterInputsAndOutputs();
        }
Beispiel #4
0
        public dynCurveByPoints()
        {
            InPortData.Add(new PortData("refPts", "List of reference points", typeof(object)));
             OutPortData = new PortData("curve", "Curve from ref points", typeof(object));

             base.RegisterInputsAndOutputs();
        }
Beispiel #5
0
        public dynLeapController()
        {
            // This input will drive the acquire of a frame of data from the Leap.
            // Attaching a timer node to it will then generate a flow of data from
            // the Leap into the system.
            InPortData.Add(new PortData("Read", "Read a frame of data from the Leap", typeof(object)));

            // Output from this node is the data from a single frame
            OutPortData = new PortData("Leap", "The Leap controller", typeof(object));

            base.RegisterInputsAndOutputs();

            this.dynElementDestroyed += new dynElementDestroyedHandler(OnDynLeapMotionDestroyed);
            this.dynElementReadyToDestroy += new dynElementReadyToDestroyHandler(OnDynLeapMotionReadyToDestroy);

            // Create a menuitem to enable/disable the Leap device
            menuItemLeapEnabled = new System.Windows.Controls.MenuItem();
            menuItemLeapEnabled.Header = "Enable Leap";
            menuItemLeapEnabled.IsCheckable = true;
            menuItemLeapEnabled.IsChecked = (leapController != null);
            menuItemLeapEnabled.Checked += new System.Windows.RoutedEventHandler(menuItemLeapEnabled_Checked);
            this.MainContextMenu.Items.Add(menuItemLeapEnabled);

            LeapEnable(true);
        }
Beispiel #6
0
        public dynColumnGrid()
        {
            InPortData.Add(new PortData("line", "Geometry Line.", typeof(Line))); // MDJ TODO - expand this to work with curved grids.
            OutPortData = new PortData("grid", "Grid", typeof(Grid));

            base.RegisterInputsAndOutputs();
        }
Beispiel #7
0
        public dynExecuteInterval()
        {
            InPortData.Add(new PortData("ms", "Delay in milliseconds", typeof(double)));
            OutPortData = new PortData("", "Success?", typeof(bool));

            base.RegisterInputsAndOutputs();
        }
Beispiel #8
0
        /// <summary>
        /// The constructor for your type is where you define inputs and outputs.
        /// </summary>
        /// <param name="nickName"></param>
        public TestNode()
        {
            //System.Uri resourceLocater = new System.Uri("/dynElement.xaml", UriKind.Relative);
            //System.Windows.Application.LoadComponent(this, resourceLocater);

            //Define the data for the input ports
            //For each port you'll define an object value - this is usually null to start,
            //a short name which will appear on the node, a tooltip which appears when
            //you hover over the node, and a type which will keep nodes from connecting to
            //others of the wrong type
            InPortData.Add(new PortData("A", "The first port", typeof(dynElement)));
            InPortData.Add(new PortData("B", "The second port", typeof(dynElement)));
            InPortData.Add(new PortData("C", "The third port", typeof(dynElement)));

            //The ouput data looks very similar
            OutPortData = new PortData("me", "The result of this node.", typeof(dynElement));
            
            //make the first output port's object the tree
            //from this object. this isn't required yet by the interface, but it's
            //nice if you want the results of this node to be
            //a tree.
            //Don't worry about creating the tree, that's done in the base class.
            //OutPortData[0].Object = this.Tree;

            //tell the base type to setup for
            //the number of inputs and outputs
            base.RegisterInputsAndOutputs();

        }
Beispiel #9
0
        public dynDraftingView()
        {
            InPortData.Add(new PortData("name", "Name", typeof(string)));
            OutPortData = new PortData("v", "Drafting View", typeof(dynDraftingView));

            base.RegisterInputsAndOutputs();
        }
Beispiel #10
0
        public dynHeight()
        {
            InPortData.Add(new PortData("elem", "Level, Family Instance, RefPoint, XYZ", typeof(object)));//add elements here when adding switch statements
            OutPortData = new PortData("h", "The height of an element in z relative to project 0.", typeof(object));

            base.RegisterInputsAndOutputs();
        }
Beispiel #11
0
        public dynCurvesFromFamilyInstance()
        {
            InPortData.Add(new PortData("fi", "family instance", typeof(object)));

            OutPortData = new PortData("curves", "Curves extracted by this operation.", typeof(Curve));

            base.RegisterInputsAndOutputs();
        }
Beispiel #12
0
        public dynXYZEvaluate()
        {
            InPortData.Add(new PortData("uv", "The point to evaluate.", typeof(object)));
            InPortData.Add(new PortData("face", "The face to evaluate.", typeof(object)));

            OutPortData = new PortData("XYZ", "The location.", typeof(string));
            base.RegisterInputsAndOutputs();
        }
Beispiel #13
0
        public dynFaceComputerDerivative()
        {
            InPortData.Add(new PortData("f", "The face to evaluate(Face)", typeof(object)));
            InPortData.Add(new PortData("uv", "The parameter to evaluate(UV)", typeof(object)));
            OutPortData = new PortData("t", "Transform describing the face at the parameter(Transform)", typeof(object));

            base.RegisterInputsAndOutputs();
        }
Beispiel #14
0
        public dynDistanceBetweenPoints()
        {
            InPortData.Add(new PortData("ptA", "Element to measure to.", typeof(object)));
            InPortData.Add(new PortData("ptB", "A Reference point.", typeof(object)));

            OutPortData = new PortData("dist", "Distance between points.", typeof(double));

            base.RegisterInputsAndOutputs();
        }
Beispiel #15
0
        public dynFileReader()
        {
            this.handler = new FileSystemEventHandler(watcher_FileChanged);

            InPortData.Add(new PortData("path", "Path to the file", typeof(string)));
            OutPortData = new PortData("contents", "File contents", typeof(string));

            base.RegisterInputsAndOutputs();
        }
Beispiel #16
0
        public dynArcCenter()
        {
            InPortData.Add(new PortData("center", "Center XYZ", typeof(XYZ)));
            InPortData.Add(new PortData("radius", "Radius", typeof(double)));
            InPortData.Add(new PortData("start", "Start Param", typeof(double)));
            InPortData.Add(new PortData("end", "End Param", typeof(double)));
            OutPortData = new PortData("arc", "Arc", typeof(Arc));

            base.RegisterInputsAndOutputs();
        }
Beispiel #17
0
        public dynLoftForm()
        {
            InPortData.Add(new PortData("solid/void", "True creates a solid, false a void", typeof(object)));
            InPortData.Add(new PortData("refListList", "ReferenceArrayArray", typeof(object)));
            InPortData.Add(new PortData("surface?", "Create a single surface or an extrusion if one loop", typeof(object)));

            OutPortData = new PortData("form", "Loft Form", typeof(object));

            base.RegisterInputsAndOutputs();
        }
Beispiel #18
0
        public dynDividedPath()
        {
            InPortData.Add(new PortData("refs", "Ref", typeof(CurveElement)));//TODO make this a ref, but how to handle tracking persistance
            InPortData.Add(new PortData("count", "Number", typeof(double))); // just divide equally for now, dont worry about spacing and starting point
            //InPortData.Add(new PortData("x0", "Starting Coordinate", typeof(double)));
            //InPortData.Add(new PortData("spacing", "The spacing.", typeof(double)));

            OutPortData = new PortData("dc ", "the divided path element", typeof(DividedPath));

            base.RegisterInputsAndOutputs();
        }
Beispiel #19
0
        public dynAnalysisResultsBySelection()
        {
            OutPortData = new PortData("ar", "Analysis Results referenced by this operation.", typeof(Element));

             //add a button to the inputGrid on the dynElement
             Button analysisResultButt = new Button();
             this.inputGrid.Children.Add(analysisResultButt);
             analysisResultButt.Margin = new Thickness(0, 0, 0, 0);
             analysisResultButt.HorizontalAlignment = HorizontalAlignment.Center;
             analysisResultButt.VerticalAlignment = VerticalAlignment.Center;
             analysisResultButt.Click += new RoutedEventHandler(analysisResultButt_Click);
             analysisResultButt.Content = "Select AR";
             analysisResultButt.HorizontalAlignment = HorizontalAlignment.Stretch;
             analysisResultButt.VerticalAlignment = VerticalAlignment.Center;

             base.RegisterInputsAndOutputs();
        }
Beispiel #20
0
        public dynFunction(IEnumerable<string> inputs, string output, string symbol)
            : base(symbol)
        {
            //Set inputs and output
            this.SetInputs(inputs);
            OutPortData = new PortData(output, "function output", typeof(object));

            //Set the nickname
            this.NickName = symbol;

            //Add a drop-shadow.
            ((DropShadowEffect)this.elementRectangle.Effect).Opacity = 1;

            //Setup double-click behavior
            this.MouseDoubleClick += delegate
            {
                dynElementSettings.SharedInstance.Bench.DisplayFunction(symbol);
            };

            base.RegisterInputsAndOutputs();
        }
Beispiel #21
0
        public dynWatch()
        {
            InPortData.Add(new PortData("", "Node to evaluate.", typeof(object)));
            OutPortData = new PortData("", "Watch contents, passed through", typeof(object));
            base.RegisterInputsAndOutputs();

            //take out the left and right margins
            //and make this so it's not so wide
            this.inputGrid.Margin = new Thickness(10, 5, 10, 5);
            this.topControl.Width = 300;
            this.topControl.Height = 200;

            wt = new WatchTree();
            this.inputGrid.Children.Add(wt);
            wtb = wt.FindResource("Tree") as WatchTreeBranch;

            foreach (dynPort p in this.InPorts)
            {
                p.PortDisconnected += new PortConnectedHandler(p_PortDisconnected);
            }
        }
Beispiel #22
0
        public dynArduino()
        {
            InPortData.Add(new PortData("exec", "Execution Interval", typeof(object)));
            OutPortData = new PortData("arduino", "Serial port for later read/write", typeof(object));

            base.RegisterInputsAndOutputs();

            string[] serialPortNames = System.IO.Ports.SerialPort.GetPortNames();
            if (port == null)
            {
                port = new SerialPort();
            }
            port.BaudRate = 9600;
            port.NewLine = "\r\n";
            port.DtrEnable = true;

            foreach (string portName in serialPortNames)
            {

                if (lastComItem != null)
                {
                    lastComItem.IsChecked = false; // uncheck last checked item
                }
                comItem = new System.Windows.Controls.MenuItem();
                comItem.Header = portName;
                comItem.IsCheckable = true;
                comItem.IsChecked = true;
                comItem.Checked += new System.Windows.RoutedEventHandler(comItem_Checked);
                this.MainContextMenu.Items.Add(comItem);

                port.PortName = portName;
                lastComItem = comItem;

            }

            this.dynElementDestroyed += new dynElementDestroyedHandler(OnDynArduinoDestroyed);
            this.dynElementReadyToDestroy += new dynElementReadyToDestroyHandler(OnDynArduinoReadyToDestroy);
        }
Beispiel #23
0
        public void ClearOutputs()
        {
            foreach (dynConnector c in outPort.Connectors)
            {
                c.Kill();
            }

            outPort = null;
            outPortData = null;
        }
Beispiel #24
0
        public dynXYZArrayAlongCurve()
        {
            InPortData.Add(new PortData("curve", "Curve", typeof(CurveElement)));
            InPortData.Add(new PortData("count", "Number", typeof(double))); // just divide equally for now, dont worry about spacing and starting point
            //InPortData.Add(new PortData("x0", "Starting Coordinate", typeof(double)));
            //InPortData.Add(new PortData("spacing", "The spacing.", typeof(double)));

            OutPortData = new PortData("XYZs", "List of XYZs in the array", typeof(XYZ));

            base.RegisterInputsAndOutputs();
        }
Beispiel #25
0
        public dynXYZAdd()
        {
            InPortData.Add(new PortData("XYZa", "XYZ a", typeof(XYZ)));
            InPortData.Add(new PortData("XYZb", "XYZ b", typeof(XYZ)));
            OutPortData = new PortData("xyz", "XYZ", typeof(XYZ));

            base.RegisterInputsAndOutputs();
        }
Beispiel #26
0
        public dynArcStartMiddleEnd()
        {
            InPortData.Add(new PortData("start", "Start XYZ", typeof(XYZ)));
            InPortData.Add(new PortData("mid", "XYZ on Curve", typeof(XYZ)));
            InPortData.Add(new PortData("end", "End XYZ", typeof(XYZ)));
            OutPortData = new PortData("arc", "Arc", typeof(Arc));

            base.RegisterInputsAndOutputs();
        }
Beispiel #27
0
        public dynXYZ()
        {
            InPortData.Add(new PortData("X", "X", typeof(double)));
            InPortData.Add(new PortData("Y", "Y", typeof(double)));
            InPortData.Add(new PortData("Z", "Z", typeof(double)));

            OutPortData = new PortData("xyz", "XYZ", typeof(XYZ));

            base.RegisterInputsAndOutputs();
        }
Beispiel #28
0
        public dynUVRandom()
        {
            InPortData.Add(new PortData("dom", "A domain.", typeof(object)));
            InPortData.Add(new PortData("U-count", "Number in the U direction.", typeof(double)));
            InPortData.Add(new PortData("V-count", "Number in the V direction.", typeof(double)));
            OutPortData = new PortData("UVs", "List of UVs in the grid", typeof(XYZ));

            base.RegisterInputsAndOutputs();
        }
Beispiel #29
0
        public dynUV()
        {
            InPortData.Add(new PortData("U", "U", typeof(double)));
            InPortData.Add(new PortData("V", "V", typeof(double)));

            OutPortData = new PortData("uv", "UV", typeof(UV));

            base.RegisterInputsAndOutputs();
        }
Beispiel #30
0
        public dynSketchPlane()
        {
            InPortData.Add(new PortData("plane", "The plane in which to define the sketch.", typeof(object))); // SketchPlane can accept Plane, Reference or PlanarFace
            OutPortData = new PortData("sp", "SketchPlane", typeof(dynSketchPlane));

            base.RegisterInputsAndOutputs();
        }