BLine Class Reference

#include <BLine.h>

Inheritance diagram for BLine:

Inheritance graph
[legend]

List of all members.


Detailed Description

A geometry object that represents a straight line segment connecting two points.

Public Member Functions

 BLine (const BLine &l)
 Copy constructor.
 BLine (const BPoint &start, const BPoint &end)
 Constructs a BLine that connects the specified points.
 BLine ()
 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 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 BGeometryDownsample (UInt32 maxPoints) const
 Changes the geometry to contain, at most, the specified number of points.
virtual void FromByteArray (const BByteArray &bytes, size_t &startPos)
 Initializes an instance of this object from a BByteArray.
virtual const BPointGetEndPoint (void) const
 Gets the end point for this BLine.
virtual const BPointsGetPoints (void) const
 Gets a collection of points that represents this BGeometry.
virtual const BPointGetStartPoint (void) const
 Gets the start point for this BLine.
virtual const
BVectorizable
GetVectorizablePtr (void) const
 Returns an interface that can be used to convert this geometry to a simple geometry.
virtual bool Intersects (const BRect &rect) const
 Determines whether or not this BGeometry intersects the specified rectangle.
virtual void SetEndPoint (const BPoint &pt)
 Sets the end point for this BLine.
virtual void SetStartPoint (const BPoint &pt)
 Sets the start point for this BLine.
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 BLine to a BPolyline that matches this BLine.

Protected Member Functions

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

Protected Attributes

BPoint m_endPt
 The end point for this BLine.
BPoint m_startPt
 The start point for this BLine.

Constructor & Destructor Documentation

BLine (  )  [inline]

Default constructor.

BLine ( const BPoint start,
const BPoint end 
) [inline]

Constructs a BLine that connects the specified points.

Parameters:
start The BPoint that gives the start point for this BLine.
end The BPoint that gives the end point for this BLine.

BLine ( const BLine l  )  [inline]

Copy constructor.

Parameters:
l The BLine object to copy.


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

Returns:
The minimum bounding rectangle for this BLine.

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]

Calculates the length and MBR of this BLine.

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 BGeometry* Downsample ( UInt32  maxPoints  )  const [virtual]

Changes the geometry to contain, at most, the specified number of points.

Parameters:
maxPoints The maximum number of points in the new geometry.
Returns:
The down-sampled geometry. The caller is responsible for deleting the returned object. This method will return NULL if the object requires no modification.

Implements BResamplable.

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

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

Gets the end point for this BLine.

Returns:
The end point.

Implements BSegment.

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

Gets a collection of points that represents this BGeometry.

Returns:
The collection of points.

Reimplemented from BVectorizable.

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

Gets the start point for this BLine.

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.

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 void SetEndPoint ( const BPoint pt  )  [virtual]

Sets the end point for this BLine.

Parameters:
pt The end point.

Implements BSegment.

virtual void SetStartPoint ( const BPoint pt  )  [virtual]

Sets the start point for this BLine.

Parameters:
pt The start point.

Implements BSegment.

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]

Converts this BLine to a BPolyline that matches this BLine.

Parameters:
factor The value used to adjust the number of points in the resulting BPolyline. This parameter is ignored for BLine objects.
Returns:
A BPolyline that matches this BLine. The caller is responsible for deleting the returned object.

Implements BSegment.


Member Data Documentation

BPoint m_endPt [protected]

The end point for this BLine.

BPoint m_startPt [protected]

The start point for this BLine.


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

GeoTranslate 5.0 From Blue Marble Geographics