#include <BDonut.h>

For example, a Donut could be used to represent a lake that has islands in it.
Public Member Functions | |
| void | AddHole (const BAreaGeoPtr &pHole) |
| Adds a hole to this BDonut. | |
| BDonut (const BDonut &p) | |
| Copy constructor. | |
| BDonut (EOrientation orientation) | |
| Constructor. | |
| BDonut () | |
| Default constructor. | |
| virtual BGeometry * | Clone (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. | |
| BAggregateAreaPtr | Flatten (void) const |
| Flattens this BDonut. | |
| virtual void | FromByteArray (const BByteArray &bytes, size_t &startPos) |
| Initializes an instance of this object from a BByteArray. | |
| const BAreaGeoPtr | GetHoleAt (size_t index) const |
| Gets the hole associated with the specified index. | |
| BAreaGeoPtr | GetHoleAt (size_t index) |
| Gets the hole associated with the specified index. | |
| size_t | GetHoleCount (void) const |
| Get the number of holes that have been added to this BDonut. | |
| virtual size_t | GetPointCount (void) const |
| Get the total number of points in this donut. | |
| BAreaGeoPtr | GetShell (void) |
| Gets the outer shell of this BDonut. | |
| const BAreaGeoPtr | GetShell (void) const |
| Gets the outer shell of this BDonut. | |
| bool | HasShell (void) const |
| Indicate whether or not this BDonut has a shell. | |
| virtual bool | Intersects (const BRect &rect) const |
| Determines whether or not this BGeometry intersects the specified rectangle. | |
| virtual bool | IsClosed (void) const |
| Indicates whether or not this is a "closed" geometry. | |
| void | SetShell (const BAreaGeoPtr &pArea) |
| Sets the outer shell of the donut. | |
| 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 | ~BDonut () |
| 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. | |
| bool | ContainsAll (const BPoints &points) const |
| Indicates whether or not the shell contains all of the points in the specified collection. | |
| bool | ContainsArea (const BAreaGeoPtr &pArea) const |
| Indicates whether or not the shell completely contains the specified BAreaGeo object. | |
Protected Attributes | |
| BAggregateArea | m_holes |
| The collection of BAreaGeo objects that define the holes. | |
| BAreaGeoPtr | m_pShell |
| The outer shell. | |
| BDonut | ( | ) | [inline] |
Default constructor.
| BDonut | ( | EOrientation | orientation | ) | [inline] |
| virtual ~BDonut | ( | ) | [inline, virtual] |
Destructor.
| void AddHole | ( | const BAreaGeoPtr & | pHole | ) |
Adds a hole to this BDonut.
The orientation of the hole must be the opposite of the orientation for this BDonut, which is the same as the orientation of the shell.
| pHole | A BAreaGeo that represents the hole. |
| BUnknownGeometryException | This exception will be thrown if the orientation of the hole is the same as the orientation for the BDonut. |
| virtual BGeometry* Clone | ( | void | ) | const [inline, virtual] |
| virtual BRect ComputeMBR | ( | ) | const [protected, virtual] |
| virtual size_t ComputeSize | ( | void | ) | const [virtual] |
Computes the size of the BByteArray required to store this object.
Reimplemented from BAreaGeo.
| virtual void ComputeStats | ( | ) | const [protected, virtual] |
| virtual bool Contains | ( | const BPoint & | point | ) | const [virtual] |
| bool ContainsAll | ( | const BPoints & | points | ) | const [protected] |
Indicates whether or not the shell contains all of the points in the specified collection.
| points | The points to test for containment. |
| bool ContainsArea | ( | const BAreaGeoPtr & | pArea | ) | const [protected] |
| virtual double DistanceTo | ( | const BPoint & | point | ) | const [virtual] |
| virtual void DoResolveToPoint | ( | const BPoint & | refPt | ) | [virtual] |
| BAggregateAreaPtr Flatten | ( | void | ) | const |
Flattens this BDonut.
Returns a BAggregateArea that contains only primitive geometries. Any aggregates (e.g. BAggregateArea or BDonut) will be flattened, and their geometries added to this collection.
| 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 for this 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 BAreaGeoPtr GetHoleAt | ( | size_t | index | ) | const [inline] |
Gets the hole associated with the specified index.
| index | The zero-based index for the desired hole. |
| BAreaGeoPtr GetHoleAt | ( | size_t | index | ) | [inline] |
Gets the hole associated with the specified index.
| index | The zero-based index for the desired hole. |
| size_t GetHoleCount | ( | void | ) | const [inline] |
| virtual size_t GetPointCount | ( | void | ) | const [virtual] |
Get the total number of points in this donut.
The point count includes all points in the shell and holes.
| BAreaGeoPtr GetShell | ( | void | ) | [inline] |
| const BAreaGeoPtr GetShell | ( | void | ) | const [inline] |
| bool HasShell | ( | void | ) | const [inline] |
Indicate whether or not this BDonut has a shell.
| virtual bool Intersects | ( | const BRect & | rect | ) | const [virtual] |
| virtual bool IsClosed | ( | void | ) | const [inline, virtual] |
| void SetShell | ( | const BAreaGeoPtr & | pArea | ) |
Sets the outer shell of the donut.
If the orientation for the BDonut has been set, then the orientation of the shell must be the same as the orientation of the BDonut. If the orientation for the BDonut has not yet been set, then it will be set to the orientation of the shell.
| pArea | The area that represents the outer shell of the BDonut. The orientation for this area must be the same as the orientation of the BDonut. |
| BUnknownGeometryException | This exception will be thrown if the orientation of this BDonut has been set and the orientation of the shell is different than the orientation of the BDonut. |
| virtual BByteArray ToByteArray | ( | void | ) | const [virtual] |
Stores this object in a BByteArray.
Reimplemented from BAreaGeo.
| 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.
BAggregateArea m_holes [protected] |
The collection of BAreaGeo objects that define the holes.
BAreaGeoPtr m_pShell [protected] |
The outer shell.