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);
101 bool hasGrid(
const Name&)
const;
134 template<
typename Gr
idPtrContainerT>
135 void write(
const GridPtrContainerT&,
const MetaMap& =
MetaMap())
const;
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;
225 this->writeGrids(grids, meta);
229 template<
typename Gr
idPtrContainerT>
231 File::write(
const GridPtrContainerT& container,
const MetaMap& meta)
const 234 std::copy(container.begin(), container.end(), std::back_inserter(grids));
235 this->writeGrids(grids, meta);
242 #endif // OPENVDB_IO_FILE_HAS_BEEN_INCLUDED
NameIterator(const NameMapCIter &iter)
Definition: File.h:142
NameIterator & operator++()
Definition: File.h:146
std::vector< GridBase::ConstPtr > GridCPtrVec
Definition: Grid.h:513
uint64_t Index64
Definition: Types.h:53
Name gridName() const
Definition: File.h:153
Name operator*() const
Definition: File.h:151
Grid archive associated with a file on disk.
Definition: File.h:30
SharedPtr< GridBase > Ptr
Definition: Grid.h:80
SharedPtr< GridPtrVec > GridPtrVecPtr
Definition: Grid.h:511
std::multimap< Name, GridDescriptor > NameMap
Definition: File.h:33
Grid serializer/unserializer.
Definition: Archive.h:31
std::shared_ptr< T > SharedPtr
Definition: Types.h:114
bool operator==(const NameIterator &iter) const
Definition: File.h:148
NameMap::const_iterator NameMapCIter
Definition: File.h:34
~NameIterator()
Definition: File.h:144
Definition: Exceptions.h:13
SharedPtr< const GridBase > ConstPtr
Definition: Grid.h:81
GridType::Ptr createGrid(const typename GridType::ValueType &background)
Create a new grid of type GridType with a given background value.
Definition: Grid.h:1757
bool operator!=(const NameIterator &iter) const
Definition: File.h:149
Definition: GridDescriptor.h:19
std::string Name
Definition: Name.h:19
#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:218