polygon
m_status = polygon;
case polygon:
void StrokePolygon(const BPolygon* polygon,
void StrokePolygon(const BPolygon* polygon,
void FillPolygon(const BPolygon* polygon,
void FillPolygon(const BPolygon* polygon,
SpiderSaver::_DrawPolygon(Polygon* polygon, BView* view)
int32 pointCount = polygon->CountPoints();
BPoint p = polygon->PointAt(0);
view->StrokeLine(polygon->PointAt(i));
void _DrawPolygon(Polygon* polygon, BView *view);
BView::StrokePolygon(const BPolygon* polygon, bool closed, ::pattern pattern)
if (polygon == NULL)
StrokePolygon(polygon->fPoints, polygon->fCount, polygon->Frame(), closed,
BPolygon polygon(pointArray, numPoints);
polygon.MapTo(polygon.Frame(), bounds);
polygon.fCount * sizeof(BPoint) + sizeof(BRect) + sizeof(bool)
fOwner->fLink->Attach<BRect>(polygon.Frame());
fOwner->fLink->Attach<int32>(polygon.fCount);
fOwner->fLink->Attach(polygon.fPoints, polygon.fCount * sizeof(BPoint));
BView::StrokePolygon(const BPolygon* polygon, bool closed, const BGradient& gradient)
if (polygon == NULL)
StrokePolygon(polygon->fPoints, polygon->fCount, polygon->Frame(), closed,
BPolygon polygon(pointArray, numPoints);
polygon.MapTo(polygon.Frame(), bounds);
polygon.fCount * sizeof(BPoint) + sizeof(BRect) + sizeof(bool)
fOwner->fLink->Attach<BRect>(polygon.Frame());
fOwner->fLink->Attach<int32>(polygon.fCount);
fOwner->fLink->Attach(polygon.fPoints, polygon.fCount * sizeof(BPoint));
BView::FillPolygon(const BPolygon* polygon, ::pattern pattern)
if (polygon == NULL
|| polygon->fCount <= 2
polygon->fCount * sizeof(BPoint) + sizeof(BRect) + sizeof(int32))
fOwner->fLink->Attach<BRect>(polygon->Frame());
fOwner->fLink->Attach<int32>(polygon->fCount);
fOwner->fLink->Attach(polygon->fPoints,
polygon->fCount * sizeof(BPoint));
BView::FillPolygon(const BPolygon* polygon, const BGradient& gradient)
if (polygon == NULL
|| polygon->fCount <= 2
polygon->fCount * sizeof(BPoint) + sizeof(BRect) + sizeof(int32))
fOwner->fLink->Attach<BRect>(polygon->Frame());
fOwner->fLink->Attach<int32>(polygon->fCount);
fOwner->fLink->Attach(polygon->fPoints,
polygon->fCount * sizeof(BPoint));
BPolygon polygon(pointArray, numPoints);
polygon.MapTo(polygon.Frame(), bounds);
FillPolygon(&polygon, pattern);
BPolygon polygon(pointArray, numPoints);
polygon.MapTo(polygon.Frame(), bounds);
FillPolygon(&polygon, gradient);
m_status = polygon;
case polygon:
m_status = polygon;
case polygon:
m_status = polygon;
m_status = polygon;
m_status = polygon;
TestView::_FillBitmap(point* polygon)
pointList[0].x = polygon[0].x;
pointList[0].y = polygon[0].y;
pointList[1].x = polygon[1].x;
pointList[1].y = polygon[1].y;
pointList[2].x = polygon[2].x;
pointList[2].y = polygon[2].y;
pointList[3].x = polygon[3].x;
pointList[3].y = polygon[3].y;
TestView::_InitPolygon(const BRect& b, point* polygon) const
polygon[0].x = b.left;
polygon[0].y = b.top;
polygon[0].direction_x = random_number_between(-SPEED, SPEED);
polygon[0].direction_y = random_number_between(-SPEED, SPEED);
polygon[0].velocity_x = 0.0;
polygon[0].velocity_y = 0.0;
polygon[1].x = b.right;
polygon[1].y = b.top;
polygon[1].direction_x = random_number_between(-SPEED, SPEED);
polygon[1].direction_y = random_number_between(-SPEED, SPEED);
polygon[1].velocity_x = 0.0;
polygon[1].velocity_y = 0.0;
polygon[2].x = b.right;
polygon[2].y = b.bottom;
polygon[2].direction_x = random_number_between(-SPEED, SPEED);
polygon[2].direction_y = random_number_between(-SPEED, SPEED);
polygon[2].velocity_x = 0.0;
polygon[2].velocity_y = 0.0;
polygon[3].x = b.left;
polygon[3].y = b.bottom;
polygon[3].direction_x = random_number_between(-SPEED, SPEED);
polygon[3].direction_y = random_number_between(-SPEED, SPEED);
polygon[3].velocity_x = 0.0;
polygon[3].velocity_y = 0.0;
TestView::_MorphPolygon(const BRect& b, point* polygon)
morph(&polygon[0].x, &polygon[0].direction_x, &polygon[0].velocity_x, b.left, b.right);
morph(&polygon[1].x, &polygon[1].direction_x, &polygon[1].velocity_x, b.left, b.right);
morph(&polygon[2].x, &polygon[2].direction_x, &polygon[2].velocity_x, b.left, b.right);
morph(&polygon[3].x, &polygon[3].direction_x, &polygon[3].velocity_x, b.left, b.right);
morph(&polygon[0].y, &polygon[0].direction_y, &polygon[0].velocity_y, b.top, b.bottom);
morph(&polygon[1].y, &polygon[1].direction_y, &polygon[1].velocity_y, b.top, b.bottom);
morph(&polygon[2].y, &polygon[2].direction_y, &polygon[2].velocity_y, b.top, b.bottom);
morph(&polygon[3].y, &polygon[3].direction_y, &polygon[3].velocity_y, b.top, b.bottom);
void _FillBitmap(point* polygon);
void _InitPolygon(const BRect& b, point* polygon) const;
void _MorphPolygon(const BRect& b, point* polygon);
BPolygon polygon;
polygon.AddPoints(p, 4);
BPolygon p = polygon;
init_polygon(const BRect& b, point* polygon)
polygon[0].x = b.left;
polygon[0].y = b.top;
polygon[0].direction_x = random_number_between(-SPEED, SPEED);
polygon[0].direction_y = random_number_between(-SPEED, SPEED);
polygon[1].x = b.right;
polygon[1].y = b.top;
polygon[1].direction_x = random_number_between(-SPEED, SPEED);
polygon[1].direction_y = random_number_between(-SPEED, SPEED);
polygon[2].x = b.right;
polygon[2].y = b.bottom;
polygon[2].direction_x = random_number_between(-SPEED, SPEED);
polygon[2].direction_y = random_number_between(-SPEED, SPEED);
polygon[3].x = b.left;
polygon[3].y = b.bottom;
polygon[3].direction_x = random_number_between(-SPEED, SPEED);
polygon[3].direction_y = random_number_between(-SPEED, SPEED);
morph_polygon(const BRect& b, point* polygon)
morph(&polygon[0].x, &polygon[0].direction_x, b.left, b.right);
morph(&polygon[1].x, &polygon[1].direction_x, b.left, b.right);
morph(&polygon[2].x, &polygon[2].direction_x, b.left, b.right);
morph(&polygon[3].x, &polygon[3].direction_x, b.left, b.right);
morph(&polygon[0].y, &polygon[0].direction_y, b.top, b.bottom);
morph(&polygon[1].y, &polygon[1].direction_y, b.top, b.bottom);
morph(&polygon[2].y, &polygon[2].direction_y, b.top, b.bottom);
morph(&polygon[3].y, &polygon[3].direction_y, b.top, b.bottom);
BPoint polygon[4];
message->FindPoint("point", 0, &polygon[0]) >= B_OK &&
message->FindPoint("point", 1, &polygon[1]) >= B_OK &&
message->FindPoint("point", 2, &polygon[2]) >= B_OK &&
message->FindPoint("point", 3, &polygon[3]) >= B_OK) {
_DrawClientPolygon(token, polygon);
WindowLayer::_DrawClientPolygon(int32 token, BPoint polygon[4])
layer->ConvertToTop(&polygon[0]);
layer->ConvertToTop(&polygon[1]);
layer->ConvertToTop(&polygon[2]);
layer->ConvertToTop(&polygon[3]);
fDrawingEngine->StrokeLine(polygon[0], polygon[1], layer->ViewColor());
fDrawingEngine->StrokeLine(polygon[1], polygon[2], layer->ViewColor());
fDrawingEngine->StrokeLine(polygon[2], polygon[3], layer->ViewColor());
fDrawingEngine->StrokeLine(polygon[3], polygon[0], layer->ViewColor());
void _DrawClientPolygon(int32 token, BPoint polygon[4]);