Skip to content

Commit

Permalink
Update class export settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsy committed Mar 10, 2016
1 parent fb880ef commit 3c8b2dd
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 22 deletions.
3 changes: 2 additions & 1 deletion include/spica.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "../sources/core/engine.h"
#include "../sources/core/path.h"
#include "../sources/core/timer.h"
#include "../sources/core/memory.h"
#include "../sources/core/sampling.h"
#include "../sources/core/spica_dirs.h"
#include "../sources/core/point2d.h"
Expand Down Expand Up @@ -85,7 +86,7 @@
#include "../sources/texture/spica_texture.h"

// --------------------------------------------
// Textures
// Materials
// --------------------------------------------

#include "../sources/material/spica_material.h"
Expand Down
1 change: 1 addition & 0 deletions sources/bxdf/bsdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "../math/vect_math.h"

#include "bxdf.h"
#include "fresnel.h"

namespace spica {

Expand Down
2 changes: 1 addition & 1 deletion sources/bxdf/bsdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace spica {

class BSDF {
class SPICA_EXPORTS BSDF {
public:
// Public methods
BSDF(const SurfaceInteraction& isect, double eta = 1.0);
Expand Down
2 changes: 1 addition & 1 deletion sources/bxdf/bssrdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class SPICA_EXPORTS SeparableBSSRDF : public BSSRDF {

protected:
// Protected methods
virtual Spectrum Sp(const SurfaceInteraction& pi) const;
Spectrum Sw(const Vector3d& w) const;
Spectrum Sp(const SurfaceInteraction& pi) const;
Spectrum sampleSp(const Scene& scene, double rand1, const Point2d& rand2,
MemoryArena& arena, SurfaceInteraction* pi,
double* pdf) const;
Expand Down
18 changes: 8 additions & 10 deletions sources/bxdf/bxdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "../core/forward_decl.h"
#include "../core/uncopyable.h"
#include "../core/spectrum.h"
#include "fresnel.h"

namespace spica {

Expand Down Expand Up @@ -45,9 +46,6 @@ class SPICA_EXPORTS BxDF : public Uncopyable {
explicit BxDF(BxDFType type = BxDFType::None);
virtual ~BxDF();

BxDF(const BxDF&) = default;
BxDF& operator=(const BxDF&) = default;

virtual Spectrum f(const Vector3d& wo, const Vector3d& wi) const = 0;
virtual Spectrum sample(const Vector3d& wo, Vector3d* wi,
const Point2d& rands, double* pdf,
Expand All @@ -64,7 +62,7 @@ class SPICA_EXPORTS BxDF : public Uncopyable {
/**
* Lambertian refrection.
*/
class LambertianReflection : public BxDF {
class SPICA_EXPORTS LambertianReflection : public BxDF {
public:
explicit LambertianReflection(const Spectrum& ref);

Expand All @@ -77,7 +75,7 @@ class LambertianReflection : public BxDF {
/**
* Lambertian transmission.
*/
class LambertianTransmission : public BxDF {
class SPICA_EXPORTS LambertianTransmission : public BxDF {
public:
explicit LambertianTransmission(const Spectrum& tr);

Expand All @@ -90,7 +88,7 @@ class LambertianTransmission : public BxDF {
/**
* Specular reflection (Metal-like effect).
*/
class SpecularReflection : public BxDF {
class SPICA_EXPORTS SpecularReflection : public BxDF {
public:
// Public methods
SpecularReflection(const Spectrum& ref, Fresnel* fresnel);
Expand All @@ -109,7 +107,7 @@ class SpecularReflection : public BxDF {
/**
* Specular transmission.
*/
class SpecularTransmission : public BxDF {
class SPICA_EXPORTS SpecularTransmission : public BxDF {
public:
// Public methods
SpecularTransmission(const Spectrum& tr, double etaA, double etaB);
Expand All @@ -130,7 +128,7 @@ class SpecularTransmission : public BxDF {
/**
* Fresnel specular refraction (Glass-like effect).
*/
class FresnelSpecular : public BxDF {
class SPICA_EXPORTS FresnelSpecular : public BxDF {
public:
// Public methods
FresnelSpecular();
Expand All @@ -152,7 +150,7 @@ class FresnelSpecular : public BxDF {
/**
* Microfacet reflaction.
*/
class MicrofacetReflection : public BxDF {
class SPICA_EXPORTS MicrofacetReflection : public BxDF {
public:
MicrofacetReflection(const Spectrum& ref,
MicrofacetDistribution* distrib, Fresnel* fresnel);
Expand All @@ -170,7 +168,7 @@ class MicrofacetReflection : public BxDF {
/**
* Microfacet transmission.
*/
class MicrofacetTransmission : public BxDF {
class SPICA_EXPORTS MicrofacetTransmission : public BxDF {
public:
// Public methods
MicrofacetTransmission(const Spectrum& tr,
Expand Down
9 changes: 5 additions & 4 deletions sources/bxdf/fresnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
#ifndef _SPICA_FRESNEL_H_
#define _SPICA_FRESNEL_H_

#include "../core/common.h"
#include "../core/spectrum.h"

namespace spica {

/**
* The inteface for Fresnel reflections.
*/
class Fresnel {
class SPICA_EXPORTS Fresnel {
public:
virtual ~Fresnel() {}
virtual Spectrum evaluate(double cosThetaI) const = 0;
Expand All @@ -21,7 +22,7 @@ class Fresnel {
/**
* Fresnel conductor class.
*/
class FresnelConductor : public Fresnel {
class SPICA_EXPORTS FresnelConductor : public Fresnel {
public:
FresnelConductor(const Spectrum& etaI, const Spectrum& etaT,
const Spectrum& k);
Expand All @@ -34,7 +35,7 @@ class FresnelConductor : public Fresnel {
/**
* Fresnel dielectric class.
*/
class FresnelDielectric : public Fresnel {
class SPICA_EXPORTS FresnelDielectric : public Fresnel {
public:
FresnelDielectric(double etaI, double etaT);
Spectrum evaluate(double cosThetaI) const override;
Expand All @@ -46,7 +47,7 @@ class FresnelDielectric : public Fresnel {
/**
* Dammy Fresnel class which returns always one.
*/
class FresnelNoOp : public Fresnel {
class SPICA_EXPORTS FresnelNoOp : public Fresnel {
public:
FresnelNoOp() {}
Spectrum evaluate(double cosThetaI) const override {
Expand Down
1 change: 1 addition & 0 deletions sources/core/interaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "../core/primitive.h"
#include "../math/vector3d.h"
#include "../bxdf/bsdf.h"
#include "../bxdf/fresnel.h"
#include "../light/area_light.h"

namespace spica {
Expand Down
1 change: 1 addition & 0 deletions sources/integrator/integrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "../bxdf/bxdf.h"
#include "../bxdf/bsdf.h"
#include "../bxdf/fresnel.h"

#include "../camera/camera.h"
#include "../image/film.h"
Expand Down
1 change: 0 additions & 1 deletion sources/material/subsurface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void SubsurfaceMaterial::setScatterFuncs(SurfaceInteraction* isect,
double uRough = uRoughness_ ? uRoughness_->evaluate(*isect) : 0.0;
double vRough = vRoughness_ ? vRoughness_->evaluate(*isect) : 0.0;

// TODO: check which method "allocate" is called.
isect->setBSDF(arena.allocate<BSDF>(*isect, eta_));

if (re.isBlack() && tr.isBlack()) return;
Expand Down
4 changes: 2 additions & 2 deletions sources/texture/texture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace spica {

Point2d UVMapping2D::map(const SurfaceInteraction& intr,
Vector2d* dstdx, Vector2d* dstdy) const {
*dstdx = Vector2d(su_ * intr.dudx(), sv_ * intr.dvdx());
*dstdy = Vector2d(su_ * intr.dudy(), sv_ * intr.dvdy());
if (dstdx) *dstdx = Vector2d(su_ * intr.dudx(), sv_ * intr.dvdx());
if (dstdy) *dstdy = Vector2d(su_ * intr.dudy(), sv_ * intr.dvdy());
return Point2d(su_ * intr.uv()[0] + du_, sv_ * intr.uv()[1] + dv_);
}

Expand Down
5 changes: 3 additions & 2 deletions sources/texture/texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ namespace spica {
class SPICA_EXPORTS TextureMapping2D {
public:
virtual ~TextureMapping2D() {}
virtual Point2d map(const SurfaceInteraction& intr, Vector2d* dstdx,
Vector2d* dstdy) const = 0;
virtual Point2d map(const SurfaceInteraction& intr,
Vector2d* dstdx = nullptr,
Vector2d* dstdy = nullptr) const = 0;
};

class UVMapping2D : public TextureMapping2D {
Expand Down

0 comments on commit 3c8b2dd

Please sign in to comment.