### IGArea

  IGArea provides a device-independent specification of an arbitrarily-shaped area.

  IGArea defines an object that performs certain binary CAG (Constructive Area Geometry) operations on other area-defining geometries, such as IGRect2D, IGEllipse2D, and IGPolygon2D. These CAG operations are Add (union), Subtract, Intersection, and Exclusive OR. For instance, an IGArea can be made up of the area of a rectangle minus the area of an ellipse.

### IGArea - Member Functions and Data by Group

### Constructors & Destructor

Use the functions in this group to construct or destroy objects of class IGArea.

~IGArea

      public:
      virtual ~IGArea()

  Destroys the geometry area of class IGArea.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

IGArea
  Creates an area geometry.

  Overload 1
  Creates an area geometry from a rectangle.

      public:
      IGArea(const IGRect2D& g)

  Use this constructor to create an area geometry from the given rectangle.

  g
    A constant reference to the rectangle from which the area is to be constructed.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 2
  Default constructor, which does nothing.

      public:
      IGArea()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 3
  Creates an area geometry from the given ellipse.

      public:
      IGArea(const IGEllipse2D& g)

  Use this constructor to create an area geometry from the specified ellipse.

  g
    A constant reference to the ellipse from which the area is to be constructed.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 4
  Creates an area geometry from the specified area.

      public:
      IGArea(const IGArea& g)

  Use this constructor to create an area geometry that is copied from the given one.

  g
    A constant reference to the area geometry from which the new one is copied.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 5
  Creates an area geometry from a loop.

      public:
      IGArea(const IGLoop2D& g)

  Use this constructor to create an area geometry from the given 2D loop.

  g
    A constant reference to the loop from which the area is to be constructed.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 6
  Creates an area geometry from a polygon.

      public:
      IGArea(const IGPolygon2D& g)

  Use this constructor to create an area geometry from the specified polygon.

  g
    A constant reference to the polygon from which the area is to be constructed.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Acting on the Current Area Geometry Using the Given One

Use the functions in this group to modify the shape defined by the current geometry area with the given IGArea geometry area. For example, these functions allow you to add the given shape to or subtract it from the current one, intersect the current shape with the given one, set the shape to the combined shape of the two minus their intersection, and so forth.

add

      public:
      void add(const IGArea&)

  Adds the shape of the specified IGArea to the current shape. Addition is achieved through union.

  IGArea
    A constant reference to the shape to be added to the current area.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

exclusiveOr

      public:
      void exclusiveOr(const IGArea&)

  Sets the shape to the combined area of the current shape and the specified IGArea's shape, minus their intersection.

  IGArea
    A constant reference to the area to be exclusive OR'd with this one.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

intersect

      public:
      void intersect(const IGArea&)

  Sets the shape to the intersection of the current shape with the specified IGArea's shape.

  IGArea
    A constant reference to the area to be intersected with this one.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator *=

      public:
      IGArea& operator *=(const IGArea&)

  Intersects the current shape with the specified IGArea's shape.

  IGArea
    A constant reference to the area to be intersected with this one.

Return
  A const reference to the left-hand side object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator +=

      public:
      IGArea& operator +=(const IGArea&)

  Adds the shape of the specified area to this one. Addition is achieved through union.

  IGArea
    A constant reference to the shape to be added to the current area.

Return
  A const reference to the left-hand side object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator -=

      public:
      IGArea& operator -=(const IGArea&)

  Subtracts the shape of the specified IGArea from the current shape.

  IGArea
    A constant reference to the shape to be subtracted from the current area.

Return
  A const reference to the left-hand side object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator ^=

      public:
      IGArea& operator ^=(const IGArea&)

  Sets the shape to the combined area of the current shape and the specified IGArea's shape, minus their intersection.

  IGArea
    A constant reference to the area to be exclusive OR'd with this one.

Return
  A const reference to the left-hand side object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

subtract

      public:
      void subtract(const IGArea&)

  Subtracts the shape of the specified IGArea from the current shape.

  IGArea
    A constant reference to the shape to be subtracted from the current area.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Assignment Operator

Use the function in this group to perform assignment operations.

operator =

      public:
      IGArea& operator =(const IGArea&)

  Assignment operator.

  IGArea
    A constant reference to the area to be copied.

Return
  A non-const reference to the left-hand side object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Creating an Empty or Infinitely Large Area Geometry

Use the functions in this group to create an empty area geometry or one that is infinitely large.

emptyArea

      public:
      static const IGArea& emptyArea()

  Creates a new empty area geometry.

Return
  The new, empty area geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

infiniteArea

      public:
      static const IGArea& infiniteArea()

  Creates a new area geometry that is infinitely large.

