/// <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(IfcTrimmedCurveClause clause) { var retVal = false; try { switch (clause) { case IfcTrimmedCurveClause.WR41: retVal = (Functions.HIINDEX(Trim1) == 1) || (Functions.TYPEOF(Trim1.ItemAt(0)) != Functions.TYPEOF(Trim1.ItemAt(1))); break; case IfcTrimmedCurveClause.WR42: retVal = (Functions.HIINDEX(Trim2) == 1) || (Functions.TYPEOF(Trim2.ItemAt(0)) != Functions.TYPEOF(Trim2.ItemAt(1))); break; case IfcTrimmedCurveClause.WR43: retVal = !(Functions.TYPEOF(BasisCurve).Contains("IFC2X3.IFCBOUNDEDCURVE")); break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.GeometryResource.IfcTrimmedCurve>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcTrimmedCurve.{0}' for #{1}.", clause, EntityLabel), ex); } return(retVal); }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); obj["BasisCurve"] = BasisCurve.getJson(this, options); obj["Trim1"] = Trim1.getJSON(mDatabase); obj["Trim2"] = Trim2.getJSON(mDatabase); obj["SenseAgreement"] = mSenseAgreement; obj["MasterRepresentation"] = mMasterRepresentation.ToString(); }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(BasisCurve != null ? BasisCurve.ToStepValue() : "$"); parameters.Add(Trim1 != null ? Trim1.ToStepValue() : "$"); parameters.Add(Trim2 != null ? Trim2.ToStepValue() : "$"); parameters.Add(SenseAgreement != null ? SenseAgreement.ToStepValue() : "$"); parameters.Add(MasterRepresentation != null ? MasterRepresentation.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }