Skip to content

Commit 05b5543

Browse files
committed
Add io/Codec.h with ReadOptions and WriteOptions
Signed-off-by: Dan Bailey <danbailey@ilm.com>
1 parent eb8dead commit 05b5543

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

openvdb/openvdb/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ set(OPENVDB_LIBRARY_INCLUDE_FILES
366366

367367
set(OPENVDB_LIBRARY_IO_INCLUDE_FILES
368368
io/Archive.h
369+
io/Codec.h
369370
io/Compression.h
370371
io/File.h
371372
io/GridDescriptor.h
@@ -734,6 +735,7 @@ endif()
734735
install(FILES ${OPENVDB_LIBRARY_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/openvdb)
735736
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openvdb/version.h DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/openvdb)
736737
install(FILES ${OPENVDB_LIBRARY_IO_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/openvdb/io)
738+
install(FILES ${OPENVDB_LIBRARY_CODECS_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/openvdb/codecs)
737739
install(FILES ${OPENVDB_LIBRARY_MATH_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/openvdb/math)
738740
install(FILES ${OPENVDB_LIBRARY_POINTS_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/openvdb/points)
739741
install(FILES ${OPENVDB_LIBRARY_POINTS_IMPL_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/openvdb/points/impl)

openvdb/openvdb/io/Codec.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright Contributors to the OpenVDB Project
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
#ifndef OPENVDB_IO_CODEC_HAS_BEEN_INCLUDED
5+
#define OPENVDB_IO_CODEC_HAS_BEEN_INCLUDED
6+
7+
#include <memory>
8+
9+
#include <openvdb/version.h>
10+
11+
namespace openvdb {
12+
OPENVDB_USE_VERSION_NAMESPACE
13+
namespace OPENVDB_VERSION_NAME {
14+
namespace io {
15+
16+
17+
enum class ReadMode {
18+
Original, // Read data as-is (default)
19+
TopologyOnly // Read topology only, no buffer data
20+
};
21+
22+
/// Global read configuration that applies to all grids
23+
/// Contains common options shared across all codec types
24+
struct OPENVDB_API ReadOptions
25+
{
26+
using Ptr = std::shared_ptr<ReadOptions>;
27+
28+
virtual ~ReadOptions() = default;
29+
30+
// BBox Clip Data
31+
BBoxd clipBBox = BBoxd();
32+
33+
// Grid Conversion Options
34+
ReadMode readMode = ReadMode::Original;
35+
}; // struct ReadOptions
36+
37+
/// Global write configuration that applies to all grids
38+
/// Contains common options shared across all codec types
39+
struct OPENVDB_API WriteOptions
40+
{
41+
using Ptr = std::shared_ptr<WriteOptions>;
42+
43+
virtual ~WriteOptions() = default;
44+
}; // struct WriteOptions
45+
46+
47+
} // namespace io
48+
} // namespace OPENVDB_VERSION_NAME
49+
} // namespace openvdb
50+
51+
#endif // OPENVDB_IO_CODEC_HAS_BEEN_INCLUDED

0 commit comments

Comments
 (0)