Coding style

This commit is contained in:
Michaël Lemaire 2016-01-18 22:22:56 +01:00
parent 7ded0a6b6f
commit e869f5b9ca
12 changed files with 25 additions and 15 deletions

View file

@ -53,7 +53,7 @@ class DEFINITIONSHARED_EXPORT DiffManager {
*/ */
void redo(); void redo();
protected: protected:
/** /**
* Publish a diff to the registered watchers. * Publish a diff to the registered watchers.
* *

View file

@ -36,7 +36,8 @@ class DEFINITIONSHARED_EXPORT WaterDefinition : public DefinitionNode, public De
return depth_color; return depth_color;
} }
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override; virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
typedef enum { WATER_PRESET_LAKE, WATER_PRESET_SEA } WaterPreset; typedef enum { WATER_PRESET_LAKE, WATER_PRESET_SEA } WaterPreset;
void applyPreset(WaterPreset preset, RandomGenerator &random = RandomGeneratorDefault); void applyPreset(WaterPreset preset, RandomGenerator &random = RandomGeneratorDefault);

View file

@ -12,7 +12,8 @@ class AtmosphereModeler : protected BaseModelerTool {
public: public:
AtmosphereModeler(MainModelerWindow *ui); AtmosphereModeler(MainModelerWindow *ui);
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override; virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
}; };
} }
} }

View file

@ -20,7 +20,8 @@ class FloatPropertyBind : public QObject, public DefinitionWatcher {
FloatPropertyBind(MainModelerWindow *window, const string &object_name, const string &property_name, FloatPropertyBind(MainModelerWindow *window, const string &object_name, const string &property_name,
FloatNode *node); FloatNode *node);
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override; virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
private slots: private slots:
void propertyChanged(); void propertyChanged();

View file

@ -19,7 +19,8 @@ class IntPropertyBind : public QObject, public DefinitionWatcher {
public: public:
IntPropertyBind(MainModelerWindow *window, const string &object_name, const string &property_name, IntNode *node); IntPropertyBind(MainModelerWindow *window, const string &object_name, const string &property_name, IntNode *node);
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override; virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
private slots: private slots:
void propertyChanged(); void propertyChanged();

View file

@ -50,7 +50,8 @@ class ModelerCameras : public QObject, public DefinitionWatcher {
protected: protected:
virtual void timerEvent(QTimerEvent *event) override; virtual void timerEvent(QTimerEvent *event) override;
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override; virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
/** /**
* Validate current camera, pushing it to rendered scenery if needed. * Validate current camera, pushing it to rendered scenery if needed.

View file

@ -18,7 +18,8 @@ class OPENGLSHARED_EXPORT OpenGLSkybox : public OpenGLPart, public DefinitionWat
virtual void update() override; virtual void update() override;
virtual void render() override; virtual void render() override;
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override; virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
virtual void floatNodeChanged(const string &path, double new_value, double old_value) override; virtual void floatNodeChanged(const string &path, double new_value, double old_value) override;
private: private:

View file

@ -32,7 +32,8 @@ class OPENGLSHARED_EXPORT OpenGLVegetation : public OpenGLPart, public Definitio
virtual void update() override; virtual void update() override;
virtual void render() override; virtual void render() override;
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override; virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
/** /**
* Get the currently rendered scenery. * Get the currently rendered scenery.

View file

@ -18,7 +18,8 @@ class OPENGLSHARED_EXPORT OpenGLWater : public OpenGLPart, public DefinitionWatc
virtual void update() override; virtual void update() override;
virtual void render() override; virtual void render() override;
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override; virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override;
/** /**
* Enable or disable the water surface rendering. * Enable or disable the water surface rendering.

View file

@ -860,7 +860,7 @@ static Color _getInscatterColor(Vector3 *_x, double *_t, Vector3 v, Vector3 s, d
/* direct sun light for ray x+tv, when sun in direction s (=L0) */ /* direct sun light for ray x+tv, when sun in direction s (=L0) */
static Color _sunColor(Vector3 v, Vector3 s, double r, double mu, double radius) { static Color _sunColor(Vector3 v, Vector3 s, double r, double mu, double radius) {
Color transmittance = r <= Rt ? _transmittanceWithShadow(r, mu) : COLOR_WHITE; /* T(x,xo) */ Color transmittance = r <= Rt ? _transmittanceWithShadow(r, mu) : COLOR_WHITE; /* T(x,xo) */
double isun = step(cos(radius), v.dotProduct(s)) * ISun; /* Lsun */ double isun = step(cos(radius), v.dotProduct(s)) * ISun; /* Lsun */
transmittance.r *= isun; transmittance.r *= isun;
transmittance.g *= isun; transmittance.g *= isun;
transmittance.b *= isun; transmittance.b *= isun;
@ -1157,7 +1157,8 @@ bool AtmosphereModelBruneton::getLightsAt(vector<LightComponent> &result, const
result.push_back(sun); result.push_back(sun);
irradiance.color = _irradiance(_irradianceTexture, r0, muS).scaled(1.0 - min(location.y / Scenery::ATMOSPHERE_WIDTH_SCALED, 1.0)); irradiance.color =
_irradiance(_irradianceTexture, r0, muS).scaled(1.0 - min(location.y / Scenery::ATMOSPHERE_WIDTH_SCALED, 1.0));
irradiance.direction = VECTOR_DOWN; irradiance.direction = VECTOR_DOWN;
irradiance.reflection = 0.0; irradiance.reflection = 0.0;
irradiance.altered = 0; irradiance.altered = 0;

View file

@ -75,7 +75,8 @@ Color MoonRenderer::getColor(const Vector3 &eye, const Vector3 &direction, Light
auto normal = p1.getNormal3(p2, p3); auto normal = p1.getNormal3(p2, p3);
double gradient = 2.3 + 8.0 * impl->noise.get3d(0.01, 0.3 * p1.x + 12.0, 0.3 * p1.y - 4.8, -0.3 * p1.z + 7.4); double gradient =
2.3 + 8.0 * impl->noise.get3d(0.01, 0.3 * p1.x + 12.0, 0.3 * p1.y - 4.8, -0.3 * p1.z + 7.4);
SurfaceMaterial material(Color(gradient, gradient, gradient)); SurfaceMaterial material(Color(gradient, gradient, gradient));
auto moon_color = lighting->apply(eye, nearest, normal, material); auto moon_color = lighting->apply(eye, nearest, normal, material);

View file

@ -14,10 +14,11 @@ class RecordingDefinitionWatcher : public DefinitionWatcher {
RecordingDefinitionWatcher() { RecordingDefinitionWatcher() {
} }
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff, const DefinitionNode *parent) override { virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff,
const DefinitionNode *parent) override {
RecordedChange change; RecordedChange change;
change.node = node; change.node = node;
change.diff = diff; // FIXME Referenced diff may get deleted by the diff manager change.diff = diff; // FIXME Referenced diff may get deleted by the diff manager
change.parent = parent; change.parent = parent;
changes.push_back(change); changes.push_back(change);
} }
@ -31,5 +32,4 @@ class RecordingDefinitionWatcher : public DefinitionWatcher {
}; };
} }
#endif // TESTTOOLDEFINITION_H #endif // TESTTOOLDEFINITION_H