public override double? getActualWidth(CogoStation aStation, out tupleNullableDoubles result) { double? ret = null; result.ahead = null; result.back = null; result.isSingleValue = true; return ret; }
public RaySheet(CogoStation beginStation, CogoStation endStation, Slope initialSlope) { interpretWidths = new Profile(beginStation, endStation, (double) enmWidthInterpret.HorizontalOnly); Widths = null; interpretCrossSlopes = new Profile(beginStation, endStation, (double)enmCrossSlopeInterpret.xPercentage); CrossSlopes = new Profile(beginStation, endStation, initialSlope); LiederLineHeight = 5.0; }
public void arithmaticAdd_computesCorrectElevation_whenBothProfilesAreOnVerticalCurves_subtract() { CogoStation sta = new CogoStation(1950.0); double el1 = (double)profile1.getElevation(sta); double el2 = (double)profile2.getElevation(sta); double expectedValue = el1 - el2; resultingProfile = Profile.arithmaticAddProfile(profile1, profile2, -1.0); double computedElevation = (double)resultingProfile.getElevation(sta); Assert.AreEqual(expectedValue, computedElevation, doubleDelta); }
public void arithmaticAdd_computesCorrectElevation_whenOnTangentAndDifferentTangent() { CogoStation sta = new CogoStation(1130.0); double el1 = (double)profile1.getElevation(sta); double el2 = (double)profile2.getElevation(sta); double expectedValue = el1 + el2; resultingProfile = Profile.arithmaticAddProfile(profile1, profile2, 1.0); double computedElevation = (double)resultingProfile.getElevation(sta); Assert.AreEqual(expectedValue, computedElevation, doubleDelta); }
public ribbonBase(CogoStation beginStation, CogoStation endStation, double initialWidth, Slope initialSlope) { if (null == beginStation) throw new ArgumentNullException("beginStation"); if (null == endStation) throw new ArgumentNullException("endStation"); interpretWidths = new Profile(beginStation, endStation, (double) enmWidthInterpret.HorizontalOnly); NominalWidth = initialWidth; Widths = new Profile(beginStation, endStation, initialWidth); interpretCrossSlopes = new Profile(beginStation, endStation, (double)enmCrossSlopeInterpret.xPercentage); NominalCrossSlope = initialSlope; resetCrossSlopes(); LiederLineHeight = 5.0; }
public virtual double? getCrossSlope(CogoStation aStation, out tupleNullableDoubles result) { CrossSlopes.getElevation(aStation, out result); if (result.back != null && result.isSingleValue == false) { return result.ahead; } return result.back; }
public virtual double? getActualWidth(CogoStation aStation) { tupleNullableDoubles rslt = new tupleNullableDoubles(); return getActualWidth(aStation, out rslt); }
public RoadwayLane(CogoStation beginStation, CogoStation endStation, double initialWidth, Slope initialSlope) : base(beginStation, endStation, initialWidth, initialSlope) { }
public void DrawPlanViewSchematic(IRM21cad2dDrawingContext cadContext, CogoStation station) { cadContext.setElementColor(Color.FromArgb(255, 255, 255, 0)); // yellow cadContext.setElementWeight(2.25); double begSta = Alignment.BeginStation; double endSta = Alignment.EndStation; cadContext.Draw(0.0, begSta, 0.0, endSta); foreach (var pglGrouping in allPGLgroupings) { pglGrouping.DrawPlanViewSchematic(cadContext, pglGrouping.myIndex); } }
public void appendStationAndElevation(CogoStation newStation, double newElevation) { verticalCurve newVC, otherVC; if (iHaveOneOrMoreVerticalCurves == true) { throw new NotImplementedException("Currently unable to add VPI to a profile with a vertical curve."); } newVC = new verticalCurve(); // To Do's //Insert new pi after last station if (newStation > EndProfTrueStation) { vcIndex = allVCs.Count - 1; otherVC = allVCs[vcIndex]; newVC.BeginStation = otherVC.EndStation; EndProfTrueStation = newStation.trueStation; otherVC.IsEndPINC = true; newVC.BeginElevation = verticalCurve.getElevation(otherVC, (CogoStation)otherVC.EndStation); newVC.IsBeginPINC = true; newVC.IsEndPINC = false; newVC.IsTangent = true; newVC.BeginSlope = (newElevation - newVC.BeginElevation) / (newStation - newVC.BeginStation); newVC.EndSlope = newVC.BeginSlope; newVC.Length = newStation - newVC.BeginStation; allVCs.Add(newVC); } else if (newStation < BeginProfTrueStation) //Insert new pi before first station { vcIndex = 0; otherVC = allVCs[vcIndex]; newVC.BeginStation = newStation; BeginProfTrueStation = newStation.trueStation; otherVC.IsBeginPINC = true; newVC.BeginElevation = newElevation; newVC.IsBeginPINC = false; newVC.IsEndPINC = true; newVC.IsTangent = true; newVC.BeginSlope = (otherVC.BeginElevation - newElevation) / (otherVC.BeginStation - newStation); newVC.EndSlope = newVC.BeginSlope; newVC.Length = otherVC.BeginStation - newStation; allVCs.Insert(0, newVC); } //insert new pi interior to the profile, but one that has no vertical curves else { //(CogoStation newStation, double newElevation) setIndexToTheCorrectVC(newStation); otherVC = allVCs[vcIndex]; // see if new station is already in the profile as a vpi if(newStation == otherVC.BeginStation) { if (vcIndex == 0) // currently at the first vc { throw new NotImplementedException(); } else { throw new NotImplementedException(); } } else if(newStation == otherVC.EndStation) { if (vcIndex == allVCs.Count - 1) // currently at the last vc { throw new NotImplementedException(); } else { throw new NotImplementedException(); } } // End: see if new station is already in the profile as a vpi else // new station is interior to an existing VC { CogoStation station1, station2, station3; double elevation1, elevation2, elevation3; station1 = otherVC.BeginStation; station2 = newStation; station3 = otherVC.EndStation; elevation1 = otherVC.BeginElevation; elevation2 = newElevation; elevation3 = verticalCurve.getElevation(otherVC, station3); otherVC.setVerticalTangent(station1, elevation1, station2, elevation2); newVC = new verticalCurve(); newVC.setVerticalTangent(station2, elevation2, station3, elevation3); verticalCurve otherOtherVC; if (vcIndex > 0) { int VCindex0 = vcIndex - 1; otherOtherVC = allVCs[VCindex0]; if (otherOtherVC.EndSlope == otherVC.BeginSlope) otherOtherVC.IsEndPINC = otherVC.IsBeginPINC = false; else otherOtherVC.IsEndPINC = otherVC.IsBeginPINC = true; } if (vcIndex < allVCs.Count-1) { int VCindex3 = vcIndex + 1; otherOtherVC = allVCs[VCindex3]; if (otherOtherVC.BeginSlope == otherVC.EndSlope) otherOtherVC.IsBeginPINC = otherVC.IsEndPINC = false; else otherOtherVC.IsBeginPINC = otherVC.IsEndPINC = true; } allVCs.Insert(vcIndex+1, newVC); } // End: new station is interior to an existing VC } // To Do: dissolve two vc's into one when they are really the same slope/elevation }
public bool isOnPINC(CogoStation aStation) { var aVC = allVCs.FirstOrDefault(vc => utilFunctions.tolerantCompare(vc.BeginStation.trueStation, aStation.trueStation, stationEqualityTolerance) == 0); if (aVC == null) return false; else return aVC.IsBeginPINC; }
public void getSlope(CogoStation station, out tupleNullableDoubles theSlope) { verticalCurve.getSwitchForProfiles callFunction = new verticalCurve.getSwitchForProfiles(verticalCurve.getSlope); getValueByDelegate(station, out theSlope, callFunction); }
public double? getSlopeFromTheRight(CogoStation station) { var resultTND = new tupleNullableDoubles(); getSlope(station, out resultTND); return resultTND.ahead; }
public double? getKValueFromTheRight(CogoStation station) { try { setIndexToTheCorrectVC(station); } catch (IndexOutOfRangeException) { } return allVCs[vcIndex].Kvalue; }
public double? getElevationFromTheLeft(CogoStation station) { return getElevation(station); }
public double? getElevation(CogoStation station) { double? retVal; var resultTND = new tupleNullableDoubles(); getElevation(station, out resultTND); if(resultTND.back != null) retVal = resultTND.back; retVal = resultTND.ahead; if (null == retVal) { if (station > EndProfTrueStation) { if (this.EndIsUnconstrained == true) { this.getElevation((CogoStation)EndProfTrueStation, out resultTND); retVal = resultTND.back; } } if (station < this.BeginProfTrueStation) { if (this.BeginIsUnconstrained == true) { this.getElevation((CogoStation)BeginProfTrueStation, out resultTND); retVal = resultTND.ahead; } } } return retVal; }
public virtual Slope getCrossSlope(CogoStation aStation) { tupleNullableDoubles rslt = new tupleNullableDoubles(); Double? xSlope = getCrossSlope(aStation, out rslt); if (xSlope == null) return null; else return new Slope((Double)xSlope); }
private new void appendStationAndElevation(CogoStation newStation, double newElevation) { }
public StationOffsetElevation getOutsideEdgeStationOffsetElevation(CogoStation sta) { StationOffsetElevation returnItem = new StationOffsetElevation(); returnItem.station = sta.trueStation; returnItem.offset = this.myOffsets.getElevation(sta); returnItem.elevation = 0.0; return returnItem; }
public void getCrossSectionEndPoints( CogoStation station, out ptsPoint leftPt, double leftOffset, out ptsPoint rightPt, double rightOffset) { leftPt = null; rightPt = null; }
public Profile(CogoStation beginStation, CogoStation endStation, double singleElevation) { vpiList aVpiList = new vpiList(); aVpiList.add(beginStation, singleElevation); aVpiList.add(endStation, singleElevation); buildThisFromRawVPIlist(aVpiList); }
public void addSegment(CogoStation beginStation, double beginElevation, double beginSlope, double endSlope, double length, bool isBeginPINC, bool isEndPINC, bool isAProfileGap) { this.BeginProfTrueStation = Math.Min(this.BeginProfTrueStation, beginStation.trueStation); this.EndProfTrueStation = Math.Max(this.EndProfTrueStation, beginStation.trueStation + length); verticalCurve aVC = new verticalCurve(); aVC.IsaProfileGap = isAProfileGap; if (false == isAProfileGap) { aVC.BeginStation = beginStation; aVC.BeginElevation = beginElevation; aVC.BeginSlope = beginSlope; aVC.EndSlope = endSlope; aVC.Length = length; aVC.IsBeginPINC = isBeginPINC; aVC.IsEndPINC = isEndPINC; } if (null == this.allVCs) this.allVCs = new List<verticalCurve>(); this.allVCs.Add(aVC); }
private void updateTransformedCanvas() { if (parentVM_ == null) return; if (parentVM_.parentVM_ == null) return; if (parentVM_.parentVM_.myViewReference == null) return; if (parentVM_.parentVM_.myViewReference.xsCanvas == null) return; currentCorridor_ = parentVM_.CurrentCorridor; if (CanvasXfrmd == null) CanvasXfrmd = new TransformedCanvas(parentVM_.parentVM_.myViewReference.psCanvas); CanvasXfrmd.Scale = ViewScaleFeetPerInch; CanvasXfrmd.verticalExagg = 1.0; CanvasXfrmd.WindowCenterX = WindowCenterX; CanvasXfrmd.WindowCenterY = WindowCenterY; CanvasXfrmd.aheadOrientation = 90.0; CanvasXfrmd.Canvas.Children.Clear(); CogoStation passStation; if (null == currentStation_) passStation = null; else passStation = new CogoStation(currentStation_); currentCorridor_.DrawPlanViewSchematic(CanvasXfrmd, passStation); }
private void getValueByDelegate(CogoStation station, out tupleNullableDoubles theOutValue, verticalCurve.getSwitchForProfiles getFunction) { if (null == allVCs) { theOutValue.ahead = 0.0; theOutValue.back = 0.0; theOutValue.isSingleValue = true; return; } if ((station.trueStation < BeginProfTrueStation - stationEqualityTolerance) || (station.trueStation > EndProfTrueStation + stationEqualityTolerance)) { // it means we are off the profile theOutValue.back = null; theOutValue.ahead = null; theOutValue.isSingleValue = true; return; } try { setIndexToTheCorrectVC(station); } catch (IndexOutOfRangeException) { } verticalCurve aVC = allVCs[vcIndex]; // if there are effectively no VCs, treat it as singleElevation if (allVCs.Count == 1 && aVC.Length < 0.00000001) { theOutValue.back = aVC.BeginElevation; theOutValue.ahead = aVC.BeginElevation; theOutValue.isSingleValue = true; } // if we are at the begin station, check to see how we relate to the previous vc else if (utilFunctions.tolerantCompare(station.trueStation, aVC.BeginStation.trueStation, stationEqualityTolerance) == 0) { // if we are at the beginning of the profile, split theOutValue if (vcIndex == 0) { theOutValue.back = null; theOutValue.ahead = getFunction(aVC, station); theOutValue.isSingleValue = false; } else // if station is on the boundary between two verticalCurves, { // then see if we need to split theOutValue if (getFunction == verticalCurve.getKvalue && aVC.IsBeginPINC) { theOutValue.back = theOutValue.ahead = 0.0; theOutValue.isSingleValue = true; } else { theOutValue.ahead = getFunction(aVC, station); theOutValue.back = getFunction(allVCs[vcIndex - 1], station); if (utilFunctions.tolerantCompare(theOutValue.back, theOutValue.ahead, 0.00005) == 0) { theOutValue.isSingleValue = true; } else theOutValue.isSingleValue = false; } } } // End: if we are at the begin station, check to see how we relate to the previous vc // if we are at the end station, check to see how we relate to the next vc else if (utilFunctions.tolerantCompare(station.trueStation, aVC.EndStation.trueStation, stationEqualityTolerance) == 0) { // if we are at the end of the profile, split theOutValue if (vcIndex == allVCs.Count - 1) { theOutValue.back = getFunction(aVC, station); theOutValue.ahead = null; theOutValue.isSingleValue = false; } else // if station is on the boundary between two verticalCurves, { // then see if we need to split theOutValue if (getFunction == verticalCurve.getKvalue && aVC.IsEndPINC) { theOutValue.back = theOutValue.ahead = 0.0; theOutValue.isSingleValue = true; } else { theOutValue.back = getFunction(aVC, station); theOutValue.ahead = getFunction(allVCs[vcIndex + 1], station); if (utilFunctions.tolerantCompare(theOutValue.back, theOutValue.ahead, 0.00005) == 0) { theOutValue.isSingleValue = true; } else theOutValue.isSingleValue = false; } } } // End: if we are at the end station, check to see how we relate to the next vc else { theOutValue.back = getFunction(aVC, station); theOutValue.ahead = theOutValue.back; theOutValue.isSingleValue = true; } }
public void DrawCrossSection(IRM21cad2dDrawingContext cadContext, CogoStation station) { if (allPGLgroupings != null) { if (null != existingGroundSurface) { ptsPoint leftEndPt = null; ptsPoint rightEndPt = null; double distancetoLeftPoint = -200.0; if (Alignment.GetType is ptsCogo.Horizontal.rm21HorizontalAlignment) { ((ptsCogo.Horizontal.rm21HorizontalAlignment)Alignment).getCrossSectionEndPoints(station, out leftEndPt, distancetoLeftPoint, out rightEndPt, Math.Abs(distancetoLeftPoint)); } existingGroundProfile = existingGroundSurface.getSectionProfile(leftEndPt, distancetoLeftPoint, rightEndPt); } DrawExistingGroundLine(cadContext, existingGroundProfile); DrawCenterLineAnnotationelementsForXS(cadContext, station); foreach (var pglGrouping in allPGLgroupings) { pglGrouping.DrawCrossSection(cadContext, existingGroundProfile, station, pglGrouping.myIndex); } } }
internal void DrawCrossSection(IRM21cad2dDrawingContext cadContext, Profile existingGroundProfile, CogoStation station, int whichSide_) { int whichSide = Math.Sign(whichSide_); StationOffsetElevation StaOffEL = new StationOffsetElevation(station.trueStation, 0.0, 0.0); if (pglProfile != null) StaOffEL.elevation = pglProfile.getElevation(station); if (thePGLoffsetRibbon != null) thePGLoffsetRibbon.DrawCrossSection(cadContext, ref StaOffEL, whichSide); if (insideRibbons != null) { double pglOffset = StaOffEL.offset; double pglElevation = StaOffEL.elevation; foreach (var aRibbon in insideRibbons) { aRibbon.DrawCrossSection(cadContext, ref StaOffEL, -1 * whichSide); } StaOffEL.offset = pglOffset; StaOffEL.elevation = pglElevation; } if (outsideRibbons != null) { foreach (var aRibbon in outsideRibbons) { aRibbon.DrawCrossSection(cadContext, ref StaOffEL, whichSide); } } }
private void DrawCenterLineAnnotationelementsForXS(IRM21cad2dDrawingContext cadContext, CogoStation station) { cadContext.setElementColor(Color.FromArgb(255, 255, 255, 255)); cadContext.setElementWeight(1.5); cadContext.Draw(0.0, 0.5, 0.0, 8.0); cadContext.Draw("C", -0.45, 8.6, 0.0); cadContext.Draw("L", -0.2, 8.3, 0.0); }
public virtual void addCrossSlopeChangedSegment(CogoStation beginOpenTaperStation, CogoStation endOpenTaperStation, double crossSlope, CogoStation beginCloseTaperStation, CogoStation endCloseTaperStation) { double startCrossSlope, endCrossSlope; CrossSlopes.getElevation(beginOpenTaperStation, out resultScratchpad); startCrossSlope = (double)resultScratchpad.back; CrossSlopes.getElevation(endCloseTaperStation, out resultScratchpad); endCrossSlope = (double)resultScratchpad.back; CrossSlopes.appendStationAndElevation(beginOpenTaperStation, startCrossSlope); CrossSlopes.appendStationAndElevation(endOpenTaperStation, crossSlope); CrossSlopes.appendStationAndElevation(beginCloseTaperStation, crossSlope); CrossSlopes.appendStationAndElevation(endCloseTaperStation, endCrossSlope); }
public BackSlopeCutDitch(CogoStation beginStation, CogoStation endStation, Slope initialSlope) : base(beginStation, endStation, initialSlope) { }
public virtual void addWidenedSegment(CogoStation beginOpenTaperStation, CogoStation endOpenTaperStation, double newTotalWidth, CogoStation beginCloseTaperStation, CogoStation endCloseTaperStation) { double startWidth, endWidth; Widths.getElevation(beginOpenTaperStation, out resultScratchpad); startWidth = (double)resultScratchpad.back; Widths.getElevation(endCloseTaperStation, out resultScratchpad); endWidth = (double)resultScratchpad.back; Widths.appendStationAndElevation(beginOpenTaperStation, startWidth); Widths.appendStationAndElevation(endOpenTaperStation, newTotalWidth); Widths.appendStationAndElevation(beginCloseTaperStation, newTotalWidth); Widths.appendStationAndElevation(endCloseTaperStation, endWidth); computeOffsetsProfile_(); }