예제 #1
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Constructor
  * @param r
  * @param at
  */
 internal RectIterator(Rectangle r, AffineTransform at)
 {
     _x = r.GetX();
     _y = r.GetY();
     _w = r.GetWidth();
     _h = r.GetHeight();
     _affine = at;
     if (_w < 0 || _h < 0)
     {
         _index = 6;
     }
 }
예제 #2
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Determines whether or not the interior of the arc entirely contains
  * the specified rectangle.
  *
  * @param r The <CODE>Rectangle</CODE> to test.
  *
  * @return <CODE>true</CODE> if the arc contains the rectangle,
  * <CODE>false</CODE> if the arc doesn't contain the rectangle.
  */
 public override bool Contains(Rectangle r)
 {
     return Contains(r.GetX(), r.GetY(), r.GetWidth(), r.GetHeight(), r);
 }
예제 #3
0
 ///////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Constructs a new arc, initialized to the specified location,
  * size, angular extents, and closure type.
  *
  * @param ellipseBounds The framing rectangle that defines the
  * outer boundary of the full ellipse of which this arc is a
  * partial section.
  * @param start The starting angle of the arc in degrees.
  * @param extent The angular extent of the arc in degrees.
  * @param type The closure type for the arc:
  * {@link #OPEN}, {@link #CHORD}, or {@link #PIE}.
  */
 public Arc(Rectangle ellipseBounds,
               double start, double extent, int type)
     : this(type)
 {
     X = ellipseBounds.GetX();
     Y = ellipseBounds.GetY();
     Width = ellipseBounds.GetWidth();
     Height = ellipseBounds.GetHeight();
     Start = start;
     Extent = extent;
 }
예제 #4
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // 13JUN2009  -------------------  -------------      ----------------------
 // 08NOV2008  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Sets the location, size, angular extents, and closure type of
  * this arc to the specified values.
  *
  * @param rect The framing rectangle that defines the
  * outer boundary of the full ellipse of which this arc is a
  * partial section.
  * @param angSt The starting angle of the arc in degrees.
  * @param angExt The angular extent of the arc in degrees.
  * @param closure The closure type for the arc:
  * {@link #OPEN}, {@link #CHORD}, or {@link #PIE}.
  */
 public void SetArc(Rectangle rect, double angSt, double angExt,
            int closure)
 {
     SetArc(rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight(),
            angSt, angExt, closure);
 }
예제 #5
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * {@inheritDoc}
  */
 public bool Intersects(Rectangle r)
 {
     return Intersects(r.GetX(), r.GetY(), r.GetWidth(), r.GetHeight());
 }
예제 #6
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 02NOV2008  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Sets the framing rectangle of this <code>IShape</code> to
  * be the specified <code>Rectangle</code>.  The framing rectangle is
  * used by the subclasses of <code>RectangularShape</code> to define
  * their geometry.
  * @param r the specified <code>Rectangle</code>
  */
 public void SetFrame(Rectangle r)
 {
     SetFrame(r.GetX(), r.GetY(), r.GetWidth(), r.GetHeight());
 }
예제 #7
0
 /**
  * Determines whether or not this Rectangle and the specified Rectangle
  * location (x, y) with the specified dimensions (width, height),
  * intersect. Two rectangles intersect if their intersection is nonempty.
  *
  * @param rect the Rectangle to check intersection with
  * @return true if the specified Rectangle and this Rectangle intersect;
  * false otherwise.
  */
 public override bool Intersects(Rectangle rect)
 {
     return Intersects(rect.GetX(), rect.GetY(),
             rect.GetSize().GetWidth(), rect.GetSize().GetHeight());
 }