BSegment Class Reference

#include <BSegment.h>

Inheritance diagram for BSegment:

Inheritance graph
[legend]

List of all members.


Detailed Description

Abstract base class for segment geometries, such as lines, arcs, and polylines.

Public Member Functions

virtual size_t ComputeSize (void) const
 Computes the size of the BByteArray required to store this object.
virtual void FromByteArray (const BByteArray &bytes, size_t &startPos)
 Initializes an instance of this object from a BByteArray.
virtual const BPointGetEndPoint (void) const =0
 Get the end point of this BSegment.
virtual const BPointGetStartPoint (void) const =0
 Gets the starting point of this BSegment.
ESegmentType GetType (void) const
 Gets the segment type.
virtual void SetEndPoint (const BPoint &pt)=0
 Sets the end point of this BSegment.
virtual void SetStartPoint (const BPoint &pt)=0
 Sets the starting point of this BSegment.
virtual BByteArray ToByteArray (void) const
 Stores this object in a BByteArray.
virtual BGeometryVectorize (double factor=1.0) const =0
 Converts this BSegment to a BPolyline that approximates this BSegment.

Protected Member Functions

 BSegment (const BSegment &seg)
 Copy constructor.
 BSegment (EGeometryType geoType, ESegmentType segType)
 Constructs a BSegment with the specified geometry type.
 BSegment ()
 Default constructor.

Protected Attributes

ESegmentType m_type
 The type of segment.

Constructor & Destructor Documentation

BSegment (  )  [inline, protected]

Default constructor.

This constructor is hidden because this is an abstract class.

BSegment ( EGeometryType  geoType,
ESegmentType  segType 
) [inline, protected]

Constructs a BSegment with the specified geometry type.

This constructor is hidden because this is an abstract class.

Parameters:
geoType The geometry type to create.
segType The segment type to create.

BSegment ( const BSegment seg  )  [inline, protected]

Copy constructor.

This constructor is hidden because this is an abstract class.

Parameters:
seg The BSegment to copy.


Member Function Documentation

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

Reimplemented in BArc, BLine, and BPolyline.

virtual void FromByteArray ( const BByteArray bytes,
size_t &  startPos 
) [inline, 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.

Reimplemented in BArc, BLine, and BPolyline.

virtual const BPoint& GetEndPoint ( void   )  const [pure virtual]

Get the end point of this BSegment.

Returns:
The end point.

Implemented in BArc, BLine, and BPolyline.

virtual const BPoint& GetStartPoint ( void   )  const [pure virtual]

Gets the starting point of this BSegment.

Returns:
The starting point.

Implemented in BArc, BLine, and BPolyline.

ESegmentType GetType ( void   )  const [inline]

Gets the segment type.

Returns:
The segment type.

virtual void SetEndPoint ( const BPoint pt  )  [pure virtual]

Sets the end point of this BSegment.

Parameters:
pt The end point.

Implemented in BArc, BLine, and BPolyline.

virtual void SetStartPoint ( const BPoint pt  )  [pure virtual]

Sets the starting point of this BSegment.

Parameters:
pt The starting point.

Implemented in BArc, BLine, and BPolyline.

virtual BByteArray ToByteArray ( void   )  const [inline, virtual]

Stores this object in a BByteArray.

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

Reimplemented from BLinearGeo.

Reimplemented in BArc, BLine, and BPolyline.

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

Converts this BSegment to a BPolyline that approximates this BSegment.

Parameters:
factor The value used to adjust the number of points in the resulting BPolyline.
Returns:
A BPolyline that approximates this BSegment. The caller is responsible for deleting the returned object.

Implements BVectorizable.

Implemented in BArc, BLine, and BPolyline.


Member Data Documentation

ESegmentType m_type [protected]

The type of segment.

Reimplemented from BGeometry.


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

GeoTranslate 5.0 From Blue Marble Geographics