Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
PartialRayEnergyEstimator.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstddef>
6#include <iostream>
7
8namespace ph
9{
10
12{
13public:
14 void update(const Integrand& integrand) override = 0;
15
17 const Ray& ray,
18 const Integrand& integrand,
19 SampleFlow& sampleFlow,
20 EnergyEstimation& out_estimation) const override = 0;
21
23 std::size_t attributeId,
24 std::size_t estimationIndex) override;
25
26 void setEstimationIndex(std::size_t index);
27
28 std::string toString() const override;
29
30protected:
31 std::size_t m_estimationIndex;
32};
33
34// In-header Implementations:
35
37 const std::size_t attributeId,
38 const std::size_t estimationIndex)
39{
40 if(attributeId == 0)
41 {
42 setEstimationIndex(estimationIndex);
43 }
44 else
45 {
46 std::cerr <<
47 "warning: at PartialRayEnergyEstimator::mapAttributeToEstimation(), "
48 "attempting to set estimation index for non-existent attribute ID " << attributeId << std::endl;
49 }
50}
51
52inline void PartialRayEnergyEstimator::setEstimationIndex(const std::size_t index)
53{
54 m_estimationIndex = index;
55}
56
57inline std::string PartialRayEnergyEstimator::toString() const
58{
59 return "Partial Ray Energy Estimator";
60}
61
62}// end namespace ph
Definition IRayEnergyEstimator.h:10
Definition Integrand.h:12
Definition PartialRayEnergyEstimator.h:12
std::size_t m_estimationIndex
Definition PartialRayEnergyEstimator.h:31
void setEstimationIndex(std::size_t index)
Definition PartialRayEnergyEstimator.h:52
void estimate(const Ray &ray, const Integrand &integrand, SampleFlow &sampleFlow, EnergyEstimation &out_estimation) const override=0
void update(const Integrand &integrand) override=0
void mapAttributeToEstimation(std::size_t attributeId, std::size_t estimationIndex) override
Definition PartialRayEnergyEstimator.h:36
std::string toString() const override
Definition PartialRayEnergyEstimator.h:57
Represents a ray in space.
Definition Ray.h:21
A sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
Definition TEstimationArray.h:13
The root for all renderer implementations.
Definition EEngineProject.h:6