Skip to content

Commit

Permalink
Fixes for Houdini 16 compatibility; improvements to logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pcucka committed Dec 9, 2016
1 parent bb4a7d1 commit bbe323e
Show file tree
Hide file tree
Showing 46 changed files with 3,201 additions and 593 deletions.
33 changes: 31 additions & 2 deletions openvdb/CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
OpenVDB Version History
=======================

Version 4.0.1 - In development

New features:
- Added functions to util/logging.h to simplify configuration of the
logging system (via command-line arguments, in particular).

Bug fixes:
- tools::fillWithSpheres() and tools::ClosestSurfacePoint now correctly
handle isosurfaces outside the input volume's narrow band.
- tools::MultiResGrid now supports all standard grid types, including
BoolGrid and MaskGrid.
- Fixed a bug that caused tools::copyToDense() to only partially populate
the output array when delayed loading was in effect.
[Reported by Stuart Levy]
- Fixed a thread race condition in math::QuantizedUnitVec that could
cause it to produce incorrect results.
[Contributed by Jeff Lait]

Python:
- Added functions getLoggingLevel(), setLoggingLevel(), and
setProgramName(), to allow configuration of the logging system.

Houdini:
- Fixed a crash in the Ray SOP when the user selected an isosurface
outside the target volume's narrow band.
- The LOD SOP now supports all standard grid types, including
boolean grids.
- Made various small changes for Houdini 16 compatibility.
[Contributed by SideFX]


Version 4.0.0 - November 15, 2016

Highlights:
Expand Down Expand Up @@ -51,7 +82,6 @@ Version 4.0.0 - November 15, 2016
- tools::fillWithSpheres() now returns an empty list of spheres
instead of crashing when the user selects an isosurface that lies
outside the bounding volume's narrow band.
A more comprehensive fix will appear in the next release.
- Fixed a null pointer dereference when copying grids that were loaded
with io::File::readGridPartial().
[Reported by Nick Avramoussis]
Expand Down Expand Up @@ -103,7 +133,6 @@ Version 4.0.0 - November 15, 2016
- Added a toggle to the Clip SOP to invert the clipping mask.
- Added a slider to the Scatter SOP to specify how far each point
may be displaced from the center of its host voxel or tile.



Version 3.2.0 - August 10, 2016
Expand Down
2 changes: 1 addition & 1 deletion openvdb/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Optional:
- pdfLaTeX (www.pdftex.org), version 1.21 or later, for documentation
in PDF format

- log4cplus (log4cplus.sourceforge.net), version 1.0 or later,
- log4cplus (log4cplus.sourceforge.net), version 1.1.2 or later,
for error logging

- GLFW 2.7 (www.glfw.org), for the OpenVDB viewer
Expand Down
4 changes: 2 additions & 2 deletions openvdb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ CPPUNIT_LIB := -lcppunit

# The parent directory of the log4cplus/ header directory
# (leave blank if log4cplus is unavailable)
LOG4CPLUS_INCL_DIR := /rel/folio/log4cplus/log4cplus-1.0.3-latest/sys_include
LOG4CPLUS_INCL_DIR := /rel/folio/log4cplus/log4cplus-1.1.2-latest/sys_include
# The directory containing liblog4cplus
LOG4CPLUS_LIB_DIR := /rel/folio/log4cplus/log4cplus-1.0.3-latest/library
LOG4CPLUS_LIB_DIR := /rel/folio/log4cplus/log4cplus-1.1.2-latest/library/c++11
LOG4CPLUS_LIB := -llog4cplus

# The directory containing glfw.h
Expand Down
11 changes: 6 additions & 5 deletions openvdb/cmd/openvdb_print/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
#include <string>
#include <vector>
#include <openvdb/openvdb.h>
#include <openvdb/util/logging.h>
#ifdef DWA_OPENVDB
#include <logging_base/logging.h>
#include <usagetrack.h>
#endif


