当前位置: 首页>>代码示例>>C#>>正文


C# IGH_DataAccess.SetData方法代码示例

本文整理汇总了C#中IGH_DataAccess.SetData方法的典型用法代码示例。如果您正苦于以下问题:C# IGH_DataAccess.SetData方法的具体用法?C# IGH_DataAccess.SetData怎么用?C# IGH_DataAccess.SetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IGH_DataAccess的用法示例。


在下文中一共展示了IGH_DataAccess.SetData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetOutputs

 protected override void SetOutputs(IGH_DataAccess da)
 {
   desiredVelocity = CalculateDesiredVelocity();
   Vector3d appliedForce = ApplyDesiredVelocity();
   da.SetData(nextOutputIndex++, appliedForce);
   da.SetData(nextOutputIndex++, desiredVelocity);
 }
开发者ID:lxfschr,项目名称:Quelea,代码行数:7,代码来源:AbstractForceComponent.cs

示例2: SolveInstance

        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string name = null;
            GH_Plane tcp = null;
            double weight = 0;
            GH_Mesh mesh = null;
            GH_Point centroid = null;
            List<GH_Plane> planes = new List<GH_Plane>();

            if (!DA.GetData(0, ref name)) { return; }
            if (!DA.GetData(1, ref tcp)) { return; }
            DA.GetDataList(2, planes);
            if (!DA.GetData(3, ref weight)) { return; }
            DA.GetData(4, ref centroid);
            DA.GetData(5, ref mesh);

            var tool = new Tool(tcp.Value, name, weight, centroid?.Value, mesh?.Value);

            if (planes.Count > 0)
            {
                if (planes.Count != 4)
                    this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, " Calibration input must be 4 planes");
                else
                    tool.FourPointCalibration(planes[0].Value, planes[1].Value, planes[2].Value, planes[3].Value);
            }

            DA.SetData(0, new GH_Tool(tool));
            DA.SetData(1, tool.Tcp);
        }
开发者ID:visose,项目名称:Robots,代码行数:29,代码来源:Machine.cs

示例3: SetOutputs

 protected override void SetOutputs(IGH_DataAccess da)
 {
   da.SetData(nextOutputIndex++, agent.MaxSpeed);
   da.SetData(nextOutputIndex++, agent.MaxForce);
   da.SetData(nextOutputIndex++, agent.VisionRadius);
   da.SetData(nextOutputIndex++, agent.VisionAngle);
 }
开发者ID:lxfschr,项目名称:Quelea,代码行数:7,代码来源:DeconstructAgentComponent.cs

示例4: SetOutputs

 protected override void SetOutputs(IGH_DataAccess da)
 {
   //da.SetDataList(nextOutputIndex++, particle.velocity3DHistory.ToList());
   da.SetData(nextOutputIndex++, particle.Velocity3D);
   if (particle.Environment.GetType() == typeof (SurfaceEnvironmentType))
   {
     da.SetData(nextOutputIndex++, particle.Velocity);
   }
 }
开发者ID:lxfschr,项目名称:Quelea,代码行数:9,代码来源:GetVelocityComponent.cs

示例5: SolveInstance

        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Indata
            WR_Utilisation util = null;
            if (!DA.GetData(0, ref util)) { return; }

            DA.SetData(0, util.GetUtilisationDegree());
            DA.SetData(1, util.ToString());
        }
开发者ID:IsakNaslund,项目名称:MasterThesis,代码行数:9,代码来源:UtilisationComponent.cs

示例6: SolveInstance

        protected override void SolveInstance(IGH_DataAccess DA)
        {
            ResultElement res = null;

            if (!DA.GetData(0, ref res)) { return; }

            DA.SetData(0, new Line(res.sPos, res.ePos));
            DA.SetData(1, CrossSectionCasts.GetRhinoString(res.SectionPropertyString));
            DA.SetData(2, res.elNormal);
        }
开发者ID:IsakNaslund,项目名称:MasterThesis,代码行数:10,代码来源:DeconstructResultElements.cs

示例7: SolveInstance

        protected override void SolveInstance(IGH_DataAccess DA)
        {
            WR_Structure struc = null;

            if(!DA.GetData(0, ref struc)) { return; }

            DA.SetData(0, struc.GetWeight());
            DA.SetData(1, struc.NodeCount);
            DA.SetData(2, struc.ElementCount);
        }
开发者ID:IsakNaslund,项目名称:MasterThesis,代码行数:10,代码来源:StructurePropertiesComponent.cs

示例8: SetOutputs

    protected override void SetOutputs(IGH_DataAccess da)
    {
      if (!apply)
      {
        da.SetData(nextOutputIndex++, false);
        return;
      }

      bool behaviorApplied = Run();
      da.SetData(nextOutputIndex++, behaviorApplied);
    }
开发者ID:lxfschr,项目名称:Quelea,代码行数:11,代码来源:AbstractBehaviorComponent.cs

示例9: SolveInstance

 protected override void SolveInstance(IGH_DataAccess DA)
 {
     DHr dhr = new DHr();
     if (DA.GetData(0, ref dhr))
     {
         DA.SetData(0, dhr.hr);
         DA.SetDataList(1, dhr.keys);
         DA.SetDataList(2, dhr.values);
         DA.SetData(3, dhr.color);
         DA.SetData(4, dhr.pos);
     }
 }
