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

#include <GeoPrimitives.H>

Collaboration diagram for CPlane:

Public Member Functions

 CPlane ()
 
 CPlane (const CPoint &p1, const CPoint &p2, const CPoint &p3)
 
 CPlane (const CVector &N, const CPoint &P)
 
 CPlane (const CPlane &plane)
 
 CPlane (const std::vector< CPoint > &vec)
 
CPlaneoperator= (const CPlane &plane)
 
double A () const
 
double B () const
 
double C () const
 
double D () const
 
CVectornormal ()
 
const CVectornormal () const
 
CPointpoint ()
 
const CPointpoint () const
 
bool contains_point (const CPoint &P) const
 
bool operator== (const CPlane &plane) const
 

Protected Attributes

CVector n
 
CPoint p
 

Detailed Description

Definition at line 1332 of file GeoPrimitives.H.

Constructor & Destructor Documentation

CPlane ( )
inline

Definition at line 1337 of file GeoPrimitives.H.

1337 {};
CPlane ( const CPoint p1,
const CPoint p2,
const CPoint p3 
)
inline

Definition at line 1338 of file GeoPrimitives.H.

References CPlane::A(), CPlane::B(), CPlane::C(), CPlane::n, CVector::normalize(), CPoint::x(), CVector::x(), CPoint::y(), and CPoint::z().

1339  : p(p1)
1340  {
1341  double A = p1.y()*(p2.z() - p3.z()) + p2.y()*(p3.z() - p1.z()) +
1342  p3.y()*(p1.z() - p2.z());
1343  double B = p1.z()*(p2.x() - p3.x()) + p2.z()*(p3.x() - p1.x()) +
1344  p3.z()*(p1.x() - p2.x());
1345  double C = p1.x()*(p2.y() - p3.y()) + p2.x()*(p3.y() - p1.y()) +
1346  p3.x()*(p1.y() - p2.y());
1347  // double D = -1.0 * ( p1.x()*(p2.y()*p3.z() - p3.y()*p2.z()) +
1348  // p2.x()*(p3.y()*p1.z() - p1.y()*p3.z()) +
1349  // p3.x()*(p1.y()*p2.z() - p2.y()*p1.z()) );
1350 
1351  n.x(A).y(B).z(C);
1352  n.normalize();
1353  };
double C() const
double B() const
NT p1
double A() const
CVector & normalize()

Here is the call graph for this function:

CPlane ( const CVector N,
const CPoint P 
)
inline

Definition at line 1354 of file GeoPrimitives.H.

1355  : n(N.unit()),p(P)
1356  {};
CPlane ( const CPlane plane)
inline

Definition at line 1357 of file GeoPrimitives.H.

1358  : n(plane.n),p(plane.p)
1359  {};
CPlane ( const std::vector< CPoint > &  vec)
inline

Definition at line 1360 of file GeoPrimitives.H.

References CPlane::A(), CPlane::B(), CPlane::C(), CPlane::n, CVector::normalize(), x, CVector::x(), y, and z.

1361  : p(vec[0])
1362  {
1363  double A = vec[0].y()*(vec[1].z() - vec[2].z()) +
1364  vec[1].y()*(vec[2].z() - vec[0].z()) +
1365  vec[2].y()*(vec[0].z() - vec[1].z());
1366  double B = vec[0].z()*(vec[1].x() - vec[2].x()) +
1367  vec[1].z()*(vec[2].x() - vec[0].x()) +
1368  vec[2].z()*(vec[0].x() - vec[1].x());
1369  double C = vec[0].x()*(vec[1].y() - vec[2].y()) +
1370  vec[1].x()*(vec[2].y() - vec[0].y()) +
1371  vec[2].x()*(vec[0].y() - vec[1].y());
1372  // double D = -1.0 * ( p1.x()*(p2.y()*p3.z() - p3.y()*p2.z()) +
1373  // p2.x()*(p3.y()*p1.z() - p1.y()*p3.z()) +
1374  // p3.x()*(p1.y()*p2.z() - p2.y()*p1.z()) );
1375 
1376  n.x(A).y(B).z(C);
1377  n.normalize();
1378  } ;
double C() const
void int int REAL REAL * y
Definition: read.cpp:74
double B() const
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
double A() const
CVector & normalize()

Here is the call graph for this function:

Member Function Documentation

double A ( ) const
inline

Definition at line 1385 of file GeoPrimitives.H.

References CPlane::n, and CVector::x().

Referenced by CPlane::CPlane().

1385 { return(n.x()); };

Here is the call graph for this function:

Here is the caller graph for this function:

double B ( ) const
inline

Definition at line 1386 of file GeoPrimitives.H.

References CPlane::n, and CVector::y().

Referenced by CPlane::CPlane().

1386 { return(n.y()); };

Here is the call graph for this function:

Here is the caller graph for this function:

double C ( ) const
inline

Definition at line 1387 of file GeoPrimitives.H.

References CPlane::n, and CVector::z().

Referenced by CPlane::CPlane().

1387 { return(n.z()); };

Here is the call graph for this function:

Here is the caller graph for this function:

bool contains_point ( const CPoint P) const
inline

Definition at line 1396 of file GeoPrimitives.H.

References CPlane::D(), CPlane::n, GeoPrim::TOL, CPoint::x(), CVector::x(), CPoint::y(), CVector::y(), CPoint::z(), and CVector::z().

Referenced by CFacet::contains_point(), and CPlane::operator==().

1397  {
1398  return(fabs(n.x()*P.x() + n.y()*P.y() + n.z()*P.z() + D()) <= TOL);
1399  };
const double TOL
Definition: GeoPrimitives.H:17
double D() const

Here is the call graph for this function:

Here is the caller graph for this function:

double D ( ) const
inline

Definition at line 1388 of file GeoPrimitives.H.

References CPlane::n, CPlane::p, CPoint::x(), CVector::x(), CPoint::y(), CVector::y(), CPoint::z(), and CVector::z().

Referenced by CPlane::contains_point().

1389  {
1390  return( -1.0 * ( n.x()*p.x() + n.y()*p.y() + n.z()*p.z()));
1391  };

Here is the call graph for this function:

Here is the caller graph for this function:

CVector& normal ( )
inline

Definition at line 1392 of file GeoPrimitives.H.

References CPlane::n.

1392 { return(n); };
const CVector& normal ( ) const
inline

Definition at line 1393 of file GeoPrimitives.H.

References CPlane::n.

1393 { return(n); };
CPlane& operator= ( const CPlane plane)
inline

Definition at line 1379 of file GeoPrimitives.H.

References CPlane::n, and CPlane::p.

1380  {
1381  n = plane.n;
1382  p = plane.p;
1383  return(*this);
1384  };
bool operator== ( const CPlane plane) const
inline

Definition at line 1400 of file GeoPrimitives.H.

References CPlane::contains_point(), CPlane::n, CPlane::p, and CVector::unit().

1401  {
1402  return((plane.n.unit() == n.unit()) && contains_point(plane.p));
1403  };
bool contains_point(const CPoint &P) const
CVector unit() const

Here is the call graph for this function:

CPoint& point ( )
inline

Definition at line 1394 of file GeoPrimitives.H.

References CPlane::p.

1394 { return(p); };
const CPoint& point ( ) const
inline

Definition at line 1395 of file GeoPrimitives.H.

References CPlane::p.

1395 { return(p); };

Member Data Documentation

CPoint p
protected

Definition at line 1335 of file GeoPrimitives.H.

Referenced by CPlane::D(), CPlane::operator=(), CPlane::operator==(), and CPlane::point().


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