#include <BPolyline.h>

A polyline is a collection of connected line segments.
Public Member Functions | |
| void | AddPoint (const BPoint &pt) |
| Adds a vertex to this BPolyline. | |
| void | AddPoints (const BPoints &pts) |
| Adds a collection of new vertices to this BPolyline. | |
| BPolyline (const BPolyline &p) | |
| Copy constructor. | |
| BPolyline (size_t num) | |
| Constructs a BPolyline and reserves space for the specified number of vertices. | |
| BPolyline (const BLinearGeoPtr &pGeo) | |
| Construct a polyline that approximates the specified BLinearGeo. | |
| BPolyline () | |
| Default constructor. | |
| virtual BGeometry * | Clone (void) const |
| Creates a deep-copy of this object. | |
| virtual BPoint | ComputeCentroid () |
| Computes the centroid of this BPolyline. | |
| 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 BGeometry * | Downsample (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 vertices in this BPolyline. | |
| virtual const BPoint & | GetEndPoint (void) const |
| Gets the end point of this BSegment. | |
| virtual const BPoint & | GetPointAt (size_t index) const |
| Gets the vertex at the specified index. | |
| virtual const BPoint & | GetStartPoint (void) const |
| Gets the start point of this BSegment. | |
| 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. | |
| BPolyline & | operator= (const BPolyline &rhs) |
| Assignment operator. | |
| void | Reserve (size_t num) |
| Reserves space for the specified number of vertices. | |
| virtual void | SetEndPoint (const BPoint &pt) |
| Sets the end point of this BPolyline. | |
| virtual void | SetPoints (const BPoints &pts) |
| Sets the BPoints collection that defines the vertices of this BPolyline. | |
| virtual void | SetStartPoint (const BPoint &pt) |
| Sets the start point of this BPolyline. | |
| 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 BGeometry * | Vectorize (double factor=1.0) const |
| Since a BPolyline is a simple geometry, this method will return a copy of this BPolyline. | |
| virtual | ~BPolyline () |
| 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 | |
| BPoint | m_centroid |
| The centroid of this BPolyline. | |
| BPolyline | ( | ) | [inline] |
Default constructor.
| BPolyline | ( | const BLinearGeoPtr & | pGeo | ) |
Construct a polyline that approximates the specified BLinearGeo.
| pGeo | The BLinearGeo that will be approximated by this BPolyline. |
| BPolyline | ( | size_t | num | ) | [inline] |
Constructs a BPolyline and reserves space for the specified number of vertices.
| num | The number of vertices for which space will be reserved. |
| virtual ~BPolyline | ( | ) | [inline, virtual] |
Destructor.
| void AddPoint | ( | const BPoint & | pt | ) |
| void AddPoints | ( | const BPoints & | pts | ) |
| virtual BGeometry* Clone | ( | void | ) | const [inline, virtual] |
| virtual BPoint ComputeCentroid | ( | ) | [virtual] |
| virtual BRect ComputeMBR | ( | ) | const [protected, virtual] |
| virtual size_t ComputeSize | ( | void | ) | const [inline, virtual] |
Computes the size of the BByteArray required to store this object.
Reimplemented from BSegment.
| virtual void ComputeStats | ( | void | ) | const [protected, virtual] |
| virtual double DistanceTo | ( | const BPoint & | point | ) | const [virtual] |
| virtual void DoResolveToPoint | ( | const BPoint & | refPt | ) | [virtual] |
Changes the geometry to contain, at most, the specified number of points.
| maxPoints | The maximum number of points in the new geometry. |
Implements BResamplable.
| virtual void FromByteArray | ( | const BByteArray & | bytes, | |
| size_t & | startPos | |||
| ) | [virtual] |
Initializes an instance of this object from a BByteArray.
| 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 size_t GetCount | ( | void | ) | const [inline, virtual] |
| virtual const BPoint& GetEndPoint | ( | void | ) | const [inline, virtual] |
| virtual const BPoint& GetPointAt | ( | size_t | index | ) | const [inline, virtual] |
Gets the vertex at the specified index.
| index | The zero-based index of the desired vertex. |
| virtual const BPoint& GetStartPoint | ( | void | ) | const [inline, virtual] |
| 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.
Reimplemented from BGeometry.
| virtual bool Intersects | ( | const BRect & | rect | ) | const [virtual] |
| void Reserve | ( | size_t | num | ) | [inline] |
Reserves space for the specified number of vertices.
| num | The number of points to reserve |
| virtual void SetEndPoint | ( | const BPoint & | pt | ) | [virtual] |
| virtual void SetPoints | ( | const BPoints & | pts | ) | [virtual] |
| virtual void SetStartPoint | ( | const BPoint & | pt | ) | [virtual] |
| virtual BByteArray ToByteArray | ( | void | ) | const [virtual] |
Stores this object in a BByteArray.
Reimplemented from BSegment.
| virtual void Transform | ( | const BTransform & | cst | ) | [virtual] |
Transforms the coordinates in this BGeometry to a different coordinate system.
| 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.
| cst | The BTransform that describes the transformation. |
Reimplemented from BGeometry.
| virtual BGeometry* Vectorize | ( | double | factor = 1.0 |
) | const [inline, virtual] |
Since a BPolyline is a simple geometry, this method will return a copy of this BPolyline.
| factor | The value used to adjust the number of points in the resulting BPolyline. This parameter is ignored for BPolyline objects. |
Implements BSegment.
BPoint m_centroid [protected] |
The centroid of this BPolyline.