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>;
36 explicit File(
const std::string& filename);
55 const std::string& filename()
const;
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 97 void setCopyMaxBytes(
Index64 bytes);
134 template<
typename Gr
idPtrContainerT>
153 Name gridName()
const {
return GridDescriptor::nameAsString(mIter->second.uniqueName()); }
167 void readGridDescriptors(std::istream&);
194 void readGridPartial(
GridBase::Ptr, std::istream&,
bool isInstance,
bool readTopology)
const;
206 const NameMap& gridDescriptors()
const;
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
GridType::Ptr createGrid(const typename GridType::ValueType &background)
Create a new grid of type GridType with a given background value.
Definition: Grid.h:1722
SharedPtr< const GridBase > ConstPtr
Definition: Grid.h:81
bool hasGrid(const std::string &fileName, const std::string &gridName)
Return true if the file contains a grid with the specified name.
Definition: IO.h:715
static fileSize_t write(std::ostream &os, const GridHandle< BufferT > &handle, Codec codec, uint32_t n)
std::shared_ptr< T > SharedPtr
Definition: Types.h:114
std::vector< GridBase::ConstPtr > GridCPtrVec
Definition: Grid.h:513
std::multimap< Name, GridDescriptor > NameMap
Definition: File.h:33
BBox< Coord > CoordBBox
Definition: NanoVDB.h:2535
bool operator!=(const NameIterator &iter) const
Definition: File.h:149
uint64_t Index64
Definition: Types.h:53
Grid serializer/unserializer.
Definition: Archive.h:31
SharedPtr< GridPtrVec > GridPtrVecPtr
Definition: Grid.h:511
NameMap::const_iterator NameMapCIter
Definition: File.h:34
Definition: Exceptions.h:13
Grid archive associated with a file on disk.
Definition: File.h:30
NameIterator(const NameMapCIter &iter)
Definition: File.h:142
NameIterator & operator++()
Definition: File.h:146
Name gridName() const
Definition: File.h:153
std::string Name
Definition: Name.h:19
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.
Definition: IO.h:580
Name operator*() const
Definition: File.h:151
SharedPtr< GridBase > Ptr
Definition: Grid.h:80
Definition: GridDescriptor.h:19
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
bool operator==(const NameIterator &iter) const
Definition: File.h:148
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)
Definition: IO.h:508
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:212
~NameIterator()
Definition: File.h:144