Skip to content

Commit

Permalink
Merge pull request #206 from FriendsOfCADability/ParametricSurfaceFix…
Browse files Browse the repository at this point in the history
…CS3005

Fix CS3005 - Identifier 'identifier' differing only in case is not CL…
  • Loading branch information
dsn27 authored Dec 20, 2024
2 parents f9f0e62 + 43437ef commit ed5d8b8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 49 deletions.
14 changes: 7 additions & 7 deletions CADability/netDxf/GTE/BSplineSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public BSplineSurface(BasisFunctionInput input0, BasisFunctionInput input1, Vect
this.numControls = new[] {input0.NumControls, input1.NumControls};

// The mBasisFunction stores the domain but so does ParametricCurve.
this.uMin = this.basisFunctions[0].MinDomain;
this.uMax = this.basisFunctions[0].MaxDomain;
this.vMin = this.basisFunctions[1].MinDomain;
this.vMax = this.basisFunctions[1].MaxDomain;
UMin = this.basisFunctions[0].MinDomain;
UMax = this.basisFunctions[0].MaxDomain;
VMin = this.basisFunctions[1].MinDomain;
VMax = this.basisFunctions[1].MaxDomain;

// The replication of control points for periodic splines is
// avoided by wrapping the i-loop index in Evaluate.
Expand All @@ -67,7 +67,7 @@ public BSplineSurface(BasisFunctionInput input0, BasisFunctionInput input1, Vect
controls.CopyTo(this.controls, 0);
}

this.isConstructed = true;
IsConstructed = true;
}

// Member access. The index 'dim' must be in {0,1}.
Expand Down Expand Up @@ -115,10 +115,10 @@ public Vector3 GetControl(int i0, int i1)
// u and v [0,1]
public override void Evaluate(double u, double v, int order, out Vector3[] jet)
{
int supOrder = SUP_ORDER;
int supOrder = SupOrder;
jet = new Vector3[supOrder];

if (!this.isConstructed || order >= supOrder)
if (!IsConstructed || order >= supOrder)
{
// Return a zero-valued jet for invalid state.
return;
Expand Down
14 changes: 7 additions & 7 deletions CADability/netDxf/GTE/NURBSSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public NURBSSurface(BasisFunctionInput input0, BasisFunctionInput input1, Vector
this.numControls = new[] {input0.NumControls, input1.NumControls};

// The mBasisFunction stores the domain but so does ParametricSurface.
this.uMin = this.basisFunctions[0].MinDomain;
this.uMax = this.basisFunctions[0].MaxDomain;
this.vMin = this.basisFunctions[1].MinDomain;
this.vMax = this.basisFunctions[1].MaxDomain;
UMin = this.basisFunctions[0].MinDomain;
UMax = this.basisFunctions[0].MaxDomain;
VMin = this.basisFunctions[1].MinDomain;
VMax = this.basisFunctions[1].MaxDomain;

// The replication of control points for periodic splines is
// avoided by wrapping the i-loop index in Evaluate.
Expand All @@ -75,7 +75,7 @@ public NURBSSurface(BasisFunctionInput input0, BasisFunctionInput input1, Vector
weights.CopyTo(this.weights, 0);
}

this.isConstructed = true;
IsConstructed = true;
}

// Member access. The index 'dim' must be in {0,1}.
Expand Down Expand Up @@ -145,10 +145,10 @@ public double GetWeight(int i0, int i1)
// d2X/dudv, d2X/dv2.
public override void Evaluate(double u, double v, int order, out Vector3[] jet)
{
const int supOrder = SUP_ORDER;
const int supOrder = SupOrder;
jet = new Vector3[supOrder];

if (!this.isConstructed || order >= supOrder)
if (!IsConstructed || order >= supOrder)
{
// Return a zero-valued jet for invalid state.
return;
Expand Down
48 changes: 13 additions & 35 deletions CADability/netDxf/GTE/ParametricSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ namespace netDxf.GTE
{
public abstract class ParametricSurface
{
protected double uMin, uMax, vMin, vMax;
protected bool isRectangular;
protected bool isConstructed;

// Abstract base class for a parameterized surface X(u,v). The
// parametric domain is either rectangular or triangular. Valid
// (u,v) values for a rectangular domain satisfy
Expand All @@ -49,48 +45,30 @@ public abstract class ParametricSurface
// (vmax-vmin)*(u-umin)+(umax-umin)*(v-vmax) <= 0
protected ParametricSurface(double umin, double umax, double vmin, double vmax, bool isRectangular)
{
this.uMin = umin;
this.uMax = umax;
this.vMin = vmin;
this.vMax = vmax;
this.isRectangular = isRectangular;
this.isConstructed = false;
UMin = umin;
UMax = umax;
VMin = vmin;
VMax = vmax;
IsRectangular = isRectangular;
IsConstructed = false;
}

// Member access.

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

public double UMin
{
get { return this.uMin; }
}
public double UMin { get; protected set; }

public double UMax
{
get { return this.uMax; }
}
public double UMax { get; protected set; }

public double VMin
{
get { return this.vMin; }
}
public double VMin { get; protected set; }

public double VMax
{
get { return this.vMax; }
}
public double VMax { get; protected set; }

public bool IsIsRectangular
{
get { return this.isRectangular; }
}
public bool IsRectangular { get; protected set; }

// Evaluation of the surface. The function supports derivative
// calculation through order 2; that is, order <= 2 is required. If
Expand All @@ -100,7 +78,7 @@ public bool IsIsRectangular
// maximum order. The values are ordered as: position X; first-order
// derivatives dX/du, dX/dv; second-order derivatives d2X/du2,
// d2X/dudv, d2X/dv2.
public const int SUP_ORDER = 6;
public const int SupOrder = 6;

public abstract void Evaluate(double u, double v, int order, out Vector3[] jet);

Expand Down

0 comments on commit ed5d8b8

Please sign in to comment.