2015-10-18 20:15:19 +00:00
|
|
|
#ifndef VEGETATIONPRESENCEDEFINITION_H
|
|
|
|
#define VEGETATIONPRESENCEDEFINITION_H
|
|
|
|
|
|
|
|
#include "definition_global.h"
|
|
|
|
|
|
|
|
#include "DefinitionNode.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace definition {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Definition of the presence of vegetation at locations.
|
|
|
|
*/
|
2015-11-09 21:38:00 +00:00
|
|
|
class DEFINITIONSHARED_EXPORT VegetationPresenceDefinition : public DefinitionNode {
|
|
|
|
public:
|
2015-10-18 20:15:19 +00:00
|
|
|
VegetationPresenceDefinition(VegetationLayerDefinition *parent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Collect instances in a rectangle area.
|
|
|
|
*
|
2016-01-06 18:55:49 +00:00
|
|
|
* If 'outcomers' is true, the rectangle area will be expanded to included potential instances that does not
|
2015-11-09 21:38:00 +00:00
|
|
|
*originate
|
2015-10-18 20:15:19 +00:00
|
|
|
* in the area, but may have leaves in it.
|
|
|
|
*
|
|
|
|
* The location vector set in collected instances is based on raw terrain height, without displacement.
|
|
|
|
* It's the renderer role to apply the correct displacement.
|
|
|
|
*/
|
2015-12-13 16:16:26 +00:00
|
|
|
bool collectInstances(vector<VegetationInstance> *result, const VegetationModelDefinition &model, double xmin,
|
2015-11-09 21:38:00 +00:00
|
|
|
double zmin, double xmax, double zmax, bool outcomers = true) const;
|
2015-10-18 22:30:20 +00:00
|
|
|
|
2015-11-02 22:00:02 +00:00
|
|
|
double getMaxHeight() const;
|
|
|
|
|
2015-11-09 21:38:00 +00:00
|
|
|
private:
|
2015-10-18 22:30:20 +00:00
|
|
|
NoiseNode *noise;
|
|
|
|
FloatNode *interval;
|
2015-10-18 20:15:19 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // VEGETATIONPRESENCEDEFINITION_H
|