20 #if !defined(__MITSUBA_RENDER_PHOTONMAP_H_)
21 #define __MITSUBA_RENDER_PHOTONMAP_H_
59 inline void clear() { m_kdtree.clear(); }
61 inline void resize(
size_t size) { m_kdtree.resize(size); }
63 inline void reserve(
size_t size) { m_kdtree.reserve(size); }
65 inline size_t size()
const {
return m_kdtree.size(); }
67 inline size_t capacity()
const {
return m_kdtree.capacity(); }
100 Float searchRadius,
int maxDepth,
101 size_t maxPhotons)
const;
118 Float searchRadius,
size_t maxPhotons)
const;
135 return m_kdtree.nnSearch(p, sqrSearchRadius, k, results);
141 return m_kdtree.nnSearch(p, k, results);
153 if (size() < capacity()) {
173 inline void build(
bool recomputeAABB =
false) { m_kdtree.build(recomputeAABB); }
176 inline size_t getDepth()
const {
return m_kdtree.getDepth(); }
180 return capacity() == size();
187 void dumpOBJ(
const std::string &filename);
void build(bool recomputeAABB=false)
Build a photon map over the supplied photons.
Definition: photonmap.h:173
PhotonTree::SearchResult SearchResult
Definition: photonmap.h:38
Three-dimensional normal data structure.
Definition: normal.h:39
size_t getDepth() const
Return the depth of the constructed KD-tree.
Definition: photonmap.h:176
PointKDTree< Photon > PhotonTree
Definition: photonmap.h:36
Base class of all reference-counted objects with serialization support.
Definition: serialization.h:35
virtual void serialize(Stream *stream, InstanceManager *manager) const =0
Serialize this object to a stream.
Float getScaleFactor() const
Return the power scale factor of this photon map.
Definition: photonmap.h:165
bool isFull() const
Determine if the photon map is completely filled.
Definition: photonmap.h:179
size_t capacity() const
Return the capacity of the kd-tree.
Definition: photonmap.h:67
void clear()
Clear the kd-tree array.
Definition: photonmap.h:59
size_t nnSearch(const Point &p, Float &sqrSearchRadius, size_t k, SearchResult *results) const
Perform a nearest-neighbor query, see PointKDTree for details.
Definition: photonmap.h:133
void push_back(const Photon &photon)
Append a kd-tree photon to the photon array.
Definition: photonmap.h:69
size_t nnSearch(const Point &p, size_t k, SearchResult *results) const
Perform a nearest-neighbor query, see PointKDTree for details.
Definition: photonmap.h:139
size_t size() const
Return the size of the kd-tree.
Definition: photonmap.h:65
Abstract seekable stream class.
Definition: stream.h:58
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Implementation of the photon map data structure.
Definition: photonmap.h:34
Memory-efficient photon representation for use with PointKDTree.
Definition: photon.h:57
void setScaleFactor(Float value)
Scale all photon power values contained in this photon map.
Definition: photonmap.h:162
bool tryAppend(const Photon &photon)
Try to append a photon to the photon map.
Definition: photonmap.h:152
Container for all information related to a surface intersection.
Definition: shape.h:36
Coordinates the serialization and unserialization of object graphs.
Definition: serialization.h:65
void reserve(size_t size)
Reserve a certain amount of memory for the kd-tree array.
Definition: photonmap.h:63
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
Photon & operator[](size_t idx)
Return one of the photons by index.
Definition: photonmap.h:71
virtual std::string toString() const
Return a human-readable string representation of the object's contents.
void resize(size_t size)
Resize the kd-tree array.
Definition: photonmap.h:61
const Photon & operator[](size_t idx) const
Return one of the photons by index (const version)
Definition: photonmap.h:73
PhotonTree::IndexType IndexType
Definition: photonmap.h:37