Merged master into NewAtmosphere.

This commit is contained in:
Jonathas Costa
2017-07-21 15:02:24 -04:00
710 changed files with 4734 additions and 5366 deletions
+2 -4
View File
@@ -44,8 +44,7 @@ namespace {
const int8_t CurrentCacheVersion = 3;
} // namespace
namespace openspace {
namespace modelgeometry {
namespace openspace::modelgeometry {
documentation:: Documentation ModelGeometry::Documentation() {
using namespace documentation;
@@ -295,5 +294,4 @@ bool ModelGeometry::loadCachedFile(const std::string& filename) {
void ModelGeometry::setUniforms(ghoul::opengl::ProgramObject&) {}
} // namespace modelgeometry
} // namespace openspace
} // namespace openspace::modelgeometry
+6 -12
View File
@@ -31,18 +31,13 @@
#include <memory>
namespace ghoul {
class Dictionary;
namespace ghoul { class Dictionary; }
namespace ghoul::opengl { class ProgramObject; }
namespace opengl { class ProgramObject; }
} // namespace ghoul
namespace openspace { class Renderable; }
namespace openspace::documentation { struct Documentation; }
namespace openspace {
class Renderable;
namespace documentation { struct Documentation; }
namespace modelgeometry {
namespace openspace::modelgeometry {
class ModelGeometry : public properties::PropertyOwner {
public:
@@ -89,7 +84,6 @@ protected:
std::string _file;
};
} // namespace modelgeometry
} // namespace openspace
} // namespace openspace::modelgeometry
#endif // __OPENSPACE_MODULE_BASE___MODELGEOMETRY___H__
@@ -28,8 +28,7 @@
#include <cstring>
namespace openspace {
namespace modelgeometry {
namespace openspace::modelgeometry {
MultiModelGeometry::MultiModelGeometry(const ghoul::Dictionary& dictionary)
: ModelGeometry(dictionary)
@@ -59,5 +58,4 @@ bool MultiModelGeometry::loadModel(const std::string& filename) {
return true;
}
} // namespace modelgeometry
} // namespace openspace
} // namespace openspace::modelgeometry
+5 -6
View File
@@ -28,11 +28,11 @@
#include <modules/base/rendering/modelgeometry.h>
namespace openspace {
class RenderableModel;
class RenderableModelProjection;
} // namespace openspace
class RenderableModel;
class RenderableModelProjection;
namespace modelgeometry {
namespace openspace::modelgeometry {
class MultiModelGeometry : public ModelGeometry {
public:
@@ -42,7 +42,6 @@ private:
bool loadModel(const std::string& filename);
};
} // namespace modelgeometry
} // namespace openspace
} // namespace openspace::modelgeometry
#endif // __OPENSPACE_MODULE_BASE___MULTIMODELGEOMETRY___H__
+1 -2
View File
@@ -51,7 +51,6 @@ namespace {
const char* keyBody = "Body";
const char* keyStart = "StartTime";
const char* keyEnd = "EndTime";
} // namespace
namespace openspace {
@@ -177,7 +176,7 @@ bool RenderableModel::deinitialize() {
return true;
}
void RenderableModel::render(const RenderData& data) {
void RenderableModel::render(const RenderData& data, RendererTasks&) {
_programObject->activate();
// Fading
+4 -9
View File
@@ -34,12 +34,10 @@
#include <memory>
namespace ghoul {
namespace opengl {
namespace ghoul::opengl {
class ProgramObject;
class Texture;
} // namespace opengl
} // namespace ghoul
} // namespace ghoul::opengl
namespace openspace {
@@ -47,10 +45,7 @@ struct RenderData;
struct UpdateData;
namespace documentation { struct Documentation; }
namespace modelgeometry {
class ModelGeometry;
}
namespace modelgeometry { class ModelGeometry; }
class RenderableModel : public Renderable {
public:
@@ -61,7 +56,7 @@ public:
bool isReady() const override;
void render(const RenderData& data) override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
+2 -2
View File
@@ -104,7 +104,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
"RenderablePlane"
);
_size = dictionary.value<double>(KeySize);
_size = static_cast<float>(dictionary.value<double>(KeySize));
if (dictionary.hasKey(KeyBillboard)) {
_billboard = dictionary.value<bool>(KeyBillboard);
@@ -173,7 +173,7 @@ bool RenderablePlane::deinitialize() {
return true;
}
void RenderablePlane::render(const RenderData& data) {
void RenderablePlane::render(const RenderData& data, RendererTasks&) {
_shader->activate();
//if (_projectionListener){
// //get parent node-texture and set with correct dimensions
+4 -6
View File
@@ -33,14 +33,12 @@
#include <ghoul/opengl/ghoul_gl.h>
namespace ghoul {
namespace filesystem { class File; }
namespace ghoul::filesystem { class File; }
namespace opengl {
namespace ghoul::opengl {
class ProgramObject;
class Texture;
}
} // namespace ghoul
} // namespace ghoul::opengl
namespace openspace {
@@ -60,7 +58,7 @@ public:
bool isReady() const override;
void render(const RenderData& data) override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
+2 -2
View File
@@ -108,7 +108,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
"RenderableSphere"
);
_size = dictionary.value<double>(KeySize);
_size = static_cast<float>(dictionary.value<double>(KeySize));
_segments = static_cast<int>(dictionary.value<double>(KeySegments));
_texturePath = absPath(dictionary.value<std::string>(KeyTexture));
@@ -181,7 +181,7 @@ bool RenderableSphere::deinitialize() {
return true;
}
void RenderableSphere::render(const RenderData& data) {
void RenderableSphere::render(const RenderData& data, RendererTasks&) {
glm::mat4 transform = glm::mat4(1.0);
transform = glm::rotate(transform, static_cast<float>(M_PI_2), glm::vec3(1, 0, 0));
+3 -5
View File
@@ -32,12 +32,10 @@
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
namespace ghoul {
namespace opengl {
namespace ghoul::opengl {
class ProgramObject;
class Texture;
}
} // namespace ghoul
} // namespace ghoul::opengl
namespace openspace {
@@ -56,7 +54,7 @@ public:
bool isReady() const override;
void render(const RenderData& data) override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
@@ -34,7 +34,7 @@
#include <math.h>
namespace {
static const std::string _loggerCat = "RenderableSphericalGrid";
static const char* _loggerCat = "RenderableSphericalGrid";
const char* KeyGridType = "GridType";
const char* KeyGridColor = "GridColor";
const char* KeyGridMatrix = "GridMatrix";
@@ -42,7 +42,8 @@ namespace {
const char* KeyGridRadius = "GridRadius";
const char* KeyGridParentsRotation = "ParentsRotation";
const glm::vec2 GridRadius = { 1.f, 20.f };
}
} // namespace
namespace openspace {
RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictionary)
@@ -196,7 +197,7 @@ bool RenderableSphericalGrid::initialize(){
return completeSuccess;
}
void RenderableSphericalGrid::render(const RenderData& data){
void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){
_gridProgram->activate();
glm::mat4 transform;
@@ -233,4 +234,5 @@ void RenderableSphericalGrid::update(const UpdateData& data) {
_parentMatrix = SpiceManager::ref().positionTransformMatrix("IAU_JUPITER", "GALACTIC", data.time.j2000Seconds());
}
}
} // namespace openspace
@@ -33,7 +33,7 @@
namespace openspace {
class RenderableSphericalGrid : public Renderable{
class RenderableSphericalGrid : public Renderable {
public:
RenderableSphericalGrid(const ghoul::Dictionary& dictionary);
~RenderableSphericalGrid();
@@ -43,7 +43,7 @@ public:
bool isReady() const override;
void render(const RenderData& data) override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
void update(const UpdateData& data) override;
protected:
+2 -2
View File
@@ -56,7 +56,7 @@ namespace {
{ "Lines+Points", RenderingModeLinesPoints },
{ "Points+Lines", RenderingModeLinesPoints }
};
}
} // namespace
namespace openspace {
@@ -217,7 +217,7 @@ bool RenderableTrail::isReady() const {
return _programObject != nullptr;
}
void RenderableTrail::render(const RenderData & data) {
void RenderableTrail::render(const RenderData& data, RendererTasks&) {
_programObject->activate();
glm::dmat4 modelTransform =
+3 -5
View File
@@ -36,12 +36,10 @@
#include <ghoul/opengl/ghoul_gl.h>
namespace ghoul {
namespace opengl {
namespace ghoul::opengl {
class ProgramObject;
class Texture;
} // namespace opengl
} // namespace ghoul
} // namespace ghoul::opengl
namespace openspace {
@@ -86,7 +84,7 @@ public:
* \c _floatingRenderInformation using the provided \p data
* \param data The data that is necessary to render this Renderable
*/
void render(const RenderData& data) override;
void render(const RenderData& data, RendererTasks& rendererTask) override;
protected:
explicit RenderableTrail(const ghoul::Dictionary& dictionary);
@@ -83,7 +83,7 @@
namespace {
const char* KeyPeriod = "Period";
const char* KeyResolution = "Resolution";
}
} // namespace
namespace openspace {
@@ -49,7 +49,7 @@ namespace {
const char* KeySampleInterval = "SampleInterval";
const char* KeyTimeStampSubsample = "TimeStampSubsampleFactor";
const char* KeyShowFullTrail = "ShowFullTrail";
}
} // namespace
namespace openspace {
@@ -255,7 +255,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
// If only trail so far should be rendered, we need to find the corresponding time
// in the array and only render it until then
_primaryRenderInformation.first = 0;
double t = (data.time.j2000Seconds() - _start) / (_end - _start);
double t = std::max(0.0, (data.time.j2000Seconds() - _start) / (_end - _start));
_primaryRenderInformation.count = std::min(
static_cast<GLsizei>(ceil(_vertexArray.size() * t)),
static_cast<GLsizei>(_vertexArray.size() - 1)
@@ -181,4 +181,5 @@ int ScreenSpaceFramebuffer::id(){
static int id = 0;
return id++;
}
} //namespace openspace
} //namespace openspace