#include "f3d_io.h"
#include <Field3D/InitIO.h>
#include <iostream>
#include <stdio.h>
namespace HDK_Sample {
{
public:
GEO_Field3DIOTranslator() {}
~GEO_Field3DIOTranslator() override {}
const char *formatName() const override;
int checkExtension(
const char *
name)
override;
int checkMagicNumber(unsigned magic) override;
bool ate_magic) override;
std::ostream &os) override;
const char *fname) override;
};
}
using namespace HDK_Sample;
GEO_Field3DIOTranslator::duplicate() const
{
return new GEO_Field3DIOTranslator();
}
const char *
GEO_Field3DIOTranslator::formatName() const
{
return "Field3D Volume Format";
}
int
GEO_Field3DIOTranslator::checkExtension(
const char *
name)
{
if (sname.fileExtension() && !strcmp(sname.fileExtension(), ".f3d"))
return true;
return false;
}
int
GEO_Field3DIOTranslator::checkMagicNumber(unsigned magic)
{
return 0;
}
{
{
std::cerr << "Error: Attempt to load Field3D from non-file source.\n";
return false;
}
return f3d_fileLoad(gdp, buf.
buffer());
}
GEO_Field3DIOTranslator::fileSave(
const GEO_Detail *gdp, std::ostream &os)
{
return false;
}
GEO_Field3DIOTranslator::fileSaveToFile(
const GEO_Detail *gdp,
const char *fname)
{
if (!fname)
return false;
return f3d_fileSave(gdp, fname, F3D_BITDEPTH_AUTO, F3D_GRIDTYPE_SPARSE, true);
}
void
{
Field3D::initIO();
}