24 #ifdef _ALLOW_TARGETING_
35 #ifdef _ALLOW_TARGETING_
36 Source(std::string _name =
"unknown source") :
Base(),
sampler(NULL), targetManager(NULL)
55 targetManager = other.targetManager;
56 for (
unsigned int i = 0; i < other.directions.size(); i++)
58 directions.push_back(other.directions.at(i));
102 name = std::string(_name);
173 #ifdef _ALLOW_TARGETING_
179 if (!directions.empty())
181 r =
vec3(directions.back());
182 directions.pop_back();
220 #ifdef _ALLOW_TARGETING_
224 targetManager = _targetManager;
227 void setInitialTargetCount(
unsigned int nb)
229 initialTargetCount = nb;
232 unsigned int getInitialTargetCount()
234 return initialTargetCount;
236 void addDirection(
vec3 dir)
238 directions.push_back(dir);
241 std::vector<vec3>& getPrecomputedDirections()
247 unsigned int initialTargetCount;
248 unsigned int targetCount;
249 std::vector<vec3> directions;
Base class of Event, Material, PostFilter, Ray, Repere, Scene, Shape, Simulation, Source.
Base()
Default constructor.
Sampler class and its sub-classes describe ray generators used in AcousticRayTracer....
virtual Sampler * Clone()
Clone a sample.
virtual vec3 getSample()
Return the sample.
int getInitialRayCount()
Get the initial rays counter.
void setSampler(Sampler *_sampler)
Set the Sampler for this Source.
void setId(unsigned int _id)
Set the Source id.
vec3 getPosition()
Get the position of the Source.
void setPosition(const vec3 _pos)
Set the position of the Source.
int nbRayLeft
Number of remaining rays to generate.
void setInitialRayCount(int nb)
Set the initial rays counter.
int getNbRayLeft()
Get the number of remaining rays to generate.
int indice
Index to know which ray we are working on.
Spectre spectrePuissance
Spectrum.
bool getDirection(vec3 &r)
Get a direction (return false if all rays has been launched)
Sampler * getSampler()
Get the Sampler of this Source.
int initialRayCount
Initial rays counter.
Spectre getSpectre()
Get the spectrum.
void setSpectre(const Spectre &spectre)
Set the spectrum.
unsigned int getId()
Get the Source id.
Source(std::string _name="unknown source")
Base constructor.
void setNbRayLeft(int nb)
Set the number of remaining rays to generate.
unsigned int id
Source identification.
Sampler * sampler
A pointer to a Sampler.
void setName(const std::string &_name)
Set the name of the Source.
std::string getName()
Get the name of the Source.
Source(const Source &other)
Copy constructor.
virtual ~Source()
Destructor.
base_vec3< decimal > vec3