public PglGroupingViewModel(PGLGrouping theNewPglGrouping)
            : base(null)
        {
            thePglGrouping_ = theNewPglGrouping;

             if (null != thePglGrouping_.insideRibbons)
             {
            foreach (var ribbon in thePglGrouping_.insideRibbons)
            {
               RibbonViewModel ribbonVM = new RibbonViewModel(ribbon as ribbonBase);
               ribbonVM.Parent = this;
               this.Children.Add(ribbonVM);
            }
             }

             if (null != thePglGrouping_.thePGLoffsetRibbon)
             {
            this.Children.Add(new RibbonViewModel(thePglGrouping_.thePGLoffsetRibbon));
             }

             //this.Children
             if (null != thePglGrouping_.outsideRibbons)
             {
            foreach (var ribbon in thePglGrouping_.outsideRibbons)
            {
               this.Children.Add(new RibbonViewModel(ribbon as ribbonBase));
            }
             }
        }
Example #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="parentPGLg">Required non-null</param>
 /// <param name="initialWidth"></param>
 /// <param name="initialSlope">Required non-null</param>
 public ribbonBase(PGLGrouping parentPGLg, Double initialWidth, Slope initialSlope)
 {
     MyParentPGLgrouping = parentPGLg;
      NominalWidth = initialWidth;
      resetWidths();
      NominalCrossSlope = initialSlope;
      resetCrossSlopes();
 }
        public void CreateCorridor_CreateHorizontalAlignmentFirst_BeginStation0()
        {
            rm21HorizontalAlignment HA = setupHA1();
             var newCorridor = new ptsCogo.CorridorTypes.rm21OpenChannelCorridor("LowerCreek");
             newCorridor.GoverningAlignment = HA;

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

             newCorridor.addPGLgrouping(pglGrLT);
             newCorridor.addPGLgrouping(pglGrRT);

             pglGrRT.addOutsideRibbon(new RoadwayLane(pglGrRT, 10.0, new Slope(0.02)));
             pglGrLT.addOutsideRibbon(new RoadwayLane(pglGrLT, 20.0, new Slope(0.10)));

             Assert.True(true);
        }
Example #4
0
 public RoadwayLane(PGLGrouping pglG, Double width, Slope slope)
     : base(pglG, width, slope)
 {
 }
        public void addPGLgrouping(PGLGrouping aPGLgrouping)
        {
            if (aPGLgrouping == null)
            throw new ArgumentNullException();

             aPGLgrouping.ParentCorridor = this;

             if (allPGLgroupings == null)
            allPGLgroupings = new ObservableCollection<PGLGrouping>();

             allPGLgroupings.Add(aPGLgrouping);
        }
        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));
        }
        private void testAribbonOffset(int pglGroupingIndex, bool outsideRibbonOrNot, int ribbonIndex, double station, double expectedValue)
        {
            Profile offsetProfile = null;
             double? testDbl = 0.0;
             double actualValue;

             testPGLgrouping = testCorridor.allPGLgroupings[pglGroupingIndex];
             if (outsideRibbonOrNot == true)
            testRibbon = testPGLgrouping.outsideRibbons.ToList()[ribbonIndex];
             else
            testRibbon = testPGLgrouping.insideRibbons.ToList()[ribbonIndex];

             offsetProfile = testRibbon.getOffsetProfile();

             testDbl = offsetProfile.getElevation((CogoStation) station);

             if (testDbl == null)
            throw new NullReferenceException();
             else
            actualValue = (double) testDbl;

             Assert.AreEqual(expectedValue, actualValue, 0.00001);
             //Assert.AreNotEqual(expectedValue, actualValue, 0.00001);
        }
        private void setupTest2()
        {
            testCorridor = new rm21RoadwayCorridor("L");

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

             PGLGrouping pglGrLT = new PGLGrouping(-1);

             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);

             /* Median Shoulder LT */
             Shoulder 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);

             testCorridor.addPGLgrouping(pglGrLT);
        }
        private void setupTest1()
        {
            testCorridor = new rm21RoadwayCorridor("L");

             testCorridor.Alignment.BeginStation = 1000.0;
             testCorridor.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));

             /* Final Ray Sheet, LT */
             //var newCutSlope = new newCutSlope((CogoStation 1000, (CogoStation) 10000, null, 1.0 / 2.0));
             //pglGrLT.addOutsideRibbon(newCutSlope);

             /* 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));

             /* Final Ray Sheet, RT */
             var newCutSlope = new RaySheet((CogoStation) 1000, (CogoStation) 10000, 1.0 / 2.0);
             //pglGrRT.addOutsideRibbon(newCutSlope);

             /* 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);

             testCorridor.addPGLgrouping(pglGrLT);
             testCorridor.addPGLgrouping(pglGrRT);

             testCorridor.existingGroundSurface = new ptsCogo.Mocks.rm21MockSurface();
        }
Example #10
0
 public void setPGLgroupingParent(PGLGrouping pglGrouping)
 {
     MyParentPGLgrouping = pglGrouping;
 }
Example #11
0
 public Shoulder(PGLGrouping pglG, Double width, Slope slope)
     : base(pglG, width, slope)
 {
 }