// 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: 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: 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: 0x06000202 RID: 514 RVA: 0x0000DE68 File Offset: 0x0000C068 private static ItGePoint3d GetRebarStartPoint(ItGeCurve3d firstSeg) { ItGePoint3d result; firstSeg.hasStartPoint(out result); return(result); }
// Token: 0x0600022E RID: 558 RVA: 0x0000F4DC File Offset: 0x0000D6DC protected short GetUnitechnikAngleOfFreeForm(ItGeCurve3d first, out ItGeVector3d normal) { ItGeVector3d directionFromCurve = SteelGroupElementRebarBase.GetDirectionFromCurve(first); double num = ItGeVector3d.kXAxis.angleTo(directionFromCurve, ItGeVector3d.kZAxis); normal = ItGeVector3d.kYAxis.rotateBy(num, ItGeVector3d.kZAxis); num = SteelGroupElement.FixAngleRange(num, false); num = ItAngle.toDegree(num); return((short)Math.Round(num, 0)); }
// Token: 0x06000214 RID: 532 RVA: 0x0000E8A4 File Offset: 0x0000CAA4 public static ItGeVector3d GetNormalFromTwoSegments(ItGeCurve3d firstCurve, ItGeCurve3d nextCurve) { ItGeCircArc3d itGeCircArc3d = firstCurve as ItGeCircArc3d; ItGeLineSeg3d itGeLineSeg3d = firstCurve as ItGeLineSeg3d; bool flag = itGeCircArc3d != null; ItGeVector3d result; if (flag) { result = itGeCircArc3d.normal(); } else { ItGeVector3d itGeVector3d = itGeLineSeg3d.direction(); ItGeCircArc3d itGeCircArc3d2 = nextCurve as ItGeCircArc3d; ItGeLineSeg3d itGeLineSeg3d2 = nextCurve as ItGeLineSeg3d; bool flag2 = itGeCircArc3d2 != null; if (flag2) { ItGeVector3d itGeVector3d2 = itGeCircArc3d2.normal(); ItGePlane itGePlane = new ItGePlane(ItGePoint3d.kOrigin, itGeVector3d2); ItGePoint3d itGePoint3d; bool flag3 = itGePlane.intersectWith(itGeLineSeg3d, out itGePoint3d, null); if (flag3) { result = ItGeVector3d.kYAxis; } else { result = itGeVector3d2; } } else { bool flag4 = itGeLineSeg3d2 != null; if (flag4) { ItGeVector3d vec = itGeLineSeg3d2.direction(); ItGeVector3d itGeVector3d3 = itGeVector3d.crossProduct(vec); bool flag5 = itGeVector3d3.length().Gt(0.0, -1.0); if (flag5) { return(itGeVector3d3); } } result = null; } } return(result); }
// Token: 0x060001D8 RID: 472 RVA: 0x0000CA88 File Offset: 0x0000AC88 private void UnitechnikWriteRebarAsFreeForm() { ItDebug.assert(base.IronSetsSchematic.any <List <ItGeCurve3d> >() && base.IronSetsSchematic[0].Count > 1, "Do not call this method for anything but bending forms."); ItUniWrapperImpl.RodstockData data = default(ItUniWrapperImpl.RodstockData); List <ItGeCurve3d> list = base.IronSetsSchematic[0]; ItGeVector3d normal; short unitechnikAngleOfFreeForm = base.GetUnitechnikAngleOfFreeForm(list[0], out normal); int num; double dValue; this.GetSpacingAndCountForUnitechnik(unitechnikAngleOfFreeForm, out num, out dValue); int freeFormLength = SteelGroupElementRebar.GetFreeFormLength(list); ItGePoint3d startPoint = base.GetStartPoint(base.IronSetsSchematic); data.length = (uint)freeFormLength; data.startAngle = unitechnikAngleOfFreeForm; data.artNr = string.Empty; data.autoProd = 0; data.diameter = (ushort)CNCDataBase.convertToMM(base.RebarBarType.BarDiameter); data.flexFormNumber = 0; data.formType = 2; data.hasSpacers = 0; data.hasWielding = 0; data.installationHeight = (uint)CNCDataBase.convertToMM(startPoint.z); data.number = (ushort)num; data.pitch = CNCDataBase.convertToMM(dValue); data.pitchSpacer = 0u; data.startingPointSpacer = 0u; data.reinfType = (byte)base.CNCReinfTypeValue; data.steelQuality = SteelGroupElementRebarBase.GetSteelQuality(base.RebarBarType); data.xcoord = CNCDataBase.convertToMM(startPoint.x); data.ycoord = CNCDataBase.convertToMM(startPoint.y); List <ItUniWrapperImpl.FreeFormSegment> list2 = new List <ItUniWrapperImpl.FreeFormSegment>(); int num2; for (int i = 0; i < list.Count; i = num2 + 1) { ItGeCurve3d itGeCurve3d = list[i]; ItGeCurve3d nextCurve = list.ElementAtOrDefault(i + 1); short unitechnikAngleOfNextSegment = this.GetUnitechnikAngleOfNextSegment(itGeCurve3d, nextCurve, normal); list2.Add(new ItUniWrapperImpl.FreeFormSegment { length = (uint)CNCDataBase.convertToMM(itGeCurve3d.len), angle = unitechnikAngleOfNextSegment }); num2 = i; } ItUniWrapperImpl.AddFreeFormRodstock(data, list2); }
// Token: 0x0600022D RID: 557 RVA: 0x0000F48C File Offset: 0x0000D68C protected static ItGeVector3d GetDirectionFromCurve(ItGeCurve3d curve) { ItGeLineSeg3d itGeLineSeg3d = curve as ItGeLineSeg3d; ItGeCircArc3d itGeCircArc3d = curve as ItGeCircArc3d; bool flag = itGeLineSeg3d != null; ItGeVector3d result; if (flag) { result = itGeLineSeg3d.direction(); } else { ItGeLine3d itGeLine3d; itGeCircArc3d.tangent(itGeCircArc3d.startPoint(), out itGeLine3d, null); result = itGeLine3d.direction(); } return(result); }
// Token: 0x060001D9 RID: 473 RVA: 0x0000CC6C File Offset: 0x0000AE6C private short GetUnitechnikAngleOfNextSegment(ItGeCurve3d thisCurve, ItGeCurve3d nextCurve, ItGeVector3d normal) { bool flag = nextCurve == null; short result; if (flag) { result = 0; } else { ItGeVector3d directionFromCurve = SteelGroupElementRebarBase.GetDirectionFromCurve(thisCurve); ItGeVector3d directionFromCurve2 = SteelGroupElementRebarBase.GetDirectionFromCurve(nextCurve); double num = directionFromCurve.angleTo(directionFromCurve2, normal); num = SteelGroupElement.FixAngleRange(num, false); num = ItAngle.toDegree(num); short num2 = (short)Math.Round(num, 0); result = num2; } return(result); }
// 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: 0x06000201 RID: 513 RVA: 0x0000DD94 File Offset: 0x0000BF94 public List <ItBar> ToBarList(ItSteel steelBlock, List <List <ItGeCurve3d> > ironSet) { List <ItBar> list = new List <ItBar>(); bool flag = ironSet.none <List <ItGeCurve3d> >(); List <ItBar> result; if (flag) { result = list; } else { bool flag2 = this.RebarBarType == null; if (flag2) { result = list; } else { foreach (List <ItGeCurve3d> list2 in ironSet) { bool flag3 = list2.none <ItGeCurve3d>(); if (!flag3) { double rotZ = 0.0; ItGeCurve3d firstSeg = list2.FirstOrDefault <ItGeCurve3d>(); ItGePoint3d rebarStartPoint = SteelGroupElementRebarBase.GetRebarStartPoint(firstSeg); ItGePoint3d startPoint = steelBlock.Offset(rebarStartPoint); ItBar itBar = this.CreateBarElement(startPoint, rotZ); this.FillSegments(itBar, list2); list.Add(itBar); } } result = list; } } return(result); }
// Token: 0x06000213 RID: 531 RVA: 0x0000E800 File Offset: 0x0000CA00 public static ItGeVector3d GetNormalFromFirstTwoSegments(List <ItGeCurve3d> rebarList, ItGeVector3d defaultValue) { bool flag = rebarList.Count < 2; ItGeVector3d result; if (flag) { result = defaultValue; } else { ItGeCircArc3d itGeCircArc3d = rebarList[0] as ItGeCircArc3d; ItGeLineSeg3d firstCurve = rebarList[0] as ItGeLineSeg3d; bool flag2 = itGeCircArc3d != null; if (flag2) { result = itGeCircArc3d.normal(); } else { int num; for (int i = 1; i < rebarList.Count; i = num + 1) { ItGeCurve3d nextCurve = rebarList[i]; ItGeVector3d normalFromTwoSegments = SteelGroupElementRebarBase.GetNormalFromTwoSegments(firstCurve, nextCurve); bool flag3 = normalFromTwoSegments != null; if (flag3) { return(normalFromTwoSegments); } num = i; } result = ItGeVector3d.kYAxis; } } return(result); }
// Token: 0x06000221 RID: 545 RVA: 0x0000EEA0 File Offset: 0x0000D0A0 protected void UnitechnikAddStraightBars(List <List <ItGeCurve3d> > arrayIrons, ElementId id) { List <ItGeCurve3d> list = arrayIrons.FirstOrDefault <List <ItGeCurve3d> >(); bool flag = list == null; if (flag) { ItFailures.PostFailure(ItFailures.CAMObjectWithoutValidGeometry, id); } else { ItGeCurve3d itGeCurve3d = list.FirstOrDefault <ItGeCurve3d>(); bool flag2 = itGeCurve3d == null; if (flag2) { ItFailures.PostFailure(ItFailures.CAMObjectWithoutValidGeometry, id); } else { ItGePoint3d itGePoint3d; itGeCurve3d.hasStartPoint(out itGePoint3d); ItGeVector3d itGeVector3d; short unitechnikAngleOfFreeForm = this.GetUnitechnikAngleOfFreeForm(itGeCurve3d, out itGeVector3d); bool flag3 = arrayIrons.Count > 1; int num; double num2; if (flag3) { this.GetSpacingAndCountForUnitechnik(unitechnikAngleOfFreeForm, out num, out num2); } else { ItGeVector3d kOrigin = ItGeVector3d.kOrigin; num2 = 0.0; num = 1; } uint length = (uint)CNCDataBase.convertToMM(itGeCurve3d.len); ItUniWrapperImpl.RodstockData data = new ItUniWrapperImpl.RodstockData { length = length, startAngle = unitechnikAngleOfFreeForm, artNr = string.Empty, autoProd = 0, diameter = (ushort)CNCDataBase.convertToMM(this.RebarBarType.BarDiameter), flexFormNumber = 0, formType = 0, hasSpacers = 0, hasWielding = 0, pitchSpacer = 0u, startingPointSpacer = 0u, reinfType = (byte)base.CNCReinfTypeValue, steelQuality = SteelGroupElementRebarBase.GetSteelQuality(this.RebarBarType), xcoord = CNCDataBase.convertToMM(itGePoint3d.x), ycoord = CNCDataBase.convertToMM(itGePoint3d.y), installationHeight = (uint)CNCDataBase.convertToMM(itGePoint3d.z), number = (ushort)(num2.Ne(0.0, -1.0) ? num : 1), pitch = CNCDataBase.convertToMM(num2) }; ItUniWrapperImpl.AddStraightRodstock(data); bool flag4 = num2.Eq(0.0, -1.0) && num > 1; if (flag4) { int num3; for (int i = 1; i < arrayIrons.Count; i = num3 + 1) { itGeCurve3d = arrayIrons[i].FirstOrDefault <ItGeCurve3d>(); bool flag5 = itGeCurve3d == null; if (!flag5) { itGeCurve3d.hasStartPoint(out itGePoint3d); data.xcoord = CNCDataBase.convertToMM(itGePoint3d.x); data.ycoord = CNCDataBase.convertToMM(itGePoint3d.y); ItUniWrapperImpl.AddStraightRodstock(data); } num3 = i; } } } } }
// 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); }
// Token: 0x060001E0 RID: 480 RVA: 0x0000D164 File Offset: 0x0000B364 private static bool IsValidBendingFormForUnitechnikFreeForm(List <List <ItGeCurve3d> > arrayIrons) { bool flag = arrayIrons.any <List <ItGeCurve3d> >(); bool flag2 = !flag; bool result; if (flag2) { result = false; } else { ItGeCurve3d curve; flag = arrayIrons.All(delegate(List <ItGeCurve3d> curves) { bool result2 = false; if (curves.any <ItGeCurve3d>()) { // result2 = curves.All((ItGeCurve3d curve) => curve is ItGeLineSeg3d); } else { result2 = false; } return(result2); }); bool flag3 = !flag; if (flag3) { result = false; } else { flag = !SteelGroupElementRebar.IsSingleSegment(arrayIrons); bool flag4 = !flag; if (flag4) { result = false; } else { bool flag5 = arrayIrons.Count > 1; if (flag5) { //SteelGroupElementRebar.<>c__DisplayClass19_1 CS$<>8__locals1 = new SteelGroupElementRebar.<>c__DisplayClass19_1(); //List<List<double>> list4 = (from curves in arrayIrons //select (from curve in curves //select curve.len).ToList<double>()).ToList<List<double>>(); //CS$<>8__locals1.firstLengths = list4[0]; //int j; //int k; //for (k = 0; k < CS$<>8__locals1.firstLengths.Count; k = j + 1) //{ // flag = list4.All((List<double> list) => list[k].Eq(CS$<>8__locals1.firstLengths[k], -1.0)); // bool flag6 = !flag; // if (flag6) // { // return false; // } // j = k; //} //List<List<ItGeVector3d>> list2 = (from curves in arrayIrons //select curves.Select(new Func<ItGeCurve3d, ItGeVector3d>(SteelGroupElementRebarBase.GetDirectionFromCurve)).ToList<ItGeVector3d>()).ToList<List<ItGeVector3d>>(); //CS$<>8__locals1.firstDirections = list2[0]; //int i; //for (i = 0; i < CS$<>8__locals1.firstDirections.Count; i = j + 1) //{ // flag = list2.All((List<ItGeVector3d> list) => list[i].isCodirectionalTo(CS$<>8__locals1.firstDirections[i], null)); // bool flag7 = !flag; // if (flag7) // { // return false; // } // j = i; //} } ItGeVector3d itGeVector3d = null; itGeVector3d = SteelGroupElementRebarBase.GetNormalFromFirstTwoSegments(arrayIrons.First <List <ItGeCurve3d> >(), ItGeVector3d.kZAxis); flag = itGeVector3d.z.Eq(0.0, -1.0); bool flag8 = !flag; if (flag8) { result = false; } else { foreach (List <ItGeCurve3d> list3 in arrayIrons) { ItGeCurve3d firstCurve = list3[0]; foreach (ItGeCurve3d itGeCurve3d in list3) { ItGeCurve3d itGeCurve3d2 = itGeCurve3d; ItGeVector3d normalFromTwoSegments = SteelGroupElementRebarBase.GetNormalFromTwoSegments(firstCurve, itGeCurve3d2); flag = (normalFromTwoSegments == null || normalFromTwoSegments.isParallelTo(itGeVector3d, null)); bool flag9 = !flag; if (flag9) { return(false); } firstCurve = itGeCurve3d2; } } curve = arrayIrons[0][0]; ItGeVector3d directionFromCurve = SteelGroupElementRebarBase.GetDirectionFromCurve(curve); bool flag10 = directionFromCurve.dotProduct(ItGeVector3d.kZAxis).Ne(0.0, -1.0); if (flag10) { ItGeCurve3d curve2 = arrayIrons[0].Last <ItGeCurve3d>(); directionFromCurve = SteelGroupElementRebarBase.GetDirectionFromCurve(curve2); bool flag11 = directionFromCurve.dotProduct(ItGeVector3d.kZAxis).Ne(0.0, -1.0); if (flag11) { return(false); } arrayIrons.ForEach(delegate(List <ItGeCurve3d> list) { list.Reverse(); }); arrayIrons.ForEach(delegate(List <ItGeCurve3d> list) { //list.ForEach(delegate(ItGeCurve3d curve) //{ // curve.reverseParam(); //}); }); } result = true; } } } } 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); }