Exemplo n.º 1
0
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     if (propIndex == 0)
     {
         _location = (IfcCartesianPoint)value.EntityVal;
     }
     else
     {
         this.HandleUnexpectedAttribute(propIndex, value);
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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()));
            }
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
        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());
        }
Exemplo n.º 6
0
        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;
            }
        }
Exemplo n.º 7
0
 public bool IsEqual(IfcCartesianPoint p, double tolerance)
 {
     return(DistanceSquared(p) <= (tolerance * tolerance));
 }
Exemplo n.º 8
0
 public double Distance(IfcCartesianPoint p)
 {
     return(Math.Sqrt(DistanceSquared(p)));
 }
Exemplo n.º 9
0
 public IfcCartesianPoint(IfcCartesianPoint cp)
 {
     _x = cp.X;
     _y = cp.Y;
     _z = cp.Z;
 }