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(); }
public dynCurvesFromPS() { InPortData.Add(new PortData("ps", "Particle System", typeof(ParticleSystem))); OutPortData = new PortData("curves", "geometry curves.", typeof(object)); base.RegisterInputsAndOutputs(); }
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(); }
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(); }
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); }
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(); }
public dynExecuteInterval() { InPortData.Add(new PortData("ms", "Delay in milliseconds", typeof(double))); OutPortData = new PortData("", "Success?", typeof(bool)); base.RegisterInputsAndOutputs(); }
/// <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(); }
public dynDraftingView() { InPortData.Add(new PortData("name", "Name", typeof(string))); OutPortData = new PortData("v", "Drafting View", typeof(dynDraftingView)); base.RegisterInputsAndOutputs(); }
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(); }
public dynCurvesFromFamilyInstance() { InPortData.Add(new PortData("fi", "family instance", typeof(object))); OutPortData = new PortData("curves", "Curves extracted by this operation.", typeof(Curve)); base.RegisterInputsAndOutputs(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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); } }
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); }
public void ClearOutputs() { foreach (dynConnector c in outPort.Connectors) { c.Kill(); } outPort = null; outPortData = null; }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }