Skip to content

Commit e782a6a

Browse files
authored
Merge pull request #1498 from apradhana/vdbtool_ci
Add CI for vdb_tool
2 parents c91c2b9 + 80198df commit e782a6a

File tree

10 files changed

+150
-116
lines changed

10 files changed

+150
-116
lines changed

ci/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ cmake \
189189
-DOPENVDB_USE_DEPRECATED_ABI_9=ON \
190190
-DOPENVDB_BUILD_VDB_PRINT=ON \
191191
-DOPENVDB_BUILD_VDB_LOD=ON \
192+
-DOPENVDB_BUILD_VDB_TOOL=ON \
193+
-DOPENVDB_TOOL_USE_NANO=OFF \
192194
-DOPENVDB_BUILD_PYTHON_UNITTESTS=ON \
193195
-DMSVC_MP_THREAD_COUNT=${PARMS[-j]} \
194196
"${CMAKE_EXTRA[@]}" \

cmake/FindOpenVDB.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
394394
elseif(${COMPONENT} STREQUAL "openvdb_je")
395395
# alias to the result of openvdb which should be handled first
396396
set(OpenVDB_${COMPONENT}_LIBRARY ${OpenVDB_openvdb_LIBRARY})
397+
elseif(${COMPONENT} STREQUAL "nanovdb")
398+
# alias to the result of openvdb which should be handled first
399+
set(OpenVDB_${COMPONENT}_LIBRARY ${OpenVDB_openvdb_LIBRARY})
397400
else()
398401
find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME}
399402
${_FIND_OPENVDB_ADDITIONAL_OPTIONS}

nanovdb/nanovdb/NanoVDB.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,9 +1139,9 @@ class Coord
11391139

11401140
/// @brief Return the octant of this Coord
11411141
//__hostdev__ size_t octant() const { return (uint32_t(mVec[0])>>31) | ((uint32_t(mVec[1])>>31)<<1) | ((uint32_t(mVec[2])>>31)<<2); }
1142-
__hostdev__ uint8_t octant() const { return (uint8_t(bool(mVec[0] & (1u << 31)))) |
1142+
__hostdev__ uint8_t octant() const { return uint8_t((uint8_t(bool(mVec[0] & (1u << 31)))) |
11431143
(uint8_t(bool(mVec[1] & (1u << 31))) << 1) |
1144-
(uint8_t(bool(mVec[2] & (1u << 31))) << 2); }
1144+
(uint8_t(bool(mVec[2] & (1u << 31))) << 2)); }
11451145

11461146
/// @brief Return a single precision floating-point vector of this coordinate
11471147
__hostdev__ inline Vec3<float> asVec3s() const;

nanovdb/nanovdb/util/GridBuilder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class AbsDiff
4242
/// @note The default value of -1 means it's un-initialized!
4343
AbsDiff(float tolerance = -1.0f) : mTolerance(tolerance) {}
4444
AbsDiff(const AbsDiff&) = default;
45+
~AbsDiff() = default;
4546
void setTolerance(float tolerance) { mTolerance = tolerance; }
4647
float getTolerance() const { return mTolerance; }
4748
/// @brief Return true if the approximate value is within the accepted
@@ -68,6 +69,7 @@ class RelDiff
6869
/// @note The default value of -1 means it's un-initialized!
6970
RelDiff(float tolerance = -1.0f) : mTolerance(tolerance) {}
7071
RelDiff(const RelDiff&) = default;
72+
~RelDiff() = default;
7173
void setTolerance(float tolerance) { mTolerance = tolerance; }
7274
float getTolerance() const { return mTolerance; }
7375
/// @brief Return true if the approximate value is within the accepted

openvdb/openvdb/tools/LevelSetFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class LevelSetFilter : public LevelSetTracker<GridT, InterruptT>
160160

161161
Filter(LevelSetFilter* parent, const MaskType* mask) : mParent(parent), mMask(mask) {}
162162
Filter(const Filter&) = default;
163-
virtual ~Filter() {}
163+
~Filter() {}
164164

