Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CLine Class Reference

#include <GeoPrimitives.H>

Collaboration diagram for CLine:

Public Member Functions

 CLine ()
 
 CLine (const CPoint &p1, const CPoint &p2)
 
 CLine (const CLine &l)
 
 CLine (const CPoint &p1, const CVector &v1)
 
 CLine (const CVector &v1)
 
CLinemove (const CPoint &p1)
 
bool operator== (const CLine &l) const
 
bool has_point (const CPoint &p2) const
 
CVectorslope ()
 
const CVectorslope () const
 
CPointpoint ()
 
const CPointpoint () const
 

Protected Attributes

CPoint p
 
CVector v
 

Friends

double Distance (const CPoint &p, const CLine &l)
 
double Distance (const C3Point &p, const CLine &l)
 

Detailed Description

Definition at line 1002 of file GeoPrimitives.H.

Constructor & Destructor Documentation

CLine ( )
inline

Definition at line 1009 of file GeoPrimitives.H.

1010  {};
CLine ( const CPoint p1,
const CPoint p2 
)
inline

Definition at line 1011 of file GeoPrimitives.H.

1012  : p(p1),v(p1,p2)
1013  {};
NT p1
CLine ( const CLine l)
inline

Definition at line 1014 of file GeoPrimitives.H.

1015  : p(l.p), v(l.v)
1016  {};
CLine ( const CPoint p1,
const CVector v1 
)
inline

Definition at line 1017 of file GeoPrimitives.H.

1018  : p(p1),v(v1)
1019  {};
NT p1
CLine ( const CVector v1)
inline

Definition at line 1020 of file GeoPrimitives.H.

1021  : p(0,0,0),v(v1)
1022  {};

Member Function Documentation

bool has_point ( const CPoint p2) const
inline

Definition at line 1033 of file GeoPrimitives.H.

References CVector::normalize(), GeoPrim::TOL, CVector::unit(), and CLine::v.

Referenced by CLineSegment::has_point().

1034  {
1035  CVector v2(p2,p);
1036  v2.normalize();
1037  double r = v2 * v.unit();
1038  return( (fabs(r - 1.0) < TOL) ||
1039  (fabs(r + 1.0) < TOL) );
1040  };
CVector unit() const
const double TOL
Definition: GeoPrimitives.H:17

Here is the call graph for this function:

Here is the caller graph for this function:

CLine& move ( const CPoint p1)
inline

Definition at line 1023 of file GeoPrimitives.H.

References p1.

1024  {
1025  p = p1;
1026  return(*this);
1027  };
NT p1
bool operator== ( const CLine l) const
inline

Definition at line 1028 of file GeoPrimitives.H.

References CLine::p, and CLine::v.

1029  {
1030  return( (p == l.p) &&
1031  (v == l.v) );
1032  };
CPoint& point ( )
inline

Definition at line 1049 of file GeoPrimitives.H.

1050  {
1051  return(p);
1052  };
const CPoint& point ( ) const
inline

Definition at line 1053 of file GeoPrimitives.H.

1054  {
1055  return(p);
1056  };
CVector& slope ( )
inline

Definition at line 1041 of file GeoPrimitives.H.

References CLine::v.

Referenced by bc_enforce(), and rflu_modextractflowdata::rflu_extractflowdatablasius().

1042  {
1043  return(v);
1044  };

Here is the caller graph for this function:

const CVector& slope ( ) const
inline

Definition at line 1045 of file GeoPrimitives.H.

References CLine::v.

1046  {
1047  return(v);
1048  };

Friends And Related Function Documentation

double Distance ( const CPoint p,
const CLine l 
)
friend
double Distance ( const C3Point p,
const CLine l 
)
friend

Definition at line 45 of file GeoPrimitives.C.

46  {
47  double u = (((p.x() - l.p.x())*l.v.x() + (p.y() - l.p.y())*l.v.y() +
48  (p.z() - l.p.z())*l.v.z())/l.v.mag2());
49  C3Point p2(l.p.x()+(u*l.v.x()),l.p.y()+(u*l.v.y()),l.p.z()+(u*l.v.z()));
50  C3Vector v(p,p2);
51  return(v.Mag());
52  }
C3Vector C3Point

Member Data Documentation

CPoint p
protected

Definition at line 1006 of file GeoPrimitives.H.

Referenced by GeoPrim::Distance(), and CLine::operator==().

CVector v
protected

The documentation for this class was generated from the following file: