Esempio n. 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);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 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;
        }
Esempio n. 4
0
        private void buildThisFromRawVPIlist(vpiList rawVPIlist)
        {
            iHaveOneOrMoreVerticalCurves = false;
             if (rawVPIlist.Count < 2)
             {
            throw new NotImplementedException("Profile can not have less than 2 VPIs");
             }
             else if (rawVPIlist.Count == 2)
             {
            thisAsVpiList_ = rawVPIlist;

            rawVPI vpi1 = rawVPIlist.getVPIbyIndex(0);
            rawVPI vpi2 = rawVPIlist.getVPIbyIndex(1);

            verticalCurve aNewVerticalCurve = new verticalCurve();
            aNewVerticalCurve.BeginElevation = vpi1.Elevation;

            aNewVerticalCurve.BeginStation = vpi1.Station;
            BeginProfTrueStation = vpi1.Station.trueStation;

            aNewVerticalCurve.Length = vpi2.Station - vpi1.Station;
            EndProfTrueStation = vpi2.Station.trueStation;

            aNewVerticalCurve.BeginSlope = (vpi2.Elevation - vpi1.Elevation) /
                                             aNewVerticalCurve.Length;
            aNewVerticalCurve.IsTangent = true;
            aNewVerticalCurve.IsBeginPINC = false;
            aNewVerticalCurve.IsEndPINC = false;

            allVCs = new List<verticalCurve>();
            allVCs.Add(aNewVerticalCurve);
             }
             else
             {
            thisAsVpiList_ = rawVPIlist;

            double g1; double g2;
            Int64 count=0;
            rawVPI vpi1; rawVPI vpi2;
            verticalCurve newVC;

            // Note: These next two lines are here to suppress compiler errors.
            //   The real assignments for vpi1 and 2 are at the end of the foureach loop
            vpi1 = rawVPIlist.getVPIbyIndex(0);
            vpi2 = rawVPIlist.getVPIbyIndex(1);

            foreach (rawVPI vpi3 in rawVPIlist.getVPIlist())
            {
               count++;
               if (count > 1)
               {
                  if (count > 2)
                  {
                     if (count == 3)
                     {
                        allVCs = new List<verticalCurve>();
                        BeginProfTrueStation = vpi1.Station.trueStation;
                     }

                     g1 = (vpi2.Elevation - vpi1.Elevation) /
                          (vpi2.Station.trueStation - vpi1.Station.trueStation);

                     g2 = (vpi3.Elevation - vpi2.Elevation) /
                          (vpi3.Station.trueStation - vpi2.Station.trueStation);

                     double incomingTanLen;
                     incomingTanLen = vpi2.getBeginStation() - vpi1.getEndStation();

                     // add a VC for the incoming tangent when necessary
                     if (incomingTanLen > 0.0)
                     {
                        newVC = new verticalCurve();
                        newVC.BeginSlope = g1;
                        newVC.BeginStation = vpi1.getEndStation();
                        newVC.EndSlope = g1;
                        newVC.Length = incomingTanLen;
                        newVC.BeginElevation = vpi2.Elevation + getELchangeAlongSlope(g1,
                           (vpi1.getEndStation() - vpi2.Station));

                        newVC.IsBeginPINC = false;
                        if (allVCs.Count > 0)
                        {
                           newVC.IsBeginPINC = allVCs.Last<verticalCurve>().IsEndPINC;
                        }

                        newVC.IsEndPINC = false;
                        if (utilFunctions.tolerantCompare(vpi2.Length, 0.0, stationEqualityTolerance) == 0)
                        {
                           newVC.IsEndPINC = true;
                        }

                        allVCs.Add(newVC);
                     }
                     // End: add a VC for the incoming tangent when necessary

                     // add a VC for the current vertical curve if VClen > 0
                     if (vpi2.Length > 0.0)
                     {
                        iHaveOneOrMoreVerticalCurves = true;
                        newVC = new verticalCurve();
                        newVC.BeginSlope = g1;
                        newVC.BeginStation = vpi2.getBeginStation();
                        newVC.EndSlope = g2;
                        newVC.Length = vpi2.Length;
                        newVC.BeginElevation = vpi2.Elevation - getELchangeAlongSlope(g1, newVC.Length / 2.0);
                        allVCs.Add(newVC);
                        EndProfTrueStation = newVC.BeginStation.trueStation + newVC.Length;
                     }
                     // End: add a VC for the current vertical curve if VClen > 0

                     // if this is the final VPI, add a final tangent if necessary
                     if (count == rawVPIlist.Count)
                     {
                        double outgoingTangentLength = vpi3.getBeginStation() - vpi2.getEndStation();
                        if (outgoingTangentLength > 0.0)
                        {
                           newVC = new verticalCurve();
                           newVC.BeginSlope = g2;
                           newVC.BeginStation = vpi2.getEndStation();
                           newVC.EndSlope = g2;
                           newVC.Length = outgoingTangentLength;
                           newVC.BeginElevation = vpi2.Elevation + getELchangeAlongSlope(g2, vpi2.Length / 2.0);

                           newVC.IsBeginPINC = false;
                           if (allVCs.Count > 0)
                           {
                              newVC.IsBeginPINC = allVCs.Last<verticalCurve>().IsEndPINC;
                           }

                           newVC.IsEndPINC = false;

                           allVCs.Add(newVC);
                           EndProfTrueStation = newVC.BeginStation.trueStation + newVC.Length;
                        }
                     }
                     // End: if this is the final VPI, add a final tangent if necessary
                  }
                  vpi1 = vpi2;
               }
               vpi2 = vpi3;
            }
             }
        }
Esempio n. 5
0
 public Profile()
 {
     vpiList aVpiList = new vpiList();
      this.BeginIsUnconstrained = false;
      this.EndIsUnconstrained = false;
 }
Esempio n. 6
0
 public void setFromVPIlist(vpiList newVPIlist)
 {
     buildThisFromRawVPIlist(newVPIlist);
 }
Esempio n. 7
0
 public Profile(vpiList rawVPIlist)
 {
     buildThisFromRawVPIlist(rawVPIlist);
 }
Esempio n. 8
0
 private new void setFromVPIlist(vpiList newVPIlist)
 {
 }
        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);
        }