Пример #1
0
        /// <summary>
        /// Returns a point at the center of the section
        /// </summary>
        /// <returns></returns>
        public PointClass Center()
        {
            PointClass point = new PointClass();

            LineClass  right  = new LineClass();
            LineClass  bottom = new LineClass();
            LineClass  second = new LineClass();
            LineClass  first  = new LineClass();
            PointClass temp   = new PointClass();

            if (IsValid())
            {
                bottom.CreateFromPoints(Corners[2], Corners[3]);
                right.CreateFromPoints(Corners[0], Corners[3]);
                first.CreateSlopePoint(right.M, bottom.CPoint(Corners[3].X - bottom.Adjustment(MeasureFunctions.HalfMile)));

                bottom.CPoint(Corners[3].X - bottom.Adjustment(MeasureFunctions.HalfMile));
                right.CPoint(Corners[3].X + (Math.Sign(right.M) * right.Adjustment(MeasureFunctions.HalfMile)));
                second.CreateSlopePoint(bottom.M, right.CPoint(Corners[3].X + (Math.Sign(right.M) * right.Adjustment(GeographicCalcService.MeasureFunctions.HalfMile))));

                temp  = MeasureFunctions.LineIntercection(first, second);
                point = temp;
            }
            else
            {
                temp.X = -1;
                temp.Y = -1;
                point  = temp;
            }
            return(point);
        }
Пример #2
0
        /// <summary>
        /// Return the point within the section based off of footage information
        /// </summary>
        /// <param name="Foot"></param>
        /// <returns></returns>
        public PointClass LocateFootage(FootageClass Foot)
        {
            PointClass LocateFootageOut = new PointClass();

            LineClass  right  = new LineClass();
            LineClass  bottom = new LineClass();
            LineClass  left   = new LineClass();
            LineClass  top    = new LineClass();
            LineClass  second = new LineClass();
            LineClass  first  = new LineClass();
            PointClass temp   = new PointClass();

            if (IsValid())
            {
                //  *** SE Corner Based of south and east borders
                if (Foot.CombindDir() == "NW")
                {
                    bottom.CreateFromPoints(Corners[2], Corners[3]);
                    right.CreateFromPoints(Corners[0], Corners[3]);
                    first.CreateSlopePoint(right.M, bottom.CPoint((Corners[3].X - bottom.Adjustment(Foot.EastWestValueMeters))));
                    second.CreateSlopePoint(bottom.M, right.CPoint((Corners[3].X + (Math.Sign(right.M) * right.Adjustment(Foot.NorthSouthValueMeters)))));
                    //  *** SW corner based of south and west borders
                }
                else if ((Foot.CombindDir() == "NE"))
                {
                    bottom.CreateFromPoints(Corners[2], Corners[3]);
                    left.CreateFromPoints(Corners[1], Corners[2]);
                    first.CreateSlopePoint(left.M, bottom.CPoint((Corners[2].X + bottom.Adjustment(Foot.EastWestValueMeters))));
                    second.CreateSlopePoint(bottom.M, left.CPoint(Corners[2].X + (Math.Sign(left.M) * left.Adjustment(Foot.NorthSouthValueMeters))));
                    //  *** NW corner based off west and north borders
                }
                else if ((Foot.CombindDir() == "SE"))
                {
                    top.CreateFromPoints(Corners[0], Corners[1]);
                    left.CreateFromPoints(Corners[1], Corners[2]);
                    first.CreateSlopePoint(left.M, top.CPoint((Corners[1].X + top.Adjustment(Foot.EastWestValueMeters))));
                    second.CreateSlopePoint(top.M, left.CPoint((Corners[1].X - (Math.Sign(left.M) * left.Adjustment(Foot.NorthSouthValueMeters)))));
                    //  *** NE corner based off east and north border
                }
                else if ((Foot.CombindDir() == "SW"))
                {
                    top.CreateFromPoints(Corners[0], Corners[1]);
                    right.CreateFromPoints(Corners[0], Corners[3]);
                    first.CreateSlopePoint(right.M, top.CPoint((Corners[0].X - bottom.Adjustment(Foot.EastWestValueMeters))));
                    second.CreateSlopePoint(top.M, right.CPoint((Corners[0].X - (Math.Sign(right.M) * right.Adjustment(Foot.NorthSouthValueMeters)))));
                }
                temp             = MeasureFunctions.LineIntercection(first, second);
                LocateFootageOut = temp;
            }
            else
            {
                temp.X           = -1;
                temp.Y           = -1;
                LocateFootageOut = temp;
            }
            return(LocateFootageOut);
        }
Пример #3
0
        /// <summary>
        /// Returns the point within the section based off of subsection information
        /// </summary>
        /// <param name="subsec"></param>
        /// <returns></returns>
        public PointClass LocateSubSection(SubSectionClass subsec)
        {
            PointClass LocateSubSectionOut = new PointClass();
            LineClass  right  = new LineClass();
            LineClass  bottom = new LineClass();
            LineClass  second = new LineClass();
            LineClass  first  = new LineClass();
            PointClass temp   = new PointClass();

            if (IsValid())
            {
                bottom.CreateFromPoints(Corners[2], Corners[3]);
                right.CreateFromPoints(Corners[0], Corners[3]);
                first.CreateSlopePoint(right.M, bottom.CPoint((Corners[3].X - bottom.Adjustment(subsec.ROffset().X))));
                second.CreateSlopePoint(bottom.M, right.CPoint((Corners[3].X + (Math.Sign(right.M) * right.Adjustment(subsec.ROffset().Y)))));
                temp = MeasureFunctions.LineIntercection(first, second);
                LocateSubSectionOut = temp;
            }
            else
            {
                temp.X = -1;
                temp.Y = -1;
                LocateSubSectionOut = temp;
            }
            return(LocateSubSectionOut);
        }