BPath Class Reference

#include <BPath.h>

Inheritance diagram for BPath:

Inheritance graph
[legend]

List of all members.


Detailed Description

A geometry object representing a connected collection of segments.

Public Member Functions

virtual void AddPoint (const BPoint &pt)
 Add a BPoint to this BPath.
virtual void AddPoints (const BPoints &pts)
 Adds a collection of BPoints to this BPath.
virtual void AddSegment (const BSegmentPtr &pSeg, bool addConnectingLine=false, double tolerance=1e-14)
 Add a BSegment to this BPath.
 BPath (const BPath &path)
 Copy constructor.
 BPath (EGeometryType type)
 Constructs a BPath with the specified geometry type.
 BPath ()
 Default constructor.
void Clear (void)
 Removes all segments from this BPath.
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 size_t GetCount (void) const
 Gets the number of segments in this BPath.
virtual const BPointsGetPoints (void) const
 Gets a collection of points that represents this BGeometry.
virtual BSegmentPtr GetSegmentAt (size_t index) const
 Gets the segment at the specified index in this BPath.
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 Reserve (size_t numSegs)
 Reserves space for the requested number of elements in this collection.
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.
virtual ~BPath ()
 Destructor.

Protected Member Functions

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

Protected Attributes

BPoints m_points
 The collection of BPoint objects that make up this BSegment.
BSegLinkVector m_segments
 The associated BSegLink collection.

Constructor & Destructor Documentation

BPath (  )  [inline]

Default constructor.

BPath ( EGeometryType  type  )  [inline]

Constructs a BPath with the specified geometry type.

Parameters:
type The geometry type.

BPath ( const BPath path  ) 

Copy constructor.

Parameters:
path The BPath to copy.

virtual ~BPath (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual void AddPoint ( const BPoint pt  )  [virtual]

Add a BPoint to this BPath.

The point will be appended to this path as part of a line segment connecting the last point in the path to this one.

Parameters:
pt The BPoint to be added to this BPath.

virtual void AddPoints ( const BPoints pts  )  [virtual]

Adds a collection of BPoints to this BPath.

Each point will be appended to the path as part of a line segment connecting the last point in the segment to the new one.

Parameters:
pts The collection of BPoint objects to be added to this BPath.

virtual void AddSegment ( const BSegmentPtr pSeg,
bool  addConnectingLine = false,
double  tolerance = 1e-14 
) [virtual]

Add a BSegment to this BPath.

If the start point for the new segment does not match the end point of the previous segment, then an additional line segment can optionally be added to connect the end of the previous segment and the start of the segment being added.

Parameters:
pSeg The BSegment to be added.
addConnectingLine True indicates that we should add a connecting line segment between the end of the previous segment and the start of the new one if the distance between them exceeds the specified tolerance.
tolerance As long as the distance between the end of the previous segment and the start of the new one is below this value, the points are considered to be the same point.

void Clear ( void   ) 

Removes all segments from this BPath.

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.

Implements BGeometry.

virtual size_t ComputeSize ( void   )  const [virtual]

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

Returns:
The size of the BByteArray.

Reimplemented from BLinearGeo.

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

Calculates the length and MBR of this BGeometry.

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

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

Gets the number of segments in this BPath.

Returns:
The number of segments in this BPath.

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 BSegmentPtr GetSegmentAt ( size_t  index  )  const [virtual]

Gets the segment at the specified index in this BPath.

Parameters:
index The zero-based index of the desired BSegment.
Returns:
The BSegment at the specified index.

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 Reserve ( size_t  numSegs  )  [virtual]

Reserves space for the requested number of elements in this collection.

Parameters:
numSegs The number of elements for which space shall be reserved.

virtual BByteArray ToByteArray ( void   )  const [virtual]

Stores this object in a BByteArray.

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

Reimplemented from BLinearGeo.

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


Member Data Documentation

BPoints m_points [protected]

The collection of BPoint objects that make up this BSegment.

BSegLinkVector m_segments [protected]

The associated BSegLink collection.


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

GeoTranslate 5.0 From Blue Marble Geographics