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 <boost/shared_ptr.hpp>
41 #include <openvdb/Grid.h>
42 #include <openvdb/metadata/MetaMap.h>
43 #include <openvdb/version.h>
122 virtual boost::shared_ptr<Archive> copy()
const;
126 std::string getUniqueTag()
const;
128 bool isIdentical(
const std::string& uuidStr)
const;
137 std::string version()
const;
148 bool isCompressionEnabled()
const;
152 void setCompressionEnabled(
bool);
183 void setFormatVersion(std::istream&);
190 void setLibraryVersion(std::istream&);
198 void setGridCompression(std::ostream&,
const GridBase&)
const;
201 static void readGridCompression(std::istream&);
205 void setWriteGridStatsMetadata(std::ostream&);
208 static int32_t readGridCount(std::istream&);
228 std::ostream&,
bool seekable)
const;
232 bool readHeader(std::istream&);
236 void writeHeader(std::ostream&,
bool seekable)
const;
245 friend class ::TestFile;
248 uint32_t mFileVersion;
252 mutable boost::uuids::uuid mUuid;
255 bool mInputHasGridOffsets;
258 bool mEnableInstancing;
260 uint32_t mCompression;
262 bool mEnableGridStats;
269 #endif // OPENVDB_IO_ARCHIVE_HAS_BEEN_INCLUDED
std::map< Name, GridBase::Ptr > NamedGridMap
Definition: Archive.h:213
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...
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. ...
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:141
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:145
bool inputHasGridOffsets() const
Return true if the input stream contains grid offsets that allow for random access or partial reading...
Definition: Archive.h:176
OPENVDB_IMPORT std::string getVersion(std::istream &)
Return a string of the form "./", giving the library and file format version nu...
void setCompressionFlags(uint32_t c)
Specify whether and how the data stream should be compressed. [Mainly for internal use]...
Definition: Archive.h:161
Definition: GridDescriptor.h:46
bool isGridStatsMetadataEnabled() const
Return true if grid statistics (active voxel count and bounding box, etc.) are computed and written a...
Definition: Archive.h:165
boost::shared_ptr< GridBase > Ptr
Definition: Grid.h:106
OPENVDB_API bool getWriteGridStatsMetadata(std::ostream &)
OPENVDB_IMPORT VersionId getLibraryVersion(std::istream &)
Return the (major, minor) library version number associated with the given input stream.
Abstract base class for typed grids.
Definition: Grid.h:103
void setInputHasGridOffsets(bool b)
Definition: Archive.h:177
VersionId libraryVersion() const
Return the (major, minor) version number of the library that was used to write the input stream...
Definition: Archive.h:134
#define OPENVDB_VERSION_NAME
Definition: version.h:45
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 ...
uint32_t compressionFlags() const
Return a bit mask specifying compression options for the data stream.
Definition: Archive.h:155
boost::shared_ptr< const GridBase > ConstPtr
Definition: Grid.h:107
OPENVDB_IMPORT void setCurrentVersion(std::istream &)
Associate the current file format and library version numbers with the given input stream...
Definition: version.h:110
std::vector< GridBase::ConstPtr > GridCPtrVec
Definition: Grid.h:401
std::vector< GridBase::Ptr > GridPtrVec
Definition: Grid.h:396
OPENVDB_IMPORT uint32_t getFormatVersion(std::istream &)
Return the file format version number associated with the given input stream.
void setGridStatsMetadataEnabled(bool b)
Specify whether grid statistics (active voxel count and bounding box, etc.) should be computed and wr...
Definition: Archive.h:168
static const uint32_t DEFAULT_COMPRESSION_FLAGS
Definition: Archive.h:116
virtual void write(const GridCPtrVec &, const MetaMap &=MetaMap()) const
Write the grids in the given container to this archive's output stream.
Definition: Archive.h:171
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.
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...
Grid serializer/unserializer.
Definition: Archive.h:113
uint32_t fileVersion() const
Return the file format version number of the input stream.
Definition: Archive.h:131
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67
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...
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.
std::string Name
Definition: Name.h:44