BArc Class Reference

#include <BArc.h>

Inheritance diagram for BArc:

Inheritance graph
[legend]

List of all members.


Detailed Description

A geometry object that represents an arc.

Public Member Functions

 BArc (const BArc &arc)
 Copy constructor.
 BArc (const BPoint &pt, double xAxis, double yAxis, double rot, double startAng, double endAng, const BPoint &startPt, const BPoint &endPt)
 Creates a BArc with the specified parameters.
 BArc ()
 Default constructor, which constructs an BArc that is a single point.
virtual BGeometryClone (void) const
 Creates a deep-copy of this object.
virtual size_t ComputeSize (void) const
 Computes the size of the BByteArray required to store this object.
virtual double DistanceTo (const BPoint &point) const
 Calculates the minimum distance from this BGeometry to the specified BPoint.
virtual void DoResolveToPoint (const BPoint &refPt)
 Resolves this BGeometry based on the input BPoint.
virtual void FromByteArray (const BByteArray &bytes, size_t &startPos)
 Initializes an instance of this object from a BByteArray.
const BPointGetCenter (void) const
 Gets the center point of this BArc.
double GetEndAngle (void) const
 Gets the angle where this BArc ends.
virtual const BPointGetEndPoint (void) const
 Gets the point where this BArc ends.
virtual const BPointsGetPoints (void) const
 Get a collection of BPoint objects that represents this BArc.
const BRotationGetRotation (void) const
 Gets the rotation for this BArc.
double GetRotationAngle (void) const
 Gets the angle by which this BArc is rotated.
double GetStartAngle (void) const
 Gets the angle where this BArc begins.
virtual const BPointGetStartPoint (void) const
 Gets the point where this BArc begins.
virtual const
BVectorizable
GetVectorizablePtr (void) const
 Returns an interface that can be used to convert this geometry to a simple geometry.
double GetXAxis (void) const
 Gets the length of the X-axis.
double GetYAxis (void) const
 Gets the length of the Y-axis.
virtual bool Intersects (const BRect &rect) const
 Determines whether or not this BGeometry intersects the specified BRect.
virtual bool IsClockwise (void) const
 Indicates if this BArc will be drawn clockwise or counter-clockwise.
void SetCenter (const BPoint &pt)
 Sets the center point of this BArc.
void SetEndAngle (double angle)
 Sets the angle where this BArc ends.
virtual void SetEndPoint (const BPoint &pt)
 Sets the point where this BArc ends.
virtual void SetIsClockwise (bool cw)
 Sets the indicator of whether or not this BArc shall be drawn clockwise.
void SetRotation (const BRotation &rot)
 Sets the roation for this BArc.
void SetRotationAngle (double angle)
 Sets the angle by which the arc is rotated.
void SetStartAngle (double angle)
 Sets the angle where this BArc begins.
virtual void SetStartPoint (const BPoint &pt)
 Sets the point where this BArc begins.
void SetXAxis (double axis)
 Sets the length of the X-axis.
void SetYAxis (double axis)
 Sets the length of the Y-axis.
virtual BByteArray ToByteArray (void) const
 Stores this object in a BByteArray.
virtual void Transform (const BTransform &cst)
 Transforms the coordinates in this BGeometry to a different coordinate system.
virtual void TransformReverse (const BTransform &cst)
 Transforms the coordinates in this BGeometry to a different coordinate system using the "reverse" of the BTransform.
virtual BGeometryVectorize (double factor=1.0) const
 Convert this BArc to a BPolyline that approximates this BArc.
virtual ~BArc ()
 Destructor.

Protected Member Functions

virtual BRect ComputeMBR () const
 Computes the minimum bounding rectangle for this BArc.
virtual void ComputeStats (void) const
 Calculate the length and MBR of this BArc.

Protected Attributes

BPoint m_center
 The center point.
double m_endAngle
 The angle where this BArc ends.
BPoint m_endPoint
 The point where the arc ends.
bool m_isClockwise
 Indicates whether or not this BArc is drawn clockwise.
BRotation m_rotation
 The angle at which this BArc is rotated.
double m_startAngle
 The angle where this BArc starts.
BPoint m_startPoint
 The point where this BArc starts.
double m_xAxis
 The length of the X-axis.
double m_yAxis
 The length of the Y-axis.

Constructor & Destructor Documentation

