BEllipse Class Reference

#include <BEllipse.h>

Inheritance diagram for BEllipse:

Inheritance graph
[legend]

List of all members.


Detailed Description

A geometry object that represents an ellipse.

Public Member Functions

 BEllipse (const BEllipse &el)
 Copy constructor.
 BEllipse (const BPoint &pt, const double x, const double y, const double rot)
 Constructor.
 BEllipse ()
 Default constructor.
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 bool Contains (const BPoint &point) const
 Determines whether or not the specified point is contained within this BGeometry.
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 for this BEllipse.
virtual BPoint GetCentroid () const
 Retrieves the center point of this ellipse.
virtual const BPointsGetPoints (void) const
 Get a collection of BPoint objects that represents this BEllipse.
BRotation GetRotation (void) const
 Get the rotation for the ellipse.
double GetRotationAngle (void) const
 Gets the angle by which the ellipse is rotated.
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 rectangle.
virtual bool IsClosed (void) const
 Indicates whather or not this is a "closed" geometry.
void SetCenter (const BPoint &pt)
 Set the center point for this BEllipse.
void SetRotation (const BRotation &rot)
 Sets the roation for the ellipse.
void SetRotationAngle (double angle)
 Set the angle by which the ellipse is rotated.
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
 Converts this BEllipse to a BPolygon that approximates this BEllipse.
virtual ~BEllipse ()
 Destructor.

Protected Member Functions

virtual BRect ComputeMBR () const
 Computes the minimum bounding rectangle for this BGeometry.
virtual void ComputeStats () const
 Computes the MBR, centroid, area, perimeter, and orientation.

Protected Attributes

BPoint m_center
 The center point.
BRotation m_rotation
 The angle at which the ellipse is rotated.
double m_xAxis
 The length of the X-axis.
double m_yAxis
 The length of the Y-axis.

Constructor & Destructor Documentation

BEllipse (  )  [inline]

Default constructor.

This constructs an ellipse with 0-length radii.

BEllipse ( const BPoint pt,
const double  x,
const double  y,
const double  rot 
) [inline]

Constructor.

Parameters:
pt The center point.
x The length of the X-axis.
y The length of the Y-axis.
rot The rotation angle, in radians.

BEllipse ( const BEllipse el  )  [inline]

Copy constructor.

Parameters:
el The BEllipse to copy.

virtual ~BEllipse (  )  [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 BGeometry.

Returns:
The minimum bounding rectangle for this BGeometry.

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 BAreaGeo.

virtual void ComputeStats (  )  const [protected, virtual]

Computes the MBR, centroid, area, perimeter, and orientation.

Implements BAreaGeo.

virtual bool Contains ( const BPoint point  )  const [virtual]

Determines whether or not the specified point is contained within this BGeometry.

Parameters:
point The BPoint to test for containment.
Returns:
True if the point is contained within this BGeometry and false otherwise.

Implements BAreaGeo.

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 of the 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 BAreaGeo.

const BPoint& GetCenter ( void   )  const [inline]

Gets the center point for this BEllipse.

Returns:
The center point.

virtual BPoint GetCentroid (  )  const [inline, virtual]

Retrieves the center point of this ellipse.

Returns:
The centroid point of this geometry.

Reimplemented from BAreaGeo.

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

Get a collection of BPoint objects that represents this BEllipse.

Returns:
The collection of BPoint objects.

Reimplemented from BVectorizable.

BRotation GetRotation ( void   )  const [inline]

Get the rotation for the ellipse.

This method should be used to get the rotation of an ellipse that exists in a three-dimensional space. To get the rotation for an ellipse in two-dimensions, use the GetRotationAngle method.

Returns:
A BRotation object that describes the rotation angle.

double GetRotationAngle ( void   )  const [inline]

Gets the angle by which the ellipse is rotated.

This method should be used to get the rotation of an ellipse that exists in a two-dimensional space. To get the rotation for an ellipse in three-dimensions, use the GetRotation method.

Returns:
The rotation angle, in radians.

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. The units used to express the length of the x-axis are the same as the units used to express the location of this BEllipse.

double GetYAxis ( void   )  const [inline]

Gets the length of the Y-axis.

Returns:
The length of the Y-axis. The units used to express the length of the y-axis are the same as the units used to express the location of this BEllipse.

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

Determines whether or not this BGeometry intersects the specified rectangle.

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

Reimplemented from BGeometry.

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

Indicates whather or not this is a "closed" geometry.

Since this geometry object represents an ellipse, this method will always return true.

return Since this is a BEllipse, this will always return true.

Reimplemented from BGeometry.

void SetCenter ( const BPoint pt  ) 

Set the center point for this BEllipse.

Parameters:
pt The center point.

void SetRotation ( const BRotation rot  ) 

Sets the roation for the ellipse.

This method should be used to set the rotation of an ellipse that exists in a three-dimensional space. To set the rotation for an ellipse in two-dimensions, use the SetRotationAngle method.

Parameters:
rot The BRotation object that describes the rotation angle.

void SetRotationAngle ( double  angle  ) 

Set the angle by which the ellipse is rotated.

This method should be used to set the rotation of an ellipse that exists in a two-dimensional space. To set the rotation for an ellipse in three-dimensions, use the SetRotation method.

Parameters:
angle The rotation angle, in radians.

void SetXAxis ( double  axis  ) 

Sets the length of the X-axis.

Parameters:
axis The length of the X-axis. The units used to express the length must be the same as the units used to express the location of this BEllipse.

void SetYAxis ( double  axis  ) 

Sets the length of the Y-axis.

Parameters:
axis The length of the Y-axis. The units used to express the length must be the same as the units used to express the location of this BEllipse.

virtual BByteArray ToByteArray ( void   )  const [virtual]

Stores this object in a BByteArray.

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

Reimplemented from BAreaGeo.

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]

Converts this BEllipse to a BPolygon that approximates this BEllipse.

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

Implements BVectorizable.


Member Data Documentation

BPoint m_center [protected]

The center point.

BRotation m_rotation [protected]

The angle at which the ellipse is rotated.

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