207 if (x < 0 or y < 0 or z < 0 )
210 if (Skin_Grid[x][y][z] ==
false){
211 if (Exterior[x][y][z] ==
false){
212 Exterior[x][y][z] =
true;
294 Exterior =
new bool ** [
LengthX];
296 Exterior[i] =
new bool * [
LengthY];
298 Exterior[i][j] =
new bool [
LengthZ];
305 Exterior[i][j][k] =
false;
312 if (Skin_Grid[i][j][0] ==
false){
313 if (Exterior[i][j][0] ==
false){
314 Exterior[i][j][0] =
true;
322 if (Skin_Grid[i][j][
LengthZ-1] ==
false){
323 if (Exterior[i][j][
LengthZ-1] ==
false){
324 Exterior[i][j][
LengthZ-1] =
true;
336 if (Skin_Grid[0][j][k] ==
false){
337 if (Exterior[0][j][k] ==
false){
338 Exterior[0][j][k] =
true;
346 if (Skin_Grid[
LengthX-1][j][k] ==
false){
347 if (Exterior[
LengthX-1][j][k] ==
false){
348 Exterior[
LengthX-1][j][k] =
true;
361 if (Skin_Grid[i][0][k] ==
false){
362 if (Exterior[i][0][k] ==
false){
363 Exterior[i][0][k] =
true;
371 if (Skin_Grid[i][
LengthY-1][k] ==
false){
372 if (Exterior[i][
LengthY-1][k] ==
false){
373 Exterior[i][
LengthY-1][k] =
true;
637 char output_file_name [] =
"sphere.grd";
638 char Title [] =
"Sphere ";
640 float scale = 1.0, spacing = 0.1;
641 float dummy1 = 0.0, dummy2 = 0.0, dummy3 = 0.0, dummy4 = 0.0, dummy5 = 0.0, dummy6 = 0.0, dummy7 = 0.0;
642 float o_x = 0.0, o_y = 0.0, o_z = 0.0;
643 int idummy1 = 0, idummy2 = 0, idummy3 = 0, idummy4 = 0, idummy5 = 0;
646 std::cout <<
"Writing the DT-Grid (ASCII) to the output file ..." << std::endl;
647 fprintf(output_file,
"%72s\n", Title);
648 fprintf(output_file,
"%12.5E%12.5E%7d%7d%7d%7d%7d\n", scale, dummy1, 3, idummy1, idummy2, one, idummy3);
649 fprintf(output_file,
"%7d%7d%7d%12.5E%12.5E%12.5E%12.5E\n", dimi, dimj, dimk, spacing, o_x, o_y, o_z);
650 fprintf(output_file,
"%12.5E%12.5E%12.5E%12.5E\n", dummy2, dummy3, dummy4, dummy5);
651 fprintf(output_file,
"%12.5E%12.5E%7d%7d\n", dummy6, dummy7, idummy4, idummy5);
668 char Title [] =
"Sphere ";
670 float scale = 1.0, spacing = 0.1;
671 float dummy1 = 0.0, dummy2 = 0.0, dummy3 = 0.0, dummy4 = 0.0, dummy5 = 0.0, dummy6 = 0.0, dummy7 = 0.0;
672 float o_x = 0.0, o_y = 0.0, o_z = 0.0;
673 int idummy1 = 0, idummy2 = 0, idummy3 = 0, idummy4 = 0, idummy5 = 0;
676 int binary_dt_type = 2;
677 int flag_binary = 160;
678 std::cout <<
"Writing the DT-Grid to the output file ..." << std::endl;
679 fwrite(&flag_binary,
sizeof(
int),1,output_file);
680 fwrite(Title,
sizeof(
char), 72, output_file);
681 fwrite(&(scale),
sizeof(
float),1,output_file);
682 fwrite(&(dummy1),
sizeof(
float),1,output_file);
683 fwrite(&binary_dt_type,
sizeof(
int),1,output_file);
684 fwrite(&(idummy1),
sizeof(
int),1,output_file);
685 fwrite(&(idummy2),
sizeof(
int),1,output_file);
686 fwrite(&(one),
sizeof(
int),1,output_file);
687 fwrite(&(idummy3),
sizeof(
int),1,output_file);
688 fwrite(&(dimi),
sizeof(
int),1,output_file);
689 fwrite(&(dimj),
sizeof(
int),1,output_file);
690 fwrite(&(dimk),
sizeof(
int),1,output_file);
691 fwrite(&(spacing),
sizeof(
float),1,output_file);
692 fwrite(&(o_x),
sizeof(
float),1,output_file);
693 fwrite(&(o_y),
sizeof(
float),1,output_file);
694 fwrite(&(o_z),
sizeof(
float),1,output_file);
695 fwrite(&(dummy2),
sizeof(
float),1,output_file);
696 fwrite(&(dummy3),
sizeof(
float),1,output_file);
697 fwrite(&(dummy4),
sizeof(
float),1,output_file);
698 fwrite(&(dummy5),
sizeof(
float),1,output_file);
699 fwrite(&(dummy6),
sizeof(
float),1,output_file);
700 fwrite(&(dummy7),
sizeof(
float),1,output_file);
701 fwrite(&(idummy4),
sizeof(
int),1,output_file);
702 fwrite(&(idummy5),
sizeof(
int),1,output_file);
int check_neighbours(bool ***, bool ***, int, int, int)
projection array to bridge 2D and 3D DT-Grids
Definition DTgrd.hpp:202