Commit ff540bed authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'feature/errors_messages' into 'master'

Error handling

See merge request spraetor/dune-vtk!31
parents 43414df5 38d5e1df
...@@ -4,6 +4,7 @@ dune_add_library("filesystem" OBJECT ...@@ -4,6 +4,7 @@ dune_add_library("filesystem" OBJECT
#install headers #install headers
install(FILES install(FILES
enum.hh enum.hh
errors.hh
filesystem.hh filesystem.hh
lagrangepoints.hh lagrangepoints.hh
lagrangepoints.impl.hh lagrangepoints.impl.hh
......
#pragma once
#include <dune/common/exceptions.hh>
/**
* \file
* \brief Macro for wrapping error checks and throwing exceptions
*/
namespace Dune {
class VtkError : public Exception {};
}
/**
* \brief check if condition \a cond holds; otherwise, throw a VtkError with a message.
*/
#define VTK_ASSERT_MSG(cond, text) \
do { \
if (!(cond)) \
DUNE_THROW(Dune::VtkError, text); \
} while (false)
/**
* \brief check if condition \a cond holds; otherwise, throw a VtkError.
*/
#define VTK_ASSERT(cond) \
do { \
if (!(cond)) \
DUNE_THROW(Dune::VtkError, #cond); \
} while (false)
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <dune/common/classname.hh> #include <dune/common/classname.hh>
#include <dune/common/version.hh> #include <dune/common/version.hh>
#include "utility/errors.hh"
#include "utility/filesystem.hh" #include "utility/filesystem.hh"
#include "utility/string.hh" #include "utility/string.hh"
...@@ -23,7 +24,7 @@ void VtkReader<Grid,Creator>::read (std::string const& filename, bool fillCreato ...@@ -23,7 +24,7 @@ void VtkReader<Grid,Creator>::read (std::string const& filename, bool fillCreato
DUNE_THROW(IOError, "File " << filename << " does not exist!"); DUNE_THROW(IOError, "File " << filename << " does not exist!");
std::ifstream input(filename, std::ios_base::in | std::ios_base::binary); std::ifstream input(filename, std::ios_base::in | std::ios_base::binary);
assert(input.is_open()); VTK_ASSERT(input.is_open());
std::string ext = Vtk::Path(filename).extension().string(); std::string ext = Vtk::Path(filename).extension().string();
if (ext == ".vtu") { if (ext == ".vtu") {
...@@ -32,7 +33,7 @@ void VtkReader<Grid,Creator>::read (std::string const& filename, bool fillCreato ...@@ -32,7 +33,7 @@ void VtkReader<Grid,Creator>::read (std::string const& filename, bool fillCreato
} else if (ext == ".pvtu") { } else if (ext == ".pvtu") {
readParallelFileFromStream(input, comm().rank(), comm().size(), fillCreator); readParallelFileFromStream(input, comm().rank(), comm().size(), fillCreator);
} else { } else {
DUNE_THROW(IOError, "File has unknown file-extension '" << ext << "'. Allowed are only '.vtu' and '.pvtu'."); DUNE_THROW(Dune::VtkError, "File has unknown file-extension '" << ext << "'. Allowed are only '.vtu' and '.pvtu'.");
} }
} }
...@@ -56,16 +57,16 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo ...@@ -56,16 +57,16 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo
auto attr = parseXml(line, closed); auto attr = parseXml(line, closed);
if (!attr["type"].empty()) if (!attr["type"].empty())
assert(attr["type"] == "UnstructuredGrid"); VTK_ASSERT_MSG(attr["type"] == "UnstructuredGrid", "VtkReader supports UnstructuredGrid types");
if (!attr["version"].empty()) if (!attr["version"].empty())
assert(std::stod(attr["version"]) == 1.0); VTK_ASSERT_MSG(std::stod(attr["version"]) == 1.0, "File format must be 1.0");
if (!attr["byte_order"].empty()) if (!attr["byte_order"].empty())
assert(attr["byte_order"] == "LittleEndian"); VTK_ASSERT_MSG(attr["byte_order"] == "LittleEndian", "LittleEndian byte order supported");
if (!attr["header_type"].empty()) if (!attr["header_type"].empty())
assert(attr["header_type"] == "UInt64"); VTK_ASSERT_MSG(attr["header_type"] == "UInt64", "Header integer type must be UInt64");
if (!attr["compressor"].empty()) { if (!attr["compressor"].empty()) {
compressor = attr["compressor"]; compressor = attr["compressor"];
assert(compressor == "vtkZLibDataCompressor"); // only ZLib compression supported VTK_ASSERT_MSG(compressor == "vtkZLibDataCompressor", "Only ZLib compression supported");
} }
section = VTK_FILE; section = VTK_FILE;
} }
...@@ -79,7 +80,8 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo ...@@ -79,7 +80,8 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo
bool closed = false; bool closed = false;
auto attr = parseXml(line, closed); auto attr = parseXml(line, closed);
assert(attr.count("NumberOfPoints") > 0 && attr.count("NumberOfCells") > 0); VTK_ASSERT_MSG(attr.count("NumberOfPoints") > 0 && attr.count("NumberOfCells") > 0,
"Number of points or cells in file must be > 0");
numberOfPoints_ = std::stoul(attr["NumberOfPoints"]); numberOfPoints_ = std::stoul(attr["NumberOfPoints"]);
numberOfCells_ = std::stoul(attr["NumberOfCells"]); numberOfCells_ = std::stoul(attr["NumberOfCells"]);
section = PIECE; section = PIECE;
...@@ -129,7 +131,7 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo ...@@ -129,7 +131,7 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo
data_offset = 0; data_offset = 0;
if (!attr["offset"].empty()) { if (!attr["offset"].empty()) {
data_offset = std::stoul(attr["offset"]); data_offset = std::stoul(attr["offset"]);
assert(data_format == "appended"); VTK_ASSERT_MSG(data_format == "appended", "Attribute 'offset' only supported by appended mode");
} }
// Store attributes of DataArray // Store attributes of DataArray
...@@ -156,7 +158,7 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo ...@@ -156,7 +158,7 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo
else if (section == CELLS) else if (section == CELLS)
section = CELLS_DATA_ARRAY; section = CELLS_DATA_ARRAY;
else else
DUNE_THROW(Exception, "Wrong section for <DataArray>"); DUNE_THROW(Dune::VtkError, "Wrong section for <DataArray>");
} }
else if (line.substr(1,10) == "/DataArray") { else if (line.substr(1,10) == "/DataArray") {
if (section == PD_DATA_ARRAY) if (section == PD_DATA_ARRAY)
...@@ -168,13 +170,13 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo ...@@ -168,13 +170,13 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo
else if (section == CELLS_DATA_ARRAY) else if (section == CELLS_DATA_ARRAY)
section = CELLS; section = CELLS;
else else
DUNE_THROW(Exception, "Wrong section for </DataArray>"); DUNE_THROW(Dune::VtkError, "Wrong section for </DataArray>");
} }
else if (isSection(line, "AppendedData", section, VTK_FILE)) { else if (isSection(line, "AppendedData", section, VTK_FILE)) {
bool closed = false; bool closed = false;
auto attr = parseXml(line, closed); auto attr = parseXml(line, closed);
if (!attr["encoding"].empty()) if (!attr["encoding"].empty())
assert(attr["encoding"] == "raw"); // base64 encoding not supported VTK_ASSERT_MSG(attr["encoding"] == "raw", "base64 encoding not supported");
offset0_ = findAppendedDataPosition(input); offset0_ = findAppendedDataPosition(input);
if (dataArray_["points"].type == Vtk::FLOAT32) if (dataArray_["points"].type == Vtk::FLOAT32)
...@@ -223,7 +225,7 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo ...@@ -223,7 +225,7 @@ void VtkReader<Grid,Creator>::readSerialFileFromStream (std::ifstream& input, bo
} }
if (section != NO_SECTION) if (section != NO_SECTION)
DUNE_THROW(IOError, "VTK-File is incomplete. It must end with </VTKFile>!"); DUNE_THROW(Dune::VtkError, "VTK-File is incomplete. It must end with </VTKFile>!");
if (fillCreator) if (fillCreator)
fillGridCreator(); fillGridCreator();
...@@ -244,15 +246,15 @@ void VtkReader<Grid,Creator>::readParallelFileFromStream (std::ifstream& input, ...@@ -244,15 +246,15 @@ void VtkReader<Grid,Creator>::readParallelFileFromStream (std::ifstream& input,
auto attr = parseXml(line, closed); auto attr = parseXml(line, closed);
if (!attr["type"].empty()) if (!attr["type"].empty())
assert(attr["type"] == "PUnstructuredGrid"); VTK_ASSERT_MSG(attr["type"] == "PUnstructuredGrid", "VtkReader supports PUnstructuredGrid types");
if (!attr["version"].empty()) if (!attr["version"].empty())
assert(std::stod(attr["version"]) == 1.0); VTK_ASSERT_MSG(std::stod(attr["version"]) == 1.0, "File format must be 1.0");
if (!attr["byte_order"].empty()) if (!attr["byte_order"].empty())
assert(attr["byte_order"] == "LittleEndian"); VTK_ASSERT_MSG(attr["byte_order"] == "LittleEndian", "LittleEndian byte order supported");
if (!attr["header_type"].empty()) if (!attr["header_type"].empty())
assert(attr["header_type"] == "UInt64"); VTK_ASSERT_MSG(attr["header_type"] == "UInt64", "Header integer type must be UInt64");
if (!attr["compressor"].empty()) if (!attr["compressor"].empty())
assert(attr["compressor"] == "vtkZLibDataCompressor"); // only ZLib compression supported VTK_ASSERT_MSG(attr["compressor"] == "vtkZLibDataCompressor", "Only ZLib compression supported");
section = VTK_FILE; section = VTK_FILE;
} }
else if (isSection(line, "/VTKFile", section, VTK_FILE)) else if (isSection(line, "/VTKFile", section, VTK_FILE))
...@@ -265,7 +267,7 @@ void VtkReader<Grid,Creator>::readParallelFileFromStream (std::ifstream& input, ...@@ -265,7 +267,7 @@ void VtkReader<Grid,Creator>::readParallelFileFromStream (std::ifstream& input,
bool closed = false; bool closed = false;
auto attr = parseXml(line, closed); auto attr = parseXml(line, closed);
assert(attr.count("Source") > 0); VTK_ASSERT_MSG(attr.count("Source") > 0, "No source files for partitions provided");
pieces_.push_back(attr["Source"]); pieces_.push_back(attr["Source"]);
} }
...@@ -274,7 +276,7 @@ void VtkReader<Grid,Creator>::readParallelFileFromStream (std::ifstream& input, ...@@ -274,7 +276,7 @@ void VtkReader<Grid,Creator>::readParallelFileFromStream (std::ifstream& input,
} }
if (section != NO_SECTION) if (section != NO_SECTION)
DUNE_THROW(IOError, "VTK-File is incomplete. It must end with </VTKFile>!"); DUNE_THROW(Dune::VtkError, "VTK-File is incomplete. It must end with </VTKFile>!");
if (fillCreator) if (fillCreator)
fillGridCreator(); fillGridCreator();
...@@ -333,8 +335,8 @@ typename VtkReader<Grid,Creator>::Sections ...@@ -333,8 +335,8 @@ typename VtkReader<Grid,Creator>::Sections
VtkReader<Grid,Creator>::readPoints (std::ifstream& input, std::string name) VtkReader<Grid,Creator>::readPoints (std::ifstream& input, std::string name)
{ {
using T = typename GlobalCoordinate::value_type; using T = typename GlobalCoordinate::value_type;
assert(numberOfPoints_ > 0); VTK_ASSERT(numberOfPoints_ > 0);
assert(dataArray_["points"].components == 3u); VTK_ASSERT(dataArray_["points"].components == 3u);
Sections sec; Sections sec;
...@@ -342,8 +344,8 @@ VtkReader<Grid,Creator>::readPoints (std::ifstream& input, std::string name) ...@@ -342,8 +344,8 @@ VtkReader<Grid,Creator>::readPoints (std::ifstream& input, std::string name)
sec = readDataArray(input, point_values, 3*numberOfPoints_, POINTS_DATA_ARRAY, POINTS); sec = readDataArray(input, point_values, 3*numberOfPoints_, POINTS_DATA_ARRAY, POINTS);
if (sec != POINTS) if (sec != POINTS)
sec = skipRestOfDataArray(input, POINTS_DATA_ARRAY, POINTS); sec = skipRestOfDataArray(input, POINTS_DATA_ARRAY, POINTS);
assert(sec == POINTS); VTK_ASSERT(sec == POINTS);
assert(point_values.size() == 3*numberOfPoints_); VTK_ASSERT(point_values.size() == 3*numberOfPoints_);
// extract points from continuous values // extract points from continuous values
GlobalCoordinate p; GlobalCoordinate p;
...@@ -364,11 +366,11 @@ template <class Grid, class Creator> ...@@ -364,11 +366,11 @@ template <class Grid, class Creator>
template <class T> template <class T>
void VtkReader<Grid,Creator>::readPointsAppended (std::ifstream& input) void VtkReader<Grid,Creator>::readPointsAppended (std::ifstream& input)
{ {
assert(numberOfPoints_ > 0); VTK_ASSERT(numberOfPoints_ > 0);
assert(dataArray_["points"].components == 3u); VTK_ASSERT(dataArray_["points"].components == 3u);
std::vector<T> point_values; std::vector<T> point_values;
readAppended(input, point_values, dataArray_["points"].offset); readAppended(input, point_values, dataArray_["points"].offset);
assert(point_values.size() == 3*numberOfPoints_); VTK_ASSERT(point_values.size() == 3*numberOfPoints_);
// extract points from continuous values // extract points from continuous values
GlobalCoordinate p; GlobalCoordinate p;
...@@ -389,18 +391,18 @@ VtkReader<Grid,Creator>::readCells (std::ifstream& input, std::string name) ...@@ -389,18 +391,18 @@ VtkReader<Grid,Creator>::readCells (std::ifstream& input, std::string name)
{ {
Sections sec = CELLS_DATA_ARRAY; Sections sec = CELLS_DATA_ARRAY;
assert(numberOfCells_ > 0); VTK_ASSERT(numberOfCells_ > 0);
if (name == "types") { if (name == "types") {
sec = readDataArray(input, vec_types, numberOfCells_, CELLS_DATA_ARRAY, CELLS); sec = readDataArray(input, vec_types, numberOfCells_, CELLS_DATA_ARRAY, CELLS);
assert(vec_types.size() == numberOfCells_); VTK_ASSERT(vec_types.size() == numberOfCells_);
} else if (name == "offsets") { } else if (name == "offsets") {
sec = readDataArray(input, vec_offsets, numberOfCells_, CELLS_DATA_ARRAY, CELLS); sec = readDataArray(input, vec_offsets, numberOfCells_, CELLS_DATA_ARRAY, CELLS);
assert(vec_offsets.size() == numberOfCells_); VTK_ASSERT(vec_offsets.size() == numberOfCells_);
} else if (name == "connectivity") { } else if (name == "connectivity") {
sec = readDataArray(input, vec_connectivity, std::size_t(-1), CELLS_DATA_ARRAY, CELLS); sec = readDataArray(input, vec_connectivity, std::size_t(-1), CELLS_DATA_ARRAY, CELLS);
} else if (name == "global_point_ids") { } else if (name == "global_point_ids") {
sec = readDataArray(input, vec_point_ids, numberOfPoints_, CELLS_DATA_ARRAY, CELLS); sec = readDataArray(input, vec_point_ids, numberOfPoints_, CELLS_DATA_ARRAY, CELLS);
assert(vec_point_ids.size() == numberOfPoints_); VTK_ASSERT(vec_point_ids.size() == numberOfPoints_);
} }
return sec; return sec;
...@@ -410,14 +412,14 @@ VtkReader<Grid,Creator>::readCells (std::ifstream& input, std::string name) ...@@ -410,14 +412,14 @@ VtkReader<Grid,Creator>::readCells (std::ifstream& input, std::string name)
template <class Grid, class Creator> template <class Grid, class Creator>
void VtkReader<Grid,Creator>::readCellsAppended (std::ifstream& input) void VtkReader<Grid,Creator>::readCellsAppended (std::ifstream& input)
{ {
assert(numberOfCells_ > 0); VTK_ASSERT(numberOfCells_ > 0);
auto types_data = dataArray_["types"]; auto types_data = dataArray_["types"];
auto offsets_data = dataArray_["offsets"]; auto offsets_data = dataArray_["offsets"];
auto connectivity_data = dataArray_["connectivity"]; auto connectivity_data = dataArray_["connectivity"];
assert(types_data.type == Vtk::UINT8); VTK_ASSERT(types_data.type == Vtk::UINT8);
readAppended(input, vec_types, types_data.offset); readAppended(input, vec_types, types_data.offset);
assert(vec_types.size() == numberOfCells_); VTK_ASSERT(vec_types.size() == numberOfCells_);
if (offsets_data.type == Vtk::INT64) if (offsets_data.type == Vtk::INT64)
readAppended(input, vec_offsets, offsets_data.offset); readAppended(input, vec_offsets, offsets_data.offset);
...@@ -428,7 +430,7 @@ void VtkReader<Grid,Creator>::readCellsAppended (std::ifstream& input) ...@@ -428,7 +430,7 @@ void VtkReader<Grid,Creator>::readCellsAppended (std::ifstream& input)
std::copy(offsets.begin(), offsets.end(), vec_offsets.begin()); std::copy(offsets.begin(), offsets.end(), vec_offsets.begin());
} }
else { DUNE_THROW(Dune::NotImplemented, "Unsupported DataType in Cell offsets."); } else { DUNE_THROW(Dune::NotImplemented, "Unsupported DataType in Cell offsets."); }
assert(vec_offsets.size() == numberOfCells_); VTK_ASSERT(vec_offsets.size() == numberOfCells_);
if (connectivity_data.type == Vtk::INT64) if (connectivity_data.type == Vtk::INT64)
readAppended(input, vec_connectivity, connectivity_data.offset); readAppended(input, vec_connectivity, connectivity_data.offset);
...@@ -439,13 +441,13 @@ void VtkReader<Grid,Creator>::readCellsAppended (std::ifstream& input) ...@@ -439,13 +441,13 @@ void VtkReader<Grid,Creator>::readCellsAppended (std::ifstream& input)
std::copy(connectivity.begin(), connectivity.end(), vec_connectivity.begin()); std::copy(connectivity.begin(), connectivity.end(), vec_connectivity.begin());
} }
else { DUNE_THROW(Dune::NotImplemented, "Unsupported DataType in Cell connectivity."); } else { DUNE_THROW(Dune::NotImplemented, "Unsupported DataType in Cell connectivity."); }
assert(vec_connectivity.size() == std::size_t(vec_offsets.back())); VTK_ASSERT(vec_connectivity.size() == std::size_t(vec_offsets.back()));
if (dataArray_.count("global_point_ids") > 0) { if (dataArray_.count("global_point_ids") > 0) {
auto point_id_data = dataArray_["global_point_ids"]; auto point_id_data = dataArray_["global_point_ids"];
assert(point_id_data.type == Vtk::UINT64); VTK_ASSERT(point_id_data.type == Vtk::UINT64);
readAppended(input, vec_point_ids, point_id_data.offset); readAppended(input, vec_point_ids, point_id_data.offset);
assert(vec_point_ids.size() == numberOfPoints_); VTK_ASSERT(vec_point_ids.size() == numberOfPoints_);
} }
} }
...@@ -470,13 +472,13 @@ void read_compressed (T* buffer, unsigned char* buffer_in, ...@@ -470,13 +472,13 @@ void read_compressed (T* buffer, unsigned char* buffer_in,
Bytef* uncompressed_buffer = reinterpret_cast<Bytef*>(buffer); Bytef* uncompressed_buffer = reinterpret_cast<Bytef*>(buffer);
input.read((char*)(compressed_buffer), compressed_space); input.read((char*)(compressed_buffer), compressed_space);
assert(uLongf(input.gcount()) == compressed_space); VTK_ASSERT(uLongf(input.gcount()) == compressed_space);
if (uncompress(uncompressed_buffer, &uncompressed_space, compressed_buffer, compressed_space) != Z_OK) { if (uncompress(uncompressed_buffer, &uncompressed_space, compressed_buffer, compressed_space) != Z_OK) {
std::cerr << "Zlib error while uncompressing data.\n"; std::cerr << "Zlib error while uncompressing data.\n";
std::abort(); std::abort();
} }
assert(uLongf(bs) == uncompressed_space); VTK_ASSERT(uLongf(bs) == uncompressed_space);
#else #else
std::cerr << "Can not call read_compressed without compression enabled!\n"; std::cerr << "Can not call read_compressed without compression enabled!\n";
std::abort(); std::abort();
...@@ -504,7 +506,7 @@ void VtkReader<Grid,Creator>::readAppended (std::ifstream& input, std::vector<T> ...@@ -504,7 +506,7 @@ void VtkReader<Grid,Creator>::readAppended (std::ifstream& input, std::vector<T>
input.read((char*)&block_size, sizeof(std::uint64_t)); input.read((char*)&block_size, sizeof(std::uint64_t));
input.read((char*)&last_block_size, sizeof(std::uint64_t)); input.read((char*)&last_block_size, sizeof(std::uint64_t));
assert(block_size % sizeof(T) == 0); VTK_ASSERT(block_size % sizeof(T) == 0);
// total size of the uncompressed data // total size of the uncompressed data
size = block_size * (num_blocks-1) + last_block_size; size = block_size * (num_blocks-1) + last_block_size;
...@@ -515,7 +517,7 @@ void VtkReader<Grid,Creator>::readAppended (std::ifstream& input, std::vector<T> ...@@ -515,7 +517,7 @@ void VtkReader<Grid,Creator>::readAppended (std::ifstream& input, std::vector<T>
} else { } else {
input.read((char*)&size, sizeof(std::uint64_t)); input.read((char*)&size, sizeof(std::uint64_t));
} }
assert(size > 0 && (size % sizeof(T)) == 0); VTK_ASSERT(size > 0 && (size % sizeof(T)) == 0);
values.resize(size / sizeof(T)); values.resize(size / sizeof(T));
if (format_ == Vtk::COMPRESSED) { if (format_ == Vtk::COMPRESSED) {
...@@ -531,7 +533,7 @@ void VtkReader<Grid,Creator>::readAppended (std::ifstream& input, std::vector<T> ...@@ -531,7 +533,7 @@ void VtkReader<Grid,Creator>::readAppended (std::ifstream& input, std::vector<T>
} }
} else { } else {
input.read((char*)(values.data()), size); input.read((char*)(values.data()), size);
assert(input.gcount() == std::streamsize(size)); VTK_ASSERT(input.gcount() == std::streamsize(size));
} }
} }
...@@ -539,9 +541,9 @@ void VtkReader<Grid,Creator>::readAppended (std::ifstream& input, std::vector<T> ...@@ -539,9 +541,9 @@ void VtkReader<Grid,Creator>::readAppended (std::ifstream& input, std::vector<T>
template <class Grid, class Creator> template <class Grid, class Creator>
void VtkReader<Grid,Creator>::fillGridCreator (bool insertPieces) void VtkReader<Grid,Creator>::fillGridCreator (bool insertPieces)
{ {
assert(vec_points.size() == numberOfPoints_); VTK_ASSERT(vec_points.size() == numberOfPoints_);
assert(vec_types.size() == numberOfCells_); VTK_ASSERT(vec_types.size() == numberOfCells_);
assert(vec_offsets.size() == numberOfCells_); VTK_ASSERT(vec_offsets.size() == numberOfCells_);
if (!vec_points.empty()) if (!vec_points.empty())
creator_->insertVertices(vec_points, vec_point_ids); creator_->insertVertices(vec_points, vec_point_ids);
...@@ -597,7 +599,7 @@ std::map<std::string, std::string> VtkReader<Grid,Creator>::parseXml (std::strin ...@@ -597,7 +599,7 @@ std::map<std::string, std::string> VtkReader<Grid,Creator>::parseXml (std::strin
case XML_NAME_ASSIGN: case XML_NAME_ASSIGN:
value.clear(); value.clear();
escape = false; escape = false;
assert( c == '"' && "Format error!" ); VTK_ASSERT_MSG( c == '"', "Format error!" );
sec = XML_VALUE; sec = XML_VALUE;
break; break;
case XML_VALUE: case XML_VALUE:
...@@ -612,7 +614,7 @@ std::map<std::string, std::string> VtkReader<Grid,Creator>::parseXml (std::strin ...@@ -612,7 +614,7 @@ std::map<std::string, std::string> VtkReader<Grid,Creator>::parseXml (std::strin
} }
break; break;
default: default:
assert(false && "Format error!"); VTK_ASSERT_MSG(false, "Format error!");
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment