cgma
|
#include <Cubit2DPoint.hpp>
Public Member Functions | |
Cubit2DPoint () | |
Cubit2DPoint (const double x, const double y) | |
Cubit2DPoint (const double xy[2]) | |
Cubit2DPoint (const Cubit2DPoint ©_from) | |
Cubit2DPoint (const Cubit2DPoint *copy_from) | |
void | set (const double x, const double y) |
void | set (const double xy[2]) |
void | set (const Cubit2DPoint &to_copy) |
double | x () const |
double | y () const |
void | get_xy (double &x, double &y) |
void | get_xy (double xy[3]) |
void | x (const double x) |
void | y (const double y) |
void | print_me () |
void | min_max (const Cubit2DPoint &pnt2, double &xmin, double &xmax, double &ymin, double &ymax) const |
void | update_min_max (Cubit2DPoint &min, Cubit2DPoint &max) const |
CubitBoolean | is_on_line_segment (const Cubit2DPoint &end1, const Cubit2DPoint &end2, double tol=1e-10) const |
Cubit2DPoint & | operator= (const Cubit2DPoint &from) |
Private Attributes | |
double | xVal |
double | yVal |
Definition at line 16 of file Cubit2DPoint.hpp.
Cubit2DPoint::Cubit2DPoint | ( | ) | [inline] |
Definition at line 88 of file Cubit2DPoint.hpp.
Cubit2DPoint::Cubit2DPoint | ( | const double | x, |
const double | y | ||
) | [inline] |
Cubit2DPoint::Cubit2DPoint | ( | const double | xy[2] | ) |
Cubit2DPoint::Cubit2DPoint | ( | const Cubit2DPoint & | copy_from | ) | [inline] |
Cubit2DPoint::Cubit2DPoint | ( | const Cubit2DPoint * | copy_from | ) | [inline] |
void Cubit2DPoint::get_xy | ( | double & | x, |
double & | y | ||
) |
void Cubit2DPoint::get_xy | ( | double | xy[3] | ) |
CubitBoolean Cubit2DPoint::is_on_line_segment | ( | const Cubit2DPoint & | end1, |
const Cubit2DPoint & | end2, | ||
double | tol = 1e-10 |
||
) | const |
Definition at line 52 of file Cubit2DPoint.cpp.
{ // Check bounding box double xmin, xmax, ymin, ymax; end1.min_max( end2, xmin, xmax, ymin, ymax ); if( xVal < xmin-tol || yVal < ymin-tol || xVal > xmax+tol || yVal > ymax+tol ) { return CUBIT_FALSE; } // Check area of triangle (formula in if is twice the area) if( fabs( end1.x()*end2.y() + end1.y()*xVal + end2.x()*yVal - end2.y()*xVal - end1.x()*yVal - end1.y()*end2.x() ) < tol ) return CUBIT_TRUE; return CUBIT_FALSE; }
void Cubit2DPoint::min_max | ( | const Cubit2DPoint & | pnt2, |
double & | xmin, | ||
double & | xmax, | ||
double & | ymin, | ||
double & | ymax | ||
) | const |
Cubit2DPoint & Cubit2DPoint::operator= | ( | const Cubit2DPoint & | from | ) | [inline] |
void Cubit2DPoint::print_me | ( | ) |
void Cubit2DPoint::set | ( | const double | x, |
const double | y | ||
) | [inline] |
void Cubit2DPoint::set | ( | const double | xy[2] | ) | [inline] |
Definition at line 114 of file Cubit2DPoint.hpp.
void Cubit2DPoint::set | ( | const Cubit2DPoint & | to_copy | ) | [inline] |
Definition at line 127 of file Cubit2DPoint.hpp.
{
*this = to_copy;
}
void Cubit2DPoint::update_min_max | ( | Cubit2DPoint & | min, |
Cubit2DPoint & | max | ||
) | const |
double Cubit2DPoint::x | ( | void | ) | const [inline] |
Definition at line 97 of file Cubit2DPoint.hpp.
{ return xVal; }
void Cubit2DPoint::x | ( | const double | x | ) | [inline] |
Definition at line 102 of file Cubit2DPoint.hpp.
double Cubit2DPoint::y | ( | void | ) | const [inline] |
Definition at line 99 of file Cubit2DPoint.hpp.
{ return yVal; }
void Cubit2DPoint::y | ( | const double | y | ) | [inline] |
Definition at line 104 of file Cubit2DPoint.hpp.
double Cubit2DPoint::xVal [private] |
Definition at line 76 of file Cubit2DPoint.hpp.
double Cubit2DPoint::yVal [private] |
Definition at line 77 of file Cubit2DPoint.hpp.