// Token: 0x06000209 RID: 521 RVA: 0x0000E100 File Offset: 0x0000C300 private ItSegment CreateSegment(ItBar xmlBar, ItSegment prevSegment, ItGeCurve3d curve, ItGeCurve3d nextCurve, ref bool flipFutureYs, out ItSegment additionalSegment) { additionalSegment = null; ItGeLineSeg3d itGeLineSeg3d = curve as ItGeLineSeg3d; ItGeCircArc3d itGeCircArc3d = curve as ItGeCircArc3d; bool flag = itGeLineSeg3d != null; ItSegment result; if (flag) { result = this.GetSegmentFromLineSeg(xmlBar, prevSegment, itGeLineSeg3d, nextCurve, ref flipFutureYs); } else { bool flag2 = itGeCircArc3d != null; if (flag2) { result = this.GetSegmentFromCircArc(xmlBar, prevSegment, itGeCircArc3d, ref flipFutureYs, out additionalSegment); } else { result = null; } } return(result); }
// Token: 0x06000206 RID: 518 RVA: 0x0000DFFC File Offset: 0x0000C1FC private ItSegment AddSegment(ItBar xmlBar, List <ItGeCurve3d> rebarList, int index, ItSegment prevSegment, ref bool flipFutureYs) { bool flag = index >= rebarList.Count; ItSegment result; if (flag) { result = null; } else { ItGeCurve3d curve = rebarList[index]; ItGeCurve3d nextCurve = (index < rebarList.Count - 1) ? rebarList[index + 1] : null; ItSegment itSegment2; ItSegment itSegment = this.CreateSegment(xmlBar, prevSegment, curve, nextCurve, ref flipFutureYs, out itSegment2); bool flag2 = itSegment == null; if (flag2) { result = null; } else { bool flag3 = itSegment2 != null; if (flag3) { xmlBar.segmentList.Add(itSegment2); } xmlBar.segmentList.Add(itSegment); result = itSegment; } } return(result); }
// Token: 0x06000205 RID: 517 RVA: 0x0000DF78 File Offset: 0x0000C178 private ItSegment AddFirstSegment(ItBar xmlBar, List <ItGeCurve3d> rebarList, ref bool flipFutureYs) { bool flag = rebarList.none <ItGeCurve3d>(); ItSegment result; if (flag) { result = null; } else { ItGeCurve3d firstCurve = rebarList[0]; ItGeCurve3d nextCurve = (rebarList.Count > 1) ? rebarList[1] : null; ItSegment itSegment2; ItSegment itSegment = this.CreateFirstSegment(rebarList, xmlBar, firstCurve, nextCurve, ref flipFutureYs, out itSegment2); bool flag2 = itSegment == null; if (flag2) { result = null; } else { bool flag3 = itSegment2 != null; if (flag3) { xmlBar.segmentList.Add(itSegment2); } xmlBar.segmentList.Add(itSegment); result = itSegment; } } return(result); }
// Token: 0x06000210 RID: 528 RVA: 0x0000E648 File Offset: 0x0000C848 private ItSegment GetSegmentFromLineSeg(ItBar xmlBar, ItSegment prevSegment, ItGeLineSeg3d lineSeg, ItGeCurve3d nextCurve, ref bool flipFutureYs) { ItGeVector3d itGeVector3d = lineSeg.direction(); ItGeVector3d xvector = prevSegment.XVector; ItGeVector3d itGeVector3d2 = itGeVector3d.orthoProject(xvector); double num; double num2; this.GetRotationsInDegree(xmlBar.CurrentNormal, prevSegment, itGeVector3d, ref flipFutureYs, out num, out num2); this.SetCurrentNormal(xmlBar, num, num2, prevSegment); ItGeVector3d xAxis; ItGeVector3d yAxis; ItGeVector3d zAxis; this.GetNewDirections(num, num2, prevSegment, out xAxis, out yAxis, out zAxis); double len = lineSeg.len; double r = 0.0; num = Math.Round(num, 10); num2 = Math.Round(num2, 10); ItGeMatrix3d kIdentity = ItGeMatrix3d.kIdentity; kIdentity.setCoordSystem(ItGePoint3d.kOrigin, xAxis, yAxis, zAxis); ItSegment itSegment = new ItSegment(len, r, num, num2, kIdentity, "normal"); this.FixSegmentLength(itSegment, nextCurve); return(itSegment); }
// Token: 0x06000219 RID: 537 RVA: 0x0000EB58 File Offset: 0x0000CD58 private void GetAdditionalSegment(ItBar xmlBar, ItSegment prevSegment, out ItSegment additionalSegment, ItGeVector3d startDirection, ref bool flipFutureYs) { additionalSegment = null; bool flag = startDirection.isCodirectionalTo(prevSegment.XVector, null); if (!flag) { double num; double num2; this.GetRotationsInDegree(xmlBar.CurrentNormal, prevSegment, startDirection, ref flipFutureYs, out num, out num2); this.SetCurrentNormal(xmlBar, num, 0.0, prevSegment); ItGeVector3d itGeVector3d; ItGeVector3d yAxis; ItGeVector3d zAxis; this.GetNewDirections(num, num2, prevSegment, out itGeVector3d, out yAxis, out zAxis); ItDebug.assert(itGeVector3d.isCodirectionalTo(startDirection, null), "Failure in: "); double l = 0.0; double r = 0.0; num = Math.Round(num, 10); num2 = Math.Round(num2, 10); ItGeMatrix3d kIdentity = ItGeMatrix3d.kIdentity; kIdentity.setCoordSystem(ItGePoint3d.kOrigin, startDirection, yAxis, zAxis); additionalSegment = new ItSegment(l, r, num, num2, kIdentity, "normal"); } }
// Token: 0x06000211 RID: 529 RVA: 0x0000E708 File Offset: 0x0000C908 private void GetNewDirections(double rotX, double bendY, ItSegment prevSegment, out ItGeVector3d newPrevX, out ItGeVector3d newPrevY, out ItGeVector3d newPrevZ) { rotX = ItAngle.toRad(rotX); bendY = ItAngle.toRad(bendY); newPrevY = new ItGeVector3d(prevSegment.YVector).rotateBy(rotX, prevSegment.XVector); newPrevX = new ItGeVector3d(prevSegment.XVector).rotateBy(bendY, -1.0 * newPrevY); newPrevZ = new ItGeVector3d(prevSegment.ZVector).rotateBy(rotX, prevSegment.XVector).rotateBy(bendY, -1.0 * newPrevY); }
// Token: 0x06000212 RID: 530 RVA: 0x0000E798 File Offset: 0x0000C998 private void SetCurrentNormal(ItBar xmlBar, double rotX, double bendY, ItSegment prevSegment) { rotX = ItAngle.toRad(rotX); bendY = ItAngle.toRad(bendY); ItGeVector3d vec = new ItGeVector3d(prevSegment.YVector).rotateBy(rotX, prevSegment.XVector); xmlBar.CurrentNormal = xmlBar.CurrentNormal.rotateBy(rotX, prevSegment.XVector).rotateBy(bendY, -1.0 * vec); }
// Token: 0x0600020A RID: 522 RVA: 0x0000E160 File Offset: 0x0000C360 private ItSegment GetFirstSegFromCircArc(ItBar xmlBar, ItGeCircArc3d firstCirc, ItGeVector3d xzPlaneNormal, ref bool flipFutureYs, out ItSegment additionalSegment) { ItGeLine3d itGeLine3d; firstCirc.tangent(firstCirc.startPoint(), out itGeLine3d, null); ItGeVector3d itGeVector3d = itGeLine3d.direction().negate(); ItSegment startSegment = this.GetStartSegment(xmlBar); double num; double num2; this.GetRotationsInDegree(xzPlaneNormal, startSegment, itGeVector3d, ref flipFutureYs, out num, out num2); ItGeVector3d itGeVector3d2; ItGeVector3d yAxis; ItGeVector3d zAxis; this.GetNewDirections(num, num2, startSegment, out itGeVector3d2, out yAxis, out zAxis); this.SetCurrentNormal(xmlBar, num, num2, startSegment); ItDebug.assert(itGeVector3d2.isCodirectionalTo(itGeVector3d, null), "Failure in: "); double l = 0.0; double r = 0.0; double rotX = Math.Round(num, 10); double bendY = Math.Round(num2, 10); ItGeMatrix3d kIdentity = ItGeMatrix3d.kIdentity; kIdentity.setCoordSystem(ItGePoint3d.kOrigin, itGeVector3d, yAxis, zAxis); additionalSegment = new ItSegment(l, r, rotX, bendY, kIdentity, "normal"); double circleSign = this.GetCircleSign(xmlBar, firstCirc); double num3; double num4; this.GetRotationsInDegree(xzPlaneNormal, additionalSegment, itGeVector3d, ref flipFutureYs, out num3, out num4); ItGeVector3d itGeVector3d3; ItGeVector3d itGeVector3d4; ItGeVector3d itGeVector3d5; this.GetNewDirections(num3, 0.0, startSegment, out itGeVector3d3, out itGeVector3d4, out itGeVector3d5); this.SetCurrentNormal(xmlBar, num3, 0.0, additionalSegment); double num5 = this.GetCentralAngleWithSign(firstCirc, circleSign); num5 = ItAngle.toDegree(num5); ItGeLine3d itGeLine3d2; firstCirc.tangent(firstCirc.startPoint(), out itGeLine3d2, null); ItGeVector3d itGeVector3d6 = itGeLine3d2.direction(); ItGeVector3d zAxis2 = itGeVector3d6.crossProduct(xzPlaneNormal); double l2 = 0.0; double r2 = firstCirc.radius(); double rotX2 = Math.Round(num3, 10); double bendY2 = Math.Round(num5, 10); kIdentity = ItGeMatrix3d.kIdentity; kIdentity.setCoordSystem(ItGePoint3d.kOrigin, itGeVector3d6, xzPlaneNormal, zAxis2); return(new ItSegment(l2, r2, rotX2, bendY2, kIdentity, "normal")); }
// Token: 0x060001BD RID: 445 RVA: 0x0000BEE8 File Offset: 0x0000A0E8 private static void AddSegmentsToBar(ItBar bar, WireItem wire) { double length = wire.Length; double r = 0.0; double rotX = 0.0; double bendY = 0.0; ItGeMatrix3d kIdentity = ItGeMatrix3d.kIdentity; ItSegment item = new ItSegment(length, r, rotX, bendY, kIdentity, "normal"); bar.segmentList.Add(item); }
// Token: 0x0600020E RID: 526 RVA: 0x0000E48C File Offset: 0x0000C68C private void GetRotationsSimple(ItGeVector3d rebarPlaneNormal, ItSegment prevSegment, ItGeVector3d direction, ref bool flipFutureYs, out double rotX, out double bendY) { ItGeVector3d xvector = prevSegment.XVector; ItGeVector3d yvector = prevSegment.YVector; rotX = yvector.angleTo(rebarPlaneNormal, xvector); rotX = SteelGroupElementRebarBase.FixRotX(rotX, ref flipFutureYs); ItGeVector3d refVec = new ItGeVector3d(yvector).rotateBy(rotX, xvector); bendY = xvector.angleTo(direction, refVec); bendY = SteelGroupElement.FixAngleRange(bendY, flipFutureYs); }
// Token: 0x0600020D RID: 525 RVA: 0x0000E42C File Offset: 0x0000C62C private void GetRotationComplex(ItGeVector3d rebarPlaneNormal, ItSegment prevSegment, ItGeVector3d direction, ref bool flipFutureYs, out double rotX, out double bendY) { ItGeVector3d xvector = prevSegment.XVector; ItGeVector3d yvector = prevSegment.YVector; ItGeVector3d itGeVector3d = yvector.orthoProject(rebarPlaneNormal); ItGeVector3d itGeVector3d2 = direction.crossProduct(rebarPlaneNormal); rotX = itGeVector3d.angleTo(itGeVector3d2, xvector); rotX = SteelGroupElementRebarBase.FixRotX(rotX, ref flipFutureYs); bendY = xvector.angleTo(direction, itGeVector3d2); bendY = SteelGroupElement.FixAngleRange(bendY, flipFutureYs); }
// Token: 0x0600020C RID: 524 RVA: 0x0000E3B8 File Offset: 0x0000C5B8 private void GetRotationsInDegree(ItGeVector3d rebarPlaneNormal, ItSegment prevSegment, ItGeVector3d direction, ref bool flipFutureYs, out double rotX, out double bendY) { double a = rebarPlaneNormal.dotProduct(prevSegment.XVector); bool flag = a.Eq(0.0, -1.0); if (flag) { this.GetRotationsSimple(rebarPlaneNormal, prevSegment, direction, ref flipFutureYs, out rotX, out bendY); } else { this.GetRotationComplex(rebarPlaneNormal, prevSegment, direction, ref flipFutureYs, out rotX, out bendY); } rotX = ItAngle.toDegree(rotX); bendY = ItAngle.toDegree(bendY); }
// Token: 0x06000204 RID: 516 RVA: 0x0000DF1C File Offset: 0x0000C11C private void FillSegments(ItBar xmlBar, List <ItGeCurve3d> rebarList) { bool flag = rebarList.Count == 0; if (!flag) { bool flag2 = true; ItSegment itSegment = this.AddFirstSegment(xmlBar, rebarList, ref flag2); ItSegment prevSegment = itSegment; int num; for (int i = 1; i < rebarList.Count; i = num + 1) { prevSegment = this.AddSegment(xmlBar, rebarList, i, prevSegment, ref flag2); num = i; } } }
// Token: 0x06000216 RID: 534 RVA: 0x0000EA48 File Offset: 0x0000CC48 private void FixSegmentLength(ItSegment segment, ItGeCurve3d nextCurve) { ItGeCircArc3d itGeCircArc3d = nextCurve as ItGeCircArc3d; bool flag = itGeCircArc3d == null; if (!flag) { double num = Math.Abs(this.GetCentralAngleWithSign(itGeCircArc3d, 1.0)); bool flag2 = num.Ge(1.5707963267948966, -1.0); if (flag2) { segment.L += itGeCircArc3d.radius(); } else { double num2 = itGeCircArc3d.radius(); double num3 = Math.Sin(num); double value = num3 * num2; segment.L += Math.Round(value, 5); } } }
// Token: 0x0600020F RID: 527 RVA: 0x0000E4EC File Offset: 0x0000C6EC private ItSegment GetSegmentFromCircArc(ItBar xmlBar, ItSegment prevSegment, ItGeCircArc3d circArc, ref bool flipFutureYs, out ItSegment additionalSegment) { additionalSegment = null; ItGeLine3d itGeLine3d = null; ItGeLine3d itGeLine3d2 = null; bool flag = !circArc.tangent(circArc.endPoint(), out itGeLine3d, null) || !circArc.tangent(circArc.startPoint(), out itGeLine3d2, null); ItSegment result; if (flag) { result = null; } else { ItGeVector3d itGeVector3d = (itGeLine3d2 != null) ? itGeLine3d2.direction().negate() : prevSegment.XVector; this.GetAdditionalSegment(xmlBar, prevSegment, out additionalSegment, itGeVector3d, ref flipFutureYs); ItGeVector3d rebarPlaneNormal = circArc.normal(); double num; double num2; this.GetRotationsInDegree(rebarPlaneNormal, additionalSegment ?? prevSegment, itGeVector3d, ref flipFutureYs, out num, out num2); this.SetCurrentNormal(xmlBar, num, 0.0, additionalSegment ?? prevSegment); double circleSign = this.GetCircleSign(xmlBar, circArc); double num3 = this.GetCentralAngleWithSign(circArc, circleSign); num3 = ItAngle.toDegree(num3); ItGeVector3d itGeVector3d2 = -1.0 * itGeLine3d.direction(); ItGeVector3d itGeVector3d3 = circleSign * circArc.normal(); ItGeVector3d zAxis = itGeVector3d2.crossProduct(itGeVector3d3); double l = 0.0; double r = circArc.radius(); num = Math.Round(num, 10); double bendY = Math.Round(num3, 10); ItGeMatrix3d kIdentity = ItGeMatrix3d.kIdentity; kIdentity.setCoordSystem(ItGePoint3d.kOrigin, itGeVector3d2, itGeVector3d3, zAxis); ItSegment itSegment = new ItSegment(l, r, num, bendY, kIdentity, "normal"); result = itSegment; } return(result); }
// Token: 0x0600020B RID: 523 RVA: 0x0000E310 File Offset: 0x0000C510 private ItSegment GetFirstSegFromLineSeg(ItBar xmlBar, ItGeLineSeg3d firstSeg, ItGeVector3d xzPlaneNormal, ItGeCurve3d nextCurve, ref bool flipFutureYs) { ItGeVector3d direction = firstSeg.direction(); ItSegment startSegment = this.GetStartSegment(xmlBar); double num; double num2; this.GetRotationsInDegree(xzPlaneNormal, startSegment, direction, ref flipFutureYs, out num, out num2); this.SetCurrentNormal(xmlBar, num, num2, startSegment); ItGeVector3d xAxis; ItGeVector3d yAxis; ItGeVector3d zAxis; this.GetNewDirections(num, num2, startSegment, out xAxis, out yAxis, out zAxis); double len = firstSeg.len; ItGeMatrix3d kIdentity = ItGeMatrix3d.kIdentity; kIdentity.setCoordSystem(ItGePoint3d.kOrigin, xAxis, yAxis, zAxis); ItSegment itSegment = new ItSegment(len, 0.0, Math.Round(num, 10), Math.Round(num2, 10), kIdentity, "normal"); this.FixSegmentLength(itSegment, nextCurve); return(itSegment); }
// Token: 0x06000207 RID: 519 RVA: 0x0000E08C File Offset: 0x0000C28C private ItSegment CreateFirstSegment(List <ItGeCurve3d> rebarList, ItBar xmlBar, ItGeCurve3d firstCurve, ItGeCurve3d nextCurve, ref bool flipFutureYs, out ItSegment additionalSegment) { additionalSegment = null; ItGeVector3d rebarElementNormal = this.GetRebarElementNormal(); ItGeVector3d normalFromFirstTwoSegments = SteelGroupElementRebarBase.GetNormalFromFirstTwoSegments(rebarList, rebarElementNormal); ItGeLineSeg3d itGeLineSeg3d = firstCurve as ItGeLineSeg3d; ItGeCircArc3d itGeCircArc3d = firstCurve as ItGeCircArc3d; bool flag = itGeLineSeg3d != null; ItSegment result; if (flag) { result = this.GetFirstSegFromLineSeg(xmlBar, itGeLineSeg3d, normalFromFirstTwoSegments, nextCurve, ref flipFutureYs); } else { bool flag2 = itGeCircArc3d != null; if (flag2) { result = this.GetFirstSegFromCircArc(xmlBar, itGeCircArc3d, normalFromFirstTwoSegments, ref flipFutureYs, out additionalSegment); } else { result = null; } } return(result); }