protected override void SetOutputs(IGH_DataAccess da) { outTree = new DataTree <Point3d>(); GH_Path trunk = new GH_Path(0); // {0} GH_Path branch = new GH_Path(); // {}\ GH_Path limb = new GH_Path(); for (int i = 0; i < particles.Count; i++) { IQuelea particle = particles[i]; branch = trunk.AppendElement(i); DataTree <Point3d> particlePositionHistoryTree = particle.Position3DHistory.ToTree(); for (int j = 0; j < particlePositionHistoryTree.BranchCount; j++) { limb = branch.AppendElement(j); //for (int k = particlePositionHistoryTree.Branch(j).Count - 1; k >= 0; k--) //{ // outTree.Add(particlePositionHistoryTree.Branch(j)[k], limb); //} outTree.AddRange(particlePositionHistoryTree.Branch(j), limb); } } da.SetDataTree(nextOutputIndex++, outTree); }
public void Add(AbstractEmitterType emitter) { Vector3d initialVelocity; Point3d emittionPt = emitter.Emit(out initialVelocity); IQuelea quelea = MakeParticle(queleaSettings[nextIndex], emittionPt, initialVelocity); Quelea.Add(quelea); nextIndex = (nextIndex + 1) % queleaSettings.Count; }
public IQuelea MakeParticle(IQuelea p, Point3d emittionPt, Vector3d initialVelocity) { if (p.GetType() == typeof(VehicleType)) { return(new VehicleType((IVehicle)p, emittionPt, initialVelocity, environment)); } if (p.GetType() == typeof(AgentType)) { return(new AgentType((IAgent)p, emittionPt, initialVelocity, environment)); } return(new ParticleType((IParticle)p, emittionPt, initialVelocity, environment)); }