Skip to content
Snippets Groups Projects

Issue/15

2 files
+ 20
63
Compare changes
  • Side-by-side
  • Inline

Files

+ 13
60
@@ -85,6 +85,19 @@ class VTKWriter
template <typename DataType>
struct VTKType
{
inline const static std::string name = [] {
static_assert(std::is_arithmetic_v<DataType>, "invalid data type");
if constexpr (std::is_integral_v<DataType>) {
if constexpr (std::is_unsigned_v<DataType>) {
return "UInt" + std::to_string(sizeof(DataType) * 8);
} else {
return "UInt" + std::to_string(sizeof(DataType) * 8);
}
} else if constexpr (std::is_floating_point_v<DataType>) {
return "Float" + std::to_string(sizeof(DataType) * 8);
}
}();
};
template <typename DataType>
@@ -360,64 +373,4 @@ class VTKWriter
~VTKWriter() = default;
};
template <>
struct VTKWriter::VTKType<int8_t>
{
inline const static std::string name{"Int8"};
};
template <>
struct VTKWriter::VTKType<uint8_t>
{
inline const static std::string name{"UInt8"};
};
template <>
struct VTKWriter::VTKType<int16_t>
{
inline const static std::string name{"Int16"};
};
template <>
struct VTKWriter::VTKType<uint16_t>
{
inline const static std::string name{"UInt16"};
};
template <>
struct VTKWriter::VTKType<int32_t>
{
inline const static std::string name{"Int32"};
};
template <>
struct VTKWriter::VTKType<uint32_t>
{
inline const static std::string name{"UInt32"};
};
template <>
struct VTKWriter::VTKType<int64_t>
{
inline const static std::string name{"Int64"};
};
template <>
struct VTKWriter::VTKType<uint64_t>
{
inline const static std::string name{"UInt64"};
};
template <>
struct VTKWriter::VTKType<float>
{
inline const static std::string name{"Float32"};
};
template <>
struct VTKWriter::VTKType<double>
{
inline const static std::string name{"Float64"};
};
#endif // VTK_WRITER_HPP
Loading