Public Member Functions | Protected Attributes | List of all members
geoalgo::Cone Class Reference

Representation of a 3D semi-infinite line. Defines a 3D cone with the following properties:
Start point (or vertex), Direction, Length (or Length), Radius, opening angle
When 2 of Length, Radius, opening angle are defined the third is automatically set. More...

#include <GeoCone.h>

Inheritance diagram for geoalgo::Cone:
geoalgo::HalfLine

Public Member Functions

 Cone ()
 Default constructor. More...
 
virtual ~Cone ()
 Default destructor. More...
 
 Cone (const double x, const double y, const double z, const double dirx, const double diry, const double dirz, const double length, const double radius)
 Alternative ctor (1) More...
 
 Cone (const Point_t &start, const Vector_t &dir, const double length, const double radius)
 Alternative ctor (2) More...
 
double Length () const
 Length getter. More...
 
double Radius () const
 Length getter. More...
 
double Angle () const
 Angle getter. More...
 
void Length (const double l)
 Length setter. More...
 
void Radius (const double r)
 Radius setter. More...
 
template<class T , class U >
 Cone (const T &start, const U &dir)
 Alternative ctor using template (3) More...
 
- Public Member Functions inherited from geoalgo::HalfLine
 HalfLine ()
 Default constructor. More...
 
virtual ~HalfLine ()
 Default destructor. More...
 
 HalfLine (const double x, const double y, const double z, const double dirx, const double diry, const double dirz)
 Alternative ctor (1) More...
 
 HalfLine (const Point_t &start, const Vector_t &dir)
 Altenartive ctor (2) More...
 
const Point_tStart () const
 Start getter. More...
 
const Vector_tDir () const
 Direction getter. More...
 
void Start (const double x, const double y, const double z)
 Start setter. More...
 
void Dir (const double x, const double y, const double z)
 Dir setter. More...
 
void Start (const TVector3 &pt)
 Start setter. More...
 
void Dir (const TVector3 &dir)
 Dir setter. More...
 
template<class T , class U >
 HalfLine (const T &start, const U &dir)
 Alternative ctor using template (3) More...
 
template<class T >
void Start (const T &pos)
 Start setter template. More...
 
template<class T >
void Dir (const T &dir)
 Dir setter template. More...
 

Protected Attributes

double _length
 Helight (length) of the cone. More...
 
double _radius
 Radius of the cone at the base. More...
 
double _angle
 Opening Angle. More...
 
- Protected Attributes inherited from geoalgo::HalfLine
Point_t _start
 Beginning of the half line. More...
 
Vector_t _dir
 Direction of the half line from _start. More...
 

Additional Inherited Members

- Protected Member Functions inherited from geoalgo::HalfLine
void Normalize ()
 Normalize direction. More...
 

Detailed Description

Representation of a 3D semi-infinite line. Defines a 3D cone with the following properties:
Start point (or vertex), Direction, Length (or Length), Radius, opening angle
When 2 of Length, Radius, opening angle are defined the third is automatically set.

Definition at line 27 of file GeoCone.h.

Constructor & Destructor Documentation

geoalgo::Cone::Cone ( )

Default constructor.

Definition at line 9 of file GeoCone.cxx.

9  : HalfLine()
10  {
11  _length = 1;
12  _radius = 1;
13  _angle = atan(_radius/_length);
14  }
double _radius
Radius of the cone at the base.
Definition: GeoCone.h:62
double _angle
Opening Angle.
Definition: GeoCone.h:63
double _length
Helight (length) of the cone.
Definition: GeoCone.h:61
HalfLine()
Default constructor.
Definition: GeoHalfLine.cxx:5
virtual geoalgo::Cone::~Cone ( )
inlinevirtual

Default destructor.

Definition at line 35 of file GeoCone.h.

35 {};
geoalgo::Cone::Cone ( const double  x,
const double  y,
const double  z,
const double  dirx,
const double  diry,
const double  dirz,
const double  length,
const double  radius 
)

Alternative ctor (1)

Definition at line 16 of file GeoCone.cxx.

