Example #1
0
        //public Profile(CogoStation beginStation, CogoStation endStation, int singleElevation)
        //   : this(beginStation, endStation, (double)singleElevation)
        //{ }
        public Profile(double beginStation, double endStation, double singleElevation)
        {
            vpiList aVpiList = new vpiList();
             aVpiList.add((CogoStation) beginStation, singleElevation);
             aVpiList.add((CogoStation) endStation, singleElevation);

             buildThisFromRawVPIlist(aVpiList);
        }
        private void setupCorridors()
        {
            rm21Corridor aCorridor =
            theRM21model.allCorridors.FirstOrDefault
                  (aCorr => aCorr.Name.Equals("L"));

             aCorridor.Alignment.BeginStation = 1000.0;
             aCorridor.Alignment.EndStation = 10000.0;

             PGLGrouping pglGrLT = new PGLGrouping(-1);
             PGLGrouping pglGrRT = new PGLGrouping(1);

             PGLoffset pgloRT = new PGLoffset((CogoStation)1000.0, (CogoStation)10000, 0.0, 0.0);  /* PGL RT */
             pgloRT.addWidenedSegment((CogoStation)2555.0, (CogoStation)2955.0, 15.0,
            (CogoStation)8050.0, (CogoStation)8050.001);
             pglGrRT.thePGLoffsetRibbon = pgloRT;

             PGLoffset pgloLT = new PGLoffset((CogoStation)1000.0, (CogoStation)10000, 0.0, 0.0);  /* PGL LT */
             pgloLT.addWidenedSegment((CogoStation)2555.0, (CogoStation)2955.0, 15.0,
            (CogoStation)8050.0, (CogoStation)8050.001);
             pglGrLT.thePGLoffsetRibbon = pgloLT;

             /* Back Thru Lane, Inner */
             RoadwayLane rdyLane = new RoadwayLane((CogoStation)1000, (CogoStation)10000, 0.0, -0.02);
             rdyLane.addWidenedSegment((CogoStation)2235, (CogoStation)2555, 12.0,
            (CogoStation)8050, (CogoStation)8050.001);
             rdyLane.addCrossSlopeChangedSegment((CogoStation)2200, (CogoStation)2300, 0.08,
            (CogoStation)2500, (CogoStation)2600);
             pglGrLT.addOutsideRibbon(rdyLane);
             /* Back Thru Lane, Outer */
             rdyLane = new RoadwayLane((CogoStation)1000, (CogoStation)10000, 12.0, -0.02);
             rdyLane.addCrossSlopeChangedSegment((CogoStation)2200, (CogoStation)2300, 0.08,
            (CogoStation)2500, (CogoStation)2600);
             pglGrLT.addOutsideRibbon(rdyLane);

             Shoulder aShldr = new Shoulder((CogoStation)1000, (CogoStation)10000, 10.0, -0.08);
             aShldr.addWidenedSegment((CogoStation)2000.0, (CogoStation)2040.0, 17.0,
            (CogoStation)2250.0, (CogoStation)2290.00);
             aShldr.addCrossSlopeChangedSegment((CogoStation)2200, (CogoStation)2300, 0.02,
            (CogoStation)2500, (CogoStation)2600);

             pglGrLT.addOutsideRibbon(aShldr);

             /* Outside Cut Ditch, LT */
             pglGrLT.addOutsideRibbon(new FrontSlopeCutDitch((CogoStation)1000, (CogoStation)10000, 15.0,  -1.0 / 4.0));

             /* Outside Cut Ditch Backslope, LT */
             pglGrLT.addOutsideRibbon(new BackSlopeCutDitch((CogoStation)1000, (CogoStation)10000, 1.0 / 2.0));

             /* Median Shoulder LT */
             aShldr = new Shoulder((CogoStation)1000, (CogoStation)10000, 0.0, -0.04);
             aShldr.addWidenedSegment((CogoStation)2555.0, (CogoStation)2715.0, 6.0,
            (CogoStation)8050.0, (CogoStation)8050.001);
             pglGrLT.addInsideRibbon(aShldr);

             /* Median Ditch Slope LT */
             FrontSlopeCutDitch ditchFS = new FrontSlopeCutDitch((CogoStation) 1000, (CogoStation) 10000, 0.0,  -1.0 / 4.0);
             ditchFS.addWidenedSegment((CogoStation) 2715.0, (CogoStation) 2955.0, 9.0,
            (CogoStation)8050.0, (CogoStation)8050.001);
             pglGrLT.addInsideRibbon(ditchFS);

             /* Ahead Thru Lane, Inner */
             rdyLane = new RoadwayLane((CogoStation)1000, (CogoStation)10000, 0.0, -0.02);
             rdyLane.addWidenedSegment((CogoStation)2235, (CogoStation)2555, 12.0,
            (CogoStation)8050, (CogoStation)8050.001);
             rdyLane.addCrossSlopeChangedSegment((CogoStation)2240, (CogoStation)2300, -0.08,
            (CogoStation)2500, (CogoStation)2560);
             pglGrRT.addOutsideRibbon(rdyLane);

             /* Ahead Thru Lane, Outer */
             rdyLane = new RoadwayLane((CogoStation)1000, (CogoStation)10000, 12.0, -0.02);
             rdyLane.addCrossSlopeChangedSegment((CogoStation)2240, (CogoStation)2300, -0.08,
            (CogoStation)2500, (CogoStation)2560);
             pglGrRT.addOutsideRibbon(rdyLane);
             pglGrRT.addOutsideRibbon(new Shoulder((CogoStation)1000, (CogoStation)10000, 10.0, -0.08));
             pglGrRT.addOutsideRibbon(new FrontSlopeCutDitch((CogoStation)1000, (CogoStation)10000, 15.0, -1.0 / 4.0));

             /* Outside Cut Ditch Backslope, LT */
             var ditchBackSlope = new BackSlopeCutDitch((CogoStation)1000, (CogoStation)10000, 1.0 / 2.0);
             ditchBackSlope.addCrossSlopeChangedSegment((CogoStation)3100, (CogoStation)3200,
            1.0 / 4.0, (CogoStation)3300, (CogoStation)3400);
             pglGrRT.addOutsideRibbon(ditchBackSlope);

             /* Median Shoulder RT */
             aShldr = new Shoulder((CogoStation)1000, (CogoStation)10000, 0.0, -0.04);
             aShldr.addWidenedSegment((CogoStation)2555.0, (CogoStation)2715.0, 6.0,
            (CogoStation)8050.0, (CogoStation)8050.001);
             pglGrRT.addInsideRibbon(aShldr);

             /* Median Ditch Slope RT */
             ditchFS = new FrontSlopeCutDitch((CogoStation)1000, (CogoStation)10000, 0.0, -1.0 / 4.0);
             ditchFS.addWidenedSegment((CogoStation)2715.0, (CogoStation)2955.0, 9.0,
            (CogoStation)8050.0, (CogoStation)8050.001);
             pglGrRT.addInsideRibbon(ditchFS);

             aCorridor.addPGLgrouping(pglGrLT);
             aCorridor.addPGLgrouping(pglGrRT);

             aCorridor.existingGroundSurface = new ptsCogo.Mocks.rm21MockSurface();
             vpiList vpiList = new vpiList();
             vpiList.add(-200.0, 3.0); vpiList.add(-150.0, -3.0); vpiList.add(-130.0, 6.0);
             vpiList.add(-40.0, 3.5); vpiList.add(38.0, 6.2); vpiList.add(65.0, 2.8);
             vpiList.add(68.0, 7.2); vpiList.add(100.0, 5.5); vpiList.add(200.0, 2.8);
             aCorridor.existingGroundSurface.setSectionProfileForMocking(new Profile(vpiList));
        }
