Represents a cartesian 3D point. More...
#include <vgl_fwd.h>

Public Member Functions | |
| vgl_sphere_3d () | |
| Default constructor. More... | |
| vgl_sphere_3d (Type px, Type py, Type pz, Type rad) | |
| Construct from four scalars: centre and radius. More... | |
| vgl_sphere_3d (const Type v[4]) | |
| Construct from a 4-array, representing centre and radius. More... | |
| vgl_sphere_3d (vgl_point_3d< Type > const &cntr, Type rad) | |
| Construct from centre point and radius. More... | |
| bool | operator== (const vgl_sphere_3d< Type > &s) const |
| Test for equality. More... | |
| bool | operator!= (vgl_sphere_3d< Type >const &s) const |
| Test for inequality. More... | |
| const vgl_point_3d< Type > & | centre () const |
| Type | radius () const |
| bool | is_empty () const |
| Return true if this sphere is empty. More... | |
| bool | contains (vgl_point_3d< Type > const &p) const |
| Return true iff the point p is inside (or on) this sphere. More... | |
| void | set_empty () |
| Make the sphere empty. More... | |
| void | set_radius (Type r) |
| Set radius r of this sphere (while centre unchanged). More... | |
| void | set_centre (const vgl_point_3d< Type > &c) |
| Set centre of this sphere to c (while radius unchanged). More... | |
| bool | clip (const vgl_line_3d_2_points< Type > &line, vgl_point_3d< Type > &p1, vgl_point_3d< Type > &p2) const |
| Calculate the end points of a line clipped by this sphere. More... | |
| void | spherical_to_cartesian (Type elevation_rad, Type azimuth_rad, Type &x, Type &y, Type &z) const |
| convert point on sphere to Cartesian coordinates, angles in radians. More... | |
| void | spherical_to_cartesian (Type elevation_rad, Type azimuth_rad, vgl_point_3d< Type > &pt) const |
| void | cartesian_to_spherical (Type x, Type y, Type z, Type &elevation_rad, Type &azimuth_rad) const |
| find elevation and azimuth of closest point on the sphere to x,y,z. More... | |
| void | cartesian_to_spherical (vgl_point_3d< Type > const &pt, Type &elevation_rad, Type &azimuth_rad) const |
| std::ostream & | print (std::ostream &os) const |
| Writes "<vgl_sphere_3d centre=vgl_point_3d<x,y,z> radius=r)>" to stream. More... | |
| std::istream & | read (std::istream &is) |
| Read from stream, possibly with formatting. More... | |
Private Attributes | |
| vgl_point_3d< Type > | c_ |
| centre More... | |
| Type | r_ |
| radius More... | |
Represents a cartesian 3D point.
|
inline |
Default constructor.
Definition at line 27 of file vgl_sphere_3d.h.
|
inline |
Construct from four scalars: centre and radius.
Definition at line 30 of file vgl_sphere_3d.h.
|
inline |
Construct from a 4-array, representing centre and radius.
Definition at line 33 of file vgl_sphere_3d.h.
|
inline |
Construct from centre point and radius.
Definition at line 36 of file vgl_sphere_3d.h.
| void vgl_sphere_3d< Type >::cartesian_to_spherical | ( | Type | x, |
| Type | y, | ||
| Type | z, | ||
| Type & | elevation_rad, | ||
| Type & | azimuth_rad | ||
| ) | const |
find elevation and azimuth of closest point on the sphere to x,y,z.
Definition at line 121 of file vgl_sphere_3d.hxx.
| void vgl_sphere_3d< Type >::cartesian_to_spherical | ( | vgl_point_3d< Type > const & | pt, |
| Type & | elevation_rad, | ||
| Type & | azimuth_rad | ||
| ) | const |
Definition at line 128 of file vgl_sphere_3d.hxx.
|
inline |
Definition at line 45 of file vgl_sphere_3d.h.
| bool vgl_sphere_3d< Type >::clip | ( | const vgl_line_3d_2_points< Type > & | line, |
| vgl_point_3d< Type > & | p1, | ||
| vgl_point_3d< Type > & | p2 | ||
| ) | const |
Calculate the end points of a line clipped by this sphere.
| bool vgl_sphere_3d< Type >::contains | ( | vgl_point_3d< Type > const & | p | ) | const |
Return true iff the point p is inside (or on) this sphere.
|
inline |
Return true if this sphere is empty.
Definition at line 49 of file vgl_sphere_3d.h.
|
inline |
Test for inequality.
Definition at line 41 of file vgl_sphere_3d.h.
|
inline |
Test for equality.
Definition at line 39 of file vgl_sphere_3d.h.
| std::ostream& vgl_sphere_3d< Type >::print | ( | std::ostream & | os | ) | const |
Writes "<vgl_sphere_3d centre=vgl_point_3d<x,y,z> radius=r)>" to stream.
|
inline |
Definition at line 46 of file vgl_sphere_3d.h.
| std::istream& vgl_sphere_3d< Type >::read | ( | std::istream & | is | ) |
Read from stream, possibly with formatting.
Either just reads 4 blank-separated numbers, or reads 4 comma-separated numbers, or reads 4 numbers in parenthesized form "(123, 321, 567, 890)"
|
inline |
Set centre of this sphere to c (while radius unchanged).
Definition at line 62 of file vgl_sphere_3d.h.
|
inline |
Make the sphere empty.
Definition at line 57 of file vgl_sphere_3d.h.
|
inline |
Set radius r of this sphere (while centre unchanged).
Definition at line 60 of file vgl_sphere_3d.h.
| void vgl_sphere_3d< Type >::spherical_to_cartesian | ( | Type | elevation_rad, |
| Type | azimuth_rad, | ||
| Type & | x, | ||
| Type & | y, | ||
| Type & | z | ||
| ) | const |
convert point on sphere to Cartesian coordinates, angles in radians.
Definition at line 96 of file vgl_sphere_3d.hxx.
| void vgl_sphere_3d< Type >::spherical_to_cartesian | ( | Type | elevation_rad, |
| Type | azimuth_rad, | ||
| vgl_point_3d< Type > & | pt | ||
| ) | const |
Definition at line 112 of file vgl_sphere_3d.hxx.
|
private |
centre
Definition at line 20 of file vgl_sphere_3d.h.
|
private |
radius
Definition at line 21 of file vgl_sphere_3d.h.
1.8.15