#include <Disks.h>
Public Methods | |
| Disks () | |
| ~Disks () | |
| void | scan (const String &init_str) |
| void | setDisks (const VecSimple(Ptv(real)) ¢ers, real radius) |
| void | addDisks (const VecSimple(Ptv(real)) ¢ers, real radius) |
| bool | isInside (const Ptv(real) &pt, int &disk_no) const |
| real | minDistance (const Ptv(real) &pt, int &disk_no) const |
| void | print (Os os, int disk_no) |
| void | print (Os os) |
NAME: Disks - description of n geometric objects of disk shape
DESCRIPTION:
The class offers a user-friendly interface to operations on a set of disks. I disk in 1D is an interval (see class "Interval"), a circle in 2D, a sphere in 3D and an n-ball in higher dimensions.
|
|
Initialization is performed in "scan", by reading a string with a special syntax, or in the "setDisks"2 function, or by a combination of "scan" and "addDisks". |
|
|
|
|
|
appends disks to the disks already present in the "Disks" object. One can, for example, read disks from the menu by using "scan" and thereafter add new disks by calling "addDisks". |
|
|
returns "true" if the point "pt" is inside any of the disks. The no of the disk that contains the point "pt" is returned in the "disk_no" argument. If the point can be inside several disks, "disk_no" corresponds to the first disk that contains the point. |
|
|
returns the minimum distance between an arbitrary point "pt" and the center points of the disks. The disk number that led to the minimum distance is returned in "disk_no". |
|
|
See documentation of one of the overloaded functions. |
|
|
prints a disk in the format "(0,3)->4.23". |
|
|
reads and initializes the class. The string to be read must have the following syntax:
d=2 n=3 (0,1)->4 (-1,-0.2)->4.8 (10,10) -> -6.1
|
|
|
alternative to "scan" for setting the center points and radii. Only a common radius for all disks is possible. |