MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Line in R^3. More...
#include <MsqGeomPrim.hpp>
Public Member Functions | |
MsqLine (const Vector3D &p_point, const Vector3D &p_dir) | |
MsqLine () | |
const Vector3D & | point () const |
const Vector3D & | direction () const |
Vector3D | point (double param) const |
Get point given parameter (mPoint + param * mDirection) | |
double | closest (const Vector3D &from_point) const |
Get parameter value for location on line closest to input point. | |
double | distance (const Vector3D &from_point) const |
bool | intersect (const MsqLine &other, double ¶m, double epsilon) const |
bool | closest (const MsqLine &other, double ¶m) const |
Find parameter of closest position on this line to another line. | |
Static Public Member Functions | |
static MsqLine | two_point (const Vector3D &p1, const Vector3D &p2) |
Private Attributes | |
Vector3D | mPoint |
Vector3D | mDirection |
Line in R^3.
Definition at line 42 of file MsqGeomPrim.hpp.
MBMesquite::MsqLine::MsqLine | ( | const Vector3D & | p_point, |
const Vector3D & | p_dir | ||
) | [inline] |
Definition at line 49 of file MsqGeomPrim.hpp.
: mPoint( p_point ), mDirection( p_dir / p_dir.length() ) { }
MBMesquite::MsqLine::MsqLine | ( | ) | [inline] |
Definition at line 53 of file MsqGeomPrim.hpp.
: mPoint( 0, 0, 0 ), mDirection( 0, 0, 0 ) {}
double MBMesquite::MsqLine::closest | ( | const Vector3D & | from_point | ) | const [inline] |
Get parameter value for location on line closest to input point.
Definition at line 76 of file MsqGeomPrim.hpp.
Referenced by MBMesquite::LineDomain::arc_length(), intersect(), MBMesquite::LineDomain::position_from_length(), GeomPrimTest::test_line_closest_to_line(), GeomPrimTest::test_line_closest_to_point(), and MBMesquite::MsqCircle::three_point().
{ return mDirection % ( from_point - mPoint ); }
bool MBMesquite::MsqLine::closest | ( | const MsqLine & | other, |
double & | param | ||
) | const |
Find parameter of closest position on this line to another line.
Definition at line 46 of file MsqGeomPrim.cpp.
References direction(), moab::dot(), N, and point().
const Vector3D& MBMesquite::MsqLine::direction | ( | ) | const [inline] |
Definition at line 64 of file MsqGeomPrim.hpp.
Referenced by closest(), MBMesquite::LineDomain::closest_point(), MBMesquite::MsqPlane::intersect(), GeomPrimTest::test_line_basic(), GeomPrimTest::test_line_closest_to_line(), GeomPrimTest::test_line_closest_to_point(), and GeomPrimTest::test_plane_intersect_plane().
{ return mDirection; }
double MBMesquite::MsqLine::distance | ( | const Vector3D & | from_point | ) | const [inline] |
Definition at line 81 of file MsqGeomPrim.hpp.
bool MBMesquite::MsqLine::intersect | ( | const MsqLine & | other, |
double & | param, | ||
double | epsilon | ||
) | const |
Find intersection between two lines
Definition at line 38 of file MsqGeomPrim.cpp.
References closest(), epsilon, MBMesquite::Vector3D::length_squared(), and point().
Referenced by GeomPrimTest::test_line_intersect().
const Vector3D& MBMesquite::MsqLine::point | ( | ) | const [inline] |
Definition at line 60 of file MsqGeomPrim.hpp.
Referenced by closest(), MBMesquite::LineDomain::closest_point(), intersect(), MBMesquite::MsqPlane::intersect(), MBMesquite::LineDomain::position_from_length(), MBMesquite::LineDomain::snap_to(), GeomPrimTest::test_line_basic(), GeomPrimTest::test_line_closest_to_line(), GeomPrimTest::test_line_closest_to_point(), GeomPrimTest::test_line_intersect(), GeomPrimTest::test_plane_intersect_line(), GeomPrimTest::test_plane_intersect_plane(), and MBMesquite::MsqCircle::three_point().
{ return mPoint; }
Vector3D MBMesquite::MsqLine::point | ( | double | param | ) | const [inline] |
Get point given parameter (mPoint + param * mDirection)
Definition at line 70 of file MsqGeomPrim.hpp.
static MsqLine MBMesquite::MsqLine::two_point | ( | const Vector3D & | p1, |
const Vector3D & | p2 | ||
) | [inline, static] |
Definition at line 55 of file MsqGeomPrim.hpp.
Referenced by GeomPrimTest::test_line_basic().
{ return MsqLine( p1, p2 - p1 ); }
Vector3D MBMesquite::MsqLine::mDirection [private] |
Definition at line 46 of file MsqGeomPrim.hpp.
Vector3D MBMesquite::MsqLine::mPoint [private] |
Definition at line 45 of file MsqGeomPrim.hpp.