165165
void box(int width);
166166
void median(int width);

openvdb_cmd/vdb_tool/CMakeLists.txt

Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,53 @@ add_library(vdb_tool_common INTERFACE)
2828
# Optional components
2929
option(BUILD_TEST "Build unit tests" OFF)
3030

31-
option(VDB_TOOL_USE_NANO "Compile with NanoVDB support" ON)
32-
option(VDB_TOOL_NANO_USE_ZIP "Compile NanoVDB with zip compression support. Requires VDB_TOOL_USE_NANO=ON to have effect" ON)
33-
option(VDB_TOOL_NANO_USE_BLOSC "Compile NanoVDB with Blosc compression support. Requires VDB_TOOL_USE_NANO=ON to have effect" ON)
34-
option(VDB_TOOL_USE_PNG "Compile with PNG support" OFF)
35-
option(VDB_TOOL_USE_EXR "Compile with EXR support" OFF)
36-
option(VDB_TOOL_USE_JPG "Compile with JPG support" OFF)
37-
option(VDB_TOOL_USE_ABC "Compile with Alembic support" OFF)
38-
option(VDB_TOOL_USE_ALL "Compile with all optional components" OFF)
39-
if(VDB_TOOL_USE_ALL)
40-
set(VDB_TOOL_USE_NANO ON)
41-
set(VDB_TOOL_USE_PNG ON)
42-
set(VDB_TOOL_USE_EXR ON)
43-
set(VDB_TOOL_USE_JPG ON)
44-
set(VDB_TOOL_USE_ABC ON)
31+
option(OPENVDB_TOOL_USE_NANO "Compile with NanoVDB support" OFF)
32+
option(OPENVDB_TOOL_NANO_USE_ZIP "Compile NanoVDB with zip compression support. Requires OPENVDB_TOOL_USE_NANO=ON to have effect" ON)
33+
option(OPENVDB_TOOL_NANO_USE_BLOSC "Compile NanoVDB with Blosc compression support. Requires OPENVDB_TOOL_USE_NANO=ON to have effect" ON)
34+
option(OPENVDB_TOOL_USE_PNG "Compile with PNG support" OFF)
35+
option(OPENVDB_TOOL_USE_EXR "Compile with EXR support" OFF)
36+
option(OPENVDB_TOOL_USE_JPG "Compile with JPG support" OFF)
37+
option(OPENVDB_TOOL_USE_ABC "Compile with Alembic support" OFF)
38+
option(OPENVDB_TOOL_USE_ALL "Compile with all optional components" OFF)
39+
if(OPENVDB_TOOL_USE_ALL)
40+
set(OPENVDB_TOOL_USE_NANO ON)
41+
set(OPENVDB_TOOL_USE_PNG ON)
42+
set(OPENVDB_TOOL_USE_EXR ON)
43+
set(OPENVDB_TOOL_USE_JPG ON)
44+
set(OPENVDB_TOOL_USE_ABC ON)
4545
endif()
4646

