### IMGraphic

  IMGraphic is an abstract base class derived from IMDrawable. IMGraphic provides the protocols for constructing and deleting a 2-D graphic, obtaining attribute information, transforming the graphic, finding the bounds of the graphic, and detecting whether the graphic has been selected by the user (hit detection).

### IMGraphic - Member Functions and Data by Group

### Constructors & Destructor

This group contains the constructors and destructors that create and destroy objects of class IMGraphic.

~IMGraphic
  Destructor.

      public:
      virtual ~IMGraphic()

  Destroys the IMGraphic object.

Supported Platforms

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

IMGraphic
  This constructor creates an IMGraphic object.

  Overload 1
  Default constructor.

      public:
      IMGraphic()

  Use this constructor to create an IMGraphic with empty bundles. Hit flag is set to false and hit detection is enabled. Moved from protected for streaming.

Supported Platforms

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

  Overload 2
  Copy Constructor.

      protected:
      IMGraphic(const IMGraphic&)

  This copy constructor is protected for the Abstract class.

  const IMGraphic&
    The object to be copied from.

Supported Platforms

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

  Overload 3

      protected:
      IMGraphic(IGrafBundle* adoptedBundle)

  Thia constructor creates an IMGraphic from a graph bundle. Protected for Abstract class.

  adoptedBundle
    The graph bundle to construct from.

Supported Platforms

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

### Accessing Attribute and Graphic Bundle information

Use the functions in this group to access attribute and bundle data.

adoptAttributeState

      public:
      virtual void
        adoptAttributeState( IAttributeState* adoptedAttributeState )

  Adopts the specified attribute bundle to determine the graphic's attributes.

  adoptedAttributeState
    The attribute bundle to be adopted by this IMGraphic.

Supported Platforms

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

adoptBundle

      public:
      virtual void adoptBundle(IGrafBundle* adoptedBundle)

  Adopts the specified bundle to determine the graphic's attributes.

  adoptedBundle
    The bundle to be adopted by this IMGraphic.

Supported Platforms

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

attributeState

      public:
      virtual const IAttributeState* attributeState() const

  Gets the attribute bundle, keeping it available for the IMGraphic.

Return
  A constant pointer to the attribute bundle.

Supported Platforms

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

bundle

      public:
      virtual const IGrafBundle* bundle() const

  Gets the bundle, keeping it available for the IMGraphic.

Return
  A constant pointer to the bundle.

Supported Platforms

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

orphanAttributeState

      public:
      virtual IAttributeState* orphanAttributeState()

  Relinquishes knowledge of, and responsibility for, the IMGraphic's attribute bundle, returning it to the caller.

Return
  The orphaned bundle.

Supported Platforms

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

orphanBundle

      public:
      virtual IGrafBundle* orphanBundle()

  Relinquishes knowledge of, and responsibility for, the IMGraphic's bundle, returning it to the caller.

Return
  The orphaned bundle.

Supported Platforms

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

### Assignment Operator

Use the operator in this group to assign a given object to the target one.

operator =

      protected:
      IMGraphic& operator =(const IMGraphic& source)

  Assignment operator.

  source
    The object to be copied.

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

Supported Platforms

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

### Drawing the Graphic to the Port

Use the function in this group to render the image using the given graphics port.

draw

      public:
      virtual void draw(IGrafPort& port) const = 0

  Draws the graphic to the specific IGrafPort.

  port
    The port to which drawing should go.

Exception

  Determined | by derived classes.

Supported Platforms

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

### Getting and Setting the Hit State

Use the functions in this group to determine if the hit enabled flag is set for the geometry, to set the hit enabled flag, and to set the hit state.

setHit

      protected:
      void setHit(bool flag)

  Caches, or sets, the hit state in the base class.

Supported Platforms

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

### Modifying the Graphic Object or Its Position

Use the functions in this group to change the graphic in some way, for example, by rotating by a number of degrees, transforming its shape and position, changing its size, or moving its position.

rotateBy

      public:
      virtual void
        rotateBy( GDegrees,
                  const IGPoint2D& centerOfRotation = IGPoint2D::origin ( ) )

  Rotates the graphic by the given number of degrees, using the specified center of rotation. Calls tranformBy by default.

  GDegrees
    The number of degrees to rotate the graphic.
  centerOfRotation=IGPoint::origin
    The center of rotation

Supported Platforms

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

