Regrouped basics/system/definition/software into core

This commit is contained in:
Michaël Lemaire 2020-03-24 23:03:54 +01:00
parent 655e0d784a
commit be8a5f9764
277 changed files with 494 additions and 723 deletions

2
.gitignore vendored
View file

@ -8,7 +8,7 @@
/output/
/perf.*
/pic*.png
core
/core
*.pro.user
*.pro.user.*
qrc_*.cpp

View file

@ -1,15 +0,0 @@
#pragma once
#include "basics_global.h"
typedef struct {
double h;
double s;
double l;
double a;
} ColorHSL;
BASICSSHARED_EXPORT Color colorFromHSL(const ColorHSL &col);
BASICSSHARED_EXPORT ColorHSL colorToHSL(const Color &col);
BASICSSHARED_EXPORT ColorHSL colorHSLFromValues(double h, double s, double l, double a);

View file

@ -1,32 +0,0 @@
#-------------------------------------------------
#
# Project created by QtCreator 2013-10-29T17:15:02
#
#-------------------------------------------------
QT -= gui
TARGET = paysages_basics
TEMPLATE = lib
DEFINES += BASICS_LIBRARY
include(../common.pri)
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
unix:!symbian {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
}
INSTALLS += target
}
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../system/release/ -lpaysages_system
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../system/debug/ -lpaysages_system
else:unix: LIBS += -L$$OUT_PWD/../system/ -lpaysages_system
INCLUDEPATH += $$PWD/../system
DEPENDPATH += $$PWD/../system

View file

@ -1,34 +0,0 @@
#pragma once
#include "system_global.h"
#if defined(BASICS_LIBRARY)
#define BASICSSHARED_EXPORT DECL_EXPORT
#else
#define BASICSSHARED_EXPORT DECL_IMPORT
#endif
namespace paysages {
namespace basics {
class Vector3;
class Matrix4;
class BoundingBox;
class SpaceGridIterator;
class SpaceSegment;
class Color;
class NoiseGenerator;
class NoiseState;
class FractalNoise;
class NoiseFunctionSimplex;
class Curve;
class ColorProfile;
class Texture2D;
class Texture3D;
class Texture4D;
class CappedCylinder;
class InfiniteRay;
class Sphere;
class InfinitePlane;
}
}
using namespace paysages::basics;

View file