47-
if(VDB_TOOL_USE_NANO)
48-
add_compile_definitions("VDB_TOOL_USE_NANO")
49-
if(VDB_TOOL_NANO_USE_ZIP)
50-
add_compile_definitions("NANOVDB_USE_ZIP")
47+
if(OPENVDB_TOOL_USE_NANO)
48+
target_compile_definitions(vdb_tool_common INTERFACE "VDB_TOOL_USE_NANO")
49+
if(OPENVDB_TOOL_NANO_USE_ZIP)
50+
target_compile_definitions(vdb_tool_common INTERFACE "NANOVDB_USE_ZIP")
5151
find_package(ZLIB REQUIRED)
5252
target_link_libraries(vdb_tool_common INTERFACE ZLIB::ZLIB)
5353
endif()
54-
if(VDB_TOOL_NANO_USE_BLOSC)
55-
add_compile_definitions("NANOVDB_USE_BLOSC")
54+
if(OPENVDB_TOOL_NANO_USE_BLOSC)
55+
target_compile_definitions(vdb_tool_common INTERFACE "NANOVDB_USE_BLOSC")
5656
find_package(Blosc REQUIRED)
5757
target_link_libraries(vdb_tool_common INTERFACE blosc)
5858
endif()
59-
if(OPENVDB_BUILD_NANOVDB)
60-
target_include_directories(vdb_tool_common INTERFACE ../../nanovdb/)
59+
#target_include_directories(vdb_tool_common INTERFACE ${PROJECT_SOURCE_DIR}/../nanovdb/)
60+
if(NOT OPENVDB_BUILD_NANOVDB)
61+
find_package(OpenVDB COMPONENTS nanovdb)
62+
if(NOT OpenVDB_nanovdb_FOUND OR NOT OpenVDB_FOUND)
63+
message(FATAL_ERROR
64+
" Couldn't find NanoVDB\n"
65+
" Either set OPENVDB_CMAKE_PATH to <OpenVDB install path>/lib/cmake/OpenVDB"
66+
" or please pass -DUSE_NANOVDB=ON as a cmake argument.")
67+
endif()
68+
set(NANOVDB_LIB OpenVDB::nanovdb)
69+
target_include_directories(vdb_tool_common INTERFACE ${OPENVDB_nanovdb_INCLUDE_DIR})
70+
else()
71+
set(NANOVDB_LIB nanovdb)
6172
endif()
73+
target_link_libraries(vdb_tool_common INTERFACE ${NANOVDB_LIB})
6274
endif()
6375

64-
if(VDB_TOOL_USE_PNG)
65-
add_compile_definitions("VDB_TOOL_USE_PNG")
76+
if(OPENVDB_TOOL_USE_PNG)
77+
target_compile_definitions(vdb_tool_common INTERFACE "VDB_TOOL_USE_PNG")
6678
if(WIN32)
6779
find_package(libpng CONFIG REQUIRED)
6880
else()
@@ -71,26 +83,26 @@ if(VDB_TOOL_USE_PNG)
7183
target_link_libraries(vdb_tool_common INTERFACE png)
7284
endif()
7385

74-
if(VDB_TOOL_USE_JPG)
75-
add_compile_definitions("VDB_TOOL_USE_JPG")
86+
if(OPENVDB_TOOL_USE_JPG)
87+
target_compile_definitions(vdb_tool_common INTERFACE "VDB_TOOL_USE_JPG")
7688
find_package(JPEG REQUIRED)
7789
target_link_libraries(vdb_tool_common INTERFACE ${JPEG_LIBRARIES})
7890
target_include_directories(vdb_tool_common INTERFACE ${JPEG_INCLUDE_DIR})
7991
endif()
8092

81-
if(VDB_TOOL_USE_EXR)
82-
add_compile_definitions("VDB_TOOL_USE_EXR")
93+
if(OPENVDB_TOOL_USE_EXR)
94+
target_compile_definitions(vdb_tool_common INTERFACE "VDB_TOOL_USE_EXR")
8395
find_package(OpenEXR REQUIRED)
8496
target_link_libraries(vdb_tool_common INTERFACE OpenEXR::IlmImf)
8597
endif()
8698

87-
if(VDB_TOOL_USE_ABC)
88-
add_compile_definitions("VDB_TOOL_USE_ABC")
99+
if(OPENVDB_TOOL_USE_ABC)
100+
target_compile_definitions(vdb_tool_common INTERFACE "VDB_TOOL_USE_ABC")
89101
find_package(Alembic CONFIG REQUIRED)
90102
target_link_libraries(vdb_tool_common INTERFACE Alembic::Alembic)
91103
endif()
92104

93-
if(WIN32 AND (VDB_TOOL_USE_ALL OR (VDB_TOOL_USE_ABC AND VDB_TOOL_USE_EXR)))
105+
if(WIN32 AND (OPENVDB_TOOL_USE_ALL OR (OPENVDB_TOOL_USE_ABC AND OPENVDB_TOOL_USE_EXR)))
94106
message(WARNING
95107
" The OpenEXR and Alembic VCPKG packages are using conflicting Imath versions.\n"
96108
" Disable one, if you encounter unresolved external symbols")
@@ -100,41 +112,41 @@ endif()
100112

