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

#include <GeoPrimitives.H>

Inheritance diagram for CFacet:
Collaboration diagram for CFacet:

Public Member Functions

 CFacet ()
 
 CFacet (const CPoint &P1, const CPoint &P2, const CPoint &P3)
 
 CFacet (const CPoint &P1, const CPoint &P2, const CPoint &P3, const CPoint &P4)
 
 CFacet (const std::vector< CPoint > &v)
 
 CFacet (const CFacet &face)
 
CVector normal () const
 
CPoint centroid () const
 
CFacetoperator= (const CFacet &face)
 
bool operator== (const CFacet &face) const
 
bool contains_point (const CPoint &P)
 

Additional Inherited Members

- Public Attributes inherited from vector< T >
elements
 STL member. More...
 

Detailed Description

Definition at line 1520 of file GeoPrimitives.H.

Constructor & Destructor Documentation

CFacet ( )
inline

Definition at line 1523 of file GeoPrimitives.H.

1523 {};
CFacet ( const CPoint P1,
const CPoint P2,
const CPoint P3 
)
inline

Definition at line 1524 of file GeoPrimitives.H.

1525  {
1526  this->resize(3);
1527  (*this)[0] = P1;
1528  (*this)[1] = P2;
1529  (*this)[2] = P3;
1530  };
CFacet ( const CPoint P1,
const CPoint P2,
const CPoint P3,
const CPoint P4 
)
inline

Definition at line 1531 of file GeoPrimitives.H.

1533  {
1534  this->resize(4);
1535  (*this)[0] = P1;
1536  (*this)[1] = P2;
1537  (*this)[2] = P3;
1538  (*this)[3] = P4;
1539  };
CFacet ( const std::vector< CPoint > &  v)
inline

Definition at line 1540 of file GeoPrimitives.H.

References pi.

1541  {
1542  std::vector<CPoint>::const_iterator pi = v.begin();
1543  while(pi != v.end())
1544  this->push_back(*pi++);
1545  };
const double pi
CFacet ( const CFacet face)
inline

Definition at line 1546 of file GeoPrimitives.H.

1547  {
1548  std::vector<CPoint>::const_iterator fi = face.begin();
1549  while(fi != face.end())
1550  this->push_back(*fi++);
1551  };
Definition: face.h:90

Member Function Documentation

CPoint centroid ( ) const
inline

Definition at line 1558 of file GeoPrimitives.H.

References GeoPrim::Centroid().

1559  {
1560  return(Centroid(*this));
1561  };
CPoint Centroid(const PointContainer &pc)

Here is the call graph for this function:

bool contains_point ( const CPoint P)
inline

Definition at line 1580 of file GeoPrimitives.H.

References cimg_library::acos(), angle(), CPlane::contains_point(), GeoPrim::PI, GeoPrim::TOL, and v.

1581  {
1582  CPlane plane((*this)[0],(*this)[1],(*this)[2]);
1583  if(!(plane.contains_point(P)))
1584  return false;
1585  std::vector<CPoint>::const_iterator fi = this->begin();
1586  CVector v1(P,*fi);
1587  CVector vp(v1);
1588  fi++;
1589  double angle = 0.0;
1590  while(fi != this->end()){
1591  CVector v(P,(*fi));
1592  angle += acos(v*vp);
1593  vp = v;
1594  fi++;
1595  }
1596  angle += acos(vp*v1);
1597  return((fabs(angle) - 2*PI) <= TOL);
1598  };
const double PI
Definition: GeoPrimitives.H:18
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
const double TOL
Definition: GeoPrimitives.H:17
double angle(Vector_3< double > v1, Vector_3< double > v2)
Compute the angle between two vectors.
Definition: geometry.C:61
CImg< _cimg_Tfloat > acos(const CImg< T > &instance)
Definition: CImg.h:6051

Here is the call graph for this function:

CVector normal ( ) const
inline

Definition at line 1552 of file GeoPrimitives.H.

1553  {
1554  CVector v1((*this)[0],(*this)[1]);
1555  CVector v2((*this)[0],(*this)[2]);
1556  return(.5*(v1%v2));
1557  };
CFacet& operator= ( const CFacet face)
inline

Definition at line 1562 of file GeoPrimitives.H.

1563  {
1564  this->clear();
1565  std::vector<CPoint>::const_iterator fi = face.begin();
1566  while(fi != face.end())
1567  this->push_back(*fi++);
1568  return(*this);
1569  };
Definition: face.h:90
bool operator== ( const CFacet face) const
inline

Definition at line 1570 of file GeoPrimitives.H.

1571  {
1572  std::vector<CPoint>::const_iterator li = this->begin();
1573  std::vector<CPoint>::const_iterator fi = face.begin();
1574  if(this->size() != face.size()) return false;
1575  while(li != this->end())
1576  if(!(*li++ == *fi++))
1577  return(false);
1578  return(true);
1579  };
Definition: face.h:90

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