@ -1,3 +1,3 @@
CONFIG(release, debug|release): DEFINES += NDEBUG QT_NO_DEBUG_OUTPUT
CONFIG += c++14
CONFIG += c++17

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "DefinitionNode.h"
@ -10,7 +10,7 @@
namespace paysages {
namespace definition {
class DEFINITIONSHARED_EXPORT AtmosphereDefinition : public DefinitionNode {
class CORESHARED_EXPORT AtmosphereDefinition : public DefinitionNode {
public:
typedef struct {
Vector3 location;

View file

@ -1,13 +1,13 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "LightSource.h"
namespace paysages {
namespace software {
class SOFTWARESHARED_EXPORT AtmosphereModelBruneton : public LightSource {
class CORESHARED_EXPORT AtmosphereModelBruneton : public LightSource {
public:
AtmosphereModelBruneton(SoftwareRenderer *parent);
virtual ~AtmosphereModelBruneton();

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "LightSource.h"

View file

@ -1,13 +1,13 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "Color.h"
namespace paysages {
namespace software {
class SOFTWARESHARED_EXPORT AtmosphereResult {
class CORESHARED_EXPORT AtmosphereResult {
public:
AtmosphereResult();
void updateFinal();

View file

@ -1,7 +1,7 @@
#include "BaseCloudLayerRenderer.h"
#include "Vector3.h"
#include "clouds/BaseCloudsModel.h"
#include "BaseCloudsModel.h"
BaseCloudLayerRenderer::BaseCloudLayerRenderer(SoftwareRenderer *parent) : parent(parent) {
setQuality(0.5);

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
namespace paysages {
namespace software {

View file

@ -1,6 +1,6 @@
#pragma once
#include "../software_global.h"
#include "core_global.h"
#include "Color.h"
@ -10,7 +10,7 @@ namespace software {
/**
* Abstract class for all cloud models (cirrus, cumulus...).
*/
class SOFTWARESHARED_EXPORT BaseCloudsModel {
class CORESHARED_EXPORT BaseCloudsModel {
public:
BaseCloudsModel(CloudLayerDefinition *layer);
virtual ~BaseCloudsModel();

View file

@ -1,11 +1,11 @@
#pragma once
#include "basics_global.h"
#include "core_global.h"
namespace paysages {
namespace basics {
class BASICSSHARED_EXPORT BoundingBox {
class CORESHARED_EXPORT BoundingBox {
public:
BoundingBox();

View file

@ -1,13 +1,13 @@
#pragma once
#include "system_global.h"
#include "core_global.h"
#include <string>
namespace paysages {
namespace system {
class SYSTEMSHARED_EXPORT CacheFile {
class CORESHARED_EXPORT CacheFile {
public:
CacheFile(const string &module, const string &ext, const string &tag1, int tag2, int tag3, int tag4, int tag5,
int tag6);

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "DefinitionNode.h"
@ -17,7 +17,7 @@ typedef struct {
double zfar;
} CameraPerspective;
class DEFINITIONSHARED_EXPORT CameraDefinition : public DefinitionNode {
class CORESHARED_EXPORT CameraDefinition : public DefinitionNode {
public:
CameraDefinition(DefinitionNode *parent = NULL);

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include <string>
#include <vector>
@ -14,7 +14,7 @@ namespace software {
* Software rendering is done in portions of Canvas (in CanvasPortion class).
* This splitting in portions allows to keep memory consumption low.
*/
class SOFTWARESHARED_EXPORT Canvas {
class CORESHARED_EXPORT Canvas {
public:
Canvas();
~Canvas();

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "Color.h"
#include "Vector3.h"
@ -11,7 +11,7 @@ namespace software {
/**
* Representation of world coordinates projected in a canvas pixel.
*/
class SOFTWARESHARED_EXPORT CanvasFragment {
class CORESHARED_EXPORT CanvasFragment {
public:
CanvasFragment() = default;
CanvasFragment(bool front_facing, const Vector3 &pixel, const Vector3 &location, int client = 0,

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
namespace paysages {
namespace software {
@ -8,7 +8,7 @@ namespace software {
/**
* Abstract class to receive live modifications from canvas preview.
*/
class SOFTWARESHARED_EXPORT CanvasLiveClient {
class CORESHARED_EXPORT CanvasLiveClient {
public:
CanvasLiveClient();

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "PictureWriter.h"
@ -10,7 +10,7 @@ namespace software {
/**
* Picture writer to create the final image from canvas portions.
*/
class SOFTWARESHARED_EXPORT CanvasPictureWriter : public PictureWriter {
class CORESHARED_EXPORT CanvasPictureWriter : public PictureWriter {
public:
CanvasPictureWriter(const Canvas *canvas);
virtual ~CanvasPictureWriter();

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "CanvasFragment.h"
@ -14,7 +14,7 @@ namespace software {
*
* A pixel stores superimposed fragments (CanvasFragment), sorted by their distance to camera.
*/
class SOFTWARESHARED_EXPORT CanvasPixel {
class CORESHARED_EXPORT CanvasPixel {
public:
CanvasPixel();

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "ParallelWorker.h"

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include <string>
@ -14,7 +14,7 @@ namespace software {
*
* Pixels are not allocated until preparePixels is called.
*/
class SOFTWARESHARED_EXPORT CanvasPortion {
class CORESHARED_EXPORT CanvasPortion {
public:
CanvasPortion(int index = 0, CanvasPreview *preview = NULL);
virtual ~CanvasPortion();

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
namespace paysages {
namespace software {
@ -8,7 +8,7 @@ namespace software {
/**
* Smaller preview of a Canvas rendering, that can be watched live.
*/
class SOFTWARESHARED_EXPORT CanvasPreview {
class CORESHARED_EXPORT CanvasPreview {
public:
CanvasPreview();
~CanvasPreview();

View file

@ -1,6 +1,6 @@
#pragma once
#include "basics_global.h"
#include "core_global.h"
#include "InfiniteCylinder.h"
#include "Sphere.h"
@ -11,7 +11,7 @@ namespace basics {
/**
* Geometric cylinder, with capped ends (not infinite).
*/
class BASICSSHARED_EXPORT CappedCylinder : public InfiniteCylinder {
class CORESHARED_EXPORT CappedCylinder : public InfiniteCylinder {
public:
CappedCylinder() = default;
CappedCylinder(const Vector3 &base, const Vector3 &direction, double radius, double length);

View file

@ -1,13 +1,13 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "DefinitionNode.h"
namespace paysages {
namespace definition {
class DEFINITIONSHARED_EXPORT CelestialBodyDefinition : public DefinitionNode {
class CORESHARED_EXPORT CelestialBodyDefinition : public DefinitionNode {
public:
CelestialBodyDefinition(DefinitionNode *parent, const string &name);

View file

@ -11,7 +11,7 @@
#include "NoiseGenerator.h"
#include "SoftwareRenderer.h"
#include "SurfaceMaterial.h"
#include "clouds/BaseCloudsModel.h"
#include "BaseCloudsModel.h"
#include <algorithm>
#include <cassert>
#include <cmath>

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "BaseCloudLayerRenderer.h"
@ -15,7 +15,7 @@ namespace software {
* This renderer simply iters through the cloud layer, collecting cloud segments.
* It does not account for local density variations.
*/
class SOFTWARESHARED_EXPORT CloudBasicLayerRenderer : public BaseCloudLayerRenderer {
class CORESHARED_EXPORT CloudBasicLayerRenderer : public BaseCloudLayerRenderer {
public:
CloudBasicLayerRenderer(SoftwareRenderer *parent);

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "DefinitionNode.h"
@ -9,7 +9,7 @@
namespace paysages {
namespace definition {
class DEFINITIONSHARED_EXPORT CloudLayerDefinition : public DefinitionNode {
class CORESHARED_EXPORT CloudLayerDefinition : public DefinitionNode {
public:
CloudLayerDefinition(DefinitionNode *parent, const string &name);
virtual ~CloudLayerDefinition();

View file

@ -1,6 +1,6 @@
#pragma once
#include "../software_global.h"
#include "core_global.h"
#include "BaseCloudsModel.h"

View file

@ -1,6 +1,6 @@
#pragma once
#include "../software_global.h"
#include "core_global.h"
#include "BaseCloudsModel.h"

View file

@ -1,6 +1,6 @@
#pragma once
#include "../software_global.h"
#include "core_global.h"
#include "BaseCloudsModel.h"

View file

@ -1,6 +1,6 @@
#pragma once
#include "../software_global.h"
#include "core_global.h"
#include "BaseCloudsModel.h"

View file

@ -1,13 +1,13 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "Layers.h"
namespace paysages {
namespace definition {
class DEFINITIONSHARED_EXPORT CloudsDefinition : public Layers {
class CORESHARED_EXPORT CloudsDefinition : public Layers {
public:
CloudsDefinition(DefinitionNode *parent);

View file

@ -9,11 +9,11 @@
#include "Scenery.h"
#include "SoftwareRenderer.h"
#include "clouds/BaseCloudsModel.h"
#include "clouds/CloudModelAltoCumulus.h"
#include "clouds/CloudModelCirrus.h"
#include "clouds/CloudModelCumuloNimbus.h"
#include "clouds/CloudModelStratoCumulus.h"
#include "BaseCloudsModel.h"
#include "CloudModelAltoCumulus.h"
#include "CloudModelCirrus.h"
#include "CloudModelCumuloNimbus.h"
#include "CloudModelStratoCumulus.h"
CloudsRenderer::CloudsRenderer(SoftwareRenderer *parent) : parent(parent) {
quality = 0.5;

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "LightFilter.h"
@ -12,7 +12,7 @@ namespace software {
/**
* Software renderer of a group of cloud layers.
*/
class SOFTWARESHARED_EXPORT CloudsRenderer : public LightFilter {
class CORESHARED_EXPORT CloudsRenderer : public LightFilter {
public:
CloudsRenderer(SoftwareRenderer *parent);
virtual ~CloudsRenderer();

View file

@ -1,11 +1,11 @@
#pragma once
#include "basics_global.h"
#include "core_global.h"
namespace paysages {
namespace basics {
class BASICSSHARED_EXPORT Color {
class CORESHARED_EXPORT Color {
public:
Color() = default;
Color(const Color &col);
@ -55,12 +55,12 @@ class BASICSSHARED_EXPORT Color {
double a;
};
BASICSSHARED_EXPORT extern const Color COLOR_TRANSPARENT;
BASICSSHARED_EXPORT extern const Color COLOR_BLACK;
BASICSSHARED_EXPORT extern const Color COLOR_RED;
BASICSSHARED_EXPORT extern const Color COLOR_GREEN;
BASICSSHARED_EXPORT extern const Color COLOR_BLUE;
BASICSSHARED_EXPORT extern const Color COLOR_WHITE;
BASICSSHARED_EXPORT extern const Color COLOR_GREY;
CORESHARED_EXPORT extern const Color COLOR_TRANSPARENT;
CORESHARED_EXPORT extern const Color COLOR_BLACK;
CORESHARED_EXPORT extern const Color COLOR_RED;
CORESHARED_EXPORT extern const Color COLOR_GREEN;
CORESHARED_EXPORT extern const Color COLOR_BLUE;
CORESHARED_EXPORT extern const Color COLOR_WHITE;
CORESHARED_EXPORT extern const Color COLOR_GREY;
}
}

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "Color.h"
#include "DefinitionDiff.h"
@ -11,7 +11,7 @@ namespace definition {
/**
* Diff for a ColorNode.
*/
class DEFINITIONSHARED_EXPORT ColorDiff : public DefinitionDiff {
class CORESHARED_EXPORT ColorDiff : public DefinitionDiff {
public:
ColorDiff(const DefinitionNode *node, const Color &oldvalue, const Color &newvalue);
ColorDiff(const ColorDiff *other, const Color &oldvalue, const Color &newvalue);

15
src/core/ColorHSL.h Normal file
View file

@ -0,0 +1,15 @@
#pragma once
#include "core_global.h"
typedef struct {
double h;
double s;
double l;
double a;
} ColorHSL;
CORESHARED_EXPORT Color colorFromHSL(const ColorHSL &col);
CORESHARED_EXPORT ColorHSL colorToHSL(const Color &col);
CORESHARED_EXPORT ColorHSL colorHSLFromValues(double h, double s, double l, double a);

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "Color.h"
#include "DefinitionNode.h"
@ -11,7 +11,7 @@ namespace definition {
/**
* Node with a single color value, for the definition tree.
*/
class DEFINITIONSHARED_EXPORT ColorNode : public DefinitionNode {
class CORESHARED_EXPORT ColorNode : public DefinitionNode {
public:
ColorNode(DefinitionNode *parent, const string &name, const Color &value = COLOR_TRANSPARENT);

View file

@ -1,14 +1,14 @@
#ifndef COLORPROFILE_H
#define COLORPROFILE_H
#include "basics_global.h"
#include "core_global.h"
#include "Color.h"
namespace paysages {
namespace basics {
class BASICSSHARED_EXPORT ColorProfile {
class CORESHARED_EXPORT ColorProfile {
public:
typedef enum { TONE_MAPPING_UNCHARTED, TONE_MAPPING_REIHNARD, TONE_MAPPING_CLAMP } ToneMappingOperator;

View file

@ -1,6 +1,6 @@
#pragma once
#include "basics_global.h"
#include "core_global.h"
namespace paysages {
namespace basics {
@ -10,7 +10,7 @@ typedef struct {
double value;
} CurvePoint;
class BASICSSHARED_EXPORT Curve {
class CORESHARED_EXPORT Curve {
public:
Curve();
~Curve();

View file

@ -1,6 +1,6 @@
#pragma once
#include "system_global.h"
#include "core_global.h"
#include <string>
@ -12,7 +12,7 @@ namespace system {
/**
* Locator of data files.
*/
class SYSTEMSHARED_EXPORT DataFile {
class CORESHARED_EXPORT DataFile {
public:
/**
* Find a data file.

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include <string>
@ -12,7 +12,7 @@ namespace definition {
*
* Diffs are used to undo/redo changes.
*/
class DEFINITIONSHARED_EXPORT DefinitionDiff {
class CORESHARED_EXPORT DefinitionDiff {
public:
DefinitionDiff(const DefinitionNode *node);
DefinitionDiff(const DefinitionDiff *other);

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include <string>
#include <vector>
@ -11,7 +11,7 @@ namespace definition {
/**
* Base class for all nodes of the definition tree.
*/
class DEFINITIONSHARED_EXPORT DefinitionNode {
class CORESHARED_EXPORT DefinitionNode {
public:
DefinitionNode(DefinitionNode *parent, const string &name, const string &type_name = "");
virtual ~DefinitionNode();

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include <set>
#include <string>
@ -13,7 +13,7 @@ namespace definition {
*
* Watchers will be registered in DiffManager to receive DefinitionDiff objects.
*/
class DEFINITIONSHARED_EXPORT DefinitionWatcher {
class CORESHARED_EXPORT DefinitionWatcher {
public:
DefinitionWatcher(const string &name);
virtual ~DefinitionWatcher();

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include <memory>
@ -12,7 +12,7 @@ namespace definition {
*
* Watchers can register themselves to received these diffs.
*/
class DEFINITIONSHARED_EXPORT DiffManager {
class CORESHARED_EXPORT DiffManager {
public:
DiffManager(DefinitionNode *tree);
~DiffManager();

View file

@ -1,6 +1,6 @@
#pragma once
#include "basics_global.h"
#include "core_global.h"
#include "InfinitePlane.h"
@ -10,7 +10,7 @@ namespace basics {
/**
* Geometric plane disk.
*/
class BASICSSHARED_EXPORT Disk : public InfinitePlane {
class CORESHARED_EXPORT Disk : public InfinitePlane {
public:
Disk() = default;
Disk(const Vector3 &point, const Vector3 &normal, double radius);

View file

@ -1,13 +1,13 @@
#pragma once
#include "system_global.h"
#include "core_global.h"
#include <string>
namespace paysages {
namespace system {
class SYSTEMSHARED_EXPORT FileSystem {
class CORESHARED_EXPORT FileSystem {
public:
/**
* Get an absolute path to a temporary file.

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "DefinitionDiff.h"
@ -10,7 +10,7 @@ namespace definition {
/**
* Diff for a FloatNode.
*/
class DEFINITIONSHARED_EXPORT FloatDiff : public DefinitionDiff {
class CORESHARED_EXPORT FloatDiff : public DefinitionDiff {
public:
FloatDiff(const DefinitionNode *node, double oldvalue, double newvalue);
FloatDiff(const FloatDiff *other, double oldvalue, double newvalue);

View file

@ -1,6 +1,6 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "DefinitionNode.h"
@ -10,7 +10,7 @@ namespace definition {
/**
* Node with a single floating point numeric value, for the definition tree.
*/
class DEFINITIONSHARED_EXPORT FloatNode : public DefinitionNode {
class CORESHARED_EXPORT FloatNode : public DefinitionNode {
public:
FloatNode(DefinitionNode *parent, const string &name, double value = 0.0);

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
namespace paysages {
namespace software {
@ -8,7 +8,7 @@ namespace software {
/**
* Interface to a fluid medium compatible class.
*/
class SOFTWARESHARED_EXPORT FluidMediumInterface {
class CORESHARED_EXPORT FluidMediumInterface {
public:
/**
* Return true if the object may change the fluid medium on the given segment.

View file

@ -1,6 +1,6 @@
#pragma once
#include "software_global.h"
#include "core_global.h"
#include "SpaceSegment.h"
@ -21,7 +21,7 @@ typedef struct {
* medium density and properties.
* It is mainly used to compute the alteration made by such media on light.
*/
class SOFTWARESHARED_EXPORT FluidMediumManager {
class CORESHARED_EXPORT FluidMediumManager {
public:
FluidMediumManager(SoftwareRenderer *renderer);
virtual ~FluidMediumManager();

View file

@ -1,6 +1,6 @@
#pragma once
#include "basics_global.h"
#include "core_global.h"
#include "NoiseState.h"
#include <string>
@ -11,7 +11,7 @@ namespace basics {
/**
* Fractal noise generator, based on a sum of simple noise functions.
*/
class BASICSSHARED_EXPORT FractalNoise {
class CORESHARED_EXPORT FractalNoise {
public:
FractalNoise();
virtual ~FractalNoise();

View file

@ -1,11 +1,11 @@
#pragma once
#include "basics_global.h"
#include "core_global.h"
namespace paysages {
namespace basics {
class BASICSSHARED_EXPORT Geometry {
class CORESHARED_EXPORT Geometry {
public:
static double get2DAngle(double x, double y);
static Vector3 getNormalFromTriangle(const Vector3 &center, const Vector3 &bottom, const Vector3 &right);

View file

@ -1,13 +1,13 @@
#pragma once
#include "definition_global.h"
#include "core_global.h"
#include "DefinitionNode.h"
namespace paysages {
namespace definition {
class DEFINITIONSHARED_EXPORT GodRaysDefinition : public DefinitionNode {
class CORESHARED_EXPORT GodRaysDefinition : public DefinitionNode {
public:
GodRaysDefinition(DefinitionNode *parent);

Some files were not shown because too many files have changed in this diff Show more