Mantid
|
Defines a track as a start point and a direction. More...
#include <Track.h>
Public Types | |
using | LType = boost::container::small_vector< Link, 5 > |
using | PType = boost::container::small_vector< IntersectionPoint, 5 > |
Public Member Functions | |
int | addLink (const Kernel::V3D &firstPoint, const Kernel::V3D &secondPoint, const double distanceAlongTrack, const IObject &obj, const ComponentID compID=nullptr) |
Adds a link to the track. More... | |
void | addPoint (const TrackDirection direction, const Kernel::V3D &endPoint, const IObject &obj, const ComponentID compID=nullptr) |
Adds a point of intersection to the track. More... | |
LType::reference | back () |
Returns a reference to the last link. More... | |
LType::const_reference | back () const |
Returns a reference to the last link (const version) More... | |
LType::iterator | begin () |
Returns an interator to the start of the set of links. More... | |
LType::const_iterator | begin () const |
Returns an interator to the start of the set of links (const version) More... | |
void | buildLink () |
Construct links between added points. More... | |
virtual double | calculateAttenuation (double lambda) const |
Calculate attenuation across all links. More... | |
LType::const_iterator | cbegin () const |
Returns an interator to the start of the set of links (const version) More... | |
LType::const_iterator | cend () const |
Returns an interator to one-past-the-end of the set of links (const version) More... | |
void | clearIntersectionResults () |
Clear the current set of intersection results. More... | |
int | count () const |
Returns the number of links. More... | |
const Kernel::V3D & | direction () const |
Returns the direction as a unit vector. More... | |
LType::iterator | end () |
Returns an interator to one-past-the-end of the set of links. More... | |
LType::const_iterator | end () const |
Returns an interator to one-past-the-end of the set of links (const version) More... | |
LType::reference | front () |
Returns a reference to the first link. More... | |
LType::const_reference | front () const |
Returns a reference to the first link (const version) More... | |
int | nonComplete () const |
Is the link complete? More... | |
void | removeCojoins () |
Remove touching Links that have identical components. More... | |
void | reset (const Kernel::V3D &startPoint, const Kernel::V3D &direction) |
Set a starting point and direction. More... | |
const Kernel::V3D & | startPoint () const |
Returns the starting point. More... | |
int | surfPointsCount () const |
Returns the number of intersection points. More... | |
double | totalDistInsideObject () const |
Returns the sum of all the links distInsideObject in the track. More... | |
Track () | |
Default constructor. More... | |
Track (const Kernel::V3D &startPt, const Kernel::V3D &unitVector) | |
Constructor. More... | |
virtual | ~Track ()=default |
Private Attributes | |
Line | m_line |
Line object containing origin and direction. More... | |
LType | m_links |
Track units. More... | |
PType | m_surfPoints |
Intersection points. More... | |
Defines a track as a start point and a direction.
Intersections are stored as ordered lists of links from the start point to the exit point.
using Mantid::Geometry::Track::LType = boost::container::small_vector<Link, 5> |
using Mantid::Geometry::Track::PType = boost::container::small_vector<IntersectionPoint, 5> |
Mantid::Geometry::Track::Track | ( | const Kernel::V3D & | startPt, |
const Kernel::V3D & | unitVector | ||
) |
Constructor.
startPt | :: Initial point |
unitVector | :: Directional vector. It must be unit vector. |
Definition at line 32 of file Track.cpp.
References m_links, m_surfPoints, and Mantid::Kernel::V3D::unitVector().
|
virtualdefault |
int Mantid::Geometry::Track::addLink | ( | const Kernel::V3D & | firstPoint, |
const Kernel::V3D & | secondPoint, | ||
const double | distanceAlongTrack, | ||
const IObject & | obj, | ||
const ComponentID | compID = nullptr |
||
) |
Adds a link to the track.
This adds a whole segment to the track : This currently assumes that links are added in order.
firstPoint | :: first Point |
secondPoint | :: second Point |
distanceAlongTrack | :: Distance along track |
obj | :: A reference to the object that was intersected |
compID | :: ID of the component that this link is about (Default=NULL) |
Index | of link within the track |
Definition at line 152 of file Track.cpp.
References index, m_links, and obj.
Referenced by buildLink(), Mantid::Geometry::ObjComponent::interceptSurface(), Mantid::Geometry::GridDetector::testIntersectionWithChildren(), and Mantid::Geometry::RectangularDetector::testIntersectionWithChildren().
void Mantid::Geometry::Track::addPoint | ( | const TrackDirection | direction, |
const Kernel::V3D & | endPoint, | ||
const IObject & | obj, | ||
const ComponentID | compID = nullptr |
||
) |
Adds a point of intersection to the track.
Objective is to merge in partial information about the beginning and end of the tracks.
The points are kept in order
direction | :: A flag indicating if the direction of travel is entering/leaving an object. +1 is entering, -1 is leaving. |
endPoint | :: Point of intersection |
obj | :: A reference to the object that was intersected |
compID | :: ID of the component that this link is about (Default=NULL) |
Definition at line 124 of file Track.cpp.
References direction(), Mantid::Kernel::V3D::distance(), Mantid::Geometry::Line::getOrigin(), m_line, m_surfPoints, and obj.
Referenced by Mantid::Geometry::MeshObject::interceptSurface(), Mantid::Geometry::CSGObject::interceptSurface(), and Mantid::Geometry::MeshObject2D::interceptSurface().
|
inline |
Returns a reference to the last link.
Definition at line 213 of file Track.h.
Referenced by Mantid::Crystal::PredictPeaks::calculateQAndAddToOutput().
|
inline |
|
inline |
|
inline |
void Mantid::Geometry::Track::buildLink | ( | ) |
Construct links between added points.
Builds a set of linking track components.
This version deals with touching surfaces
Definition at line 184 of file Track.cpp.
References addLink(), Mantid::Geometry::ENTERING, fabs, Mantid::Geometry::Line::getOrigin(), Mantid::Geometry::LEAVING, m_line, m_surfPoints, and Mantid::Kernel::Tolerance.
Referenced by Mantid::Geometry::MeshObject::interceptSurface(), Mantid::Geometry::CSGObject::interceptSurface(), and Mantid::Geometry::MeshObject2D::interceptSurface().
|
virtual |
Calculate attenuation across all links.
Definition at line 276 of file Track.cpp.
References lambda, and m_links.
Referenced by Mantid::Algorithms::AddAbsorptionWeightedPathLengths::exec().
|
inline |
Returns an interator to the start of the set of links (const version)
Definition at line 206 of file Track.h.
Referenced by Mantid::Algorithms::XrayAbsorptionCorrection::calculateMuonPos(), Mantid::Algorithms::DetectorEfficiencyCor::distToSurface(), Mantid::Algorithms::He3TubeEfficiency::distToSurface(), Mantid::CurveFitting::Algorithms::VesuvioCalculateMS::generateDetectorPos(), Mantid::CurveFitting::Algorithms::VesuvioCalculateMS::generateScatter(), Mantid::Geometry::InstrumentRayTracer::getResults(), Mantid::Algorithms::FlatPlateAbsorption::initialiseCachedDistances(), Mantid::Geometry::ObjComponent::interceptSurface(), Mantid::Geometry::CSGObject::searchForObject(), Mantid::Geometry::MeshObject::searchForObject(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::updateWeightAndPosition().
|
inline |
Returns an interator to one-past-the-end of the set of links (const version)
Definition at line 209 of file Track.h.
Referenced by Mantid::Geometry::InstrumentRayTracer::getResults(), Mantid::Geometry::ObjComponent::interceptSurface(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::updateWeightAndPosition().
void Mantid::Geometry::Track::clearIntersectionResults | ( | ) |
Clear the current set of intersection results.
Definition at line 55 of file Track.cpp.
References m_links, and m_surfPoints.
Referenced by Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::calculateDistances(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL12s(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::Geometry::InstrumentRayTracer::getResults(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::inc_xyz().
|
inline |
Returns the number of links.
Definition at line 219 of file Track.h.
Referenced by Mantid::Algorithms::XrayAbsorptionCorrection::calculateMuonPos(), Mantid::Algorithms::DetectorEfficiencyCor::distToSurface(), Mantid::Algorithms::He3TubeEfficiency::distToSurface(), Mantid::Algorithms::XrayAbsorptionCorrection::exec(), Mantid::Geometry::MeshObject::interceptSurface(), Mantid::Geometry::CSGObject::interceptSurface(), Mantid::Geometry::MeshObject2D::interceptSurface(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::updateWeightAndPosition().
|
inline |
Returns the direction as a unit vector.
Definition at line 193 of file Track.h.
Referenced by addPoint(), Mantid::Geometry::MeshObject2D::distance(), Mantid::Geometry::CSGObject::distance(), Mantid::Geometry::MeshObject::distance(), Mantid::Geometry::BoundingBox::doesLineIntersect(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::inc_xyz(), Mantid::Geometry::MeshObject::interceptSurface(), Mantid::Geometry::CSGObject::interceptSurface(), Mantid::Geometry::MeshObject2D::interceptSurface(), Mantid::Geometry::ObjComponent::interceptSurface(), reset(), Mantid::Geometry::GridDetector::testIntersectionWithChildren(), Mantid::Geometry::RectangularDetector::testIntersectionWithChildren(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::updateTrackDirection().
|
inline |
|
inline |
|
inline |
Returns a reference to the first link.
Definition at line 211 of file Track.h.
Referenced by Mantid::Algorithms::DiscusMultipleScatteringCorrection::inc_xyz(), and Mantid::DataHandling::Mantid3MFFileIO::writeMeshObject().
|
inline |
int Mantid::Geometry::Track::nonComplete | ( | ) | const |
Is the link complete?
Determines if the track is complete.
0 | :: Complete from Init to end without gaps |
+ve | :: Index number of incomplete segment +1 |
Definition at line 65 of file Track.cpp.
References Mantid::Kernel::V3D::distance(), Mantid::Geometry::Line::getOrigin(), m_line, m_links, and Mantid::Kernel::Tolerance.
void Mantid::Geometry::Track::removeCojoins | ( | ) |
void Mantid::Geometry::Track::reset | ( | const Kernel::V3D & | startPoint, |
const Kernel::V3D & | direction | ||
) |
Set a starting point and direction.
Resets the track starting point and direction.
startPoint | :: The new starting point |
direction | :: The new direction. Must be a unit vector! |
Definition at line 45 of file Track.cpp.
References direction(), m_line, Mantid::Geometry::Line::setLine(), startPoint(), and Mantid::Kernel::V3D::unitVector().
Referenced by Mantid::Algorithms::MultipleScatteringCorrection::calculateL12s(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::API::DetectorSearcher::checkInteceptWithNeighbours(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::inc_xyz(), Mantid::Geometry::InstrumentRayTracer::trace(), Mantid::Geometry::InstrumentRayTracer::traceFromSample(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::updateTrackDirection().
|
inline |
Returns the starting point.
Definition at line 191 of file Track.h.
Referenced by Mantid::Geometry::MeshObject2D::distance(), Mantid::Geometry::CSGObject::distance(), Mantid::Geometry::MeshObject::distance(), Mantid::Geometry::BoundingBox::doesLineIntersect(), Mantid::Geometry::MeshObject::interceptSurface(), Mantid::Geometry::CSGObject::interceptSurface(), Mantid::Geometry::MeshObject2D::interceptSurface(), Mantid::Geometry::ObjComponent::interceptSurface(), reset(), Mantid::Geometry::GridDetector::testIntersectionWithChildren(), Mantid::Geometry::RectangularDetector::testIntersectionWithChildren(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::updateTrackDirection().
|
inline |
double Mantid::Geometry::Track::totalDistInsideObject | ( | ) | const |
Returns the sum of all the links distInsideObject in the track.
Sums each link's distance inside an object to get a total interior distance for the track.
This is needed when there are multiple intersection points through an object.
Definition at line 254 of file Track.cpp.
References m_links.
Referenced by Mantid::Algorithms::AbsorptionCorrection::calculateDistances(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::calculateDistances(), and Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::initialiseCachedDistances().
|
private |
Line object containing origin and direction.
Definition at line 228 of file Track.h.
Referenced by addPoint(), buildLink(), nonComplete(), and reset().
|
private |
Track units.
Definition at line 229 of file Track.h.
Referenced by addLink(), calculateAttenuation(), clearIntersectionResults(), nonComplete(), removeCojoins(), totalDistInsideObject(), and Track().
|
private |
Intersection points.
Definition at line 230 of file Track.h.
Referenced by addPoint(), buildLink(), clearIntersectionResults(), and Track().