src/cdtGen.cpp
/*! \fn bool CDTGenerator::isCellOutsidePLC(LCC::Dart_handle cellHandle)
 *  \brief Tests whether input cell is outside PLC
 *  \param [in] cellHandle Dart handle for the input cell.
 *  \return True if the input cell is outside PLC.
 */
\fn bool CDTGenerator::isCellOutsidePLC(LCC::Dart_handle cellHandle)
\brief Tests whether input cell is outside PLC
\param [in] cellHandle Dart handle for the input cell.
\return True if the input cell is outside PLC.
\ fn bool CDTGenerator :: isCellOutsidePLC ( LCC :: Dart_handle cellHandle ) \ brief Tests whether input cell is outside PLC \ param [ in ] cellHandle Dart handle for the input cell . \ return True if the input cell is outside PLC .
bool CDTGenerator::isCellOutsidePLC(LCC::Dart_handle &cellHandle, CGALPoint& plcCentroid)
{
	size_t i = 0;
	CGALPoint p[4];
	for (LCC::One_dart_per_incident_cell_range<0, 3>::iterator pIter = cdtMesh.one_dart_per_incident_cell<0, 3>(cellHandle).begin(), pIterEnd = cdtMesh.one_dart_per_incident_cell<0, 3>(cellHandle).end(); pIter != pIterEnd; pIter++)
		p[i++] = cdtMesh.point(pIter); 
	CGALPoint testTetCentroid = centroid(p[0], p[1], p[2], p[3]);
	CGALRay randomRay = CGALRay(testTetCentroid, plcCentroid);
	if (randomRay.is_degenerate())
	{
		cout << "Generated ray is degenerate!!";
		exit(0);
	}
	size_t nIntersections = 0;
	for (LCC::One_dart_per_cell_range<2>::iterator fHandle = plc.one_dart_per_cell<2>().begin(), fHandleEnd = plc.one_dart_per_cell<2>().end(); fHandle != fHandleEnd; fHandle++)
		countRayPLCFacetIntersections(randomRay, fHandle, nIntersections);
	return (nIntersections % 2 == 0) ? true : false;
}
bool CDTGenerator :: isCellOutsidePLC ( LCC :: Dart_handle & cellHandle , CGALPoint & plcCentroid ) { size_t i = 0 ; CGALPoint p [ 4 ] ; for ( LCC :: One_dart_per_incident_cell_range < 0 , 3 > :: iterator pIter = cdtMesh . one_dart_per_incident_cell < 0 , 3 > ( cellHandle ) . begin ( ) , pIterEnd = cdtMesh . one_dart_per_incident_cell < 0 , 3 > ( cellHandle ) . end ( ) ; pIter != pIterEnd ; pIter ++ ) p [ i ++ ] = cdtMesh . point ( pIter ) ; CGALPoint testTetCentroid = centroid ( p [ 0 ] , p [ 1 ] , p [ 2 ] , p [ 3 ] ) ; CGALRay randomRay = CGALRay ( testTetCentroid , plcCentroid ) ; if ( randomRay . is_degenerate ( ) ) { cout << " " ; exit ( 0 ) ; } size_t nIntersections = 0 ; for ( LCC :: One_dart_per_cell_range < 2 > :: iterator fHandle = plc . one_dart_per_cell < 2 > ( ) . begin ( ) , fHandleEnd = plc . one_dart_per_cell < 2 > ( ) . end ( ) ; fHandle != fHandleEnd ; fHandle ++ ) countRayPLCFacetIntersections ( randomRay , fHandle , nIntersections ) ; return ( nIntersections % 2 == 0 ) ? true : false ; }
\fn bool CDTGenerator::isCellOutsidePLC(LCC::Dart_handle cellHandle)
  \brief Tests whether input cell is outside PLC
  \param [in] cellHandle Dart handle for the input cell.
\ fn bool CDTGenerator :: isCellOutsidePLC ( LCC :: Dart_handle cellHandle ) \ brief Tests whether input cell is outside PLC \ param [ in ] cellHandle Dart handle for the input cell .
// endpoint 1 // compute random ray //	cout << "Centroid of plc is:  " << plcCentroid << endl; //	cout << "Centroid of test tet is:  " << testTetCentroid << endl; //	cout << "Total number of intersections: " << nIntersections << endl;