Skip to content

Commit

Permalink
Merge branch 'issue63_VTI-writer' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tkphd committed Oct 16, 2018
2 parents 76c6bab + 64b2e9b commit 4af68b3
Show file tree
Hide file tree
Showing 4 changed files with 650 additions and 773 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ MMSP is nothing more than a collection of C++ header files that declare a number
* An ISO compliant C++ compiler (e.g. GCC 2.95 or later)
* zlib libraries for data compression (e.g. zlib 1.2.7)
* libpng headers for mmsp2png image generation utility (e.g. libpng12-dev)
* libvtk headers for mmsp2vti image generation utility (e.g. libvtk6-dev)
* MPI libraries if compiling parallel programs (e.g. Open MPI)

*Documentation*
Expand Down
8 changes: 6 additions & 2 deletions include/MMSP.grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,10 +1181,14 @@ template<int dim, typename T> void grid<dim,T>::input(const char* filename, int
}

// grid data type error check
std::string type;
std::string type, scalar_type;
getline(input, type, '\n');
scalar_type = "grid:scalar" + type.substr(type.find_last_of(":", 8));
if (type != name(*this) && scalar_type == name(*this)) {
type = scalar_type;
}
if (type != name(*this)) {
std::cerr << "File read error: wrong data type (" << type << ")." << std::endl;
std::cerr << "File read error: wrong data type (" << type << "), expected (" << name(*this) << ")." << std::endl;
exit(-2);
}

Expand Down
12 changes: 8 additions & 4 deletions utility/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
# GNU makefile for grid conversion programs using MMSP
# Questions/comments to [email protected] (Jason Gruber)

# find VTK libraries
VTK_SRC = -I $(shell dirname $(shell locate --limit 1 vtkImageData.h))
VTK_LIB = -L $(shell dirname $(shell locate --limit 1 vtkCommonCore.so))
vtklinks = -lvtkCommonCore -lvtkCommonDataModel -lvtkIOXML

# compilers/flags
compiler = g++
flags = -O2 -Wall -pedantic -I ../include/

flags = -O2 -Wall -I ../include $(VTK_SRC) $(VTK_LIB)
topo = ../algorithms/topology

# conversion programs
Expand All @@ -32,9 +36,9 @@ mmsp2pvd : mmsp2pvd.cpp
mmsp2tsv : mmsp2tsv.cpp
$(compiler) $(flags) $< -o $@ -lz

# convert MMSP grid file to VTK Image file type
# convert MMSP grid file to compressed VTK Image file type
mmsp2vti : mmsp2vti.cpp
$(compiler) $(flags) $< -o $@ -lz
$(compiler) $(flags) $< -o $@ $(vtklinks) -lz

# convert MMSP grid file to XYZ point cloud file type
mmsp2xyz : mmsp2xyz.cpp
Expand Down
Loading

0 comments on commit 4af68b3

Please sign in to comment.