public override bool checkModelObjects(_Mark other) { TSM.RebarGroup part1 = _part as TSM.RebarGroup; TSM.RebarGroup part2 = other._part as TSM.RebarGroup; T3D.Point p1start = __GeometryOperations.factor1Point(part1.StartPoint, _view as TSD.View); T3D.Point p1end = __GeometryOperations.factor1Point(part1.EndPoint, _view as TSD.View); T3D.Point p2start = __GeometryOperations.factor1Point(part2.StartPoint, other._view as TSD.View); T3D.Point p2end = __GeometryOperations.factor1Point(part2.EndPoint, other._view as TSD.View); if (!__GeometryOperations.compare2Points(p1start, p2start)) { return(false); } if (!__GeometryOperations.compare2Points(p1end, p2end)) { return(false); } ArrayList polygon1 = part1.Polygons; ArrayList polygon2 = part2.Polygons; if (polygon1.Count != polygon2.Count) { return(false); } for (int i = 0; i < polygon1.Count; i++) { TSM.Polygon poly1 = polygon1[i] as TSM.Polygon; TSM.Polygon poly2 = polygon2[i] as TSM.Polygon; ArrayList points1 = poly1.Points; ArrayList points2 = poly2.Points; ArrayList transformed1 = __GeometryOperations.factorPointArray(points1, _view as TSD.View); ArrayList transformed2 = __GeometryOperations.factorPointArray(points2, other._view as TSD.View); if (!__GeometryOperations.comparePointArray(transformed1, transformed2)) { return(false); } } return(true); }
public override bool checkModelObjects(_Mark other) { TSM.SingleRebar part1 = _part as TSM.SingleRebar; TSM.SingleRebar part2 = other._part as TSM.SingleRebar; ArrayList points1 = part1.Polygon.Points; ArrayList points2 = part2.Polygon.Points; ArrayList transformed1 = __GeometryOperations.factorPointArray(points1, _view as TSD.View); ArrayList transformed2 = __GeometryOperations.factorPointArray(points2, other._view as TSD.View); if (!__GeometryOperations.comparePointArray(transformed1, transformed2)) { return(false); } return(true); }
public void reCreateMark(_Mark input) { _mark.Attributes = input._mark.Attributes; _mark.Modify(); if (input._mark.Placing is TSD.LeaderLinePlacing) { TSD.LeaderLinePlacing attr = input._mark.Placing as TSD.LeaderLinePlacing; T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint); TSD.LeaderLinePlacing newPlacing = new TSD.LeaderLinePlacing(start); _mark.Placing = newPlacing; } else if (input._mark.Placing is TSD.AlongLinePlacing) { TSD.AlongLinePlacing attr = input._mark.Placing as TSD.AlongLinePlacing; T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint); T3D.Point end = __GeometryOperations.applyGlobalOffset(attr.EndPoint); TSD.AlongLinePlacing newPlacing = new TSD.AlongLinePlacing(start, end); _mark.Placing = newPlacing; } else if (input._mark.Placing is TSD.BaseLinePlacing) { //TSD.BaseLinePlacing attr = input._mark.Placing as TSD.BaseLinePlacing; //T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint); //T3D.Point end = __GeometryOperations.applyGlobalOffset(attr.EndPoint); //TSD.BaseLinePlacing newPlacing = new TSD.BaseLinePlacing(start, end); //_mark.Placing = newPlacing; } else if (input._mark.Placing is TSD.PointPlacing) { TSD.PointPlacing newPlacing = new TSD.PointPlacing(); _mark.Placing = newPlacing; } _mark.InsertionPoint = __GeometryOperations.applyGlobalOffset(input._mark.InsertionPoint); _mark.Modify(); _mark.Modify(); }
public override bool checkModelObjects(_Mark other) { TSM.BoltGroup part1 = _part as TSM.BoltGroup; TSM.BoltGroup part2 = other._part as TSM.BoltGroup; T3D.Point p1start = __GeometryOperations.factor1Point(part1.FirstPosition, _view as TSD.View); T3D.Point p1end = __GeometryOperations.factor1Point(part1.SecondPosition, _view as TSD.View); T3D.Point p2start = __GeometryOperations.factor1Point(part2.FirstPosition, other._view as TSD.View); T3D.Point p2end = __GeometryOperations.factor1Point(part2.SecondPosition, other._view as TSD.View); if (!__GeometryOperations.compare2Points(p1start, p2start)) { return(false); } if (!__GeometryOperations.compare2Points(p1end, p2end)) { return(false); } return(true); }
public abstract bool checkModelObjects(_Mark name);
private void reCreateMarkSmarts(_Mark other) { _mark.Attributes = other._mark.Attributes; _mark.Attributes.Frame.Color = TSD.DrawingColors.Green; _mark.Modify(); T3D.Point inputStart = __GeometryOperations.factor1Point((other._part as TSM.Beam).StartPoint, other._view as TSD.View); inputStart = __GeometryOperations.applyGlobalOffset(inputStart); T3D.Point inputEnd = __GeometryOperations.factor1Point((other._part as TSM.Beam).EndPoint, other._view as TSD.View); inputEnd = __GeometryOperations.applyGlobalOffset(inputEnd); T3D.Point outputStart = __GeometryOperations.factor1Point((this._part as TSM.Beam).StartPoint, this._view as TSD.View); T3D.Point outputEnd = __GeometryOperations.factor1Point((this._part as TSM.Beam).EndPoint, this._view as TSD.View); T3D.Point markOffset = __GeometryOperations.getLocalOffset(inputStart, outputStart); double alfa = __GeometryOperations.getAlfa(inputStart, inputEnd, outputStart, outputEnd); T3D.Point insertion = __GeometryOperations.applyGlobalOffset(other._mark.InsertionPoint); insertion = __GeometryOperations.applyLocalOffset(insertion, markOffset); if (other._mark.Placing is TSD.LeaderLinePlacing) { TSD.LeaderLinePlacing attr = other._mark.Placing as TSD.LeaderLinePlacing; T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint); start = __GeometryOperations.applyLocalOffset(start, markOffset); T3D.Point placingOffset = __GeometryOperations.getPlacingOffset(start, outputStart, alfa); T3D.Point insertionOffset = __GeometryOperations.getLocalOffset(start, insertion); start = __GeometryOperations.applyLocalOffset(outputStart, placingOffset); insertion = __GeometryOperations.applyLocalOffset(start, insertionOffset); TSD.LeaderLinePlacing newPlacing = new TSD.LeaderLinePlacing(start); _mark.Placing = newPlacing; } else if (other._mark.Placing is TSD.AlongLinePlacing) { TSD.AlongLinePlacing attr = other._mark.Placing as TSD.AlongLinePlacing; T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint); start = __GeometryOperations.applyLocalOffset(start, markOffset); T3D.Point placingOffset = __GeometryOperations.getPlacingOffset(outputStart, start, alfa); T3D.Point insertionOffset = __GeometryOperations.getLocalOffset(start, insertion); start = __GeometryOperations.applyLocalOffset(start, placingOffset); insertion = __GeometryOperations.applyLocalOffset(start, insertionOffset); T3D.Point end = __GeometryOperations.applyGlobalOffset(attr.EndPoint); end = __GeometryOperations.applyLocalOffset(end, markOffset); end = __GeometryOperations.applyLocalOffset(end, placingOffset); TSD.AlongLinePlacing newPlacing = new TSD.AlongLinePlacing(start, end); _mark.Placing = newPlacing; } else if (other._mark.Placing is TSD.BaseLinePlacing) { //TSD.BaseLinePlacing attr = input._mark.Placing as TSD.BaseLinePlacing; //T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint); //start = __GeometryOperations.applyLocalOffset(start, markOffset); //T3D.Point placingOffset = __GeometryOperations.getPlacingOffset(startPointRefactor, start, alfa); //T3D.Point insertionOffset = __GeometryOperations.getLocalOffset(start, insertion); //start = __GeometryOperations.applyLocalOffset(start, placingOffset); //insertion = __GeometryOperations.applyLocalOffset(start, insertionOffset); //T3D.Point end = __GeometryOperations.applyGlobalOffset(attr.EndPoint); //end = __GeometryOperations.applyLocalOffset(end, markOffset); //end = __GeometryOperations.applyLocalOffset(end, placingOffset); //TSD.BaseLinePlacing newPlacing = new TSD.BaseLinePlacing(start, end); //_mark.Placing = newPlacing; } else if (other._mark.Placing is TSD.PointPlacing) { TSD.PointPlacing newPlacing = new TSD.PointPlacing(); _mark.Placing = newPlacing; } _mark.InsertionPoint = insertion; _mark.Modify(); _mark.Modify(); }