101113
# GCC flags
102114
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
103-
add_compile_options(-Wno-invalid-offsetof -pthread -lpthread)
104-
add_compile_options("$<$<CONFIG:DEBUG>:-O1>")
115+
target_compile_options(vdb_tool_common INTERFACE -Wno-invalid-offsetof -pthread -lpthread)
116+
target_compile_options(vdb_tool_common INTERFACE "$<$<CONFIG:DEBUG>:-O1>")
105117
endif()
106118

107119

108120
# MSVC flags
109121
# Increase the number of sections that an object file can contain
110-
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/bigobj>")
122+
target_compile_options(vdb_tool_common INTERFACE "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/bigobj>")
111123
# Excludes APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets
112-
add_compile_definitions("$<$<CXX_COMPILER_ID:MSVC>:WIN32_LEAN_AND_MEAN>")
124+
target_compile_definitions(vdb_tool_common INTERFACE "$<$<CXX_COMPILER_ID:MSVC>:WIN32_LEAN_AND_MEAN>")
113125
# Disable non-secure CRT library function warnings
114126
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/
115127
# compiler-warning-level-3-c4996?view=vs-2019#unsafe-crt-library-functions
116-
add_compile_definitions("$<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>")
128+
target_compile_definitions(vdb_tool_common INTERFACE "$<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>")
117129
# Disable POSIX function name warnings
118130
# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/
119131
# compiler-warning-level-3-c4996?view=vs-2019#posix-function-names
120-
add_compile_definitions("$<$<CXX_COMPILER_ID:MSVC>:_CRT_NONSTDC_NO_WARNINGS>")
132+
target_compile_definitions(vdb_tool_common INTERFACE "$<$<CXX_COMPILER_ID:MSVC>:_CRT_NONSTDC_NO_WARNINGS>")
121133

122134
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
123-
add_compile_options("$<$<CONFIG:RELEASE>:/Oi>")
135+
target_compile_options(vdb_tool_common INTERFACE "$<$<CONFIG:RELEASE>:/Oi>")
124136

125137
message(STATUS "Suppressing some noisy MSVC CXX warnings.")
126138
endif()
127139
# Conversion from int64_t to long
128-
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4244>")
140+
target_compile_options(vdb_tool_common INTERFACE "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4244>")
129141
# It's not possible to use STL types in DLL interfaces in a portable and
130142
# reliable way so disable this warning
131-
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4251>")
143+
target_compile_options(vdb_tool_common INTERFACE "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4251>")
132144
# Conversion from size_t to uLong
133-
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4267>")
145+
target_compile_options(vdb_tool_common INTERFACE "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4267>")
134146
# Non dll-interface class used as base for dll-interface class
135-
#add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4275>")
147+
#target_compile_options(vdb_tool_common INTERFACE "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4275>")
136148
# Truncation from 'int' to 'bool'
137-
#add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4305>")
149+
#target_compile_options(vdb_tool_common INTERFACE "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/wd4305>")
138150

139151
if(OPENVDB_BUILD_CORE)
140152
target_link_libraries(vdb_tool_common INTERFACE ${OPENVDB_BINARIES_DEPENDENT_LIBS})

