2015-10-18 22:26:25 +00:00
|
|
|
#ifndef NOISENODE_H
|
|
|
|
#define NOISENODE_H
|
|
|
|
|
|
|
|
#include "definition_global.h"
|
|
|
|
|
|
|
|
#include "DefinitionNode.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace definition {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Definition node with noise parameters.
|
|
|
|
*/
|
2015-11-09 21:30:46 +00:00
|
|
|
class DEFINITIONSHARED_EXPORT NoiseNode : public DefinitionNode {
|
|
|
|
public:
|
2015-10-18 22:26:25 +00:00
|
|
|
NoiseNode(DefinitionNode *parent);
|
|
|
|
virtual ~NoiseNode();
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
inline const NoiseGenerator *getGenerator() {
|
|
|
|
return noise;
|
|
|
|
}
|
2015-10-18 22:26:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the number of levels to use in the noise generator.
|
|
|
|
*/
|
2015-11-09 21:30:46 +00:00
|
|
|
void setLevels(int levels, double min_value = -1.0, double max_value = 1.0);
|
2015-10-18 22:26:25 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
protected:
|
2015-10-18 22:26:25 +00:00
|
|
|
virtual void save(PackStream *stream) const override;
|
|
|
|
virtual void load(PackStream *stream) override;
|
|
|
|
virtual void copy(DefinitionNode *destination) const override;
|
|
|
|
virtual void validate() override;
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private:
|
2015-10-18 22:26:25 +00:00
|
|
|
NoiseGenerator *noise;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // NOISENODE_H
|