Skip to content

Commit

Permalink
Fix warnings in ParametricCurve and dependent classes.
Browse files Browse the repository at this point in the history
Mainly CS3005
#49
  • Loading branch information
dsn27 committed Jan 15, 2025
1 parent 7acffce commit 53f264e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CADability/netDxf/GTE/BSplineCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public BSplineCurve(BasisFunctionInput input, Vector3[] controls)
controls.CopyTo(this.controls, 0);
}

this.isConstructed = true;
IsConstructed = true;
}

// Member access.
Expand Down Expand Up @@ -93,7 +93,7 @@ public override void Evaluate(double t, int order, out Vector3[] jet)
int supOrder = SUP_ORDER;
jet = new Vector3[supOrder];

if (!this.isConstructed || order >= supOrder)
if (!IsConstructed || order >= supOrder)
{
// Return a zero-valued jet for invalid state.
return;
Expand Down
4 changes: 2 additions & 2 deletions CADability/netDxf/GTE/BezierCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public BezierCurve(Vector3[] controls, int degree)
}
}

this.isConstructed = true;
IsConstructed = true;
}

// Member access.
Expand Down Expand Up @@ -134,7 +134,7 @@ public override void Evaluate(double t, int order, out Vector3[] jet)
const int supOrder = SUP_ORDER;
jet = new Vector3[supOrder];

if (!this.isConstructed || order >= SUP_ORDER)
if (!IsConstructed || order >= SUP_ORDER)
{
// Return a zero-valued jet for invalid state.
return;
Expand Down
4 changes: 2 additions & 2 deletions CADability/netDxf/GTE/NURBSCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public NURBSCurve(BasisFunctionInput input, Vector3[] controls, double[] weights
weights.CopyTo(this.weights, 0);
}

this.isConstructed = true;
IsConstructed = true;
}

// Member access.
Expand Down Expand Up @@ -143,7 +143,7 @@ public override void Evaluate(double t, int order, out Vector3[] jet)
const int supOrder = SUP_ORDER;
jet = new Vector3[supOrder];

if (!this.isConstructed || order >= supOrder)
if (!IsConstructed || order >= supOrder)
{
// Return a zero-valued jet for invalid state.
return;
Expand Down
18 changes: 7 additions & 11 deletions CADability/netDxf/GTE/ParametricCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ public abstract class ParametricCurve
protected const int DEFAULT_MAX_BISECTIONS = 1024;
protected const int SUP_ORDER = 4;

protected readonly double[] times;
protected readonly double[] segmentLength;
protected readonly double[] acumulatedLength;
protected int rombergOrder;
protected int maxBisections;
protected bool isConstructed;
private readonly double[] times;
private readonly double[] segmentLength;
private readonly double[] acumulatedLength;
private int rombergOrder;
private int maxBisections;

// Abstract base class for a parameterized curve X(t), where t is the
// parameter in [tmin,tmax] and X is an N-tuple position. The first
Expand All @@ -66,16 +65,13 @@ protected ParametricCurve(int numSegments, double[] times)
this.acumulatedLength = new double[numSegments];
this.rombergOrder = DEFAULT_ROMBERG_ORDER;
this.maxBisections = DEFAULT_MAX_BISECTIONS;
this.isConstructed = false;
IsConstructed = false;
}

// To validate construction, create an object as shown:
// DerivedClassCurve<N, Real> curve(parameters);
// if (!curve) { <constructor failed, handle accordingly>; }
public bool IsConstructed
{
get { return this.isConstructed; }
}
public bool IsConstructed { get; protected set; }

// Member access.
public double TMin
Expand Down

0 comments on commit 53f264e

Please sign in to comment.