openvdb_cmd/vdb_tool/include/Geometry.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ void Geometry::writeSTL(std::ostream &os) const
337337
if (!mQuad.empty()) throw std::invalid_argument("STL file only supports triangles");
338338
uint8_t buffer[80] = {0};// fixed-sized buffer initiated with zeros!
339339
os.write((const char*)buffer, 80);// write header as zeros
340-
const uint32_t nTri = mTri.size();
340+
const uint32_t nTri = static_cast<uint32_t>(mTri.size());
341341
os.write((const char*)&nTri, 4);
342342
float *p = 3 + reinterpret_cast<float*>(buffer);// the normal will remain zero
343343
for (const Vec3I &tri : mTri) {
@@ -466,7 +466,7 @@ void Geometry::readPLY(std::istream &is)
466466
};
467467
auto tokens = tokenize_line();
468468
auto test = [&tokens](int i, std::vector<std::string> str) {
469-
if (i >= tokens.size()) return false;
469+
if (i >= static_cast<int>(tokens.size())) return false;
470470
for (auto &s : str) {
471471
if (tokens[i] == s) return true;
472472
}
@@ -520,20 +520,20 @@ void Geometry::readPLY(std::istream &is)
520520
} else {// e.g. nx, ny, nz, intensity, s, t etc
521521
if (n!=0 && n!=3) error("vdb_tool::readPLY: vertex float property interlaced with coordinates");
522522
vtx_skip[m].count += 1;
523-
vtx_skip[m].bytes += sizeof(float);
523+
vtx_skip[m].bytes += static_cast<int>(sizeof(float));
524524
}
525525
} else if ( test(1, {"int16", "uint16"}) ) {// e.g. material_index etc
526526
if (n!=0 && n!=3) error("vdb_tool::readPLY: vertex int16 property interlaced with coordinates is not supported");
527527
vtx_skip[m].count += 1;
528-
vtx_skip[m].bytes += sizeof(int16_t);
528+
vtx_skip[m].bytes += static_cast<int>(sizeof(int16_t));
529529
} else if ( test(1, {"int", "int32"}) ) {// e.g. material_index etc
530530
if (n!=0 && n!=3) error("vdb_tool::readPLY: vertex int32 property interlaced with coordinates is not supported");
531531
vtx_skip[m].count += 1;
532-
vtx_skip[m].bytes += sizeof(int32_t);
532+
vtx_skip[m].bytes += static_cast<int>(sizeof(int32_t));
533533
} else if ( test(1, {"uchar", "int8"}) ) {// eg red, green, blue, alpha
534534
if (n!=0 && n!=3) error("vdb_tool::readPLY: vertex int8 property interlaced with coordinates is not supported");
535535
vtx_skip[m].count += 1;
536-
vtx_skip[m].bytes += sizeof(unsigned char);
536+
vtx_skip[m].bytes += static_cast<int>(sizeof(unsigned char));
537537
} else {
538538
error("vdb_tool::readPLY: invalid vertex property");
539539
}
@@ -620,7 +620,7 @@ void Geometry::readPLY(std::istream &is)
620620
} else {// ascii
621621
for (auto &v : mVtx) {
622622
tokens = tokenize_line();
623-
if (tokens.size() != vtx_skip[0].count + 3 + vtx_skip[1].count) {
623+
if (static_cast<int>(tokens.size()) != vtx_skip[0].count + 3 + vtx_skip[1].count) {
624624
error("vdb_tool::readPLY: error reading ascii vertex coordinates");
625625
}
626626
for (int i = 0; i<3; ++i) {
@@ -675,7 +675,7 @@ void Geometry::readPLY(std::istream &is)
675675
throw std::invalid_argument("Geometry::readPLY: ascii " + std::to_string(n)+"-gons are not supported");
676676
}
677677
for (int i = 0; i<n; ++i) {
678-
vtx[i] = std::stoll(tokens[i + 1 + ply_skip[0].count]);
678+
vtx[i] = static_cast<uint32_t>(std::stoll(tokens[i + 1 + ply_skip[0].count]));
679679
}
680680
if (n==3) {
681681
mTri.emplace_back(vtx);
@@ -706,14 +706,12 @@ void Geometry::readVDB(const std::string &fileName)
706706
io::File file(fileName);
707707
file.open();// enables delayed loading by default
708708
GridPtrVecPtr meta = file.readAllGridMetadata();
709-
size_t count = 0;
710709
for (auto m : *meta) {
711710
if (m->isType<points::PointDataGrid>()) {
712711
auto grid = gridPtrCast<points::PointDataGrid>(file.readGrid(m->getName()));
713712
assert(grid);
714713
size_t n = mVtx.size();
715714
const auto m = points::pointCount(grid->tree());
716-
count += m;
717715
mVtx.resize(n + m);
718716
for (auto leafIter = grid->tree().cbeginLeaf(); leafIter; ++leafIter) {
719717
const points::AttributeArray& array = leafIter->constAttributeArray("P");
@@ -753,7 +751,6 @@ void Geometry::readPTS(const std::string &fileName)
753751
std::ifstream infile(fileName, std::ios::in);
754752
if (!infile.is_open()) throw std::runtime_error("Error opening particle file \""+fileName+"\"");
755753
std::string line;
756-
size_t count = 0;
757754
std::istringstream iss;
758755
while(std::getline(infile, line)) {
759756
const size_t n = mVtx.size(), m = std::stoi(line);
@@ -801,7 +798,7 @@ void Geometry::readSTL(const std::string &fileName)
801798
throw std::invalid_argument("Geometry::readSTL ASCII: error parsing line: \""+line+"\"");
802799
}
803800
}// endloop
804-
const int vtx = mVtx.size() - 1;
801+
const int vtx = static_cast<int>(mVtx.size()) - 1;
805802
switch (nGone){
806803
case 3:
807804
mTri.emplace_back(vtx - 2, vtx - 1, vtx);
@@ -822,7 +819,7 @@ void Geometry::readSTL(const std::string &fileName)
822819
infile.seekg (0, infile.end);
823820
if (infile.tellg() != 80 + 4 + 50*numTri) throw std::invalid_argument("Geometry::readSTL binary: Unexpected file size");
824821
infile.seekg(80 + 4, infile.beg);
825-
uint32_t vtxBegin = mVtx.size(), triBegin = mTri.size();
822+
uint32_t vtxBegin = static_cast<uint32_t>(mVtx.size()), triBegin = static_cast<uint32_t>(mTri.size());
826823
mVtx.resize(vtxBegin + 3*numTri);
827824
mTri.resize(triBegin + numTri);
828825
Vec3f *pV = mVtx.data() + vtxBegin;
@@ -841,9 +838,9 @@ void Geometry::readSTL(const std::string &fileName)
841838
mBBox = BBoxT();//invalidate BBox
842839
}// Geometry::readSTL
843840

841+
#ifdef VDB_TOOL_USE_NANO
844842
void Geometry::readNVDB(const std::string &fileName)
845843
{
846-
#ifdef VDB_TOOL_USE_NANO
847844
auto handle = nanovdb::io::readGrid(fileName);
848845
auto grid = handle.grid<uint32_t>();
849846
if (grid == nullptr || !grid->isPointData()) return;
@@ -855,10 +852,13 @@ void Geometry::readNVDB(const std::string &fileName)
855852
mVtx.resize(n + count);
856853
for (size_t i=n; i<mVtx.size(); ++i) mVtx[i] = *p++;// loop over points
857854
mBBox = BBoxT();//invalidate BBox
855+
}// Geometry::readNVDB
858856
#else
857+
void Geometry::readNVDB(const std::string&)
858+
{
859859
throw std::runtime_error("NanoVDB support was disabled during compilation!");
860-
#endif
861860
}// Geometry::readNVDB
861+
#endif
862862

863863
void Geometry::print(size_t n, std::ostream& os) const
864864
{
@@ -1115,9 +1115,9 @@ void Geometry::transform(const math::Transform &xform)
11151115
{
11161116
using RangeT = tbb::blocked_range<size_t>;
11171117
tbb::parallel_for(RangeT(0, mVtx.size()), [&](RangeT r){
1118-
for (int i=r.begin(); i<r.end(); ++i){
1118+
for (size_t i=r.begin(); i<r.end(); ++i){
11191119
Vec3d xyz(mVtx[i]);
1120-
mVtx[i] = xform.baseMap()->applyMap(xyz);
1120+
mVtx[i] = static_cast<Vec3s>(xform.baseMap()->applyMap(xyz));
11211121
}
11221122
});
11231123
mBBox = BBoxT();//invalidate BBox

0 commit comments

Comments
 (0)