Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larcorealg
larcorealg
GeoAlgo
GeoCone.cxx
Go to the documentation of this file.
1
#include "
larcorealg/GeoAlgo/GeoAlgoException.h
"
// for GeoAlgoException
2
#include "
larcorealg/GeoAlgo/GeoCone.h
"
3
4
#include <math.h>
5
#include <sstream>
6
7
namespace
geoalgo
{
8
9
Cone::Cone
() :
HalfLine
()
10
{
11
_length
= 1;
12
_radius
= 1;
13
_angle
= atan(
_radius
/
_length
);
14
}
15
16
Cone::Cone
(
const
double
x
,
const
double
y
,
const
double
z
,
17
const
double
dirx,
const
double
diry,
const
double
dirz,
18
const
double
length,
const
double
radius)
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
}
31
32
Cone::Cone
(
const
Point_t
& start,
const
Vector_t
&
dir
,
33
const
double
length,
const
double
radius)
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
}
46
47
double
Cone::Length
()
const
{
return
_length
; }
48
49
double
Cone::Radius
()
const
{
return
_radius
; }
50
51
double
Cone::Angle
()
const
{
return
_angle
; }
52
53
void
Cone::Length
(
const
double
l
)
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
}
64
65
void
Cone::Radius
(
const
double
r
) {
_radius
=
r
;
_angle
= atan(
_radius
/
_length
); }
66
}
geoalgo::Cone::_radius
double _radius
Radius of the cone at the base.
Definition:
GeoCone.h:62
msg
void msg(const char *fmt,...)
Definition:
message.cpp:107
geoalgo::Cone::_angle
double _angle
Opening Angle.
Definition:
GeoCone.h:63
geoalgo::Cone::_length
double _length
Helight (length) of the cone.
Definition:
GeoCone.h:61
GeoAlgoException.h
Class def header for a class GeoAlgoException.
geoalgo::Cone::Length
double Length() const
Length getter.
Definition:
GeoCone.cxx:47
dir
string dir
Definition:
INukeNucleonCorr.cxx:61
GeoCone.h
Class def header for a class HalfLine.
l
static QStrList * l
Definition:
config.cpp:1044
makePolycone.z
z
Definition:
makePolycone.py:153
geoalgo::Cone::Cone
Cone()
Default constructor.
Definition:
GeoCone.cxx:9
wirecell.validate.cmaps.y
y
Definition:
cmaps.py:73
geoalgo::HalfLine
Representation of a 3D semi-infinite line. Defines a semi-infinite 3D line by having a start point (P...
Definition:
GeoHalfLine.h:30
geoalgo
Definition:
GeoAABox.cxx:4
geoalgo::Cone::Angle
double Angle() const
Angle getter.
Definition:
GeoCone.cxx:51
train.x
list x
Definition:
train.py:276
geoalgo::Cone::Radius
double Radius() const
Length getter.
Definition:
GeoCone.cxx:49
geoalgo::Vector
Definition:
GeoVector.h:33
geoalgo::GeoAlgoException
Definition:
GeoAlgoException.h:27
plot_model.r
r
Definition:
plot_model.py:57
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11