38 for(
int i = 1; i < nsTgt; i++ )
40 middle = 1. / nsTgt * middle;
43 for(
int j = 0; j < nsTgt; j++ )
48 if( rc != 0 )
return 1;
51 for(
int j = 1; j < nsTgt - 1; j++ )
70 bool check_boxes_first )
85 for(
int i = 0; i < nsSrc; i++ )
87 int nexti = ( i + 1 ) % nsSrc;
95 if( check_boxes_first )
107 for(
int j = 0; j < nsTgt; j++ )
112 for(
int j = 0; j < nsSrc; j++ )
120 for(
int j = 0; j < nsSrc; j++ )
128 std::cout <<
"gnomonic plane: " <<
plane <<
"\n";
129 std::cout <<
" tgt src\n";
130 for(
int j = 0; j < nsTgt; j++ )
134 for(
int j = 0; j < nsSrc; j++ )
141 markb, markr,
plane,
R, P, nP ) );
146 if( extraPoints >= 1 )
148 for(
int k = 0; k < nsSrc; k++ )
157 markb[( k + nsSrc - 1 ) % nsSrc] =
172 if( extraPoints >= 1 )
174 for(
int k = 0; k < nsTgt; k++ )
180 markr[( k + nsTgt - 1 ) % nsTgt] =
197 for(
int k = 1; k < nP - 1; k++ )
218 for(
int n = 0; n < nP; n++ )
219 std::cout <<
" \t" << iP[2 * n] <<
"\t" << iP[2 * n + 1] <<
"\n";
237 for(
int i = 0; i < nP; i++ )
239 double* pp = &iP[2 * i];
248 for( j = 0; j < nsTgt && !found; j++ )
266 for( j = 0; j < nsSrc && !found; j++ )
286 for( j = 0; j < nsTgt; j++ )
288 int j1 = ( j + 1 ) % nsTgt;
293 <<
" " <<
tgtConn[j1] <<
" area : " << area <<
"\n";
303 std::cerr <<
" error in adjacent tgt edge: " <<
mb->
id_from_handle( adjTgtEdges[j] ) <<
"\n";
311 int nbExtraNodesSoFar = expts->size();
312 if( nbExtraNodesSoFar > 0 )
315 mb->
get_coords( &( *expts )[0], nbExtraNodesSoFar, &( coords1[0][0] ) );
317 for(
int k = 0; k < nbExtraNodesSoFar && !found; k++ )
324 foundIds[i] = ( *expts )[k];
326 if( dbg_1 ) std::cout <<
" found node:" << foundIds[i] << std::endl;
340 ( *expts ).push_back( outNode );
341 foundIds[i] = outNode;
344 if( dbg_1 ) std::cout <<
" new node: " << outNode << std::endl;
352 std::cout <<
" tgt quad: ";
353 for(
int j1 = 0; j1 < nsTgt; j1++ )
357 std::cout <<
" a point pp is not on a tgt quad " << *pp <<
" " << pp[1] <<
" tgt quad "
366 std::cout <<
" candidate polygon: nP" << nP <<
" plane: " <<
plane <<
"\n";
367 for(
int i1 = 0; i1 < nP; i1++ )
368 std::cout << iP[2 * i1] <<
" " << iP[2 * i1 + 1] <<
" " << foundIds[i1] <<
"\n";
397 std::cout <<
"Counting: " <<
counting <<
"\n";
398 std::cout <<
" polygon " <<
mb->
id_from_handle( polyNew ) <<
" nodes: " << nP <<
" :";
399 for(
int i1 = 0; i1 < nP; i1++ )
401 std::cout <<
" plane: " <<
plane <<
"\n";
402 std::vector< CartVect > posi( nP );
404 for(
int i1 = 0; i1 < nP; i1++ )
405 std::cout << foundIds[i1] <<
" " << posi[i1] <<
"\n";
407 std::stringstream fff;
408 fff <<
"file0" <<
counting <<
".vtk";