Example #1
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 13JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Calculate the union of the two rectangle.
         * @param r
         * @return
         */
        public RectangleFP Union(RectangleFP r)
        {
            if (!r.IsEmpty())
            {
                if (IsEmpty())
                {
                    Reset(r);
                }
                else
                {
                    Reset(MathFP.Min(_ffXmin, r._ffXmin),
                          MathFP.Max(_ffXmax, r._ffXmax),
                          MathFP.Min(_ffYmin, r._ffYmin),
                          MathFP.Max(_ffYmax, r._ffYmax));
                }
            }
            return(this);
        }