Class: TPicture

Declaration: Picture.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MGraphic

Inherited By:

None.

Purpose:

TPicture derives from MGraphic and represents a picture of both 2-D and 3-D geometries and images composited together. The picture, once created, can be edited only by adding more geometries and images to it. It cannot be edited in any other respect, such as removing old geometries or modifying the geometries which are already part of this picture. Users wanting to edit the picture must destroy one TPicture and create another. TPicture is similar to TImage: both classes represent a scene made of primitive geometries. However, TImage renders the primitives onto a device-dependent pixel buffer and does not retain the geometries from which it is constructed. TPicture keeps a pure state of each geometry and its attributes as rendered onto the TGrafPort. TPicture renders its geometries in the same order (first come, first drawn) that they were originally rendered to the TGrafPort, concatenating the geometry's state with that of the picture. Because 3-D geometries can also be rendered, a SceneBundle is needed in the constructor of TPicture so that the 3-D objects can be projected onto the picture's 2-D plane. Once projected, the projection plane is not modified when the images are rendered. TPicture is a 2-D representation of 3-D and 2-D objects.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TPicture::TPicture

  1. TPicture ()
  2. TPicture (const TSceneBundle &, TGrafBundle * =NIL)
  3. TPicture (const TPicture &)

Interface Category:

API.

Purpose:

  1. Creates a TPicture without a scene bundle (for users who want only 2-D objects).
  2. Creates a TPicture and initializes its scene bundle and attribute bundle to the ones provided as parameters.
  3. Copy constructor.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::~TPicture

virtual ~ TPicture ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::Draw

virtual void Draw (TGrafPort & port) const

Interface Category:

API.

Purpose:

Draws the picture to the specified TGrafPort. TPicture renders its geometries in the same order (first come, first drawn) that they were originally rendered to the grafport, concatenating the geometry's state with that of the picture.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::GetGeometricBounds

virtual TGRect GetGeometricBounds () const

Interface Category:

API.

Purpose:

Returns the bounding rectangle of the geometry, without considering any area determined by the bundle information.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the rectangle that encloses the picture, in world space coordinates.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::GetLooseFitBounds

virtual TGRect GetLooseFitBounds (const TGrafPort * port =NIL) const

Interface Category:

API.

Purpose:

Returns the entire graphic's bounding rectangle, including the area determined by the bundle information.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the rectangle that encloses the picture, in world space coordinates.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::TransformBy

virtual void TransformBy (const TGrafMatrix &)

Interface Category:

API.

Purpose:

Transforms the graphic's shape and position by applying the specified transformation matrix. Transformation is achieved through concatenation.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::operator==

bool operator ==(const TPicture & source) const

Interface Category:

API.

Purpose:

Tests whether two objects are equal.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::operator!=

bool operator != (const TPicture & source) const

Interface Category:

API.

Purpose:

Tests whether two objects are equal.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the objects are not equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

A reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

A reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::operator=

TPicture & operator =(const TPicture & source)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPicture::GetGrafPort

virtual TGrafPort * GetGrafPort () const

Interface Category:

API.

Purpose:

Returns the TGrafPort associated with the picture. The port is created in the constructor. This function does not return a const pointer because the port is modified when the picture is drawn into it.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The grafport currently associated with the picture.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.