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

#include <GeoPrimitives.H>

Collaboration diagram for C3Plane:

Public Member Functions

 C3Plane ()
 
 C3Plane (const C3Point &p1, const C3Point &p2, const C3Point &p3)
 
 C3Plane (const C3Vector &N, const C3Point &P)
 
 C3Plane (const C3Plane &plane)
 
 C3Plane (const std::vector< C3Point > &vec)
 
C3Planeoperator= (const C3Plane &plane)
 
double A () const
 
double B () const
 
double C () const
 
double D () const
 
C3Vectornormal ()
 
const C3Vectornormal () const
 
C3Pointpoint ()
 
const C3Pointpoint () const
 
bool contains_point (const C3Point &P) const
 
bool operator== (const C3Plane &plane) const
 

Protected Attributes

C3Vector n
 
C3Point p
 

Detailed Description

Definition at line 1406 of file GeoPrimitives.H.

Constructor & Destructor Documentation

C3Plane ( )
inline

Definition at line 1411 of file GeoPrimitives.H.

1411 {};
C3Plane ( const C3Point p1,
const C3Point p2,
const C3Point p3 
)
inline

Definition at line 1412 of file GeoPrimitives.H.

References C3Plane::A(), C3Plane::B(), C3Plane::C(), C3Plane::n, C3Vector::Normalize(), C3Vector::x(), C3Vector::y(), and C3Vector::z().

1413  : p(p1)
1414  {
1415  double A = p1.y()*(p2.z() - p3.z()) + p2.y()*(p3.z() - p1.z()) +
1416  p3.y()*(p1.z() - p2.z());
1417  double B = p1.z()*(p2.x() - p3.x()) + p2.z()*(p3.x() - p1.x()) +
1418  p3.z()*(p1.x() - p2.x());
1419  double C = p1.x()*(p2.y() - p3.y()) + p2.x()*(p3.y() - p1.y()) +
1420  p3.x()*(p1.y() - p2.y());
1421  // double D = -1.0 * ( p1.x()*(p2.y()*p3.z() - p3.y()*p2.z()) +
1422  // p2.x()*(p3.y()*p1.z() - p1.y()*p3.z()) +
1423  // p3.x()*(p1.y()*p2.z() - p2.y()*p1.z()) );
1424 
1425  n.x(A).y(B).z(C);
1426  n.Normalize();
1427  };
NT p1
double B() const
double C() const
C3Vector & Normalize()
double A() const

Here is the call graph for this function:

C3Plane ( const C3Vector N,
const C3Point P 
)
inline

Definition at line 1428 of file GeoPrimitives.H.

1429  : n(N.Unit()),p(P)
1430  {};
C3Plane ( const C3Plane plane)
inline

Definition at line 1431 of file GeoPrimitives.H.

1432  : n(plane.n),p(plane.p)
1433  {};
C3Plane ( const std::vector< C3Point > &  vec)
inline

Definition at line 1434 of file GeoPrimitives.H.

References C3Plane::A(), C3Plane::B(), C3Plane::C(), C3Plane::n, C3Vector::Normalize(), x, C3Vector::x(), y, and z.

1435  : p(vec[0])
1436  {
1437  double A = vec[0].y()*(vec[1].z() - vec[2].z()) +
1438  vec[1].y()*(vec[2].z() - vec[0].z()) +
1439  vec[2].y()*(vec[0].z() - vec[1].z());
1440  double B = vec[0].z()*(vec[1].x() - vec[2].x()) +
1441  vec[1].z()*(vec[2].x() - vec[0].x()) +
1442  vec[2].z()*(vec[0].x() - vec[1].x());
1443  double C = vec[0].x()*(vec[1].y() - vec[2].y()) +
1444  vec[1].x()*(vec[2].y() - vec[0].y()) +
1445  vec[2].x()*(vec[0].y() - vec[1].y());
1446  // double D = -1.0 * ( p1.x()*(p2.y()*p3.z() - p3.y()*p2.z()) +
1447  // p2.x()*(p3.y()*p1.z() - p1.y()*p3.z()) +
1448  // p3.x()*(p1.y()*p2.z() - p2.y()*p1.z()) );
1449 
1450  n.x(A).y(B).z(C);
1451  n.Normalize();
1452  } ;
void int int REAL REAL * y
Definition: read.cpp:74
double B() const
double C() const
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
C3Vector & Normalize()
double A() const

Here is the call graph for this function:

Member Function Documentation

double A ( ) const
inline

Definition at line 1459 of file GeoPrimitives.H.

References C3Plane::n, and C3Vector::x().

Referenced by C3Plane::C3Plane().

1459 { 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 1460 of file GeoPrimitives.H.

References C3Plane::n, and C3Vector::y().

Referenced by C3Plane::C3Plane().

1460 { 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 1461 of file GeoPrimitives.H.

References C3Plane::n, and C3Vector::z().

Referenced by C3Plane::C3Plane().

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool contains_point ( const C3Point P) const
inline

Definition at line 1470 of file GeoPrimitives.H.

References C3Plane::D(), C3Plane::n, GeoPrim::TOL, C3Vector::x(), C3Vector::y(), and C3Vector::z().

Referenced by C3Plane::operator==(), and Mesh::GenericElement::ShapeOK().

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

Here is the call graph for this function:

Here is the caller graph for this function:

double D ( ) const
inline

Definition at line 1462 of file GeoPrimitives.H.

References C3Plane::n, C3Plane::p, C3Vector::x(), C3Vector::y(), and C3Vector::z().

Referenced by C3Plane::contains_point().

1463  {
1464  return( -1.0 * ( n.x()*p.x() + n.y()*p.y() + n.z()*p.z()));
1465  };

Here is the call graph for this function:

Here is the caller graph for this function:

C3Vector& normal ( )
inline

Definition at line 1466 of file GeoPrimitives.H.

References C3Plane::n.

1466 { return(n); };
const C3Vector& normal ( ) const
inline

Definition at line 1467 of file GeoPrimitives.H.

References C3Plane::n.

1467 { return(n); };
C3Plane& operator= ( const C3Plane plane)
inline

Definition at line 1453 of file GeoPrimitives.H.

References C3Plane::n, and C3Plane::p.

1454  {
1455  n = plane.n;
1456  p = plane.p;
1457  return(*this);
1458  };
bool operator== ( const C3Plane plane) const
inline

Definition at line 1474 of file GeoPrimitives.H.

References C3Plane::contains_point(), C3Plane::n, C3Plane::p, and C3Vector::Unit().

1475  {
1476  return((plane.n.Unit() == n.Unit()) && contains_point(plane.p));
1477  };
C3Vector Unit() const
bool contains_point(const C3Point &P) const

Here is the call graph for this function:

C3Point& point ( )
inline

Definition at line 1468 of file GeoPrimitives.H.

References C3Plane::p.

1468 { return(p); };
const C3Point& point ( ) const
inline

Definition at line 1469 of file GeoPrimitives.H.

References C3Plane::p.

1469 { return(p); };

Member Data Documentation

C3Point p
protected

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