开发者ID:ksteinfe,项目名称:dyear,代码行数:12,代码来源:Components+Primitive.cs

示例10: SolveInstance

        protected override void SolveInstance(IGH_DataAccess da)
        {
            bool set = false;
            da.GetData(PInSet, ref set);
            bool reset = false;
            da.GetData(PInReset, ref reset);

            if (set) FOutput = true;
            else if (reset) FOutput = false;

            da.SetData(POutOutput, FOutput);
            da.SetData(POutInverseOutput, !FOutput);
        }
开发者ID:smakhtin,项目名称:BoolFrog,代码行数:13,代码来源:FlipFlop.cs

示例11: SolveInstance

        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            //Input
            Object[] output = new Object[2];
            DA.GetData(0, ref output);

            //Casting
            Point3d pt = (Point3d) output[0];
            Vector3d force = (Vector3d) output[1];

            //Output
            DA.SetData(0, pt);
            DA.SetData(1, force);
        }
开发者ID:CecilieBrandt,项目名称:K2Engineering,代码行数:18,代码来源:CastLoadOutput.cs

示例12: SolveInstance

        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            //Input
            Line line = new Line();
            DA.GetData(0, ref line);

            double eModulus = 0.0;
            DA.GetData(1, ref eModulus);

            double area = 0.0;
            DA.GetData(2, ref area);

            double preStress = 0.0;
            if (this.Params.Input[3].SourceCount != 0)
            {
                DA.GetData(3, ref preStress);
            }


            //Create instance of bar
            GoalObject cableElement = new CableGoal(line, eModulus, area, preStress);


            //Output
            DA.SetData(0, cableElement);
        }
开发者ID:CecilieBrandt,项目名称:K2Engineering,代码行数:30,代码来源:Cable.cs

示例13: SolveInstance

        protected override void SolveInstance(IGH_DataAccess DA)
        {
            SpringMesh iSpringMesh = null;
            DA.GetData<SpringMesh>("Spring Mesh", ref iSpringMesh);

            DA.SetData("Rhino Mesh", iSpringMesh.ConvertToRhinoMesh());
        }
开发者ID:GeneKao,项目名称:Pavilion2015_ITECH,代码行数:7,代码来源:GHC_SpringMeshToRhinoMesh.cs

示例14: SolveInstance

        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            //Input
            Point3d supportPt = new Point3d();
            DA.GetData(0, ref supportPt);

            bool isXFixed = true;
            DA.GetData(1, ref isXFixed);

            bool isYFixed = true;
            DA.GetData(2, ref isYFixed);

            bool isZFixed = true;
            DA.GetData(3, ref isZFixed);

            double weight = 1.0;
            DA.GetData(4, ref weight);

            //Warning if no direction is fixed
            if (!isXFixed && !isYFixed && !isZFixed)
            {
                this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "The specified point is free to move!");
            }


            //Create simple support goal
            GoalObject support = new SupportGoal(supportPt, isXFixed, isYFixed, isZFixed, weight);


            //Output
            DA.SetData(0, support);
        }
开发者ID:CecilieBrandt,项目名称:K2Engineering,代码行数:36,代码来源:Support.cs

示例15: SolveInstance

        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string name = null; 
            GH_RobotSystem robotSystem = null;
            var initCommandsGH = new List<GH_Command>();
            var targetsA = new List<GH_Target>();
            var targetsB = new List<GH_Target>();
            var multiFileIndices = new List<int>();
            double stepSize = 1;

            if (!DA.GetData(0, ref name)) { return; }
            if (!DA.GetData(1, ref robotSystem)) { return; }
            if (!DA.GetDataList(2, targetsA)) { return; }
            DA.GetDataList(3, targetsB);
            DA.GetDataList(4, initCommandsGH);
            DA.GetDataList(5, multiFileIndices);
            if (!DA.GetData(6, ref stepSize)) { return; }

            var initCommands = initCommandsGH.Count > 0 ? new Robots.Commands.Group(initCommandsGH.Select(x => x.Value)) : null;

            var targets = new List<IEnumerable<Target>>();
            targets.Add(targetsA.Select(x => x.Value));
            if (targetsB.Count > 0) targets.Add(targetsB.Select(x => x.Value));

            var program = new Program(name, robotSystem.Value, targets, initCommands, multiFileIndices, stepSize);

            DA.SetData(0, new GH_Program(program));


            if (program.Code != null)
            {
                var path = DA.ParameterTargetPath(2);
                var structure = new GH_Structure<GH_String>();

                for (int i = 0; i < program.Code.Count; i++)
                {
                    var tempPath = path.AppendElement(i);
                    for (int j = 0; j < program.Code[i].Count; j++)
                    {
                        structure.AppendRange(program.Code[i][j].Select(x => new GH_String(x)), tempPath.AppendElement(j));
                    }
                }

                DA.SetDataTree(1, structure);
            }

            DA.SetData(2, program.Duration);

            if (program.Warnings.Count > 0)
            {
                DA.SetDataList(3, program.Warnings);
                this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Warnings in program");
            }

            if (program.Errors.Count > 0)
            {
                DA.SetDataList(4, program.Errors);
                this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Errors in program");
            }
        }
开发者ID:visose,项目名称:Robots,代码行数:60,代码来源:Program.cs


注:本文中的IGH_DataAccess.SetData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。