MarlinUtil
1.12.1
|
Definition of a LCCylinder describing a geometrical cylinder in 3D space. More...
#include <LCCylinder.h>
Public Member Functions | |
LCCylinder (LCVector3D point1, LCVector3D point2, double radius, bool endPlane=false) | |
Constructor from two points and a radius. More... | |
LCCylinder (double radius, LCVector3D point, LCVector3D axis, bool endPlane) | |
Constructor from one point, th Axis of the cylinder and the radius. More... | |
LCCylinder (const LCCylinder &cylinder) | |
Copy constructor. More... | |
~LCCylinder () | |
Destructor. More... | |
LCCylinder & | operator= (const LCCylinder &rhs) |
Assignment. More... | |
LCVector3D | startPoint () const |
startpoint of cylinder axis | |
LCVector3D | endPoint () const |
end point of cylinder axis | |
LCVector3D | axisDirection () const |
orientation of cylinder axis. More... | |
double | length () const |
length of cylinder axis | |
double | radius () const |
Radius of cylinder. More... | |
double | distance (const LCVector3D &point) const |
Distance of a point to the cylinder. More... | |
LCVector3D | projectPoint (const LCVector3D &point, int &code) const |
Projection of a point on to the surface of the cylinder. More... | |
bool | isInside (const LCVector3D &point) const |
Checks if a given point is inside the clyinder. More... | |
bool | operator== (const LCCylinder &rhs) const |
Test for equality. More... | |
bool | operator!= (const LCCylinder &rhs) const |
Test for inequality. More... | |
Protected Attributes | |
double | _radius |
bool | _endPlane |
LCVector3D | _axisSstartPoint |
LCVector3D | _axisEndPoint |
Definition of a LCCylinder describing a geometrical cylinder in 3D space.
LCCylinder::LCCylinder | ( | LCVector3D | point1, |
LCVector3D | point2, | ||
double | radius, | ||
bool | endPlane = false |
||
) |
Constructor from two points and a radius.
point1 | point1 is the start point of the cylinder axis |
point2 | point2 is the end point of the cylinder axis |
radius | radius is the radius of the xylinder |
endPlane | endPlane switches if cylinder is open or not |
LCCylinder::LCCylinder | ( | double | radius, |
LCVector3D | point, | ||
LCVector3D | axis, | ||
bool | endPlane | ||
) |
Constructor from one point, th Axis of the cylinder and the radius.
radius | radius of cylinder. |
point | point in the middle of the axis of the xylinder |
axis | axis is the orientation of the xylinder axis. the length of axis is the half length of the cylinder |
endPlane | endPlane switches if cylinder is open or not |
LCCylinder::LCCylinder | ( | const LCCylinder & | cylinder | ) |
Copy constructor.
cylinder | cylinder is an other LCCylinder. |
|
inline |
Destructor.
LCVector3D LCCylinder::axisDirection | ( | ) | const |
orientation of cylinder axis.
the return vector is normalised
Referenced by isInside(), and projectPoint().
double LCCylinder::distance | ( | const LCVector3D & | point | ) | const |
Distance of a point to the cylinder.
point | point is a point in space |
References projectPoint().
Referenced by SimpleHelix::getIntersectionWithCylinder(), and SimpleLine::getIntersectionWithCylinder().
bool LCCylinder::isInside | ( | const LCVector3D & | point | ) | const |
Checks if a given point is inside the clyinder.
point | point is a point in space. |
References axisDirection(), LCLine3D::distance(), LCLine3D::projectPoint(), and radius().
bool LCCylinder::operator!= | ( | const LCCylinder & | rhs | ) | const |
Test for inequality.
LCCylinder & LCCylinder::operator= | ( | const LCCylinder & | rhs | ) |
Assignment.
bool LCCylinder::operator== | ( | const LCCylinder & | rhs | ) | const |
Test for equality.
LCVector3D LCCylinder::projectPoint | ( | const LCVector3D & | point, |
int & | code | ||
) | const |
Projection of a point on to the surface of the cylinder.
point | point is a point in space. |
code | code gives an integer code for the type of area the point gets projected to: 0 : No projection possible (point is not normal above the surface) 1 : prjection hits plane at start point ( startPoint() ) 2 : prjection hits plane at end point ( endPoint() ) 3 : projection hits the finite tube of the cylinder |
References axisDirection(), LCLine3D::distance(), LCLine3D::position(), LCPlane3D::projectPoint(), LCLine3D::projectPoint(), and radius().
Referenced by distance().
double LCCylinder::radius | ( | ) | const |
Radius of cylinder.
Referenced by SimpleHelix::getIntersectionWithCylinder(), SimpleLine::getIntersectionWithCylinder(), isInside(), and projectPoint().