6#ifndef OPENVDB_IO_FILE_HAS_BEEN_INCLUDED
7#define OPENVDB_IO_FILE_HAS_BEEN_INCLUDED
9#include <openvdb/version.h>
33 using NameMap = std::multimap<Name, GridDescriptor>;
63 OPENVDB_DEPRECATED_MESSAGE(
"Use File::open() instead.This method is deprecated and will be removed. Delayed loading is no longer supported.")
65 OPENVDB_DEPRECATED_MESSAGE(
"Use File::open() instead. This method is deprecated and will be removed. Delayed loading is no longer supported.")
78 OPENVDB_DEPRECATED_MESSAGE(
"Always returns 0. This method is deprecated and will be removed. Delayed loading is no longer supported.")
130 template<
typename Gr
idPtrContainerT>
201 const NameMap& gridDescriptors()
const;
204 std::istream& inputStream()
const;
206 friend class ::TestFile;
207 friend class ::TestStream;
209 std::string mFilename;
213 std::unique_ptr<std::istream> mInStream;
218 bool mIsOpen =
false;
235 this->writeGrids(grids, meta, writeOptions);
239template<
typename Gr
idPtrContainerT>
245 std::copy(container.begin(), container.end(), std::back_inserter(grids));
246 this->writeGrids(grids, meta, writeOptions);
SharedPtr< GridBase > Ptr
Definition Grid.h:81
std::map< Name, GridBase::Ptr > NamedGridMap
Definition Archive.h:157
NameIterator(const NameIterator &)=default
~NameIterator()
Definition File.h:141
Name operator*() const
Definition File.h:148
Name gridName() const
Definition File.h:150
bool operator!=(const NameIterator &iter) const
Definition File.h:146
NameIterator(const NameMapCIter &iter)
Definition File.h:139
NameIterator & operator++()
Definition File.h:143
bool operator==(const NameIterator &iter) const
Definition File.h:145
bool isOpen() const
Return true if the file has been opened for reading.
bool open(bool, const MappedFile::Notifier &)
Definition File.h:66
GridBase::Ptr readGrid(const Name &, const io::ReadOptions &readOptions=io::ReadOptions{})
Read an entire grid, including all of its data blocks, using the provided options if given.
NameIterator endName() const
bool hasGrid(const Name &) const
Return true if a grid of the given name exists in this file.
File(const std::string &filename)
const std::string & filename() const
Return the name of the file with which this archive is associated.
GridBase::Ptr readGrid(const Name &, const BBoxd &)
Read a grid, including its data blocks, but only where it intersects the given world-space bounding b...
GridPtrVecPtr readGrids(const Name &name, const io::ReadOptions &readOptions=io::ReadOptions{})
Read all grids whose grid name is exactly name, in file order.
void close()
Close the file once we are done reading from it.
NameMap::const_iterator NameMapCIter
Definition File.h:34
~File() override
Definition File.h:37
NameIterator beginName() const
File(const File &other)
Copy constructor.
File & operator=(const File &other)
Assignment.
MetaMap::Ptr getMetadata() const
Return (in a newly created MetaMap) the file-level metadata.
GridBase::Ptr readGridMetadata(const Name &)
Read a grid's metadata and transform only.
void write(const GridCPtrVec &, const MetaMap &=MetaMap(), const io::WriteOptions &=io::WriteOptions{}) const override
Write the grids in the given container to the file whose name was given in the constructor.
Definition File.h:232
SharedPtr< Archive > copy() const override
Return a copy of this archive.
GridPtrVecPtr readAllGridMetadata()
Read just the grid metadata and transforms from the file and return a list of pointers to grids that ...
Index64 getSize() const
Return this file's current size on disk in bytes.
bool open()
Open the file, read the file header and the file-level metadata, and populate the grid descriptors,...
bool open(bool)
Definition File.h:64
Index64 copyMaxBytes() const
Definition File.h:79
std::multimap< Name, GridDescriptor > NameMap
Definition File.h:33
GridPtrVecPtr getGrids(const io::ReadOptions &readOptions=io::ReadOptions{}) const
Read the entire contents of the file and return a list of grid pointers.
void setCopyMaxBytes(Index64)
Definition File.h:81
Definition GridDescriptor.h:20
static std::string nameAsString(const Name &)
Given a name with suffix N, return "name[N]", otherwise just return "name". Use this to produce a hum...
std::string Name
Definition Name.h:19
std::vector< GridBase::Ptr > GridPtrVec
Definition Grid.h:508
SharedPtr< GridPtrVec > GridPtrVecPtr
Definition Grid.h:511
math::BBox< Vec3d > BBoxd
Definition Types.h:65
uint64_t Index64
Definition Types.h:33
std::shared_ptr< T > SharedPtr
Definition Types.h:95
std::vector< GridBase::ConstPtr > GridCPtrVec
Definition Grid.h:513
Definition Exceptions.h:13
Thread-safe collection of read diagnostics accumulated during a codec read.
Definition Codec.h:211
Global read configuration passed to every codec during deserialization.
Definition Codec.h:167
Global write configuration passed to every codec during serialization.
Definition Codec.h:188
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:286