OHOS::Polygon

Overview

Related Modules:

Graphic

Description:

Defines a polygon, including vertex coordinates and the maximum number of vertices (defined by MAX_VERTEX_NUM).

Since:

1.0

Version:

1.0

Summary

Public Member Functions

Public Member Function Name

Description

Polygon ()

 

The default constructor used to create a Polygon instance.

Polygon (const Rect &rect)

 

A constructor used to construct a Polygon instance based on a rectangle.

Polygon (const Vector2< int16_t > vertexes, const uint8_t vertexNum)

 

A constructor used to create a Polygon instance based on the vertex coordinates and the number of coordinates.

~Polygon ()

 

A destructor used to delete the Polygon instance.

MakeAABB () const

Rect 

Obtains the minimum rectangle that can contain the polygon. All vertices of the polygon are inside this rectangle.

GetVertexNum () const

uint8_t 

Obtains the number of vertices of the polygon.

SetVertexNum (uint8_t vertexNum)

void 

Sets the number of vertices of a polygon.

operator new (size_t size)

void  

Overrides the new function.

operator delete (void *p)

void 

Overrides the delete function.

Static Public Attributes

Static Public Attribute Name

Description

MAX_VERTEX_NUM = 8