2015-10-18 15:26:19 +00:00
|
|
|
#ifndef VEGETATIONMODELDEFINITION_H
|
|
|
|
#define VEGETATIONMODELDEFINITION_H
|
|
|
|
|
|
|
|
#include "definition_global.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include "DefinitionNode.h"
|
|
|
|
#include "Sphere.h"
|
|
|
|
#include "CappedCylinder.h"
|
|
|
|
#include "Disk.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace definition {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Model of vegetation.
|
|
|
|
*/
|
|
|
|
class DEFINITIONSHARED_EXPORT VegetationModelDefinition: public DefinitionNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VegetationModelDefinition(DefinitionNode *parent);
|
|
|
|
virtual ~VegetationModelDefinition();
|
|
|
|
|
2015-11-09 00:07:33 +00:00
|
|
|
inline const SurfaceMaterial &getSolidMaterial() const {return *solid_material;}
|
|
|
|
inline const SurfaceMaterial &getFoliageMaterial() const {return *foliage_material;}
|
|
|
|
|
2015-10-18 15:26:19 +00:00
|
|
|
inline const std::vector<CappedCylinder> &getSolidVolumes() const {return solid_volumes;}
|
|
|
|
inline const std::vector<Sphere> &getFoliageGroups() const {return foliage_groups;}
|
|
|
|
inline const std::vector<Disk> &getFoliageItems() const {return foliage_items;}
|
|
|
|
|
|
|
|
virtual void save(PackStream *stream) const override;
|
|
|
|
virtual void load(PackStream *stream) override;
|
|
|
|
virtual void copy(DefinitionNode *destination) const override;
|
|
|
|
virtual void validate() override;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Randomize the model geometry.
|
|
|
|
*/
|
|
|
|
void randomize();
|
|
|
|
|
|
|
|
private:
|
|
|
|
SurfaceMaterial *solid_material;
|
|
|
|
SurfaceMaterial *foliage_material;
|
|
|
|
std::vector<CappedCylinder> solid_volumes;
|
|
|
|
std::vector<Sphere> foliage_groups;
|
|
|
|
std::vector<Disk> foliage_items;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // VEGETATIONMODELDEFINITION_H
|