2015-10-18 15:26:19 +00:00
|
|
|
#ifndef VEGETATIONMODELRENDERER_H
|
|
|
|
#define VEGETATIONMODELRENDERER_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
|
|
|
#include "LightFilter.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renderer of a single instance of vegetation model (e.g a single tree).
|
|
|
|
*/
|
2015-11-09 21:38:00 +00:00
|
|
|
class SOFTWARESHARED_EXPORT VegetationModelRenderer : public LightFilter {
|
|
|
|
public:
|
|
|
|
VegetationModelRenderer(SoftwareRenderer *parent, const VegetationModelDefinition *model);
|
2015-10-18 15:26:19 +00:00
|
|
|
virtual ~VegetationModelRenderer();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the final color of this model on a segment.
|
|
|
|
*
|
|
|
|
* Coordinates should be expressed as relative to the model origin point.
|
|
|
|
*
|
|
|
|
* If only_hit is True, we only look whether there is a hit or not.
|
|
|
|
*/
|
2015-11-09 21:38:00 +00:00
|
|
|
VegetationResult getResult(const SpaceSegment &segment, bool only_hit = false) const;
|
2015-10-18 15:26:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal (relative) light filter.
|
|
|
|
*
|
|
|
|
* The 'at' parameter should be expressed as relative to the model origin point.
|
|
|
|
*/
|
|
|
|
virtual bool applyLightFilter(LightComponent &light, const Vector3 &at);
|
|
|
|
|
2015-11-09 21:38:00 +00:00
|
|
|
private:
|
|
|
|
SoftwareRenderer *parent;
|
|
|
|
const VegetationModelDefinition *model;
|
2015-10-18 15:26:19 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // VEGETATIONMODELRENDERER_H
|