Return
  The new, infinitely large area geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Modifying an Area Geometry

Use the functions in this group to remove the area's geometry or to transform the area using a given matrix.

setToEmpty

      public:
      void setToEmpty()

  Removes all basic geometries from this area.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

transformBy

      public:
      void transformBy(const IGrafMatrix&)

  Transforms the entire area using the specified matrix.

  IGrafMatrix
    A constant reference to the matrix used to transform the area.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Obtaining Information About the Area Geometry

Use the functions in this group to obtain information about an area, such as the object's time stamp, the rectangle that completely encloses the area, whether the area contains a given point, a given rectangle, any geometries, whether the area is rectangular, comprised completely of horizontal and vertical edges, comprised of a single basic geometry, and so forth.

bounds

      public:
      IGRect2D bounds() const

  Returns the rectangle that completely encloses the area.

Return
  The bounding rectangle for the area.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

contains

  Overload 1
  Tests whether the area geometry contains the given point.

      public:
      bool contains(const IGPoint2D&) const

  IGPoint2D
    A constant reference to the point to test for within the area geometry.

Return
  True if the point lies completely within the area geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 2
  Tests whether the area geometry contains the given rectangle.

      public:
      bool contains(const IGRect2D&) const

  IGRect2D
    A constant reference to the rectangle to test for within the area geometry.

Return
  True if the rectangle lies completely within the area geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

intersects

      public:
      bool intersects(const IGRect2D&) const

  Tests whether the area geometry intersects the given rectangle.

  IGRect2D
    A constant reference to the rectangle to test for intersection.

Return
  True if the area geometry intersects the given rectangle.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

isEmpty

      public:
      bool isEmpty() const

  Tests whether this area contains any geometries.

Return
  True if this area contains no basic geometries.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

isRectangular

      public:
      bool isRectangular() const

  Tests whether the area is rectangular in shape.

Return
  True if the area is rectangular in shape.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

isRectilinear

      public:
      bool isRectilinear() const

  Tests whether the area is comprised completely of horizontal and vertical edges.

Return
  True if the area is comprised completely of horizontal and vertical edges.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

isSingular

      public:
      bool isSingular() const

  Tests whether the area is comprised of a single basic geometry.

Return
  True if the area is comprised of a single basic geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

timeStamp

      public:
      unsigned long timeStamp() const

  Returns the object's time stamp.

Return
  The object's time stamp.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Streaming an Object In and Out

Use the functions and operators in this group to stream an area geometry object in and out. The functions are readFromStream and writeToStream. The operators are operator <<= and operator >>=.

operator <<=

      public:
      IDataStream& operator <<=(IDataStream&)

  Operator that streams the area geometry in using the given polymorphic stream.

  IDataStream
    A reference to the stream used to stream in the area geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator >>=

      public:
      IDataStream& operator >>=(IDataStream&) const

  Operator that streams the area geometry out using the given polymorphic stream.

  IDataStream
    A reference to the stream used to stream out the area geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

readFromStream

      public:
      void readFromStream(IDataStream& toWhere)

  Streams the area geometry in using the polymorphic streaming specified by fromWhere.

  fromWhere
    A reference to the stream used to stream in the area geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

writeToStream

      public:
      void writeToStream(IDataStream& toWhere) const

  Streams out the area geometry object out using the given stream defined for polymorphic streaming.

  toWhere
    A reference to the stream used to stream out the area geometry.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Testing Two Area Geometries for Equality or Inequality

Use the functions in this group to test two area geometries for equality or inequality.

operator !=

      public:
      bool operator !=(const IGArea&) const

  Tests whether the two objects differ.

  IGArea
    A constant reference to the area geometry to be compared to this one.

Return
  True if the two area geometries are not equal.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator ==

      public:
      bool operator ==(const IGArea&) const

  Tests whether the two objects are equal.

  IGArea
    A constant reference to the area geometry to be compared to this one.

Return
  True if the two area geometries are equal.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### IGArea - Associated Globals

operator *

      IGArea operator *(const IGArea&, const IGArea&)

  Sets the shape to the combined area of the current shape and the specified IGArea's shape, minus their intersection.

operator +

      IGArea operator +(const IGArea&, const IGArea&)

  The addition operator for IGArea. Addition is achieved through union.

operator -

      IGArea operator -(const IGArea&, const IGArea&)

  Subtraction operator that sets the shape to the intersection of the current shape with the specified IGArea's shape.

operator ^

      IGArea operator ^(const IGArea&, const IGArea&)

  Sets the shape to the combined area of two IGArea's shape, minus their intersection.

### IGArea - Inherited Member Functions and Data

#### Inherited Public Functions

  - None

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  - None

#### Inherited Protected Data

  - None