From d53f7c9196e44051d972ac9e83f961baf62f414f Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Mon, 5 Sep 2011 14:29:41 -0400 Subject: [PATCH] renamed a few constants --- include/mitsuba/render/bsdf.h | 8 ++++---- include/mitsuba/render/common.h | 14 +++++++++----- include/mitsuba/render/phase.h | 6 +++--- include/mitsuba/render/records.inl | 8 ++++---- src/librender/common.cpp | 2 +- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/include/mitsuba/render/bsdf.h b/include/mitsuba/render/bsdf.h index a669a8d1..bb57f0b7 100644 --- a/include/mitsuba/render/bsdf.h +++ b/include/mitsuba/render/bsdf.h @@ -61,7 +61,7 @@ public: * The transported quantity (\ref ERadiance or \ref EImportance) */ explicit inline BSDFQueryRecord(const Intersection &its, Sampler *sampler, - ETransportQuantity quantity = ERadiance); + ETransportMode quantity = ERadiance); /** * \brief Given a surface interaction an an incident/exitant direction @@ -81,7 +81,7 @@ public: * The transported quantity (\ref ERadiance or \ref EImportance) */ inline BSDFQueryRecord(const Intersection &its, const Vector &wo, - ETransportQuantity quantity = ERadiance); + ETransportMode quantity = ERadiance); /** * \brief Given a surface interaction an an incident/exitant direction @@ -104,7 +104,7 @@ public: */ inline BSDFQueryRecord(const Intersection &its, const Vector &wi, const Vector &wo, - ETransportQuantity quantity = ERadiance); + ETransportMode quantity = ERadiance); /** * \brief Reverse the direction of light transport in the record @@ -153,7 +153,7 @@ public: * This information is required for rendering with non-reciprocal * BSDFs such as transmission through a dielectric material */ - ETransportQuantity quantity; + ETransportMode quantity; /** * \brief Bit mask containing the requested BSDF component types that diff --git a/include/mitsuba/render/common.h b/include/mitsuba/render/common.h index 096f7301..03e5e75a 100644 --- a/include/mitsuba/render/common.h +++ b/include/mitsuba/render/common.h @@ -28,12 +28,16 @@ MTS_NAMESPACE_BEGIN * sampling or evaluating a scattering function * \ingroup librender */ -enum ETransportQuantity { - /* Note to self: do not change enumeration values, - some code depends on this. */ +enum ETransportMode { + /* Note to self: do not change these enumeration + values, some code depends on them. */ + /// Radiance transport ERadiance = 0, - EImportance = 1 + /// Importance transport + EImportance = 1, + /// Specifies the number of supported transport modes + ETransportModes = 2 }; /** * \brief Specifies the measure associated with @@ -48,7 +52,7 @@ enum EMeasure { /// \cond -extern MTS_EXPORT_RENDER std::ostream &operator<<(std::ostream &os, const ETransportQuantity &quantity); +extern MTS_EXPORT_RENDER std::ostream &operator<<(std::ostream &os, const ETransportMode &quantity); extern MTS_EXPORT_RENDER std::ostream &operator<<(std::ostream &os, const EMeasure &measure); /// \endcond diff --git a/include/mitsuba/render/phase.h b/include/mitsuba/render/phase.h index 35ff4455..2545d4f3 100644 --- a/include/mitsuba/render/phase.h +++ b/include/mitsuba/render/phase.h @@ -52,7 +52,7 @@ struct MTS_EXPORT_RENDER PhaseFunctionQueryRecord { /* Transported quantity (radiance or importance) -- required for rendering with non-reciprocal phase functions */ - ETransportQuantity quantity; + ETransportMode quantity; /** * \brief Given a medium interaction and an incident direction, @@ -70,7 +70,7 @@ struct MTS_EXPORT_RENDER PhaseFunctionQueryRecord { */ inline PhaseFunctionQueryRecord(const MediumSamplingRecord &mRec, - const Vector &wi, ETransportQuantity quantity = ERadiance) + const Vector &wi, ETransportMode quantity = ERadiance) : mRec(mRec), wi(wi), quantity(quantity) { } /* @@ -92,7 +92,7 @@ struct MTS_EXPORT_RENDER PhaseFunctionQueryRecord { * The transported quantity (\ref ERadiance or \ref EImportance) */ inline PhaseFunctionQueryRecord(const MediumSamplingRecord &mRec, - const Vector &wi, const Vector &wo, ETransportQuantity quantity = ERadiance) + const Vector &wi, const Vector &wo, ETransportMode quantity = ERadiance) : mRec(mRec), wi(wi), wo(wo), quantity(quantity) { } std::string toString() const; diff --git a/include/mitsuba/render/records.inl b/include/mitsuba/render/records.inl index c9fd39e9..b5f031fa 100644 --- a/include/mitsuba/render/records.inl +++ b/include/mitsuba/render/records.inl @@ -21,24 +21,24 @@ MTS_NAMESPACE_BEGIN -inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, Sampler *sampler, ETransportQuantity quantity) +inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, Sampler *sampler, ETransportMode quantity) : its(its), sampler(sampler), wi(its.wi), quantity(quantity), typeMask(BSDF::EAll), component(-1), sampledType(0), sampledComponent(-1) { } -inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, const Vector &wo, ETransportQuantity quantity) +inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, const Vector &wo, ETransportMode quantity) : its(its), sampler(NULL), wi(its.wi), wo(wo), quantity(quantity), typeMask(BSDF::EAll), component(-1), sampledType(0), sampledComponent(-1) { } -inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, const Vector &wi, const Vector &wo, ETransportQuantity quantity) +inline BSDFQueryRecord::BSDFQueryRecord(const Intersection &its, const Vector &wi, const Vector &wo, ETransportMode quantity) : its(its), sampler(NULL), wi(wi), wo(wo), quantity(quantity), typeMask(BSDF::EAll), component(-1), sampledType(0), sampledComponent(-1) { } void BSDFQueryRecord::reverse() { std::swap(wo, wi); - quantity = (ETransportQuantity) (1-quantity); + quantity = (ETransportMode) (1-quantity); } inline bool Intersection::hasSubsurface() const { diff --git a/src/librender/common.cpp b/src/librender/common.cpp index 626efc93..3cedc349 100644 --- a/src/librender/common.cpp +++ b/src/librender/common.cpp @@ -20,7 +20,7 @@ MTS_NAMESPACE_BEGIN -std::ostream &operator<<(std::ostream &os, const ETransportQuantity &quantity) { +std::ostream &operator<<(std::ostream &os, const ETransportMode &quantity) { switch (quantity) { case EImportance: os << "importance"; break; case ERadiance: os << "radiance"; break;