Class to represent a polygon.
More...
|
static | create ($shape, $coordsstring) |
| Creates a new shape of the specified type. More...
|
|
static | exists ($shape) |
| Checks if the passed shape exists. More...
|
|
static | human_readable_coords_format () |
|
static | human_readable_name ($lowercase=false) |
| Return a human readable name of the shape. More...
|
|
static | name () |
| Returns the name of the shape. More...
|
|
static | shape_options () |
|
|
array | $coords |
| Arrary of xy coords where xy coords are also in a two element array [x,y].
|
|
|
bool | $error = false |
| Indicates if there is an error.
|
|
array | $maxxy |
| max x and y coords in a two element array [x,y].
|
|
array | $minxy |
| min x and y coords in a two element array [x,y].
|
|
|
static string | $classnameprefix = 'qtype_ddmarker_shape_' |
| The shape class prefix.
|
|
Class to represent a polygon.
- Copyright
- 2012 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ center_point()
qtype_ddmarker_shape_polygon::center_point |
( |
| ) |
|
◆ create()
static qtype_ddmarker_shape::create |
( |
|
$shape, |
|
|
|
$coordsstring |
|
) |
| |
|
staticinherited |
Creates a new shape of the specified type.
- Parameters
-
string | $shape | The shape to create |
string | $coordsstring | The string describing the coordinates |
- Return values
-
◆ exists()
static qtype_ddmarker_shape::exists |
( |
|
$shape | ) |
|
|
staticinherited |
Checks if the passed shape exists.
- Parameters
-
string | $shape | The shape name |
- Return values
-
◆ get_coords_interpreter_error()
qtype_ddmarker_shape::get_coords_interpreter_error |
( |
| ) |
|
|
inherited |
Gets any coordinate error.
- Return values
-
string|bool | String of the error or false if there is no error |
◆ human_readable_name()
static qtype_ddmarker_shape::human_readable_name |
( |
|
$lowercase = false | ) |
|
|
staticinherited |
Return a human readable name of the shape.
- Parameters
-
bool | $lowercase | True if it should be lowercase. |
- Return values
-
◆ is_left()
Tests if a point is left / on / right of an infinite line.
- Parameters
-
- Return values
-
number | > 0 if the point is left of the line. = 0 if the point is on the line. < 0 if the point is right of the line. |
◆ is_only_numbers()
qtype_ddmarker_shape::is_only_numbers |
( |
| ) |
|
|
protectedinherited |
Test if all passed parameters consist of only numbers.
- Return values
-
◆ is_point_in_bounding_box()
qtype_ddmarker_shape::is_point_in_bounding_box |
( |
|
$pointxy, |
|
|
|
$xleftytop, |
|
|
|
$xrightybottom |
|
) |
| |
|
protectedinherited |
Checks if the point is within the bounding box made by top left and bottom right.
- Parameters
-
array | $pointxy | Array of the point (x, y) |
array | $xleftytop | Top left point of bounding box |
array | $xrightybottom | Bottom left point of bounding box |
- Return values
-
◆ is_point_in_shape()
qtype_ddmarker_shape_polygon::is_point_in_shape |
( |
|
$xy | ) |
|
Check if the location is within the shape.
- Parameters
-
array | $xy | $xy[0] is x, $xy[1] is y |
- Return values
-
boolean | is point inside shape |
Reimplemented from qtype_ddmarker_shape.
◆ name()
static qtype_ddmarker_shape::name |
( |
| ) |
|
|
staticinherited |
Returns the name of the shape.
- Return values
-
The documentation for this class was generated from the following file: