Exemplo n.º 1
0
        public SpacePoint FromPriorSpace(WPoint source)
        {
            PriorPoint = source;
            SubclippedPoint = Space.ToHeadSpaceFromPriorSpace(source);
            StandardPoint = Space.ToStandardSpaceFromHeadSpace(SubclippedPoint);
            FramePoint = Space.ToFrameSpaceFromHeadSpace(SubclippedPoint);

            return this;
        }
Exemplo n.º 2
0
        public void ReadHullsFrame()
        {
            //Convert prior spaced hulls to frame space
            ConvexHullsFrame = ConvexHullsPrior.Keys.ToDictionary(k => k, v => new List <DPoint>());

            ConvexHullsPrior.Keys.ForEach(k =>
                                          ConvexHullsFrame[k].AddRange(ConvexHullsPrior[k].Select(pv =>
                                                                                                  Space.ToHeadSpaceFromPriorSpace(pv)
                                                                                                  ))
                                          );

            //Add standard space hulls
            ConvexHullsStandard = ConvexHullsPrior.Keys.ToDictionary(k => k, v => new List <DPoint>());

            ConvexHullsPrior.Keys.ForEach(k =>
                                          ConvexHullsStandard[k].AddRange(ConvexHullsFrame[k].Select(pv =>
                                                                                                     Space.ToStandardSpaceFromHeadSpace(pv)
                                                                                                     ))
                                          );

            //Find the proboscis base point
            var closestPts = ConvexHullsPrior[PointLabels.Proboscis]
                             .OrderByDescending(p => p.Y)
                             .Take(2)
                             .ToList();

            ProboscisHullBase = new SpacePoint(Space)
                                .FromPriorSpace
                                    (new WPoint(
                                        closestPts.Average(p => p.X),
                                        closestPts.Average(p => p.Y)
                                        ));
        }