namespace {

typedef std::vector<std::string> StringVec;
using StringVec = std::vector<std::string>;

const char* INDENT = " ";
const char* gProgName = "";
Expand Down Expand Up @@ -264,7 +264,6 @@ main(int argc, char *argv[])
{
#ifdef DWA_OPENVDB
USAGETRACK_report_basic_tool_usage(argc, argv, /*duration=*/0);
logging_base::configure(argc, argv);
#endif

OPENVDB_START_THREADSAFE_STATIC_WRITE
Expand All @@ -276,6 +275,8 @@ main(int argc, char *argv[])

if (argc == 1) usage();

openvdb::logging::initialize(argc, argv);

bool stats = false, metadata = false, version = false;
StringVec filenames;
for (int i = 1; i < argc; ++i) {
Expand All @@ -290,7 +291,7 @@ main(int argc, char *argv[])
} else if (arg == "-version" || arg == "--version") {
version = true;
} else {
std::cerr << gProgName << ": \"" << arg << "\" is not a valid option\n";
OPENVDB_LOG_FATAL("\"" << arg << "\" is not a valid option");
usage();
}
} else if (!arg.empty()) {
Expand All @@ -307,7 +308,7 @@ main(int argc, char *argv[])
}

if (filenames.empty()) {
std::cerr << gProgName << ": expected one or more OpenVDB files\n";
OPENVDB_LOG_FATAL("expected one or more OpenVDB files");
usage();
}

Expand Down
20 changes: 10 additions & 10 deletions openvdb/cmd/openvdb_render/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@

#include <iostream>
#include <limits>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/scoped_ptr.hpp>
#include <OpenEXR/ImfChannelList.h>
#include <OpenEXR/ImfFrameBuffer.h>
#include <OpenEXR/ImfHeader.h>
Expand All @@ -54,7 +54,6 @@
#include <openvdb/tools/RayIntersector.h>
#include <openvdb/tools/RayTracer.h>
#ifdef DWA_OPENVDB
#include <logging_base/logging.h>
#include <usagetrack.h>
#endif

Expand Down Expand Up @@ -257,7 +256,7 @@ usage [[noreturn]] (int exitStatus = EXIT_FAILURE)
void
saveEXR(const std::string& fname, const openvdb::tools::Film& film, const RenderOpts& opts)
{
typedef openvdb::tools::Film::RGBA RGBA;
using RGBA = openvdb::tools::Film::RGBA;

std::string filename = fname;
if (!boost::iends_with(filename, ".exr")) filename += ".exr";
Expand Down Expand Up @@ -322,7 +321,7 @@ render(const GridType& grid, const std::string& imgFilename, const RenderOpts& o

tools::Film film(opts.width, opts.height);

boost::scoped_ptr<tools::BaseCamera> camera;
std::unique_ptr<tools::BaseCamera> camera;
if (boost::starts_with(opts.camera, "persp")) {
camera.reset(new tools::PerspectiveCamera(film, opts.rotate, opts.translate,
opts.focal, opts.aperture, opts.znear, opts.zfar));
Expand All @@ -336,7 +335,7 @@ render(const GridType& grid, const std::string& imgFilename, const RenderOpts& o
if (opts.lookat) camera->lookAt(opts.target, opts.up);

// Define the shader for level set rendering. The default shader is a diffuse shader.
boost::scoped_ptr<tools::BaseShader> shader;
std::unique_ptr<tools::BaseShader> shader;
if (opts.shader == "matte") {
if (opts.colorgrid) {
shader.reset(new tools::MatteShader<openvdb::Vec3SGrid>(*opts.colorgrid));
Expand Down Expand Up @@ -380,7 +379,7 @@ render(const GridType& grid, const std::string& imgFilename, const RenderOpts& o
tools::rayTrace(grid, intersector, *shader, *camera, opts.samples,
/*seed=*/0, (opts.threads != 1));
} else {
typedef tools::VolumeRayIntersector<GridType> IntersectorType;
using IntersectorType = tools::VolumeRayIntersector<GridType>;
IntersectorType intersector(grid);

tools::VolumeRender<IntersectorType> renderer(intersector, *camera);
Expand Down Expand Up @@ -467,8 +466,8 @@ struct OptParse
{
if (argv[idx] == name) {
if (idx + numArgs >= argc) {
std::cerr << gProgName << ": option " << name << " requires "
<< numArgs << " argument" << (numArgs == 1 ? "" : "s") << "\n";
OPENVDB_LOG_FATAL("option " << name << " requires "
<< numArgs << " argument" << (numArgs == 1 ? "" : "s"));
usage();
}
return true;
Expand All @@ -485,7 +484,6 @@ main(int argc, char *argv[])
{
#ifdef DWA_OPENVDB
USAGETRACK_report_basic_tool_usage(argc, argv, /*duration=*/0);
logging_base::configure(argc, argv);
#endif

OPENVDB_START_THREADSAFE_STATIC_WRITE
Expand All @@ -497,6 +495,8 @@ main(int argc, char *argv[])

if (argc == 1) usage();

openvdb::logging::initialize(argc, argv);

std::string vdbFilename, imgFilename, gridName;
RenderOpts opts;

Expand Down Expand Up @@ -601,7 +601,7 @@ main(int argc, char *argv[])
} else if (arg == "-h" || arg == "-help" || arg == "--help") {
usage(EXIT_SUCCESS);
} else {
std::cerr << gProgName << ": \"" << arg << "\" is not a valid option\n";
OPENVDB_LOG_FATAL("\"" << arg << "\" is not a valid option");
usage();
}
} else if (vdbFilename.empty()) {
Expand Down
7 changes: 3 additions & 4 deletions openvdb/cmd/openvdb_view/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <vector>
#include <exception>
#ifdef DWA_OPENVDB
#include <logging_base/logging.h>
#include <usagetrack.h>
#endif

Expand Down Expand Up @@ -89,7 +88,6 @@ main(int argc, char *argv[])
{
#ifdef DWA_OPENVDB
USAGETRACK_report_basic_tool_usage(argc, argv, /*duration=*/0);
logging_base::configure(argc, argv);
#endif

const char* progName = argv[0];
Expand All @@ -99,6 +97,7 @@ main(int argc, char *argv[])

try {
openvdb::initialize();
openvdb::logging::initialize(argc, argv);

bool printInfo = false, printGLInfo = false, printVersionInfo = false;

Expand Down Expand Up @@ -193,10 +192,10 @@ main(int argc, char *argv[])
openvdb_viewer::exit();

} catch (const char* s) {
OPENVDB_LOG_ERROR(progName << ": " << s);
OPENVDB_LOG_ERROR(s);
status = EXIT_FAILURE;
} catch (std::exception& e) {
OPENVDB_LOG_ERROR(progName << ": " << e.what());
OPENVDB_LOG_ERROR(e.what());
status = EXIT_FAILURE;
}
return status;
Expand Down
40 changes: 40 additions & 0 deletions openvdb/doc/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,46 @@

@page changes Release Notes

@htmlonly <a name="v4_0_1_changes"></a>@endhtmlonly
@par
<B>Version 4.0.1</B> - <I>In development</I>
@par
New features:
- Added functions to util/logging.h to simplify configuration of the
logging system (via command-line arguments, in particular).

@par
Bug fixes:
- The @vdblink::tools::fillWithSpheres() fillWithSpheres@endlink
and @vdblink::tools::ClosestSurfacePoint ClosestSurfacePoint@endlink
tools now correctly handle isosurfaces outside the input volume&rsquo;s
narrow band.
- The @vdblink::tools::MultiResGrid MultiResGrid@endlink tool
now supports all standard grid types, including
@vdblink::BoolGrid BoolGrid@endlink and @vdblink::MaskGrid MaskGrid@endlink.
- Fixed a bug that caused @vdblink::tools::copyToDense()
tools::copyToDense@endlink to only partially populate the output array
when delayed loading was in effect.
<I>[Reported&nbsp;by&nbsp;Stuart&nbsp;Levy]</I>
- Fixed a thread race condition in
@vdblink::math::QuantizedUnitVec QuantizedUnitVec@endlink
that could cause it to produce incorrect results.
<I>[Contributed by Jeff&nbsp;Lait]</I>

@par
Python:
- Added functions @c getLoggingLevel, @c setLoggingLevel, and
@c setProgramName, to allow configuration of the logging system.

@par
Houdini:
- Fixed a crash in the Ray SOP when the user selected an isosurface
outside the target volume&rsquo;s narrow band.
- The LOD SOP now supports all standard grid types, including boolean grids.
- Made various small changes for Houdini&nbsp;16 compatibility.
<I>[Contributed&nbsp;by&nbsp;SideFX]</I>


@htmlonly <a name="v4_0_0_changes"></a>@endhtmlonly
@par
<B>Version 4.0.0</B> - <I>November 15, 2016</I>
Expand Down
7 changes: 4 additions & 3 deletions openvdb/doxygen-config
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ PROJECT_NAME = "OpenVDB"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 4.0.0
PROJECT_NUMBER = 4.0.1

ALIASES += vdbnamespace="openvdb::v4_0_0"
PREDEFINED = OPENVDB_VERSION_NAME=v4_0_0
ALIASES += vdbnamespace="openvdb::v4_0_1"
PREDEFINED = OPENVDB_VERSION_NAME=v4_0_1

PREDEFINED += __declspec(x):= __attribute__(x):=
PREDEFINED += OPENVDB_STATIC_SPECIALIZATION=""
PREDEFINED += OPENVDB_USE_LOG4CPLUS=
#EXPAND_AS_DEFINED = \
# OPENVDB_API \
# OPENVDB_HOUDINI_API \
Expand Down
Loading

0 comments on commit bbe323e

Please sign in to comment.