Skip to content

Commit

Permalink
Merge pull request #210 from FriendsOfCADability/Fix_CS3006
Browse files Browse the repository at this point in the history
Fix CS3006 - Overloaded method 'method' differing only in ref or out,…
dsn27 authored Dec 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 3c23e44 + 44e72bb commit 728d71d
Showing 17 changed files with 22 additions and 27 deletions.
2 changes: 1 addition & 1 deletion CADability/Arc2D.cs
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ public override bool HitTest(ref BoundingRect Rect, bool IncludeControlPoints)
{ // 19.8.15: bin nicht sicher, ob das mit negativem sweep auch geht, deshalb hier umdrehen
return (new Arc2D(Center, Radius, start + sweep, -sweep)).HitTest(ref Rect, IncludeControlPoints);
}
ClipRect clr = new ClipRect(ref Rect);
ClipRect clr = new ClipRect(Rect);

int StartQuadrant = start.Quadrant;
int EndQuadrant = (start + sweep).Quadrant;
2 changes: 1 addition & 1 deletion CADability/Bitmap.cs
Original file line number Diff line number Diff line change
@@ -381,7 +381,7 @@ public override bool HitTest(Projection projection, BoundingRect rect, bool only
}
else
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
return clr.ParallelogramHitTest(projection.ProjectUnscaled(location), projection.ProjectUnscaled(directionWidth), projection.ProjectUnscaled(directionHeight));
}
}
2 changes: 1 addition & 1 deletion CADability/BoundingCube.cs
Original file line number Diff line number Diff line change
@@ -930,7 +930,7 @@ private bool Interferes(ref GeoPoint tetra1, ref GeoPoint tetra2, ref GeoPoint t
/// <returns>ture if interference, false otherwise</returns>
public bool Interferes(Projection projection, BoundingRect rect)
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
GeoPoint2D[] points2d = new GeoPoint2D[]{
projection.ProjectUnscaled(new GeoPoint(Xmin, Ymin, Zmin)),
projection.ProjectUnscaled(new GeoPoint(Xmax, Ymin, Zmin)),
2 changes: 1 addition & 1 deletion CADability/Circle2D.cs
Original file line number Diff line number Diff line change
@@ -298,7 +298,7 @@ public override BoundingRect GetExtent()
/// <returns></returns>
public override bool HitTest(ref BoundingRect Rect, bool IncludeControlPoints)
{
ClipRect clr = new ClipRect(ref Rect);
ClipRect clr = new ClipRect(Rect);
if (clr.ArcHitTest(center, radius, 0, new GeoPoint2D(center.x + radius, center.y), new GeoPoint2D(center.x, center.y + radius))) return true;
if (clr.ArcHitTest(center, radius, 1, new GeoPoint2D(center.x, center.y + radius), new GeoPoint2D(center.x - radius, center.y))) return true;
if (clr.ArcHitTest(center, radius, 2, new GeoPoint2D(center.x - radius, center.y), new GeoPoint2D(center.x, center.y - radius))) return true;
7 changes: 0 additions & 7 deletions CADability/ClipRect.cs
Original file line number Diff line number Diff line change
@@ -38,13 +38,6 @@ private int ClipCode(ref GeoPoint2D p) // ref wg. Geschwindigkeit
else if (p.y > Top) res = res | ClipTop;
return res;
}
public ClipRect(ref BoundingRect r)
{ // warum mit ref???
Left = r.Left;
Right = r.Right;
Bottom = r.Bottom;
Top = r.Top;
}
public ClipRect(BoundingRect r)
{
Left = r.Left;
2 changes: 2 additions & 0 deletions CADability/DebuggerContainer.cs
Original file line number Diff line number Diff line change
@@ -324,6 +324,8 @@ public static DebuggerContainer Show(GeoPoint[] points)
res.Add(pl);
return res;
}

[CLSCompliant(false)]
public static DebuggerContainer Show(GeoPoint[,] points)
{
DebuggerContainer res = new DebuggerContainer();
2 changes: 1 addition & 1 deletion CADability/Ellipse2D.cs
Original file line number Diff line number Diff line change
@@ -384,7 +384,7 @@ public override bool HitTest(ref BoundingRect Rect, bool IncludeControlPoints)
Angle majorang = majorAxis.Angle;
double radiusx = majorAxis.Length;
double radiusy = minorAxis.Length;
ClipRect clr = new ClipRect(ref Rect);
ClipRect clr = new ClipRect(Rect);
if (clr.EllipseArcHitTest(center, radiusx, radiusy, majorang, 0, right, top)) return true;
if (clr.EllipseArcHitTest(center, radiusx, radiusy, majorang, 1, top, left)) return true;
if (clr.EllipseArcHitTest(center, radiusx, radiusy, majorang, 2, left, bottom)) return true;
2 changes: 1 addition & 1 deletion CADability/EllipseArc2D.cs
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ public override bool HitTest(ref BoundingRect Rect, bool IncludeControlPoints)
Angle majorang = majorAxis.Angle;
double radiusx = majorAxis.Length;
double radiusy = minorAxis.Length;
ClipRect clr = new ClipRect(ref Rect);
ClipRect clr = new ClipRect(Rect);
if (clr.Contains(startPoint)) return true;
if (clr.Contains(EndPoint)) return true;

4 changes: 2 additions & 2 deletions CADability/Face.cs
Original file line number Diff line number Diff line change
@@ -5699,7 +5699,7 @@ bool IOctTreeInsertable.HitTest(Projection projection, BoundingRect rect, bool o
}
else
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
return clr.TriangleHitTest(p1, p2, p3);
}
}
@@ -7236,7 +7236,7 @@ internal bool HitTestWithoutEdges(ref BoundingCube cube, double precision)
public override bool HitTest(Projection projection, BoundingRect rect, bool onlyInside)
{
if (trianglePoint == null) return false; // this is only for selecting with the mouse
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
if (onlyInside)
{
lock (lockTriangulationData)
2 changes: 1 addition & 1 deletion CADability/GeneralCurve2D.cs
Original file line number Diff line number Diff line change
@@ -3637,7 +3637,7 @@ private bool TriangleHitTest(ref ClipRect rect, GeoPoint2D sp, GeoPoint2D ep, Ge
}
public virtual bool HitTest(ref BoundingRect rect, bool includeControlPoints)
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
if (interpol == null) MakeTriangulation();
for (int i = 0; i < interpol.Length - 1; ++i)
{
8 changes: 4 additions & 4 deletions CADability/Line.cs
Original file line number Diff line number Diff line change
@@ -328,7 +328,7 @@ public override bool HitTest(Projection projection, BoundingRect rect, bool only
}
else
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
return clr.LineHitTest(projection.ProjectUnscaled(startPoint), projection.ProjectUnscaled(endPoint));
}
}
@@ -971,7 +971,7 @@ BoundingRect IQuadTreeInsertable.GetExtent()

bool IQuadTreeInsertable.HitTest(ref BoundingRect rect, bool includeControlPoints)
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
return clr.LineHitTest(sp, ep);
}

@@ -1013,7 +1013,7 @@ bool IOctTreeInsertable.HitTest(Projection projection, BoundingRect rect, bool o
}
else
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
// eine Linie machen, die bestimmt über das rechteck hinaus geht
GeoPoint2D sp2d = projection.ProjectUnscaled(start);
GeoVector2D dir2d = projection.ProjectUnscaled(dir);
@@ -1080,7 +1080,7 @@ bool IOctTreeInsertable.HitTest(Projection projection, BoundingRect rect, bool o
}
else
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
// eine Linie machen, die bestimmt über das rechteck hinaus geht
GeoPoint2D sp2d = projection.ProjectUnscaled(start);
GeoVector2D dir2d = projection.ProjectUnscaled(dir);
4 changes: 2 additions & 2 deletions CADability/Line2D.cs
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ public Line2D(GeoPoint2D location, GeoVector2D direction, BoundingRect clippedBy
double l = clippedBy.Width + clippedBy.Height;
startPoint = c + l * direction;
endPoint = c - l * direction;
ClipRect clr = new ClipRect(ref clippedBy);
ClipRect clr = new ClipRect(clippedBy);
clr.ClipLine(ref startPoint, ref endPoint);
}
public override string ToString()
@@ -188,7 +188,7 @@ public override BoundingRect GetExtent()
/// <returns></returns>
public override bool HitTest(ref BoundingRect Rect, bool IncludeControlPoints)
{
ClipRect clr = new ClipRect(ref Rect);
ClipRect clr = new ClipRect(Rect);
return clr.LineHitTest(startPoint, endPoint);
}
/// <summary>
2 changes: 1 addition & 1 deletion CADability/Polyline.cs
Original file line number Diff line number Diff line change
@@ -1721,7 +1721,7 @@ bool IOctTreeInsertable.HitTest(ref BoundingCube cube, double precision)

bool IOctTreeInsertable.HitTest(Projection projection, BoundingRect rect, bool onlyInside)
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
for (int i = 1; i < vertex.Length - 3; ++i)
{
if (clr.LineHitTest(projection.ProjectUnscaled(vertex[i]), projection.ProjectUnscaled(vertex[i + 1]))) return true;
2 changes: 1 addition & 1 deletion CADability/Polyline2D.cs
Original file line number Diff line number Diff line change
@@ -263,7 +263,7 @@ public override BoundingRect GetExtent()
/// <returns></returns>
public override bool HitTest(ref BoundingRect Rect, bool IncludeControlPoints)
{
ClipRect clr = new ClipRect(ref Rect);
ClipRect clr = new ClipRect(Rect);
for (int i = 1; i < vertex.Length; ++i)
{
GeoPoint2D sp = vertex[i - 1];
2 changes: 1 addition & 1 deletion CADability/Surface.cs
Original file line number Diff line number Diff line change
@@ -6515,7 +6515,7 @@ internal static bool ParallelDistance(ISurface surface1, BoundingRect domain1, I
double f = (axloc.y - domain1.Top) / axdir.y;
p2 = p2 - f * axdir;
}
ClipRect clr = new ClipRect(ref domain1);
ClipRect clr = new ClipRect(domain1);
if (clr.ClipLine(ref p1, ref p2))
{
GeoPoint2D pm = new GeoPoint2D(p1, p2);
2 changes: 1 addition & 1 deletion CADability/Text.cs
Original file line number Diff line number Diff line change
@@ -3112,7 +3112,7 @@ public override bool HitTest(Projection projection, BoundingRect rect, bool only
}
else
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
// nicht sicher, object die folgenden noch skaliert werden müssen:
return clr.ParallelogramHitTest(projection.ProjectUnscaled(lowerLeft), projection.ProjectUnscaled(lowerRight - lowerLeft), projection.ProjectUnscaled(upperLeft - lowerLeft));
}
2 changes: 1 addition & 1 deletion CADability/Triangulation.cs
Original file line number Diff line number Diff line change
@@ -279,7 +279,7 @@ BoundingRect IQuadTreeInsertable.GetExtent()

bool IQuadTreeInsertable.HitTest(ref BoundingRect rect, bool includeControlPoints)
{
ClipRect clr = new ClipRect(ref rect);
ClipRect clr = new ClipRect(rect);
return clr.LineHitTest(vertex[edge.v1].p2d, vertex[edge.v2].p2d);
}

0 comments on commit 728d71d

Please sign in to comment.