Example #3
0
        /// <summary>
        /// Warning: currently does not handle profiles with vertical curves
        /// we must implement that feature some day, but not today (9-29-2012)
        /// </summary>
        /// <returns></returns>
        public vpiList to_vpiList()
        {
            if (true == iHaveOneOrMoreVerticalCurves)
            throw new NotImplementedException("Profiles with vertical curves not supported yet.  Only profiles with VPI-NCs.");

             if (allVCs.Count < 1)
            return null;

             int count=allVCs.Count-1;
             vpiList returnList = new vpiList();
             foreach (var profSeg in allVCs)
             {
            count--;
            if (profSeg.Length > 0.0)
            {
               returnList.add(new rawVPI(profSeg.BeginStation, profSeg.BeginElevation));
               if (count == -1)
               {
                  returnList.add(new rawVPI(profSeg.EndStation, profSeg.EndElevation));
               }
            }
             }

             thisAsVpiList_ = returnList;

             return returnList;
        }
        private void pfl9Setup()
        {
            // Tests for adding two profiles that cover the same range: No VCs
             var aVpiList = new vpiList();
             aVpiList.add(1062.50, 12.0);
             aVpiList.add(1120.00, 12.0);
             aVpiList.add(1220.00, 15.0);
             aVpiList.add(1315.00, 15.0);
             aVpiList.add(1345.00, 10.0);
             aVpiList.add(1365.00, 10.0);

             var aProfile = new Profile(aVpiList);

             aVpiList = new vpiList();
             aVpiList.add(1062.50, 12.0);
             aVpiList.add(1120.00, 12.0);
             aVpiList.add(1219.00, 15.0);
             aVpiList.add(1315.00, 15.0);
             aVpiList.add(1345.00, 10.0);
             aVpiList.add(1365.00, 10.0);
             var otherPfl = new Profile(aVpiList);

             pfl9 = Profile.arithmaticAddProfile(aProfile, otherPfl, 1.0);
        }
        public void ProfilesTestSetup()
        {
            var aVpiList = new vpiList();
             aVpiList.add(1062.50, 12.0);
             aVpiList.add(1120.00, 12.0);
             aVpiList.add(1220.00, 15.0);
             aVpiList.add(1315.00, 15.0);
             aVpiList.add(1345.00, 10.0);
             aVpiList.add(1365.00, 10.0);
             aVpiList.add(1400.00, 10.0);
             aVpiList.add(2000.00, 14.0, 200);
             aVpiList.add(2500.00, 9.0);
             aVpiList.add(3000.00, 4.0);

             profile1 = new Profile(aVpiList);

             aVpiList = new vpiList();
             aVpiList.add(1062.50, 12.0);
             aVpiList.add(1120.00, 12.0);
             aVpiList.add(1220.00, 15.0);
             aVpiList.add(1250.00, 15.0);
             aVpiList.add(1340.00, 10.0);
             aVpiList.add(1365.00, 10.0);
             aVpiList.add(1400.00, 10.0);
             aVpiList.add(2000.00, 14.0, 200);
             aVpiList.add(2500.00, 9.0);
             aVpiList.add(3000.00, 4.0);

             profile2 = new Profile(aVpiList);

             pfl1Setup();
             pfl2Setup();
             pfl3Setup();
             pfl4and5Setup();
             pfl6_7and8Setup();
             pfl9Setup();

             ray1.StartPoint = new ptsPoint(1100.0, 0.0, 10.0);
             ray1.Slope = new Slope(1.00);
             ray1.HorizontalDirection = null;

             ray2.StartPoint = new ptsPoint(1312.0, 0.0, 15.2);
             ray2.Slope = new Slope(-1.0 / 7.0);
             ray2.HorizontalDirection = null;

             ray3.StartPoint = new ptsPoint(1312.0, 0.0, 15.2);
             ray3.Slope = new Slope(+1.0 / 7.0);
             ray3.HorizontalDirection = null;

             ray4.StartPoint = new ptsPoint(1880.0, 0.0, 13.54533333333);
             ray4.Slope = new Slope(-0.02 / 100.0);
             ray4.HorizontalDirection = null;

             ray5.StartPoint = new ptsPoint(1976.600, 0.0, 13.50);
             ray5.Slope = new Slope(-0.06 / 100.0);
             ray5.advanceDirection = -1;
             ray5.HorizontalDirection = null;
        }
        private void pfl6_7and8Setup()
        {
            var aVpiList = new vpiList();
             aVpiList.add(1062.50, 12.0);
             aVpiList.add(1120.00, 12.0);
             aVpiList.add(1220.00, 15.0);
             aVpiList.add(1315.00, 15.0);
             aVpiList.add(1345.00, 10.0);
             aVpiList.add(1365.00, 10.0);

             pfl6 = new Profile(aVpiList);

             aVpiList = new vpiList();
             aVpiList.add(2062.50, 12.0);
             aVpiList.add(2120.00, 12.0);
             aVpiList.add(2220.00, 15.0);

             pfl7 = new Profile(aVpiList);

             pfl8 = Profile.arithmaticAddProfile(pfl6, pfl7, 1.0);
        }
        private void pfl4and5Setup()
        {
            var aVpiList = new vpiList();
             aVpiList.add(1062.50, 2178.23);
             aVpiList.add(1120.00, 2173.973, 115.0);
             aVpiList.add(1220.00, 2173.140, 85.0);
             aVpiList.add(1315.00, 2168.2265, 90.0);
             aVpiList.add(1365.00, 2167.8765);

             pfl4 = new Profile(aVpiList);

             pfl5 = Profile.arithmaticAddProfile(null, pfl4, -1.0);
        }
        private void pfl3Setup()
        {
            var aVpiList = new vpiList();
             aVpiList.add(1000.00, 12.0);
             aVpiList.add(1100.00, 12.0);

             pfl3 = new Profile(aVpiList);
        }
        private void pfl2Setup()
        {
            var aVpiList = new vpiList();
             aVpiList.add(1000.00, 100.0);
             aVpiList.add(1100.00, 110.0);
             aVpiList.add(1200.00, 102.0);

             pfl2 = new Profile(aVpiList);
        }
        private void pfl1Setup()
        {
            vpiList aVpiList = new vpiList();
             aVpiList.add(1062.50, 2178.23);
             aVpiList.add(1120.00, 2173.973, 115.0);
             aVpiList.add(1220.00, 2173.140, 85.0);
             aVpiList.add(1315.00, 2168.2265, 90.0);
             aVpiList.add(1365.00, 2167.8765);

             pfl1 = new Profile(aVpiList);
        }