Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MGraphic
Inherited By:
None.
Purpose:
TArea provides a wrapper for the TGArea geometry class, to which it adds the facilities inherited from MGraphic: an attribute bundle, matrix transformations, and hit detection. TArea has a, not is a, TGArea. The TGArea class defines an arbitrarily-shaped area by performing certain binary CAG (Constructive Area Geometry) operations to combine other area-defining geometries.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TArea ()
- TArea (const TArea &)
- TArea (const TGArea &, TGrafBundle * adoptBundle =NIL)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
- Creates a TArea from the specified TGArea with the specified attribute bundle.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
- Call this function directly.
Parameters:
- Takes no parameters.
- const TArea & -The area to be copied.
- const TGArea & -The area to be copied.
- TGrafBundle * adoptBundle =NIL -The attribute bundle to be adopted.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TArea ()
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: TArea::Draw
virtual void Draw (TGrafPort & port) const
Interface Category:
API.
Purpose:
Draws the TArea to the specific TGrafPort. Attributes in the area's bundle override those already provided in the port (if any).
Calling Context:
Call this function directly.
Parameters:
- TGrafPort & port -The port to which drawing should go. The port in turn invokes rendering on a particular TGrafDevice.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::TransformBy
virtual void TransformBy (const TGrafMatrix &)
Interface Category:
API.
Purpose:
Transforms the TArea's shape and position by applying the specified transformation matrix.
Calling Context:
Called by the Graphics system. You can also call this function directly.
Parameters:
- const TGrafMatrix & -The transformation matrix by which the area's points are multiplied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::ScaleBy
virtual void ScaleBy (const TGPoint &, const TGPoint & center =TGPoint :: kOrigin)
Interface Category:
API.
Purpose:
Changes the TArea's size according to the specified horizontal and vertical scalars (the coordinates of the first parameter). Because there are two independent scalars, the area's shape can change. The second parameter defines the center of scale. Every point is mapped to a new position by applying the scalars to the point's horizontal and vertical displacements from the center of scale. Thus, the scaled area does not stay centered at the same point unless the second argument is the old center of the area.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint & -A vector whose x-coordinate is the horizontal scalar, and whose y-coordinate is the vertical scalar.
- const TGPoint & center =TGPoint :: kOrigin -The point from which to measure the horizontal and vertical displacement of each point to be scaled. To create the resulting geometry, the displacements are multiplied by the horizontal and vertical scalars, respectively. The default center of scale is the origin (0,0).
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::TranslateBy
virtual void TranslateBy (const TGPoint &)
Interface Category:
API.
Purpose:
Moves the TArea's position by the specified vector.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint & -The vector whose x- and y-coordinates are to be added to those of each point in the geometry.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::RotateBy
virtual void RotateBy (GDegrees, const TGPoint & center =TGPoint :: kOrigin)
Interface Category:
API.
Purpose:
Rotates the TArea by the given number of degrees, using the specified center of rotation. This does not change the size or shape of the area, only its orientation.
Calling Context:
Call this function directly.
Parameters:
- GDegrees -The number of degrees to rotate the graphic.
- const TGPoint & center =TGPoint :: kOrigin -The point around which the area is rotated.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::GetGeometricBounds
virtual TGRect GetGeometricBounds () const
Interface Category:
API.
Purpose:
Gets the bounding rectangle of the TArea's geometry, without considering any area added by its attribute bundle. (For example, the pen is a bundled attribute that can increase the area of the area by adding a border that extends beyond the bounds of the geometry.)
Calling Context:
Called during hit detection. You can also call this function directly.
Parameters:
Return Value:
Returns the bounding rectangle, which is the smallest axis-aligned rectangle that encloses the geometry.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::GetLooseFitBounds
virtual TGRect GetLooseFitBounds (const TGrafPort* =NIL) const
Interface Category:
API.
Purpose:
Gets the entire TArea's bounding rectangle, taking into account the bundle information. (For example, the pen is a bundled attribute that can increase the area of the area by adding a border that extends beyond the bounds of the geometry.)
Calling Context:
Called during hit detection. You can also call this function directly.
Parameters:
- const TGrafPort * =NIL -The graphics port used for accessing hierarchical bundles.
Return Value:
Returns the bounding rectangle, which is the smallest axis-aligned rectangle that encloses the entire graphic, including any area added by the pen.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::IsEmpty
virtual bool IsEmpty () const
Interface Category:
API.
Purpose:
Determines whether this TArea's geometry is empty (which it is when the area is created with the default constructor).
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the order of the curve is zero.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::SetToEmpty
virtual void SetToEmpty ()
Interface Category:
API.
Purpose:
Resets this TArea to empty (that is, uninitialized).
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: TArea::IsRectilinear
virtual bool IsRectilinear () const
Interface Category:
API.
Purpose:
Determines whether all the line segments of this TArea are horizontal or vertical.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if all the line segments of this area are horizontal or vertical.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::IsSingular
virtual bool IsSingular () const
Interface Category:
API.
Purpose:
Determines whether this TArea is comprised of a single basic geometry.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the area is comprised of a single basic geometry.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::GetArea
virtual const TGArea * GetArea () const
Interface Category:
API.
Purpose:
Returns a constant pointer to this TArea's encapsulated TGArea.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a constant pointer to the area's encapsulated area geometry.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::operator=
TArea & operator =(const TArea & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TArea & source -The object to be copied.
Return Value:
Returns a 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: TArea::operator==
bool operator ==(const TArea & source) const
Interface Category:
API.
Purpose:
Determines whether the two TAreas are equal by testing their respective geometries and attribute bundles.
Calling Context:
Call this function by using the operator in an expression.
Parameters:
- const TArea & source -The area to be compared with this one.
Return Value:
Returns true if this area and the parameter have equal geometries and attribute bundles.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::operator!=
bool operator != (const TArea &) const
Interface Category:
API.
Purpose:
Determines whether the two TAreas are not equal by testing their respective geometries and attribute bundles.
Calling Context:
Call this function by using the operator in an expression.
Parameters:
- const TArea & -The area to be compared with this one.
Return Value:
Returns true if the geometries or bundles of this area and the parameter are not equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TArea::operator>>=
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -The stream that the object is streamed out to.
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: TArea::operator<<=
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream that the object is streamed in from.
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: TArea::Validate
void Validate ()
Interface Category:
API.
Purpose:
Makes sure that the graphic's bounds are up-to-date.
Calling Context:
Called by the Graphics system before returning bounds to the user. You should not need to call it directly.
Parameters:
Return Value:
None.
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.