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;
92 void setCopyMaxBytes(
Index64 bytes);
128 template<
typename Gr
idPtrContainerT>
147 Name gridName()
const {
return GridDescriptor::nameAsString(mIter->second.uniqueName()); }
161 void readGridDescriptors(std::istream&);
188 void readGridPartial(
GridBase::Ptr, std::istream&,
bool isInstance,
bool readTopology)
const;
200 const NameMap& gridDescriptors()
const;
203 std::istream& inputStream()
const;
205 friend class ::TestFile;
206 friend class ::TestStream;
209 std::unique_ptr<Impl> mImpl;
223 template<
typename Gr
idPtrContainerT>
228 std::copy(container.begin(), container.end(), std::back_inserter(grids));
236 #endif // OPENVDB_IO_FILE_HAS_BEEN_INCLUDED
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:707
std::function< void(std::string)> Notifier
Definition: io.h:156
std::multimap< Name, GridDescriptor > NameMap
Definition: File.h:33
SharedPtr< GridBase > Ptr
Definition: Grid.h:80
NameIterator(const NameMapCIter &iter)
Definition: File.h:136
NameMap::const_iterator NameMapCIter
Definition: File.h:34
std::shared_ptr< T > SharedPtr
Definition: Types.h:114
Name operator*() const
Definition: File.h:145
static fileSize_t write(std::ostream &os, const GridHandle< BufferT > &handle, Codec codec)
SharedPtr< GridPtrVec > GridPtrVecPtr
Definition: Grid.h:517
Grid serializer/unserializer.
Definition: Archive.h:32
BBox< Coord > CoordBBox
Definition: NanoVDB.h:1658
Name gridName() const
Definition: File.h:147
std::vector< GridBase::ConstPtr > GridCPtrVec
Definition: Grid.h:519
std::string Name
Definition: Name.h:17
uint64_t Index64
Definition: Types.h:53
Definition: Exceptions.h:13
GridType::Ptr createGrid(const typename GridType::ValueType &background)
Create a new grid of type GridType with a given background value.
Definition: Grid.h:1739
bool operator!=(const NameIterator &iter) const
Definition: File.h:143
~NameIterator()
Definition: File.h:138
NameIterator & operator++()
Definition: File.h:140
Grid archive associated with a file on disk.
Definition: File.h:30
bool operator==(const NameIterator &iter) const
Definition: File.h:142
GridHandle< BufferT > readGrid(const std::string &fileName, uint64_t n=0, int verbose=0, const BufferT &buffer=BufferT())
Read the n'th grid from file (defaults to first grid)
Definition: IO.h:576
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
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:543
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:202
Definition: GridDescriptor.h:19