6 #ifndef OPENVDB_IO_FILE_HAS_BEEN_INCLUDED
7 #define OPENVDB_IO_FILE_HAS_BEEN_INCLUDED
33 using NameMap = std::multimap<Name, GridDescriptor>;
57 #ifdef OPENVDB_USE_DELAYED_LOADING
67 bool open(
bool delayLoad =
true,
const MappedFile::Notifier& = MappedFile::Notifier());
69 bool open(
bool =
false);
82 #ifdef OPENVDB_USE_DELAYED_LOADING
134 template<
typename Gr
idPtrContainerT>
135 void write(
const GridPtrContainerT&,
const MetaMap& =
MetaMap())
const;
160 NameIterator beginName()
const;
163 NameIterator endName()
const;
167 void readGridDescriptors(std::istream&);
171 NameMapCIter findDescriptor(
const Name&)
const;
194 void readGridPartial(
GridBase::Ptr, std::istream&,
bool isInstance,
bool readTopology)
const;
206 const NameMap& gridDescriptors()
const;
207 NameMap& gridDescriptors();
209 std::istream& inputStream()
const;
211 friend class ::TestFile;
212 friend class ::TestStream;
215 std::unique_ptr<Impl> mImpl;
229 template<
typename Gr
idPtrContainerT>
234 std::copy(container.begin(), container.end(), std::back_inserter(grids));
242 #endif // OPENVDB_IO_FILE_HAS_BEEN_INCLUDED
Grid serializer/unserializer.
void write(const GridCPtrVec &, const MetaMap &=MetaMap()) const override
Write the grids in the given container to the file whose name was given in the constructor.
GT_API const UT_StringHolder filename
GridType::Ptr createGrid(const typename GridType::ValueType &background)
Create a new grid of type GridType with a given background value.
SharedPtr< GridBase > Ptr
gridName(grid.gridName())
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
bool operator!=(const NameIterator &iter) const
GLsizei const GLchar *const * string
Grid archive associated with a file on disk.
void writeGrids(const std::string &fileName, const VecT< GridHandle< BufferT >> &handles, Codec codec=Codec::NONE, int verbose=0)
Write multiple grids to file (over-writing existing content of the file)
#define OPENVDB_USE_VERSION_NAMESPACE
NameMap::const_iterator NameMapCIter
NameIterator & operator++()
bool operator==(const NameIterator &iter) const
std::shared_ptr< T > SharedPtr
NameIterator(const NameMapCIter &iter)
std::multimap< Name, GridDescriptor > NameMap
SharedPtr< GridPtrVec > GridPtrVecPtr
Library and file format version numbers.
LeafData & operator=(const LeafData &)=delete
SharedPtr< const GridBase > ConstPtr
bool hasGrid(const std::string &fileName, const std::string &gridName)
Return true if the file contains a grid with the specified name.
std::vector< GridBase::ConstPtr > GridCPtrVec
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
GridHandle< BufferT > readGrid(const std::string &fileName, int n=0, int verbose=0, const BufferT &buffer=BufferT())
Read and return one or all grids from a file into a single GridHandle.
static std::string nameAsString(const Name &)
Given a name with suffix N, return "name[N]", otherwise just return "name". Use this to produce a...