Ejemplo n.º 1
0
        ///
        ///	 <summary> * add an element x y zto the Range attribute as a JDFRange
        ///	 *  </summary>
        ///	 * <param name="double"> x the width </param>
        ///	 * <param name="double"> y the height </param>
        ///	 * <param name="double"> z the depth </param>
        ///
        public virtual void addRange(double x, double y, double z)
        {
            JDFShapeRangeList srl = getRange();

            srl.Append(new JDFShape(x, y, z));
            setRange(srl);
        }
Ejemplo n.º 2
0
        ///
        ///	 <summary> * add an element x1 y1 z1~ x2 y2 z2to the Range attribute as a JDFRange
        ///	 *  </summary>
        ///	 * <param name="double"> x1 the 1. width </param>
        ///	 * <param name="double"> y1 the 1. height </param>
        ///	 * <param name="double"> z1 the 1. depth </param>
        ///	 * <param name="double"> x2 the 2. width </param>
        ///	 * <param name="double"> y2 the 2. height </param>
        ///	 * <param name="double"> z2 the 2. depth </param>
        ///
        public virtual void addRange(double x1, double y1, double z1, double x2, double y2, double z2)
        {
            JDFShapeRangeList srl = getRange();

            srl.Append(new JDFShape(x1, y1, z1), new JDFShape(x2, y2, z2));
            setRange(srl);
        }
Ejemplo n.º 3
0
        ///
        ///	 <summary> * add an element x y to the Range attribute as a JDFRange
        ///	 *  </summary>
        ///	 * <param name="JDFShape"> shape1 the Range value </param>
        ///	 * <param name="JDFShape"> shape2 the Range value </param>
        ///
        public virtual void addRange(JDFShape shape1, JDFShape shape2)
        {
            JDFShapeRangeList srl = getRange();

            srl.Append(shape1, shape2);
            setRange(srl);
        }
Ejemplo n.º 4
0
        ///
        ///	 <summary> * fitsTolerance - checks whether this Evaluation has a specified Tolerance
        ///	 * that it is not equal to "0 0", and expands the original rangelist to the
        ///	 * rangelist that fits Tolerance.
        ///	 *  </summary>
        ///	 * <param name="origRangeList">
        ///	 *            original rangelist </param>
        ///	 * <returns> NumberRangeList - expanded rangelist, returns original range if
        ///	 *         Tolerance=="0 0" </returns>
        ///
        private JDFShapeRangeList fitsTolerance(JDFShapeRangeList origRangeList)
        {
            double nt = getTolerance().X; // negative tolerance
            double pt = getTolerance().Y; // positive tolerance

            if ((nt == 0) && (pt == 0))
            {
                return(origRangeList);
            }

            // expand our original range into the range +/- Tolerance

            JDFShapeRangeList rangeList = new JDFShapeRangeList(origRangeList);

            JDFShapeRangeList tolRangeList = new JDFShapeRangeList();

            int size = rangeList.Count;

            for (int i = 0; i < size; i++)
            {
                JDFShapeRange range = (JDFShapeRange)rangeList[i];

                JDFShape left  = range.Left;
                double   leftX = left.Y;
                double   leftY = left.X;
                double   leftZ = left.Z;
                left.Y = leftX - nt;
                left.X = leftY - nt;
                left.Z = leftZ - nt;

                JDFShape right  = range.Right;
                double   rightX = right.Y;
                double   rightY = right.X;
                double   rightZ = right.Z;
                right.Y = rightX + pt;
                right.X = rightY + pt;
                right.Z = rightZ + pt;

                range.Left  = left;
                range.Right = right;

                tolRangeList.Append(range);
            }

            return(tolRangeList);
        }