BArc (  )  [inline]

Default constructor, which constructs an BArc that is a single point.

BArc ( const BPoint pt,
double  xAxis,
double  yAxis,
double  rot,
double  startAng,
double  endAng,
const BPoint startPt,
const BPoint endPt 
) [inline]

Creates a BArc with the specified parameters.

Parameters:
pt The center point.
xAxis The length of the X-axis.
yAxis The length of the Y-axis.
rot The rotation angle, in radians.
startAng The start angle.
endAng The end angle.
startPt The start point.
endPt The end point.

BArc ( const BArc arc  )  [inline]

Copy constructor.

Parameters:
arc The BArc object to copy.

virtual ~BArc (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual BGeometry* Clone ( void   )  const [inline, virtual]

Creates a deep-copy of this object.

Returns:
A deep-copy of this object.

Implements BGeometry.

virtual BRect ComputeMBR (  )  const [protected, virtual]

Computes the minimum bounding rectangle for this BArc.

Returns:
The minimum bounding rectangle.

Implements BGeometry.

virtual size_t ComputeSize ( void   )  const [inline, virtual]

Computes the size of the BByteArray required to store this object.

Returns:
The size of the BByteArray.

Reimplemented from BSegment.

virtual void ComputeStats ( void   )  const [protected, virtual]

Calculate the length and MBR of this BArc.

Implements BLinearGeo.

virtual double DistanceTo ( const BPoint point  )  const [virtual]

Calculates the minimum distance from this BGeometry to the specified BPoint.

Parameters:
point The BPoint used to calculate distance.
Returns:
The distance. The units used to express this distance are the same as the units used to express the location of this BGeometry.

Reimplemented from BGeometry.

virtual void DoResolveToPoint ( const BPoint refPt  )  [virtual]

Resolves this BGeometry based on the input BPoint.

This should only be called on BGeometry objects that are part of a BBlockDef and contain coordinates that represent offsets from a point rather then an absolute location.

Parameters:
refPt The insertion point.

Implements BGeometry.

virtual void FromByteArray ( const BByteArray bytes,
size_t &  startPos 
) [virtual]

Initializes an instance of this object from a BByteArray.

Parameters:
bytes The BByteArray containing the byte representation for this object.
startPos The position in the BByteArray where the byte representation begins. This value will be updated to point to the byte past the end of this object in the byte array.

Reimplemented from BSegment.

const BPoint& GetCenter ( void   )  const [inline]

Gets the center point of this BArc.

Returns:
The center point.

double GetEndAngle ( void   )  const [inline]

Gets the angle where this BArc ends.

This angle is measured counter-clockwise from the X-axis (3 o'clock).

Returns:
The angle, in radians.

virtual const BPoint& GetEndPoint ( void   )  const [inline, virtual]

Gets the point where this BArc ends.

Returns:
The end point.

Implements BSegment.

virtual const BPoints& GetPoints ( void   )  const [virtual]

Get a collection of BPoint objects that represents this BArc.

Returns:
The collection of BPoint objects.

Reimplemented from BVectorizable.

const BRotation& GetRotation ( void   )  const [inline]

Gets the rotation for this BArc.

Returns:
A BRotation that describes how this BArc is rotated.

double GetRotationAngle ( void   )  const [inline]

Gets the angle by which this BArc is rotated.

Returns:
The rotation angle, in radians.

double GetStartAngle ( void   )  const [inline]

Gets the angle where this BArc begins.

This angle is measured counter-clockwise from the X-axis (3 o'clock).

Returns:
The angle, in radians.

virtual const BPoint& GetStartPoint ( void   )  const [inline, virtual]

Gets the point where this BArc begins.

Returns:
The start point.

Implements BSegment.

virtual const BVectorizable* GetVectorizablePtr ( void   )  const [inline, virtual]

Returns an interface that can be used to convert this geometry to a simple geometry.

The caller should NOT delete the pointer returned by this method.

Returns:
A BVectorizable interface for this object, or NULL if this geometry is already a simple geometry.

Reimplemented from BGeometry.

double GetXAxis ( void   )  const [inline]

Gets the length of the X-axis.

Returns:
The length of the X-axis.

double GetYAxis ( void   )  const [inline]

Gets the length of the Y-axis.

Returns:
The length of the Y-axis.

virtual bool Intersects ( const BRect rect  )  const [virtual]

Determines whether or not this BGeometry intersects the specified BRect.

Parameters:
rect The BRect to test for intersection.
Returns:
True if the BGeometry intersects the BRect and false otherwise.

Reimplemented from BGeometry.

virtual bool IsClockwise ( void   )  const [inline, virtual]

Indicates if this BArc will be drawn clockwise or counter-clockwise.

Returns:
True if this BArc will be drawn clockwise, false otherwise.

void SetCenter ( const BPoint pt  ) 

Sets the center point of this BArc.

Parameters:
pt The center point.

void SetEndAngle ( double  angle  ) 

Sets the angle where this BArc ends.

This angle is measured counter-clockwise from the X-axis (3 o'clock).

Parameters:
angle The angle, in radians.

virtual void SetEndPoint ( const BPoint pt  )  [virtual]

Sets the point where this BArc ends.

Parameters:
pt The end point.

Implements BSegment.

virtual void SetIsClockwise ( bool  cw  )  [inline, virtual]

Sets the indicator of whether or not this BArc shall be drawn clockwise.

Parameters:
cw True if this BArc shall be drawn clockwise and false otherwise.

void SetRotation ( const BRotation rot  ) 

Sets the roation for this BArc.

Use this method when setting the rotation for a three-dimensional BArc.

Parameters:
rot The BRotation that describes how the BArc is rotated.
See also:
BArc::SetRotationAngle For setting the rotation for a two-dimensional BArc.

void SetRotationAngle ( double  angle  ) 

Sets the angle by which the arc is rotated.

Use this method when setting the rotation for a BArc that is two-dimensional.

Parameters:
angle The rotation angle, in radians.
See also:
BArc::SetRotation For setting the rotation for a three-dimensional BArc.

void SetStartAngle ( double  angle  ) 

Sets the angle where this BArc begins.

This angle is measured counter-clockwise from the X-axis (3 o'clock).

Parameters:
angle The angle, in radians.

virtual void SetStartPoint ( const BPoint pt  )  [virtual]

Sets the point where this BArc begins.

Parameters:
pt The start point.

Implements BSegment.

void SetXAxis ( double  axis  ) 

Sets the length of the X-axis.

Parameters:
axis The length of the X-axis.

void SetYAxis ( double  axis  ) 

Sets the length of the Y-axis.

Parameters:
axis The length of the Y-axis.

virtual BByteArray ToByteArray ( void   )  const [virtual]

Stores this object in a BByteArray.

Returns:
A BByteArray that stores the contents of this object.

Reimplemented from BSegment.

virtual void Transform ( const BTransform cst  )  [virtual]

Transforms the coordinates in this BGeometry to a different coordinate system.

Parameters:
cst The BTransform that describes the transformation.

Reimplemented from BGeometry.

virtual void TransformReverse ( const BTransform cst  )  [virtual]

Transforms the coordinates in this BGeometry to a different coordinate system using the "reverse" of the BTransform.

Parameters:
cst The BTransform that describes the transformation.

Reimplemented from BGeometry.

virtual BGeometry* Vectorize ( double  factor = 1.0  )  const [virtual]

Convert this BArc to a BPolyline that approximates this BArc.

Parameters:
factor The value used to adjust the number of points in the resulting BPolyline. The default number of points (1 per degree), will be multiplied by this factor.
Returns:
A BPolyline that approximates this BArc. The caller is responsible for deleting the returned object.

Implements BSegment.


Member Data Documentation

BPoint m_center [protected]

The center point.

double m_endAngle [protected]

The angle where this BArc ends.

All BArcs are drawn counter-clockwise.

BPoint m_endPoint [protected]

The point where the arc ends.

All BArcs are drawn counter-clockwise.

bool m_isClockwise [protected]

Indicates whether or not this BArc is drawn clockwise.

BRotation m_rotation [protected]

The angle at which this BArc is rotated.

double m_startAngle [protected]

The angle where this BArc starts.

All BArcs are drawn counter-clockwise.

BPoint m_startPoint [protected]

The point where this BArc starts.

All BArcs are drawn counter-clockwise.

double m_xAxis [protected]

The length of the X-axis.

double m_yAxis [protected]

The length of the Y-axis.


The documentation for this class was generated from the following file:

GeoTranslate 5.0 From Blue Marble Geographics