Skip to content

Commit 8b9e74c

Browse files
authored
Merge pull request #222 from FriendsOfCADability/ParametricCurve_FixWarnings
Fix warnings in ParametricCurve and dependent classes.
2 parents 30a9798 + 53f264e commit 8b9e74c

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

CADability/netDxf/GTE/BSplineCurve.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public BSplineCurve(BasisFunctionInput input, Vector3[] controls)
6262
controls.CopyTo(this.controls, 0);
6363
}
6464

65-
this.isConstructed = true;
65+
IsConstructed = true;
6666
}
6767

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

96-
if (!this.isConstructed || order >= supOrder)
96+
if (!IsConstructed || order >= supOrder)
9797
{
9898
// Return a zero-valued jet for invalid state.
9999
return;

CADability/netDxf/GTE/BezierCurve.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public BezierCurve(Vector3[] controls, int degree)
103103
}
104104
}
105105

106-
this.isConstructed = true;
106+
IsConstructed = true;
107107
}
108108

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

137-
if (!this.isConstructed || order >= SUP_ORDER)
137+
if (!IsConstructed || order >= SUP_ORDER)
138138
{
139139
// Return a zero-valued jet for invalid state.
140140
return;

CADability/netDxf/GTE/NURBSCurve.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public NURBSCurve(BasisFunctionInput input, Vector3[] controls, double[] weights
6969
weights.CopyTo(this.weights, 0);
7070
}
7171

72-
this.isConstructed = true;
72+
IsConstructed = true;
7373
}
7474

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

146-
if (!this.isConstructed || order >= supOrder)
146+
if (!IsConstructed || order >= supOrder)
147147
{
148148
// Return a zero-valued jet for invalid state.
149149
return;

CADability/netDxf/GTE/ParametricCurve.cs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ public abstract class ParametricCurve
4242
protected const int DEFAULT_MAX_BISECTIONS = 1024;
4343
protected const int SUP_ORDER = 4;
4444

45-
protected readonly double[] times;
46-
protected readonly double[] segmentLength;
47-
protected readonly double[] acumulatedLength;
48-
protected int rombergOrder;
49-
protected int maxBisections;
50-
protected bool isConstructed;
45+
private readonly double[] times;
46+
private readonly double[] segmentLength;
47+
private readonly double[] acumulatedLength;
48+
private int rombergOrder;
49+
private int maxBisections;
5150

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

7271
// To validate construction, create an object as shown:
7372
// DerivedClassCurve<N, Real> curve(parameters);
7473
// if (!curve) { <constructor failed, handle accordingly>; }
75-
public bool IsConstructed
76-
{
77-
get { return this.isConstructed; }
78-
}
74+
public bool IsConstructed { get; protected set; }
7975

8076
// Member access.
8177
public double TMin

0 commit comments

Comments
 (0)