Diffpack Documentation

(Functionality not available, requires installation of an additional Diffpack Toolbox)


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

Disks Class Reference

description of n geometric objects of disk shape. More...

#include <Disks.h>

List of all members.

Public Methods

 Disks ()
 ~Disks ()
void scan (const String &init_str)
void setDisks (const VecSimple(Ptv(real)) &centers, real radius)
void addDisks (const VecSimple(Ptv(real)) &centers, 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)


Detailed Description

description of n geometric objects of disk shape.

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.


Constructor & Destructor Documentation

Disks::Disks ( ) [inline]
 

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".

Disks::~Disks ( ) [inline]
 


Member Function Documentation

void Disks::addDisks ( const VecSimple(Ptv(real)) & centers,
real radius )
 

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".

bool Disks::isInside ( const Ptv(real) & pt,
int & disk_no ) const
 

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.

real Disks::minDistance ( const Ptv(real) & pt,
int & disk_no ) const
 

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".

void Disks::print ( Os os )
 

See documentation of one of the overloaded functions.

void Disks::print ( Os os,
int disk_no )
 

prints a disk in the format "(0,3)->4.23".

void Disks::scan ( const String & init_str )
 

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
This string initializes 3 ("n=3") 2D ("d=2") disks. A comment not containing "=" can preceed the string. Only the "=", "(", "," and ">" are significant when interpreting the string. A shpere in 3D, centered at the point (1,2,0) with radius 0.5 has the syntax "(1,2,0)->0.5".

void Disks::setDisks ( const VecSimple(Ptv(real)) & centers,
real radius )
 

alternative to "scan" for setting the center points and radii. Only a common radius for all disks is possible.


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.