src/cdtGen.cpp
/*! \fn void CDTGenerator::sew2CellsWithDartInfoFromEdge(LCCWithDartInfo &lcc)
 *  \brief Sews 2-cells of LCC with dart info sharing common edge.
 *  \param [in, out] Linear cell complex containing 2-cells.  
 */
\fn void CDTGenerator::sew2CellsWithDartInfoFromEdge(LCCWithDartInfo &lcc)
\brief Sews 2-cells of LCC with dart info sharing common edge.
\param [in, out] Linear cell complex containing 2-cells.
\ fn void CDTGenerator :: sew2CellsWithDartInfoFromEdge ( LCCWithDartInfo &lcc ) \ brief Sews 2 - cells of LCC with dart info sharing common edge . \ param [ in out ] Linear cell complex containing 2 - cells .
void CDTGenerator::sew2CellsWithDartInfoFromEdge(LCCWithDartInfo &lcc)
{
	vector<pair<LCCWithDartInfo::Dart_handle, LCCWithDartInfo::Dart_handle> > twoCellsToBeSewed;
	int sewedMark = lcc.get_new_mark();
	if (sewedMark == -1)
	{
		cout << "\nNo free mark available!!";
		exit(0);
	}	
	for (LCCWithDartInfo::Dart_range::iterator segIter1 = lcc.darts().begin(), segIterEnd1 = lcc.darts().end(); segIter1 != segIterEnd1; segIter1++)
	{
		if (!lcc.is_marked(segIter1, sewedMark)) 
		{
			for (LCCWithDartInfo::Dart_range::iterator segIter2 = lcc.darts().begin(), segIterEnd2 = lcc.darts().end(); segIter2 != segIterEnd2; segIter2++)
			{
				if (!lcc.is_marked(segIter2, sewedMark) && lcc.is_sewable<2>(segIter1, segIter2))
				{
					if (areGeometricallySameSegmentsWithDartInfo(segIter1, segIter2, lcc)) 
					{
						lcc.mark(segIter1, sewedMark);
						lcc.mark(segIter2, sewedMark);
						twoCellsToBeSewed.push_back(pair<LCCWithDartInfo::Dart_handle, LCCWithDartInfo::Dart_handle>(segIter1, segIter2));
						break;
					}
				}
				else
					continue;
			}
		}	
		else
			continue;
	}
	size_t k = 0;
	for (vector<pair<LCCWithDartInfo::Dart_handle, LCCWithDartInfo::Dart_handle> >::iterator dIter = twoCellsToBeSewed.begin(), dIterEnd = twoCellsToBeSewed.end(); dIter != dIterEnd; dIter++)
		if (lcc.is_sewable<2>(dIter->first, dIter->second))
		{
			lcc.sew<2>(dIter->first, dIter->second);
			k++;	
		}
	lcc.free_mark(sewedMark);
}
void CDTGenerator :: sew2CellsWithDartInfoFromEdge ( LCCWithDartInfo & lcc ) { vector < pair < LCCWithDartInfo :: Dart_handle , LCCWithDartInfo :: Dart_handle > > twoCellsToBeSewed ; int sewedMark = lcc . get_new_mark ( ) ; if ( sewedMark == -1 ) { cout << " \n " ; exit ( 0 ) ; } for ( LCCWithDartInfo :: Dart_range :: iterator segIter1 = lcc . darts ( ) . begin ( ) , segIterEnd1 = lcc . darts ( ) . end ( ) ; segIter1 != segIterEnd1 ; segIter1 ++ ) { if ( ! lcc . is_marked ( segIter1 , sewedMark ) ) { for ( LCCWithDartInfo :: Dart_range :: iterator segIter2 = lcc . darts ( ) . begin ( ) , segIterEnd2 = lcc . darts ( ) . end ( ) ; segIter2 != segIterEnd2 ; segIter2 ++ ) { if ( ! lcc . is_marked ( segIter2 , sewedMark ) && lcc . is_sewable < 2 > ( segIter1 , segIter2 ) ) { if ( areGeometricallySameSegmentsWithDartInfo ( segIter1 , segIter2 , lcc ) ) { lcc . mark ( segIter1 , sewedMark ) ; lcc . mark ( segIter2 , sewedMark ) ; twoCellsToBeSewed . push_back ( pair < LCCWithDartInfo :: Dart_handle , LCCWithDartInfo :: Dart_handle > ( segIter1 , segIter2 ) ) ; break ; } } else continue ; } } else continue ; } size_t k = 0 ; for ( vector < pair < LCCWithDartInfo :: Dart_handle , LCCWithDartInfo :: Dart_handle > > :: iterator dIter = twoCellsToBeSewed . begin ( ) , dIterEnd = twoCellsToBeSewed . end ( ) ; dIter != dIterEnd ; dIter ++ ) if ( lcc . is_sewable < 2 > ( dIter -> first , dIter -> second ) ) { lcc . sew < 2 > ( dIter -> first , dIter -> second ) ; k ++ ; } lcc . free_mark ( sewedMark ) ; }
\fn void CDTGenerator::sew2CellsWithDartInfoFromEdge(LCCWithDartInfo &lcc)
  \brief Sews 2-cells of LCC with dart info sharing common edge.
\ fn void CDTGenerator :: sew2CellsWithDartInfoFromEdge ( LCCWithDartInfo &lcc ) \ brief Sews 2 - cells of LCC with dart info sharing common edge .
// sew facets sharing edge // not sewed till now // checks the geometry of segments // sew the faces sharing an edge