protected IfcBSplineCurve(DatabaseIfc db, IfcBSplineCurve c) : base(db, c) { mDegree = c.mDegree; ControlPointsList.AddRange(c.ControlPointsList.Select(x => db.Factory.Duplicate(x) as IfcCartesianPoint)); mCurveForm = c.mCurveForm; mClosedCurve = c.mClosedCurve; mSelfIntersect = c.mSelfIntersect; }
protected IfcBSplineSurface(int uDegree, int vDegree, IEnumerable <IEnumerable <IfcCartesianPoint> > controlPoints) : this(controlPoints.First().First().mDatabase, uDegree, vDegree) { foreach (IEnumerable <IfcCartesianPoint> points in controlPoints) { ControlPointsList.Add(new LIST <IfcCartesianPoint>(points)); } }
internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary) { mDegree = int.Parse(ParserSTEP.StripField(str, ref pos, len)); ControlPointsList.AddRange(ParserSTEP.StripListLink(str, ref pos, len).Select(x => dictionary[x] as IfcCartesianPoint)); string s = ParserSTEP.StripField(str, ref pos, len); if (s[0] == '.') { Enum.TryParse <IfcBSplineCurveForm> (s.Replace(".", ""), true, out mCurveForm); } mClosedCurve = ParserIfc.StripLogical(str, ref pos, len); mSelfIntersect = ParserIfc.StripLogical(str, ref pos, len); }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(Degree != null ? Degree.ToStepValue() : "$"); parameters.Add(ControlPointsList != null ? ControlPointsList.ToStepValue() : "$"); parameters.Add(CurveForm != null ? CurveForm.ToStepValue() : "$"); parameters.Add(ClosedCurve != null ? ClosedCurve.ToStepValue() : "$"); parameters.Add(SelfIntersect != null ? SelfIntersect.ToStepValue() : "$"); parameters.Add(KnotMultiplicities != null ? KnotMultiplicities.ToStepValue() : "$"); parameters.Add(Knots != null ? Knots.ToStepValue() : "$"); parameters.Add(KnotSpec != null ? KnotSpec.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
internal override IEnumerable <StepSyntax> GetParameters(StepWriter writer) { foreach (var parameter in base.GetParameters(writer)) { yield return(parameter); } yield return(new StepIntegerSyntax(Degree)); yield return(new StepSyntaxList(ControlPointsList.Select(c => writer.GetItemSyntax(c)))); yield return(new StepEnumerationValueSyntax(GetCurveFormString(CurveForm))); yield return(new StepEnumerationValueSyntax(ClosedCurve ? "T" : "F")); yield return(new StepEnumerationValueSyntax(SelfIntersect ? "T" : "F")); }
internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary) { mUDegree = int.Parse(ParserSTEP.StripField(str, ref pos, len)); mVDegree = int.Parse(ParserSTEP.StripField(str, ref pos, len)); foreach (List <int> ids in ParserSTEP.StripListListLink(str, ref pos, len)) { ControlPointsList.Add(new LIST <IfcCartesianPoint>(ids.Select(x => dictionary[x] as IfcCartesianPoint))); } string s = ParserSTEP.StripField(str, ref pos, len); if (s[0] == '.') { Enum.TryParse <IfcBSplineSurfaceForm>(s.Replace(".", ""), true, out mSurfaceForm); } mUClosed = ParserIfc.StripLogical(str, ref pos, len); mVClosed = ParserIfc.StripLogical(str, ref pos, len); mSelfIntersect = ParserIfc.StripLogical(str, ref pos, len); }
/// <summary> /// Tests the express where-clause specified in param 'clause' /// </summary> /// <param name="clause">The express clause to test</param> /// <returns>true if the clause is satisfied.</returns> public bool ValidateClause(IfcBSplineCurveClause clause) { var retVal = false; try { switch (clause) { case IfcBSplineCurveClause.SameDim: retVal = Functions.SIZEOF(ControlPointsList.Where(Temp => Temp.Dim != ControlPointsList.ItemAt(0).Dim)) == 0; break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.GeometryResource.IfcBSplineCurve>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcBSplineCurve.{0}' for #{1}.", clause, EntityLabel), ex); } return(retVal); }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(UDegree != null ? UDegree.ToStepValue() : "$"); parameters.Add(VDegree != null ? VDegree.ToStepValue() : "$"); parameters.Add(ControlPointsList != null ? ControlPointsList.ToStepValue() : "$"); parameters.Add(SurfaceForm != null ? SurfaceForm.ToStepValue() : "$"); parameters.Add(UClosed != null ? UClosed.ToStepValue() : "$"); parameters.Add(VClosed != null ? VClosed.ToStepValue() : "$"); parameters.Add(SelfIntersect != null ? SelfIntersect.ToStepValue() : "$"); parameters.Add(UMultiplicities != null ? UMultiplicities.ToStepValue() : "$"); parameters.Add(VMultiplicities != null ? VMultiplicities.ToStepValue() : "$"); parameters.Add(UKnots != null ? UKnots.ToStepValue() : "$"); parameters.Add(VKnots != null ? VKnots.ToStepValue() : "$"); parameters.Add(KnotSpec != null ? KnotSpec.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
protected IfcBSplineCurve(int degree, IEnumerable <IfcCartesianPoint> controlPoints) : this(controlPoints.First().mDatabase, degree) { ControlPointsList.AddRange(controlPoints); }
public StepBSplineCurve(string name, IEnumerable <StepCartesianPoint> controlPoints) : base(name) { ControlPointsList.AddRange(controlPoints); }