public override void IfcParse(int propIndex, IPropertyValue value) { if (propIndex == 0) { _location = (IfcCartesianPoint)value.EntityVal; } else { this.HandleUnexpectedAttribute(propIndex, value); } }
public double DistanceSquared(IfcCartesianPoint p) { double d = 0, dd; double x1, y1, z1, x2, y2, z2; XYZ(out x1, out y1, out z1); p.XYZ(out x2, out y2, out z2); dd = x1; dd -= x2; dd *= dd; d += dd; dd = y1; dd -= y2; dd *= dd; d += dd; dd = z1; dd -= z2; dd *= dd; d += dd; return(d); }
public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex) { switch (propIndex) { case 0: _location = (IfcCartesianPoint)(value.EntityVal); return; default: throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper())); } }
public override void IfcParse(int propIndex, IPropertyValue value) { switch (propIndex) { case 0: _pnt = (IfcCartesianPoint)value.EntityVal; break; case 1: _dir = (IfcVector)value.EntityVal; break; default: this.HandleUnexpectedAttribute(propIndex, value); break; } }
public override string ToString() { StringBuilder str = new StringBuilder(); foreach (IfcTrimmingSelect item in this) { if (str.Length > 0) { str.Append(","); } IfcCartesianPoint pt = item as IfcCartesianPoint; if (pt != null) { str.AppendFormat("C{0}", pt); } else { str.AppendFormat("P{0}", item); } } return(str.ToString()); }
public override void IfcParse(int propIndex, IPropertyValue value) { switch (propIndex) { case 0: _axis1 = (IfcDirection)value.EntityVal; break; case 1: _axis2 = (IfcDirection)value.EntityVal; break; case 2: _localOrigin = (IfcCartesianPoint)value.EntityVal; break; case 3: _scale = value.RealVal; break; default: this.HandleUnexpectedAttribute(propIndex, value); break; } }
public bool IsEqual(IfcCartesianPoint p, double tolerance) { return(DistanceSquared(p) <= (tolerance * tolerance)); }
public double Distance(IfcCartesianPoint p) { return(Math.Sqrt(DistanceSquared(p))); }
public IfcCartesianPoint(IfcCartesianPoint cp) { _x = cp.X; _y = cp.Y; _z = cp.Z; }