31 #ifndef OPENVDB_IO_STREAM_HAS_BEEN_INCLUDED
32 #define OPENVDB_IO_STREAM_HAS_BEEN_INCLUDED
51 explicit Stream(std::istream&);
56 explicit Stream(std::ostream&);
61 virtual boost::shared_ptr<Archive> copy()
const;
75 template<
typename Gr
idPtrContainerT>
76 void write(
const GridPtrContainerT&,
const MetaMap& =
MetaMap())
const;
80 template<
typename Gr
idPtrContainerT>
95 std::ostream* mOutputStream;
105 if (mOutputStream == NULL) {
108 this->writeGrids(*mOutputStream, grids, metadata);
112 template<
typename Gr
idPtrContainerT>
114 Stream::write(
const GridPtrContainerT& container,
const MetaMap& metadata)
const
116 if (mOutputStream == NULL) {
120 std::copy(container.begin(), container.end(), std::back_inserter(grids));
121 this->writeGrids(*mOutputStream, grids, metadata);
125 template<
typename Gr
idPtrContainerT>
127 Stream::write(std::ostream& os,
const GridPtrContainerT& container,
131 std::copy(container.begin(), container.end(), std::back_inserter(grids));
132 this->writeGrids(os, grids, metadata);
137 Stream::write<GridCPtrVec>(std::ostream& os,
const GridCPtrVec& grids,
140 this->writeGrids(os, grids, metadata);
147 #endif // OPENVDB_IO_STREAM_HAS_BEEN_INCLUDED
Grid archive associated with arbitrary input and output streams (not necessarily files) ...
Definition: Stream.h:47
GridPtrVecPtr getGrids()
Return pointers to the grids that were read from the input stream.
Definition: Stream.h:67
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:97
Definition: GridDescriptor.h:46
boost::shared_ptr< GridBase > Ptr
Definition: Grid.h:106
Definition: Exceptions.h:88
boost::shared_ptr< GridPtrVec > GridPtrVecPtr
Definition: Grid.h:399
#define OPENVDB_VERSION_NAME
Definition: version.h:45
std::vector< GridBase::ConstPtr > GridCPtrVec
Definition: Grid.h:401
Grid serializer/unserializer.
Definition: Archive.h:113
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:67