| Class Overview |
Creates a new BShape object. The first form of the BShape constructor
creates an empty shape. The second form, which accepts another BShape as
an argument, copies that shape into the new one. The third form
reconstructs a BShape from an archive.
status_t AddShape(const BShape* otherShape);
AddShape() adds the lines and curves that comprise the
otherShape to the shape.
| Return Code | Description |
|---|---|
| No error. |
Other errors. | None are defined at this time, but you should always check for errors returned by this function. |
virtual Archive(BMessage* archive,
bool deep = true) const;
Stores the BShape in the
BMessage archive.
See also:
BArchivable::Archive(),
Instantiate()
static function
status_t BezierTo(BPoint controlPoints[3]);
Adds a command to the BShape that represents a Beziér curve that begins
at the current coordinates and is constructed using the specified control
points.
| Return Code | Description |
|---|---|
| No error. |
Other errors. | None are defined at this time, but you should always check for errors returned by this function. |
BRect Bounds() const;
Bounds() returns the bounds rectangle of the entire shape; this rectangle
encloses all the lines and Beziér curves that comprise the shape.
void Clear();
Clear() deletes all the lines and Beziér curves that comprise the shape,
leaving it empty.
void Close();
Close() should be called when the shape has been fully-constructed by
calls to the
BezierTo(),
LineTo(), and
MoveTo() functions.
| Return Code | Description |
|---|---|
| No error. |
Other errors. | None are defined at this time, but you should always check for errors returned by this function. |
status_t LineTo(BPoint point);
Adds a "draw line" command to the BShape. A line will be drawn from the
previous coordinates to the specified coordinates.
| Return Code | Description |
|---|---|
| No error. |
Other errors. | None are defined at this time, but you should always check for errors returned by this function. |
status_t MoveTo(BPoint point);
Adds a "move to" command to the BShape. The next
LineTo() or
BezierTo()
will begin at this point. This lets you create noncontiguous shapes.
| Return Code | Description |
|---|---|
| No error. |
Other errors. | None are defined at this time, but you should always check for errors returned by this function. |
static BArchivable* Instantiate(BMessage* archive);
Returns a new BShape object, allocated by new and created with the
version of the constructor that takes a BMessage archive. However, if the
archive message doesn't contain data for a BShape object, the return
value will be NULL.