Mantid
Loading...
Searching...
No Matches
PolygonEdge.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//-----------------------------------------------------------------------------
10// Includes
11//-----------------------------------------------------------------------------
12#include "MantidGeometry/DllConfig.h"
13#include "MantidKernel/V2D.h"
14
15namespace Mantid {
16namespace Geometry {
23class MANTID_GEOMETRY_DLL PolygonEdge {
24public:
31 SkewNoCross
32 };
33
35 PolygonEdge(const Kernel::V2D &start, const Kernel::V2D &end);
37 inline const Kernel::V2D &start() const { return m_start; }
39 inline const Kernel::V2D &end() const { return m_end; }
41 inline const Kernel::V2D &direction() const { return m_dir; }
43 Kernel::V2D point(const double fraction) const;
44
45private:
48
55};
56
66};
68MANTID_GEOMETRY_DLL PointClassification classify(const Kernel::V2D &pt, const PolygonEdge &edge);
69
71MANTID_GEOMETRY_DLL PolygonEdge::Orientation orientation(const PolygonEdge &focusEdge, const PolygonEdge &refEdge,
72 double &t);
74MANTID_GEOMETRY_DLL PolygonEdge::Orientation crossingPoint(const PolygonEdge &edgeOne, const PolygonEdge &edgeTwo,
75 Kernel::V2D &crossPoint);
77MANTID_GEOMETRY_DLL bool edgeAimsAt(const PolygonEdge &a, const PolygonEdge &b, PointClassification aclass,
78 PolygonEdge::Orientation crossType);
79
80} // namespace Geometry
81} // namespace Mantid
PolygonEdge Defines a directed edge between two points on a polygon.
Definition: PolygonEdge.h:23
const Kernel::V2D & end() const
Access the end point.
Definition: PolygonEdge.h:39
const Kernel::V2D & direction() const
Return the direction.
Definition: PolygonEdge.h:41
PolygonEdge()
Default constructor.
const Kernel::V2D & start() const
Access the start point.
Definition: PolygonEdge.h:37
const Kernel::V2D m_start
Origin point.
Definition: PolygonEdge.h:50
Orientation
Defines the orientation with respect to another edge.
Definition: PolygonEdge.h:26
@ Parallel
Edges point in the same direction.
Definition: PolygonEdge.h:28
@ Skew
Edges are at an angle to each other.
Definition: PolygonEdge.h:29
@ Collinear
Edges lie on the same line.
Definition: PolygonEdge.h:27
@ SkewCross
Edges are at an angle and intersect.
Definition: PolygonEdge.h:30
const Kernel::V2D m_end
Destination point.
Definition: PolygonEdge.h:52
const Kernel::V2D m_dir
Direction vector.
Definition: PolygonEdge.h:54
Implements a 2-dimensional vector embedded in a 3D space, i.e.
Definition: V2D.h:29
MANTID_GEOMETRY_DLL PolygonEdge::Orientation orientation(const PolygonEdge &focusEdge, const PolygonEdge &refEdge, double &t)
Calculate the orientation type of one edge wrt to another.
Definition: PolygonEdge.cpp:81
MANTID_GEOMETRY_DLL PointClassification classify(const Kernel::V2D &pt, const PolygonEdge &edge)
Helper function for classification.
Definition: PolygonEdge.cpp:47
MANTID_GEOMETRY_DLL bool edgeAimsAt(const PolygonEdge &a, const PolygonEdge &b, PointClassification aclass, PolygonEdge::Orientation crossType)
Return if the edges aim at each other.
MANTID_GEOMETRY_DLL PolygonEdge::Orientation crossingPoint(const PolygonEdge &edgeOne, const PolygonEdge &edgeTwo, Kernel::V2D &crossPoint)
Calculate the crossing point of one edge with wrt another.
PointClassification
Enumeration for point type w.r.t an edge.
Definition: PolygonEdge.h:58
@ Destination
Point equals edge destination.
Definition: PolygonEdge.h:65
@ OnRight
Point is to right of edge.
Definition: PolygonEdge.h:60
@ Between
Point is between edge origin and destination.
Definition: PolygonEdge.h:63
@ OnLeft
Point is to left of edge.
Definition: PolygonEdge.h:59
@ Origin
Point equals edge origin.
Definition: PolygonEdge.h:64
@ Behind
Point is left of edge origin.
Definition: PolygonEdge.h:62
@ Beyond
Point is right of edge destination.
Definition: PolygonEdge.h:61
Helper class which provides the Collimation Length for SANS instruments.