31 #ifndef OPENVDB_IO_IO_HAS_BEEN_INCLUDED
32 #define OPENVDB_IO_IO_HAS_BEEN_INCLUDED
34 #include <openvdb/Platform.h>
35 #include <openvdb/version.h>
36 #include <boost/any.hpp>
37 #include <boost/function.hpp>
38 #include <boost/scoped_ptr.hpp>
39 #include <boost/shared_ptr.hpp>
59 typedef boost::shared_ptr<StreamMetadata>
Ptr;
60 typedef boost::shared_ptr<const StreamMetadata>
ConstPtr;
71 void transferTo(std::ios_base&)
const;
73 uint32_t fileVersion()
const;
74 void setFileVersion(uint32_t);
79 uint32_t compression()
const;
80 void setCompression(uint32_t);
82 uint32_t gridClass()
const;
85 const void* backgroundPtr()
const;
86 void setBackgroundPtr(
const void*);
88 bool halfFloat()
const;
91 bool writeGridStats()
const;
92 void setWriteGridStats(
bool);
101 const MetaMap& gridMetadata()
const;
106 AuxDataMap& auxData();
108 const AuxDataMap& auxData()
const;
112 std::string str()
const;
116 boost::scoped_ptr<Impl> mImpl;
135 typedef boost::shared_ptr<MappedFile>
Ptr;
140 std::string filename()
const;
151 boost::shared_ptr<std::streambuf> createBuffer()
const;
153 typedef boost::function<void(std::string )>
Notifier;
156 void setNotifier(
const Notifier&);
158 void clearNotifier();
163 explicit MappedFile(
const std::string& filename,
bool autoDelete =
false);
169 boost::scoped_ptr<Impl> mImpl;
264 boost::shared_ptr<StreamMetadata>&,
bool transfer =
true);
273 #endif // OPENVDB_IO_IO_HAS_BEEN_INCLUDED
OPENVDB_API void setHalfFloat(std::ios_base &, bool)
Specify whether floating-point values should be quantized to 16 bits when writing to the given stream...
Definition: version.h:120
boost::shared_ptr< MappedFile > Ptr
Definition: io.h:135
OPENVDB_API void setWriteGridStatsMetadata(std::ios_base &, bool writeGridStats)
Specify whether to compute grid statistics (active voxel count and bounding box, etc.) and store them as grid metadata when writing to the given stream.
OPENVDB_API uint32_t getGridClass(std::ios_base &)
Return the class (GRID_LEVEL_SET, GRID_UNKNOWN, etc.) of the grid currently being read from or writte...
OPENVDB_API uint32_t getDataCompression(std::ios_base &)
Return a bitwise OR of compression option flags (COMPRESS_ZIP, COMPRESS_ACTIVE_MASK, etc.) specifying whether and how input data is compressed or output data should be compressed.
OPENVDB_API void setGridBackgroundValuePtr(std::ios_base &, const void *background)
Specify (a pointer to) the background value of the grid currently being read from or written to the g...
OPENVDB_API void setMappedFilePtr(std::ios_base &, boost::shared_ptr< MappedFile > &)
Associate the given stream with (a shared pointer to) a memory-mapped file.
OPENVDB_API boost::shared_ptr< StreamMetadata > clearStreamMetadataPtr(std::ios_base &)
Dissociate the given stream from its metadata object (if it has one) and return a shared pointer to t...
OPENVDB_API bool getHalfFloat(std::ios_base &)
Return true if floating-point values should be quantized to 16 bits when writing to the given stream ...
OPENVDB_API void setCurrentVersion(std::istream &)
Associate the current file format and library version numbers with the given input stream...
Handle to control the lifetime of a memory-mapped .vdb file.
Definition: io.h:132
OPENVDB_API boost::shared_ptr< MappedFile > getMappedFilePtr(std::ios_base &)
Return a shared pointer to the memory-mapped file with which the given stream is associated, or a null pointer if the stream is not associated with a memory-mapped file.
#define OPENVDB_VERSION_NAME
Definition: version.h:43
OPENVDB_API void setGridClass(std::ios_base &, uint32_t)
Associate with the given stream the class (GRID_LEVEL_SET, GRID_UNKNOWN, etc.) of the grid currently ...
OPENVDB_API uint32_t getFormatVersion(std::ios_base &)
Return the file format version number associated with the given input stream.
Grid archive associated with a file on disk.
Definition: File.h:54
OPENVDB_API bool getWriteGridStatsMetadata(std::ios_base &)
Return true if grid statistics (active voxel count and bounding box, etc.) should be computed and sto...
OPENVDB_API void setDataCompression(std::ios_base &, uint32_t compressionFlags)
Associate with the given stream a bitwise OR of compression option flags (COMPRESS_ZIP, COMPRESS_ACTIVE_MASK, etc.) specifying whether and how input data is compressed or output data should be compressed.
Definition: Exceptions.h:39
OPENVDB_API boost::shared_ptr< StreamMetadata > getStreamMetadataPtr(std::ios_base &)
Return a shared pointer to an object that stores metadata (file format, compression scheme...
OPENVDB_API const void * getGridBackgroundValuePtr(std::ios_base &)
Return a pointer to the background value of the grid currently being read from or written to the give...
std::string getErrorString()
Return a string (possibly empty) describing the most recent system error.
OPENVDB_API void setStreamMetadataPtr(std::ios_base &, boost::shared_ptr< StreamMetadata > &, bool transfer=true)
Associate the given stream with (a shared pointer to) an object that stores metadata (file format...
OPENVDB_API VersionId getLibraryVersion(std::ios_base &)
Return the (major, minor) library version number associated with the given input stream.
OPENVDB_API std::string getVersion(std::ios_base &)
Return a string of the form "./", giving the library and file format version nu...
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:71
OPENVDB_API void setVersion(std::ios_base &, const VersionId &libraryVersion, uint32_t fileVersion)
Associate specific file format and library version numbers with the given stream. ...
std::ostream & operator<<(std::ostream &, const StreamMetadata::AuxDataMap &)
boost::function< void(std::string)> Notifier
Definition: io.h:153