Class to represent a circle.
More...
|
static | create ($shape, $coordsstring) |
| Creates a new shape of the specified type.
|
|
static | exists ($shape) |
| Checks if the passed shape exists.
|
|
static | human_readable_coords_format () |
|
static | human_readable_name ($lowercase=false) |
| Return a human readable name of the shape.
|
|
static | name () |
| Returns the name of the shape.
|
|
static | shape_options () |
|
|
bool | $error = false |
| Indicates if there is an error.
|
|
int | $radius |
| Radius of circle.
|
|
int | $xcentre |
| X center.
|
|
int | $ycentre |
| Y center.
|
|
|
static string | $classnameprefix = 'qtype_ddmarker_shape_' |
| The shape class prefix.
|
|
Class to represent a circle.
- Copyright
- 2012 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
qtype_ddmarker_shape_circle::__construct |
( |
| $coordsstring | ) |
|
◆ center_point()
qtype_ddmarker_shape_circle::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_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_circle::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
-
◆ outlying_coords_to_test()
qtype_ddmarker_shape_circle::outlying_coords_to_test |
( |
| ) |
|
|
protected |
The documentation for this class was generated from the following file:
- question/type/ddmarker/shapes.php