renamed a few constants

metadata
Wenzel Jakob 2011-09-05 14:29:41 -04:00
parent d666d89031
commit d53f7c9196
5 changed files with 21 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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 {

View File

@ -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;