Sorting more classes into the correct modules

This commit is contained in:
Alexander Bock
2015-05-20 21:40:52 +02:00
parent 59e474d5cd
commit e51df4b2a0
42 changed files with 289 additions and 126 deletions
+2 -2
View File
@@ -53,12 +53,12 @@ public:
ghoul::TemplateFactory<T>* factory() const;
private:
FactoryManager();
FactoryManager() = default;
~FactoryManager();
FactoryManager(const FactoryManager& c) = delete;
static FactoryManager* _manager; ///<Singleton member
static FactoryManager* _manager; ///< Singleton member
std::vector<ghoul::TemplateFactoryBase*> _factories;
};
+6 -2
View File
@@ -2,7 +2,6 @@ set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/modelgeometry.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometry.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableconstellationbounds.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablecrawlingline.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefieldlines.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodel.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablepath.h
@@ -14,6 +13,9 @@ set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderabletrail.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometry.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/wavefrontgeometry.h
${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/dynamicephemeris.h
${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/spiceephemeris.h
${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/staticephemeris.h
)
source_group("Header Files" FILES ${HEADER_FILES})
@@ -21,7 +23,6 @@ set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/modelgeometry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableconstellationbounds.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablecrawlingline.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefieldlines.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablepath.cpp
@@ -33,6 +34,9 @@ set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderabletrail.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/wavefrontgeometry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/dynamicephemeris.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/spiceephemeris.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ephemeris/staticephemeris.cpp
)
source_group("Source Files" FILES ${SOURCE_FILES})
+13 -5
View File
@@ -37,7 +37,6 @@
#include <modules/base/rendering/renderablesphere.h>
#include <modules/base/rendering/renderablesphericalgrid.h>
#include <modules/base/rendering/renderablefieldlines.h>
#include <modules/base/rendering/renderablecrawlingline.h>
#include <modules/base/rendering/renderableplanet.h>
#include <modules/base/rendering/simplespheregeometry.h>
#include <modules/base/rendering/renderableplane.h>
@@ -45,6 +44,10 @@
#include <modules/base/rendering/modelgeometry.h>
#include <modules/base/rendering/wavefrontgeometry.h>
#include <modules/base/ephemeris/staticephemeris.h>
#include <modules/base/ephemeris/dynamicephemeris.h>
#include <modules/base/ephemeris/spiceephemeris.h>
namespace openspace {
bool BaseModule::initialize() {
@@ -52,7 +55,7 @@ bool BaseModule::initialize() {
FactoryManager::ref().addFactory(new ghoul::TemplateFactory<modelgeometry::ModelGeometry>);
auto fRenderable = FactoryManager::ref().factory<Renderable>();
ghoul_assert(fRenderable, "No renderable factory existed");
ghoul_assert(fRenderable, "Renderable factory was not created");
fRenderable->registerClass<RenderablePlanet>("RenderablePlanet");
fRenderable->registerClass<RenderableStars>("RenderableStars");
@@ -64,14 +67,19 @@ bool BaseModule::initialize() {
fRenderable->registerClass<RenderableModel>("RenderableModel");
fRenderable->registerClass<RenderablePlane>("RenderablePlane");
fRenderable->registerClass<RenderableFieldlines>("RenderableFieldlines");
fRenderable->registerClass<RenderableCrawlingLine>("RenderableCrawlingLine");
auto fEphemeris = FactoryManager::ref().factory<Ephemeris>();
ghoul_assert(fEphemeris, "Ephemeris factory was not created");
fEphemeris->registerClass<StaticEphemeris>("Static");
fEphemeris->registerClass<StaticEphemeris>("Dynamic");
fEphemeris->registerClass<SpiceEphemeris>("Spice");
auto fPlanetGeometry = FactoryManager::ref().factory<planetgeometry::PlanetGeometry>();
ghoul_assert(fPlanetGeometry, "No planet geometry factory existed");
ghoul_assert(fPlanetGeometry, "Planet geometry factory was not created");
fPlanetGeometry->registerClass<planetgeometry::SimpleSphereGeometry>("SimpleSphere");
auto fModelGeometry = FactoryManager::ref().factory<modelgeometry::ModelGeometry>();
ghoul_assert(fModelGeometry, "No model geometry factory existed");
ghoul_assert(fModelGeometry, "Model geometry factory was not created");
fModelGeometry->registerClass<modelgeometry::WavefrontGeometry>("WavefrontGeometry");
return true;
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/scene/dynamicephemeris.h>
#include <modules/base/ephemeris/dynamicephemeris.h>
namespace {
const std::string KeyPosition = "Position";
@@ -25,7 +25,7 @@
#ifndef __DYNAMICEPHEMERIS_H__
#define __DYNAMICEPHEMERIS_H__
#include "ephemeris.h"
#include <openspace/scene/ephemeris.h>
namespace openspace {
@@ -22,11 +22,10 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/scene/spiceephemeris.h>
#include <modules/base/ephemeris/spiceephemeris.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/time.h>
#include <openspace/util/imagesequencer2.h>
namespace {
const std::string _loggerCat = "SpiceEphemeris";
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/scene/staticephemeris.h>
#include <modules/base/ephemeris/staticephemeris.h>
namespace {
const std::string KeyPosition = "Position";
@@ -25,7 +25,7 @@
#ifndef __STATICEPHEMERIS_H__
#define __STATICEPHEMERIS_H__
#include "ephemeris.h"
#include <openspace/scene/ephemeris.h>
namespace openspace {
@@ -22,12 +22,12 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <modules/base/rendering/renderablecrawlingline.h>
#include <modules/newhorizons/rendering/renderablecrawlingline.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/imagesequencer2.h>
#include <modules/newhorizons/util/imagesequencer2.h>
//#include <imgui.h>
namespace {
@@ -37,7 +37,6 @@
#include <openspace/util/time.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/imagesequencer2.h>
#include <openspace/engine/openspaceengine.h>
#include <sgct.h>
+20
View File
@@ -1,19 +1,39 @@
set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometryprojection.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablecrawlingline.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefov.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplaneprojection.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanetprojection.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometryprojection.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/writeToTexture.h
${CMAKE_CURRENT_SOURCE_DIR}/util/decoder.h
${CMAKE_CURRENT_SOURCE_DIR}/util/hongkangparser.h
${CMAKE_CURRENT_SOURCE_DIR}/util/imagesequencer.h
${CMAKE_CURRENT_SOURCE_DIR}/util/imagesequencer2.h
${CMAKE_CURRENT_SOURCE_DIR}/util/instrumentdecoder.h
${CMAKE_CURRENT_SOURCE_DIR}/util/labelparser.h
${CMAKE_CURRENT_SOURCE_DIR}/util/scannerdecoder.h
${CMAKE_CURRENT_SOURCE_DIR}/util/sequenceparser.h
${CMAKE_CURRENT_SOURCE_DIR}/util/targetdecoder.h
)
source_group("Header Files" FILES ${HEADER_FILES})
set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometryprojection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablecrawlingline.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablefov.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplaneprojection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableplanetprojection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometryprojection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/decoder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/hongkangparser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/imagesequencer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/imagesequencer2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/instrumentdecoder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/labelparser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/scannerdecoder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/sequenceparser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/targetdecoder.cpp
)
source_group("Source Files" FILES ${SOURCE_FILES})
+12
View File
@@ -30,19 +30,27 @@
#include <ghoul/misc/assert.h>
#include <modules/newhorizons/rendering/planetgeometryprojection.h>
#include <modules/newhorizons/rendering/renderablecrawlingline.h>
#include <modules/newhorizons/rendering/renderablefov.h>
#include <modules/newhorizons/rendering/renderableplaneprojection.h>
#include <modules/newhorizons/rendering/renderableplanetprojection.h>
#include <modules/newhorizons/rendering/simplespheregeometryprojection.h>
#include <modules/newhorizons/util/decoder.h>
#include <modules/newhorizons/util/instrumentdecoder.h>
#include <modules/newhorizons/util/targetdecoder.h>
namespace openspace {
bool NewHorizonsModule::initialize() {
FactoryManager::ref().addFactory(new ghoul::TemplateFactory<planetgeometryprojection::PlanetGeometryProjection>);
FactoryManager::ref().addFactory(new ghoul::TemplateFactory<Decoder>);
auto fRenderable = FactoryManager::ref().factory<Renderable>();
ghoul_assert(fRenderable, "No renderable factory existed");
fRenderable->registerClass<RenderableCrawlingLine>("RenderableCrawlingLine");
fRenderable->registerClass<RenderableFov>("RenderableFov");
fRenderable->registerClass<RenderablePlaneProjection>("RenderablePlaneProjection");
fRenderable->registerClass<RenderablePlanetProjection>("RenderablePlanetProjection");
@@ -50,6 +58,10 @@ bool NewHorizonsModule::initialize() {
auto fPlanetGeometryProjection = FactoryManager::ref().factory<planetgeometryprojection::PlanetGeometryProjection>();
fPlanetGeometryProjection->registerClass<planetgeometryprojection::SimpleSphereGeometryProjection>("SimpleSphereProjection");
auto fDecoder = FactoryManager::ref().factory<Decoder>();
fDecoder->registerClass<InstrumentDecoder>("Instrument");
fDecoder->registerClass<TargetDecoder>("Target");
return true;
}
@@ -0,0 +1,182 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2015 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <modules/newhorizons/rendering/renderablecrawlingline.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/util/spicemanager.h>
#include <modules/newhorizons/util/imagesequencer2.h>
//#include <imgui.h>
namespace {
const std::string _loggerCat = "RenderableCrawlingLine";
const std::string KeySource = "Source";
const std::string KeyTarget = "Target";
const std::string KeyInstrument = "Instrument";
const std::string KeyReferenceFrame = "Frame";
const std::string keyColor = "RGB";
static const int SourcePosition = 0;
static const int TargetPosition = 1;
}
namespace openspace {
RenderableCrawlingLine::RenderableCrawlingLine(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _program(nullptr)
, _imageSequenceTime(-1.f)
, _vao(0)
, _vbo(0)
{
dictionary.getValue(KeySource, _source);
dictionary.getValue(KeyTarget, _target);
dictionary.getValue(KeyInstrument, _instrumentName);
dictionary.getValue(KeyReferenceFrame, _referenceFrame);
if (dictionary.hasKeyAndValue<glm::vec3>(keyColor))
dictionary.getValue(keyColor, _lineColor);
else
_lineColor = glm::vec3(1);
}
bool RenderableCrawlingLine::isReady() const {
bool ready = true;
ready &= !_source.empty();
ready &= !_target.empty();
ready &= !_instrumentName.empty();
ready &= (_program != nullptr);
return ready;
}
bool RenderableCrawlingLine::initialize() {
_frameCounter = 0;
bool completeSuccess = true;
_program = ghoul::opengl::ProgramObject::Build("RenderableCrawlingLine",
"${SHADERS}/modules/crawlingline/crawlingline_vs.glsl",
"${SHADERS}/modules/crawlingline/crawlingline_fs.glsl"
);
if (!_program)
return false;
glGenVertexArrays(1, &_vao);
glGenBuffers(1, &_vbo);
glBindVertexArray(_vao);
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glBufferData(GL_ARRAY_BUFFER, 2 * sizeof(psc), NULL, GL_DYNAMIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, (void*)0);
glBindVertexArray(0);
return completeSuccess;
}
bool RenderableCrawlingLine::deinitialize(){
glDeleteVertexArrays(1, &_vao);
_vao = 0;
glDeleteBuffers(1, &_vbo);
_vbo = 0;
return true;
}
void RenderableCrawlingLine::render(const RenderData& data) {
if (_drawLine) {
_program->activate();
_frameCounter++;
// fetch data
psc currentPosition = data.position;
psc campos = data.camera.position();
glm::mat4 camrot = data.camera.viewRotationMatrix();
glm::mat4 transform = glm::mat4(1);
// setup the data to the shader
_program->setUniform("ViewProjection", data.camera.viewProjectionMatrix());
_program->setUniform("ModelTransform", transform);
int frame = _frameCounter % 60;
float fadingFactor = static_cast<float>(sin((frame * pi_c()) / 60));
float alpha = 0.6f + fadingFactor*0.4f;
glLineWidth(2.f);
_program->setUniform("_alpha", alpha);
_program->setUniform("color", _lineColor);
setPscUniforms(_program, &data.camera, data.position);
glBindVertexArray(_vao);
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(psc) * 2, _positions);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0);
glDrawArrays(GL_LINES, 0, 2);
glBindVertexArray(0);
_program->deactivate();
}
}
void RenderableCrawlingLine::update(const UpdateData& data) {
if (_program->isDirty())
_program->rebuildFromFile();
glm::dmat3 transformMatrix = glm::dmat3(1);
openspace::SpiceManager::ref().getPositionTransformMatrix(_source, _referenceFrame, data.time, transformMatrix);
glm::mat4 tmp = glm::mat4(1);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++){
tmp[i][j] = static_cast<float>(transformMatrix[i][j]);
}
}
_positions[SourcePosition] = PowerScaledCoordinate::CreatePowerScaledCoordinate(0, 0, 0);
std::string shape, instrument;
std::vector<glm::dvec3> bounds;
glm::dvec3 boresight;
bool found = openspace::SpiceManager::ref().getFieldOfView(_source, shape, instrument, boresight, bounds);
if (!found)
LERROR("Could not find field of view for instrument");
glm::vec4 target(boresight[0], boresight[1], boresight[2], 12);
target = tmp * target;
_positions[TargetPosition] = target;
if (ImageSequencer2::ref().isReady()) {
_imageSequenceTime = ImageSequencer2::ref().instrumentActiveTime(_instrumentName);
_drawLine = _imageSequenceTime != -1.f;
}
}
}
@@ -29,7 +29,7 @@
#include <openspace/util/constants.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/imagesequencer2.h> // testing
#include <modules/newhorizons/util/imagesequencer2.h> // testing
#include <openspace/util/time.h>
@@ -29,8 +29,6 @@
#include <openspace/scene/scenegraphnode.h>
#include <openspace/util/spicemanager.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/scene/staticephemeris.h>
#include <openspace/scene/dynamicephemeris.h>
#include <ghoul/filesystem/filesystem>
#include <ghoul/io/texture/texturereader.h>
@@ -28,7 +28,7 @@
#include <openspace/rendering/renderable.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/util/imagesequencer2.h>
#include <modules/newhorizons/util/imagesequencer2.h>
#include <openspace/properties/vectorproperty.h>
#include <openspace/util/updatestructures.h>
@@ -29,12 +29,12 @@
// open space includes
#include <openspace/rendering/renderable.h>
#include <openspace/util/imagesequencer2.h>
#include <modules/newhorizons/util/imagesequencer2.h>
#include <openspace/util/sequenceparser.h>
#include <openspace/util/hongkangparser.h>
#include <openspace/util/labelparser.h>
#include <openspace/util/decoder.h>
#include <modules/newhorizons/util/sequenceparser.h>
#include <modules/newhorizons/util/hongkangparser.h>
#include <modules/newhorizons/util/labelparser.h>
#include <modules/newhorizons/util/decoder.h>
#include <openspace/properties/stringproperty.h>
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/util/decoder.h>
#include <modules/newhorizons/util/decoder.h>
#include <openspace/util/factorymanager.h>
namespace {
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/util/imagesequencer2.h>
#include <modules/newhorizons/util/imagesequencer2.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/filesystem/directory.h>
@@ -32,8 +32,8 @@
#include <iterator>
#include <iomanip>
#include <limits>
#include <openspace/util/hongkangparser.h>
#include <openspace/util/instrumentdecoder.h>
#include <modules/newhorizons/util/hongkangparser.h>
#include <modules/newhorizons/util/instrumentdecoder.h>
namespace {
@@ -22,11 +22,11 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __HONGKANGPARSER_H__
#define __HONGKANGPARSER_H__
#include <openspace/util/imagesequencer2.h>
#include <openspace/util/sequenceparser.h>
#include <modules/newhorizons/util/imagesequencer2.h>
#include <modules/newhorizons/util/sequenceparser.h>
#include <map>
#include <string>
@@ -23,7 +23,7 @@
****************************************************************************************/
// open space includes
#include <openspace/util/imagesequencer.h>
#include <modules/newhorizons/util/imagesequencer.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/filesystem/directory.h>
@@ -23,13 +23,13 @@
****************************************************************************************/
// open space includes
#include <openspace/util/imagesequencer2.h>
#include <modules/newhorizons/util/imagesequencer2.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/filesystem/directory.h>
#include <openspace/util/time.h>
#include <ghoul/filesystem/cachemanager.h>
#include <openspace/util/decoder.h>
#include <modules/newhorizons/util/decoder.h>
#include <openspace/util/spicemanager.h>
#include <fstream>
@@ -33,7 +33,7 @@
#include <map>
#include <vector>
#include <openspace/util/sequenceparser.h>
#include <modules/newhorizons/util/sequenceparser.h>
namespace openspace {
/**
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/util/instrumentdecoder.h>
#include <modules/newhorizons/util/instrumentdecoder.h>
namespace {
const std::string _loggerCat = "InstrumentDecoder";
@@ -25,7 +25,7 @@
#ifndef __INSTRUMENTDECODER_H__
#define __INSTRUMENTDECODER_H__
#include <openspace/util/decoder.h>
#include <modules/newhorizons/util/decoder.h>
#include <openspace/util/powerscaledcoordinate.h>
@@ -27,13 +27,13 @@
#include <ghoul/filesystem/directory.h>
#include <openspace/util/time.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/decoder.h>
#include <modules/newhorizons/util/decoder.h>
#include <fstream>
#include <iterator>
#include <iomanip>
#include <limits>
#include <openspace/util/labelparser.h>
#include <modules/newhorizons/util/labelparser.h>
namespace {
const std::string _loggerCat = "LabelParser";
@@ -24,8 +24,9 @@
#ifndef __LABELPARSER_H__
#define __LABELPARSER_H__
#include <openspace/util/imagesequencer2.h>
#include <openspace/util/sequenceparser.h>
#include <modules/newhorizons/util/imagesequencer2.h>
#include <modules/newhorizons/util/sequenceparser.h>
#include <map>
#include <string>
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/util/scannerdecoder.h>
#include <modules/newhorizons/util/scannerdecoder.h>
namespace {
const std::string _loggerCat = "ScannerDecoder";
@@ -25,7 +25,7 @@
#ifndef __SCANNERDECODER_H__
#define __SCANNERDECODER_H__
#include <openspace/util/decoder.h>
#include <modules/newhorizons/util/decoder.h>
#include <openspace/util/powerscaledcoordinate.h>
namespace openspace {
@@ -22,11 +22,11 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/util/sequenceparser.h>
#include <modules/newhorizons/util/sequenceparser.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/decoder.h>
#include <modules/newhorizons/util/decoder.h>
namespace {
const std::string _loggerCat = "SequenceParser";
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <openspace/util/targetdecoder.h>
#include <modules/newhorizons/util/targetdecoder.h>
namespace {
const std::string _loggerCat = "TargetDecoder";
@@ -25,7 +25,7 @@
#ifndef __TARGETDECODER_H__
#define __TARGETDECODER_H__
#include <openspace/util/decoder.h>
#include <modules/newhorizons/util/decoder.h>
#include <openspace/util/powerscaledcoordinate.h>
+1 -1
View File
@@ -7,7 +7,7 @@ return {
-- Sets the scene that is to be loaded by OpenSpace. A scene file is a description
-- of all entities that will be visible during an instance of OpenSpace
Scene = "${OPENSPACE_DATA}/scene/default.scene",
Scene = "${OPENSPACE_DATA}/scene/default_nh.scene",
Paths = {
SGCT = "${BASE_PATH}/config/sgct",
+1 -1
View File
@@ -45,7 +45,7 @@
#include <openspace/util/constants.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/syncbuffer.h>
#include <openspace/util/imagesequencer2.h> // testing
#include <modules/newhorizons/util/imagesequencer2.h> // testing
#include <openspace/engine/moduleengine.h>
+3 -3
View File
@@ -24,7 +24,7 @@
#include <openspace/rendering/renderengine.h>
#include <openspace/util/imagesequencer2.h>
#include <modules/newhorizons/util/imagesequencer2.h>
#include <openspace/abuffer/abuffervisualizer.h>
@@ -61,8 +61,8 @@
#include <sgct.h>
// These are temporary ---abock
#include <openspace/scene/spiceephemeris.h>
#include <openspace/scene/staticephemeris.h>
#include <modules/base/ephemeris/spiceephemeris.h>
#include <modules/base/ephemeris/staticephemeris.h>
// ABuffer defines
#define ABUFFER_FRAMEBUFFER 0
+1 -1
View File
@@ -36,7 +36,7 @@
#include <ghoul/opengl/shaderobject.h>
#include <ghoul/misc/highresclock.h>
#include <openspace/scene/staticephemeris.h>
#include <modules/base/ephemeris/staticephemeris.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/util/factorymanager.h>
+10 -70
View File
@@ -24,97 +24,37 @@
#include <openspace/util/factorymanager.h>
// renderables
#include <openspace/rendering/renderable.h>
//#include <openspace/rendering/model/renderablemodel.h>
//#include <openspace/rendering/stars/renderableconstellationbounds.h>
//#include <openspace/rendering/stars/renderablestars.h>
//#include <openspace/rendering/renderabletrail.h>
//#include <openspace/rendering/renderablepath.h>
//#include <openspace/rendering/renderablefov.h>
//#include <openspace/rendering/renderablesphere.h>
//#include <openspace/rendering/renderablesphericalgrid.h>
//#include <openspace/rendering/renderablefieldlines.h>
//#include <openspace/rendering/renderablecrawlingline.h>
//#include <openspace/rendering/planets/renderableplanet.h>
//#include <openspace/rendering/planets/simplespheregeometry.h>
//#include <openspace/rendering/renderableplane.h>
//#include <openspace/rendering/renderableplaneprojection.h>
//#include <openspace/rendering/renderablevolumegl.h>
//#include <openspace/rendering/planets/simplespheregeometry.h>
//#include <openspace/rendering/model/modelgeometry.h>
//#include <openspace/rendering/model/wavefrontgeometry.h>
#include <openspace/scene/ephemeris.h>
// positioninformation
#include <openspace/scene/staticephemeris.h>
#include <openspace/scene/dynamicephemeris.h>
#include <openspace/scene/spiceephemeris.h>
// projection
//#include <openspace/rendering/planets/renderableplanetprojection.h>
//#include <openspace/rendering/planets/simplespheregeometryprojection.h>
//#include <openspace/rendering/planets/planetgeometryprojection.h>
#include <openspace/util/decoder.h>
#include <openspace/util/instrumentdecoder.h>
#include <openspace/util/targetdecoder.h>
// std
#include <cassert>
#include <ghoul/misc/assert.h>
namespace openspace {
FactoryManager* FactoryManager::_manager = nullptr;
void FactoryManager::initialize()
{
assert(_manager == nullptr);
void FactoryManager::initialize() {
ghoul_assert(!_manager, "Factory Manager already initialized");
if (_manager == nullptr)
_manager = new FactoryManager;
assert(_manager != nullptr);
ghoul_assert(_manager, "Factory Manager was not correctly initialized");
_manager->addFactory(new ghoul::TemplateFactory<Renderable>);
// Add Ephemerides
_manager->addFactory(new ghoul::TemplateFactory<Ephemeris>);
_manager->factory<Ephemeris>()->registerClass<StaticEphemeris>("Static");
_manager->factory<Ephemeris>()->registerClass<StaticEphemeris>("Dynamic");
_manager->factory<Ephemeris>()->registerClass<SpiceEphemeris>("Spice");
_manager->addFactory(new ghoul::TemplateFactory<Decoder>);
_manager->factory<Decoder>()->registerClass<InstrumentDecoder>("Instrument");
_manager->factory<Decoder>()->registerClass<TargetDecoder>("Target");
//_manager->addFactory(new ghoul::TemplateFactory<planetgeometry::PlanetGeometry>);
//_manager->addFactory(new ghoul::TemplateFactory<modelgeometry::ModelGeometry>);
//// Add PlanetGeometryProjection
//_manager->addFactory(new ghoul::TemplateFactory<planetgeometryprojection::PlanetGeometryProjection>);
//_manager->factory<planetgeometryprojection::PlanetGeometryProjection>()
// ->registerClass<planetgeometryprojection::SimpleSphereGeometryProjection>("SimpleSphereProjection");
}
void FactoryManager::deinitialize()
{
assert(_manager != nullptr);
void FactoryManager::deinitialize() {
ghoul_assert(_manager, "No Factory Manager to deinitialize");
delete _manager;
_manager = nullptr;
}
FactoryManager& FactoryManager::ref()
{
assert(_manager != nullptr);
FactoryManager& FactoryManager::ref() {
ghoul_assert(_manager, "No Factory Manager to dereference");
return *_manager;
}
FactoryManager::FactoryManager()
{
}
FactoryManager::~FactoryManager()
{
FactoryManager::~FactoryManager() {
for (ghoul::TemplateFactoryBase* factory : _factories)
delete factory;
_factories.clear();