31 #ifndef OPENVDB_IO_ARCHIVE_HAS_BEEN_INCLUDED
32 #define OPENVDB_IO_ARCHIVE_HAS_BEEN_INCLUDED
34 #include <openvdb/Platform.h>
38 #include <boost/uuid/uuid.hpp>
39 #include <boost/cstdint.hpp>
40 #include <openvdb/Grid.h>
41 #include <openvdb/metadata/MetaMap.h>
42 #include <openvdb/version.h>
122 std::string getUniqueTag()
const;
124 bool isIdentical(
const std::string& uuidStr)
const;
133 std::string version()
const;
144 bool isCompressionEnabled()
const;
148 void setCompressionEnabled(
bool);
176 void setFormatVersion(std::istream&);
183 void setLibraryVersion(std::istream&);
191 void setGridCompression(std::ostream&,
const GridBase&)
const;
194 static void readGridCompression(std::istream&);
198 void setWriteGridStatsMetadata(std::ostream&);
201 static int32_t readGridCount(std::istream&);
221 std::ostream&,
bool seekable)
const;
225 bool readHeader(std::istream&);
229 void writeHeader(std::ostream&,
bool seekable)
const;
238 friend class ::TestFile;
241 uint32_t mFileVersion;
245 mutable boost::uuids::uuid mUuid;
248 bool mInputHasGridOffsets;
251 bool mEnableInstancing;
253 uint32_t mCompression;
255 bool mEnableGridStats;
262 #endif // OPENVDB_IO_ARCHIVE_HAS_BEEN_INCLUDED
OPENVDB_IMPORT VersionId getLibraryVersion(std::istream &)
Return the (major, minor) library version number associated with the given input stream.
std::vector< GridBase::ConstPtr > GridCPtrVec
Definition: Grid.h:401
void setInstancingEnabled(bool b)
Specify whether trees shared by multiple grids should be written out only once (true) or once per gri...
Definition: Archive.h:141
OPENVDB_IMPORT void setVersion(std::ios_base &, const VersionId &libraryVersion, uint32_t fileVersion)
Associate specific file format and library version numbers with the given stream. ...
OPENVDB_IMPORT 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_IMPORT void setCurrentVersion(std::istream &)
Associate the current file format and library version numbers with the given input stream...
std::vector< GridBase::Ptr > GridPtrVec
Definition: Grid.h:396
Definition: GridDescriptor.h:46
OPENVDB_IMPORT 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.
void setInputHasGridOffsets(bool b)
Definition: Archive.h:170
OPENVDB_API bool getWriteGridStatsMetadata(std::ostream &)
void setCompressionFlags(uint32_t c)
Specify whether and how the data stream should be compressed. [Mainly for internal use]...
Definition: Archive.h:157
OPENVDB_IMPORT std::string getVersion(std::istream &)
Return a string of the form "<major>.<minor>/<format>", giving the library and file format version nu...
OPENVDB_IMPORT uint32_t getFormatVersion(std::istream &)
Return the file format version number associated with the given input stream.
std::string Name
Definition: Name.h:44
Abstract base class for typed grids.
Definition: Grid.h:103
#define OPENVDB_VERSION_NAME
Definition: version.h:45
bool isInstancingEnabled() const
Return true if trees shared by multiple grids are written out only once, false if they are written ou...
Definition: Archive.h:137
OPENVDB_IMPORT 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...
uint32_t compressionFlags() const
Return a bit mask specifying compression options for the data stream.
Definition: Archive.h:151
static const uint32_t DEFAULT_COMPRESSION_FLAGS
Definition: Archive.h:115
std::map< Name, GridBase::Ptr > NamedGridMap
Definition: Archive.h:206
OPENVDB_IMPORT 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.
uint32_t fileVersion() const
Return the file format version number of the input stream.
Definition: Archive.h:127
boost::shared_ptr< const GridBase > ConstPtr
Definition: Grid.h:107
OPENVDB_IMPORT uint32_t getGridClass(std::ios_base &)
Return the class (GRID_LEVEL_SET, GRID_UNKNOWN, etc.) of the grid currently being read from or writte...
VersionId libraryVersion() const
Return the (major, minor) version number of the library that was used to write the input stream...
Definition: Archive.h:130
Grid serializer/unserializer.
Definition: Archive.h:112
void setGridStatsMetadataEnabled(bool b)
Specify whether grid statistics (active voxel count and bounding box, etc.) should be computed and wr...
Definition: Archive.h:164
bool inputHasGridOffsets() const
Return true if the input stream contains grid offsets that allow for random access or partial reading...
Definition: Archive.h:169
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:56
OPENVDB_IMPORT 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...
bool isGridStatsMetadataEnabled() const
Return true if grid statistics (active voxel count and bounding box, etc.) are computed and written a...
Definition: Archive.h:161
boost::shared_ptr< GridBase > Ptr
Definition: Grid.h:106