19  : HalfLine(x, y, z, dirx, diry, dirz)
20  {
21  if (length == 0){
22  std::ostringstream msg;
23  msg << "<<" << __FUNCTION__ << ">>"
24  << " Cone Length cannot be 0." << std::endl;
25  throw GeoAlgoException(msg.str());
26  }
27  _length = length;
28  _radius = radius;
29  _angle = atan(_radius/_length);
30  }
double _radius
Radius of the cone at the base.
Definition: GeoCone.h:62
void msg(const char *fmt,...)
Definition: message.cpp:107
double _angle
Opening Angle.
Definition: GeoCone.h:63
double _length
Helight (length) of the cone.
Definition: GeoCone.h:61
HalfLine()
Default constructor.
Definition: GeoHalfLine.cxx:5
list x
Definition: train.py:276
QTextStream & endl(QTextStream &s)
geoalgo::Cone::Cone ( const Point_t start,
const Vector_t dir,
const double  length,
const double  radius 
)

Alternative ctor (2)

Definition at line 32 of file GeoCone.cxx.

34  : HalfLine( start, dir )
35  {
36  if (length == 0){
37  std::ostringstream msg;
38  msg << "<<" << __FUNCTION__ << ">>"
39  << " Cone Length cannot be 0." << std::endl;
40  throw GeoAlgoException(msg.str());
41  }
42  _length = length;
43  _radius = radius;
44  _angle = atan(_radius/_length);
45  }
double _radius
Radius of the cone at the base.
Definition: GeoCone.h:62
void msg(const char *fmt,...)
Definition: message.cpp:107
double _angle
Opening Angle.
Definition: GeoCone.h:63
double _length
Helight (length) of the cone.
Definition: GeoCone.h:61
string dir
HalfLine()
Default constructor.
Definition: GeoHalfLine.cxx:5
QTextStream & endl(QTextStream &s)
template<class T , class U >
geoalgo::Cone::Cone ( const T &  start,
const U &  dir 
)
inline

Alternative ctor using template (3)

Definition at line 70 of file GeoCone.h.

71  : Cone(Point_t(start), Vector_t(dir))
72  {}
string dir
Cone()
Default constructor.
Definition: GeoCone.cxx:9
Vector Point_t
Definition: GeoVector.h:196
Vector Vector_t
Point has same feature as Vector.
Definition: GeoVector.h:195

Member Function Documentation

double geoalgo::Cone::Angle ( ) const

Angle getter.

Definition at line 51 of file GeoCone.cxx.

51 { return _angle; }
double _angle
Opening Angle.
Definition: GeoCone.h:63
double geoalgo::Cone::Length ( ) const

Length getter.

Definition at line 47 of file GeoCone.cxx.

47 { return _length; }
double _length
Helight (length) of the cone.
Definition: GeoCone.h:61
void geoalgo::Cone::Length ( const double  l)

Length setter.

Definition at line 53 of file GeoCone.cxx.

54  {
55  if (l == 0){
56  std::ostringstream msg;
57  msg << "<<" << __FUNCTION__ << ">>"
58  << " Cone Length cannot be 0." << std::endl;
59  throw GeoAlgoException(msg.str());
60  }
61  _length = l;
62  _angle = atan(_radius/_length);
63  }
double _radius
Radius of the cone at the base.
Definition: GeoCone.h:62
void msg(const char *fmt,...)
Definition: message.cpp:107
double _angle
Opening Angle.
Definition: GeoCone.h:63
double _length
Helight (length) of the cone.
Definition: GeoCone.h:61
static QStrList * l
Definition: config.cpp:1044
QTextStream & endl(QTextStream &s)
double geoalgo::Cone::Radius ( ) const

Length getter.

Definition at line 49 of file GeoCone.cxx.

49 { return _radius; }
double _radius
Radius of the cone at the base.
Definition: GeoCone.h:62
void geoalgo::Cone::Radius ( const double  r)

Radius setter.

Definition at line 65 of file GeoCone.cxx.

65 { _radius = r; _angle = atan(_radius/_length); }
double _radius
Radius of the cone at the base.
Definition: GeoCone.h:62
double _angle
Opening Angle.
Definition: GeoCone.h:63
double _length
Helight (length) of the cone.
Definition: GeoCone.h:61

Member Data Documentation

double geoalgo::Cone::_angle
protected

Opening Angle.

Definition at line 63 of file GeoCone.h.

double geoalgo::Cone::_length
protected

Helight (length) of the cone.

Definition at line 61 of file GeoCone.h.

double geoalgo::Cone::_radius
protected

Radius of the cone at the base.

Definition at line 62 of file GeoCone.h.


The documentation for this class was generated from the following files: