Class: TGQuadrilateral

Declaration: Transforms.h

Taxonomy Categories:

Member Functions:


Interface Category:

API

Inherits From:

None.

Inherited By:

None.

Purpose:

A quadrilateral is a four-sided polygon. The TGQuadrilateral class is used by TGrafMatrix::SetToPerspectiveMap to specify perspective and affine mapping. A TGQuadrilateral can be any set of any four points. However, classes that use TGQuadrilateral, such as TGrafMatrix, can impose further restrictions to ensure that the polygon is not degenerate, requiring (for example) that no two points be identical or that no three points be colinear.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Do not derive classes from TGQuadrilateral.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TGQuadrilateral::TGQuadrilateral

  1. TGQuadrilateral ()
  2. TGQuadrilateral (const TGRect &)
  3. TGQuadrilateral (const TGPoint & p0, const TGPoint & p1, const TGPoint & p2, const TGPoint & p3)
  4. TGQuadrilateral (const TGQuadrilateral &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a quadrilateral for a rectilinear mapping.
  3. Creates a quadrilateral for a general perspective mapping.
  4. Copy constructor.

Calling Context:

  1. Called by the stream-in operators. You can also call this function directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Called to copy an object. You can also 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: TGQuadrilateral::~TGQuadrilateral

virtual ~ TGQuadrilateral ()

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: TGQuadrilateral::GetPoints

void GetPoints (TGPoint & p0, TGPoint & p1, TGPoint & p2, TGPoint & p3) const

Interface Category:

API.

Purpose:

Returns, in the specified parameters, the quadrilateral's four vertices.

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: TGQuadrilateral::GetPoint

TGPoint GetPoint (unsigned long index) const

Interface Category:

API.

Purpose:

Returns the specified vertex.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The specified vertex.

Exceptions:

Fails a parameter assertion if the index is greater than 3.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGQuadrilateral::SetPoint

void SetPoint (unsigned long index, const TGPoint & p)

Interface Category:

API.

Purpose:

Sets the specified vertex.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Fails a parameter assertion if the index is greater than 3.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGQuadrilateral::TransformBy

void TransformBy (const TGrafMatrix & mat)

Interface Category:

API.

Purpose:

Passes a quadrilateral through a linear transformation.

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: TGQuadrilateral::GetBounds

TGRect GetBounds () const

Interface Category:

API.

Purpose:

Returns the geometry's bounding rectangle (the smallest axis-aligned rectangle that encloses the quadrilateral).

Calling Context:

Call this function directly.

Parameters:

Return Value:

The bounding rectangle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGQuadrilateral::operator>>=

TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns 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: TGQuadrilateral::operator<<=

TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns 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: TGQuadrilateral::operator=

TGQuadrilateral & operator =(const TGQuadrilateral & Src)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

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: TGQuadrilateral::operator==

bool operator ==(const TGQuadrilateral & Src) const

Interface Category:

API.

Purpose:

Allows you to quickly determine if this quadrilateral is equal to another quadrilateral.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if this->vertex0 ==Src.vertex0 and this->vertex1 ==Src.vertex1 and this->vertex2 ==Src.vertex2 and this->vertex3 ==Src.vertex3.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGQuadrilateral::operator!=

bool operator != (const TGQuadrilateral & Src) const

Interface Category:

API.

Purpose:

Allows you to quickly determine if this quadrilateral is not equal to another quadrilateral.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if this->vertex0 != Src.vertex0 or this->vertex1 != Src.vertex1 or this->vertex2 != Src.vertex2 or this->vertex3 != Src.vertex3.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGQuadrilateral::IsDegenerate

bool IsDegenerate () const

Interface Category:

API.

Purpose:

Checks to see if the TGQuadrilateral is a degenerate polygon. If the polygon that makes up the quadrilateral is either concave or colinear (no two points are identical or no three points are colinear), then it returns true, otherwise, false.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the points that make up the quadrilateral are either concave or colinear (no two points are identical or no three points are colinear).

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.