Skip to content

Commit

Permalink
modules: Remove major version from VTK outputs (r.out.vtk, r3.out.vtk…
Browse files Browse the repository at this point in the history
…, v.out.vtk)

r.out.vtk, r3.out.vtk, and v.out.vtk include software name in the VTK header line. This removes the major version from the string.
  • Loading branch information
wenzeslaus committed Apr 28, 2022
1 parent 3820004 commit 9e1096f
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 13 deletions.
7 changes: 4 additions & 3 deletions raster/r.out.vtk/writeascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ write_vtk_normal_header(FILE * fp, struct Cell_head region, double elevation,

/*Simple vtk ASCII header */
fprintf(fp, "# vtk DataFile Version 3.0\n");
fprintf(fp, "GRASS GIS 7 Export\n");
/* The header line describes the data. */
fprintf(fp, "GRASS GIS Export\n");
fprintf(fp, "ASCII\n");
fprintf(fp, "DATASET STRUCTURED_POINTS\n"); /*We are using the structured point dataset. */

Expand Down Expand Up @@ -109,7 +110,7 @@ void write_vtk_structured_elevation_header(FILE * fp, struct Cell_head region)

/*Simple vtk ASCII header */
fprintf(fp, "# vtk DataFile Version 3.0\n");
fprintf(fp, "GRASS GIS 7 Export\n");
fprintf(fp, "GRASS GIS Export\n");
fprintf(fp, "ASCII\n");
fprintf(fp, "DATASET STRUCTURED_GRID\n"); /*We are using the structured grid dataset. */
fprintf(fp, "DIMENSIONS %i %i %i\n", region.cols, region.rows, 1);
Expand All @@ -125,7 +126,7 @@ void write_vtk_polygonal_elevation_header(FILE * fp, struct Cell_head region)

/*Simple vtk ASCII header */
fprintf(fp, "# vtk DataFile Version 3.0\n");
fprintf(fp, "GRASS GIS 7 Export\n");
fprintf(fp, "GRASS GIS Export\n");
fprintf(fp, "ASCII\n");
fprintf(fp, "DATASET POLYDATA\n"); /*We are using polydataset. */
fprintf(fp, "POINTS %i float\n", region.cols * region.rows);
Expand Down
2 changes: 1 addition & 1 deletion raster3d/r3.out.vtk/test_volume_null_1_cells.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vtk DataFile Version 3.0
GRASS GIS 7 Export
GRASS GIS Export
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 13 9 6
Expand Down
2 changes: 1 addition & 1 deletion raster3d/r3.out.vtk/test_volume_null_1_cells_elevation.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vtk DataFile Version 3.0
GRASS GIS 7 Export
GRASS GIS Export
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 3840 float
Expand Down
2 changes: 1 addition & 1 deletion raster3d/r3.out.vtk/test_volume_null_1_cells_rgb_vect.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vtk DataFile Version 3.0
GRASS GIS 7 Export
GRASS GIS Export
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 13 9 6
Expand Down
2 changes: 1 addition & 1 deletion raster3d/r3.out.vtk/test_volume_null_1_points.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vtk DataFile Version 3.0
GRASS GIS 7 Export
GRASS GIS Export
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 12 8 5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vtk DataFile Version 3.0
GRASS GIS 7 Export
GRASS GIS Export
ASCII
DATASET STRUCTURED_GRID
DIMENSIONS 12 8 5
Expand Down
2 changes: 1 addition & 1 deletion raster3d/r3.out.vtk/test_volume_null_1_points_rgb_vect.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vtk DataFile Version 3.0
GRASS GIS 7 Export
GRASS GIS Export
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 12 8 5
Expand Down
7 changes: 4 additions & 3 deletions raster3d/r3.out.vtk/writeVTKHead.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void write_vtk_structured_point_header(FILE * fp, char *vtkFile,
/*Simple vtk ASCII header */

fprintf(fp, "# vtk DataFile Version 3.0\n");
fprintf(fp, "GRASS GIS 7 Export\n");
/* The header line describes the data. */
fprintf(fp, "GRASS GIS Export\n");
fprintf(fp, "ASCII\n");
fprintf(fp, "DATASET STRUCTURED_POINTS\n"); /*We are using the structured point dataset. */

Expand Down Expand Up @@ -95,7 +96,7 @@ void write_vtk_structured_grid_header(FILE * fp, char *vtkFile,
G_debug(3,
"write_vtk_structured_grid_header: Writing VTKStructuredGrid-Header");
fprintf(fp, "# vtk DataFile Version 3.0\n");
fprintf(fp, "GRASS GIS 7 Export\n");
fprintf(fp, "GRASS GIS Export\n");
fprintf(fp, "ASCII\n");
fprintf(fp, "DATASET STRUCTURED_GRID\n"); /*We are using the structured grid dataset. */
fprintf(fp, "DIMENSIONS %i %i %i\n", region.cols, region.rows,
Expand All @@ -117,7 +118,7 @@ void write_vtk_unstructured_grid_header(FILE * fp, char *vtkFile,
G_debug(3,
"write_vtk_unstructured_grid_header: Writing VTKUnstructuredGrid-Header");
fprintf(fp, "# vtk DataFile Version 3.0\n");
fprintf(fp, "GRASS GIS 7 Export\n");
fprintf(fp, "GRASS GIS Export\n");
fprintf(fp, "ASCII\n");
fprintf(fp, "DATASET UNSTRUCTURED_GRID\n"); /*We are using the unstructured grid dataset. */
/*Only cell data is available, because we creating a hexaeder/vtk-voxel for every voxel */
Expand Down
3 changes: 2 additions & 1 deletion vector/v.out.vtk/head.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ int write_vtk_head(FILE * fp, struct Map_info *Map)
{
G_debug(3, _("writeVTKHeader: Writing VTK-Header"));
fprintf(fp, "# vtk DataFile Version 3.0\n");
fprintf(fp, "GRASS GIS 7 vector map: %s\n", Map->name);
/* The header line describes the data. */
fprintf(fp, "GRASS GIS vector map: %s\n", Map->name);
fprintf(fp, "ASCII\n");
fprintf(fp, "DATASET POLYDATA\n"); /*We are using polydata. If Volume data is supported, uGrid should be used */
return (0);
Expand Down

0 comments on commit 9e1096f

Please sign in to comment.