Beispiel #1
0
        public void Split(Split split)
        {
            List<SplitTreeNode> newGeneration = new List<SplitTreeNode>();
            foreach(SplitTreeNode child in _latestGeneration)
            {
                BlockBounds childBounds = child.bounds;
                BlockBounds splitL, splitR;
                this.Split(split.Axis, split.Value, childBounds, out splitL, out splitR);

                if ((splitL != null) && (splitR != null))
                {
                    SplitTreeNode nodeL = new SplitTreeNode(child, splitL);
                    SplitTreeNode nodeR = new SplitTreeNode(child, splitR);

                    newGeneration.Add(nodeL);
                    newGeneration.Add(nodeR);

                    child.bounds = null;
                    child.children = new SplitTreeNode[] { nodeL, nodeR };

                }
                else
                {
                    newGeneration.Add(child);
                }
            }

            _latestGeneration = newGeneration.ToArray();
        }
Beispiel #2
0
 internal SplitSide(LevelTree levelTree, Split split, bool lhs)
 {
     _split = split;
     Lhs = lhs;
     Group = levelTree.GetGroupBranch(split.Group);
     AttachedRotateables = split.AttachedGroups
         .Where(attached => attached.Lhs == lhs)
         .Select(attached => levelTree.GetGroupBranch(attached.AttachedGroup))
         .ToArray();
 }
Beispiel #3
0
 private BezierSpline[][] GetSplinesWithSplits(TrackDTO trackDto, Split[] splits)
 {
     SplitTrack splitTrack = splitter.SplitTrack(trackDto, splits);
     return splitTrack.SubTracks.Select(subTrack => splineGenerator.GenerateSplines(splitTrack, subTrack)).ToArray();
 }