scaleBy

      public:
      virtual void
        scaleBy( const IGPoint2D&,
                 const IGPoint2D& centerOfScale = IGPoint2D::origin ( ) )

  Changes the graphic's size according to the specified horizontal and vertical scalars. Calls transformBy by default.

  const IGPoint2D&
    A vector whose x-coordinate is the horizontal scalar, and whose y-coordinate is the vertical scalar.
  centerOfScale=IGPoint::origin
    The center of the scaling.

Supported Platforms

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

transformBy

      public:
      virtual void transformBy(const IGrafMatrix&) = 0

  Transforms the graphic's shape and position by applying the specified transformation matrix.

  const IGrafMatrix&
    The transformation matrix by which the graphic's points are multiplied.

Exception

  Determined | by derived classes.

Supported Platforms

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

translateBy

      public:
      virtual void translateBy(const IGPoint2D&)

  Moves the graphic's position by the specified vector.

  const IGPoint2D&
    The vector whose x- and y-coordinates are to be added to those of each point in the geometry.

Supported Platforms

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

### Obtaining Information about the Graphic Object

Use the functions in this group to obtain information about the graphic, such as the geometry's bounding rectangle and its bounds including width and capping.

geometricBounds

      public:
      virtual IGRect2D geometricBounds() const = 0

  Gets the bounding rectangle of the geometry, without considering any area added by the bundle.

Return
  The bounding rectangle, which is the smallest axis-aligned rectangle that encloses the geometry.

Exception

  Determined | by derived classes.

Supported Platforms

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

looseFitBounds

      public:
      virtual IGRect2D looseFitBounds(const IGrafPort* = 0) const

  Returns the bounds of the graphic object considering attributes like width and capping.

Supported Platforms

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

### Setting, Getting, and Resetting the Object's Time Stamp

Use the functions in this group to set and get the object's time stamp, and to reset the time stamp to 0.

resetTimeStamp

      protected:
      virtual void resetTimeStamp()

  Sets the time stamp to zero.

  None

Supported Platforms

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

setTimeStamp

      protected:
      virtual void setTimeStamp(const unsigned long&)

  Sets the time stamp to the specified value.

  const unsigned long&
    The new time stamp.

Supported Platforms

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

timeStamp

      protected:
      virtual unsigned long timeStamp() const

  Gets the object's time stamp.

Return
  Returns the graphic's time stamp.

Supported Platforms

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

updateTimeStamp

      protected:
      virtual void updateTimeStamp()

  Updates the object's time stamp.

Supported Platforms

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

### Streaming the Object In and Out

Use the functions in this group to write the graphic out to a stream or read it in from one.

readFromStream

      protected:
      virtual void readFromStream(IDataStream& toWhere)

  Read the graphic object in from the specified stream.

  fromWhere
    The stream used to stream the object in.

Supported Platforms

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

writeToStream

      protected:
      virtual void writeToStream(IDataStream& toWhere) const

  Writes the graphic object out to the specified stream.

  toWhere
    The stream that the object is streamed out to.

Supported Platforms

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

### Testing IMGraphic and IMDrawable Objects for Equality

Use the function in this group to test an IMDrawable object with the current IMGraphic object for equality.

operator ==

      public:
      virtual bool operator ==(const IMDrawable&) const

  Tests the IMGraphic and the IMDrawable for equality. The base class only tests whether the two bundles have equal contents.

  const IMDrawable&
    The IMDrawable to be compared with this one.

Return
  Returns true if this IMGraphic and the argument have equal bundles.

Supported Platforms

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

### IMGraphic - Inherited Member Functions and Data

#### Inherited Public Functions

  IMDrawable

  -     virtual ~IMDrawable()

  -     bool operator !=(const IMDrawable&) const

  IMStreamable

  -     virtual ~IMStreamable()

  -     void externalizeToStream(IDataStream& towhere) const

  -     void internalizeFromStream(IDataStream& fromwhere)

  -     virtual const ITypeRepresentation&
          typeRepresentation() const = 0

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IMDrawable

  -     IMDrawable(const IMDrawable&)

  -     IMDrawable()

  -     IMDrawable& operator =(const IMDrawable& source)

  IMStreamable

  -     IMStreamable(const IMStreamable& other)

  -     IMStreamable()

  -     virtual void readFromStream(IDataStream& fromwhere) = 0

  -     virtual void writeToStream(IDataStream& towhere) const = 0

#### Inherited Protected Data

  - None