Mantid
|
Impliments a line. More...
#include <Line.h>
Public Types | |
using | PType = boost::container::small_vector< Kernel::V3D, 5 > |
Public Member Functions | |
Line * | clone () const |
Virtual copy constructor (not currently used) More... | |
void | displace (const Kernel::V3D &) |
Apply a displacement Pt. More... | |
double | distance (const Kernel::V3D &) const |
distance from line More... | |
const Kernel::V3D & | getDirect () const |
returns the direction More... | |
const Kernel::V3D & | getOrigin () const |
returns the origin More... | |
Kernel::V3D | getPoint (const double lambda) const |
gets the point O+lam*N More... | |
int | intersect (PType &, const Cylinder &) const |
For the line that intersects the cylinder generate add the point to the VecOut, return number of points added. More... | |
int | intersect (PType &, const Plane &) const |
For the line that intersects the cylinder generate add the point to the VecOut, return number of points added. More... | |
int | intersect (PType &, const Quadratic &) const |
For the line that intersects the surfaces add the point(s) to the VecOut, return number of points added. More... | |
int | intersect (PType &, const Sphere &) const |
For the line that intersects the cylinder generate add the point to the VecOut, return number of points added. More... | |
int | isValid (const Kernel::V3D &) const |
Is the point on the line. More... | |
Line () | |
Constructor. More... | |
Line (const Kernel::V3D &, const Kernel::V3D &) | |
Constructor. More... | |
void | print () const |
Print statement for debugging. More... | |
void | rotate (const Kernel::Matrix< double > &) |
Applies the rotation matrix to the object. More... | |
int | setLine (const Kernel::V3D &, const Kernel::V3D &) |
input Origin + direction More... | |
Private Member Functions | |
int | lambdaPair (const int ix, const std::pair< std::complex< double >, std::complex< double > > &SQ, PType &PntOut) const |
Helper function to decide which roots to take. More... | |
Private Attributes | |
Kernel::V3D | m_direction |
Direction of outer surface (Unit Vector) More... | |
Kernel::V3D | m_origin |
Orign point (on plane) More... | |
Impliments a line.
Impliments the line
\[ r=\vec{O} + \lambda \vec{n} \]
ChangeLog: 22.04.2008: Sri, Missing MANTID_GEOMETRY_DLL and Destructor was virtual it's changed to normal destructor
using Mantid::Geometry::Line::PType = boost::container::small_vector<Kernel::V3D, 5> |
Mantid::Geometry::Line::Line | ( | ) |
Mantid::Geometry::Line::Line | ( | const Kernel::V3D & | O, |
const Kernel::V3D & | D | ||
) |
Line * Mantid::Geometry::Line::clone | ( | ) | const |
void Mantid::Geometry::Line::displace | ( | const Kernel::V3D & | Pt | ) |
double Mantid::Geometry::Line::distance | ( | const Kernel::V3D & | A | ) | const |
|
inline |
returns the direction
Definition at line 53 of file Line.h.
Referenced by Mantid::Geometry::LineIntersectVisit::sortAndRemoveDuplicates().
|
inline |
returns the origin
Definition at line 52 of file Line.h.
Referenced by Mantid::Geometry::Track::addPoint(), Mantid::Geometry::Track::buildLink(), Mantid::Geometry::Track::nonComplete(), and Mantid::Geometry::LineIntersectVisit::sortAndRemoveDuplicates().
Kernel::V3D Mantid::Geometry::Line::getPoint | ( | const double | lambda | ) | const |
For the line that intersects the cylinder generate add the point to the VecOut, return number of points added.
It does not check the points for validity.
PntOut | :: Vector of points found by the line/cylinder intersection |
cylinder | :: Cylinder to intersect line with |
Definition at line 200 of file Line.cpp.
References Mantid::Kernel::V3D::norm2(), radius, Mantid::Kernel::V3D::scalar_prod(), and Mantid::solveQuadratic().
For the line that intersects the cylinder generate add the point to the VecOut, return number of points added.
It does not check the points for validity.
PntOut | :: Vector of points found by the line/cylinder intersection |
Pln | :: Plane for intersect |
Definition at line 177 of file Line.cpp.
References fabs, and Mantid::Kernel::Tolerance.
For the line that intersects the surfaces add the point(s) to the VecOut, return number of points added.
It does not check the points for validity.
VecOut | :: intersection points of the line and surface |
Sur | :: Surface to intersect with a line |
Definition at line 152 of file Line.cpp.
References Mantid::Geometry::d, and Mantid::solveQuadratic().
Referenced by Mantid::Geometry::LineIntersectVisit::Accept().
For the line that intersects the cylinder generate add the point to the VecOut, return number of points added.
It does not check the points for validity.
PntOut | :: Vector of points found by the line/sphere intersection |
Sph | :: Sphere to intersect line with |
Definition at line 234 of file Line.cpp.
References Mantid::Kernel::V3D::scalar_prod(), and Mantid::solveQuadratic().
int Mantid::Geometry::Line::isValid | ( | const Kernel::V3D & | A | ) | const |
Is the point on the line.
Calculate is point is on line by using distance to determine if the point is within Tolerance of the line.
A | :: Point to test |
1 | : the point is on the line |
0 | : Point is not on the line |
Definition at line 72 of file Line.cpp.
References Mantid::Kernel::Tolerance.
|
private |
Helper function to decide which roots to take.
The assumption is that lambda has been solved by quadratic equation and we require the points that correspond to these values. Note: have changed this so that only positive roots are returned. This makes the quadratic solutions consistent with the ones returned when asking if a line hits a plane. It is not clear if some other use cases exist.
ix | : number of solutions in SQ (0,1,2) |
SQ | : solutions to lambda (the distance along the line |
PntOut | : Output vector of points (added to) |
Definition at line 105 of file Line.cpp.
References lambda, and Mantid::Kernel::Tolerance.
void Mantid::Geometry::Line::print | ( | ) | const |
Print statement for debugging.
Definition at line 276 of file Line.cpp.
References m_direction, and m_origin.
void Mantid::Geometry::Line::rotate | ( | const Kernel::Matrix< double > & | MA | ) |
Applies the rotation matrix to the object.
MA | :: Rotation Matrix |
Definition at line 84 of file Line.cpp.
References m_direction, m_origin, Mantid::Kernel::V3D::normalize(), and Mantid::Kernel::V3D::rotate().
int Mantid::Geometry::Line::setLine | ( | const Kernel::V3D & | O, |
const Kernel::V3D & | D | ||
) |
input Origin + direction
sets the line given the Origne and direction
O | :: origin |
D | :: direction |
0 | :: Direction == 0 ie no line |
1 | :: on success |
Definition at line 260 of file Line.cpp.
References m_direction, m_origin, Mantid::Kernel::normalize(), and Mantid::Kernel::V3D::nullVector().
Referenced by Mantid::Geometry::Track::reset().
|
private |
|
private |