45 <<
"could not be read!" << std::endl;
49 std::streampos file_size = 0;
50 file.seekg(0, std::ios::end);
51 file_size =
file.tellg() - file_size;
52 file.seekg(0, std::ios::beg);
53 std::vector<char> data(file_size);
54 file.read(data.data(), file_size);
60 <<
"is empty!" << std::endl;
64 draco::DecoderBuffer buffer;
65 buffer.Init(data.data(), data.size());
67 auto type = draco::Decoder::GetEncodedGeometryType(&buffer);
71 std::cerr <<
"Content in"
73 <<
"is neither a Mesh nor a PointCloud!" << std::endl;
77 const draco::EncodedGeometryType geom_type = type.value();
90 std::cerr <<
"no model set for export!" << std::endl;
96 std::cerr <<
"model does not contain geometry data!" << std::endl;
101 std::unique_ptr<draco::EncoderBuffer> buffer =
103 : draco::EncodedGeometryType::TRIANGULAR_MESH));
110 file.write(buffer->data(), buffer->size());