/***************************************************************************************** * * * OpenSpace * * * * Copyright (c) 2014-2018 * * * * 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace openspace { ghoul::opengl::ProgramObjectManager BaseModule::ProgramObjectManager; BaseModule::BaseModule() : OpenSpaceModule(BaseModule::Name) {} void BaseModule::internalInitialize(const ghoul::Dictionary&) { FactoryManager::ref().addFactory( std::make_unique>(), "ModelGeometry" ); FactoryManager::ref().addFactory( std::make_unique>(), "ScreenSpaceRenderable" ); auto fSsRenderable = FactoryManager::ref().factory(); ghoul_assert(fSsRenderable, "ScreenSpaceRenderable factory was not created"); fSsRenderable->registerClass("ScreenSpaceDashboard"); fSsRenderable->registerClass("ScreenSpaceImageLocal"); fSsRenderable->registerClass("ScreenSpaceImageOnline"); fSsRenderable->registerClass("ScreenSpaceFramebuffer"); auto fDashboard = FactoryManager::ref().factory(); ghoul_assert(fDashboard, "Dashboard factory was not created"); fDashboard->registerClass("DashboardItemAngle"); fDashboard->registerClass("DashboardItemDate"); fDashboard->registerClass("DashboardItemDistance"); fDashboard->registerClass("DashboardItemFramerate"); fDashboard->registerClass("DashboardItemMission"); fDashboard->registerClass( "DashboardItemParallelConnection" ); fDashboard->registerClass( "DashboardItemSimulationIncrement" ); fDashboard->registerClass("DashboardItemSpacing"); auto fRenderable = FactoryManager::ref().factory(); ghoul_assert(fRenderable, "Renderable factory was not created"); fRenderable->registerClass("RenderableModel"); fRenderable->registerClass("RenderablePlaneImageLocal"); fRenderable->registerClass("RenderablePlaneImageOnline"); fRenderable->registerClass("RenderableSphere"); fRenderable->registerClass("RenderableSphericalGrid"); fRenderable->registerClass("RenderableTrailOrbit"); fRenderable->registerClass("RenderableTrailTrajectory"); auto fTranslation = FactoryManager::ref().factory(); ghoul_assert(fTranslation, "Ephemeris factory was not created"); fTranslation->registerClass("LuaTranslation"); fTranslation->registerClass("StaticTranslation"); auto fRotation = FactoryManager::ref().factory(); ghoul_assert(fRotation, "Rotation factory was not created"); fRotation->registerClass("FixedRotation"); fRotation->registerClass("LuaRotation"); fRotation->registerClass("StaticRotation"); auto fScale = FactoryManager::ref().factory(); ghoul_assert(fScale, "Scale factory was not created"); fScale->registerClass("LuaScale"); fScale->registerClass("StaticScale"); auto fGeometry = FactoryManager::ref().factory(); ghoul_assert(fGeometry, "Model geometry factory was not created"); fGeometry->registerClass("MultiModelGeometry"); } void BaseModule::internalDeinitializeGL() { ProgramObjectManager.releaseAll(ghoul::opengl::ProgramObjectManager::Warnings::Yes); } std::vector BaseModule::documentations() const { return { DashboardItemDate::Documentation(), DashboardItemDistance::Documentation(), DashboardItemFramerate::Documentation(), DashboardItemMission::Documentation(), DashboardItemParallelConnection::Documentation(), DashboardItemSimulationIncrement::Documentation(), DashboardItemSpacing::Documentation(), RenderableModel::Documentation(), RenderablePlane::Documentation(), RenderableSphere::Documentation(), RenderableTrailOrbit::Documentation(), RenderableTrailTrajectory::Documentation(), ScreenSpaceDashboard::Documentation(), ScreenSpaceFramebuffer::Documentation(), ScreenSpaceImageLocal::Documentation(), ScreenSpaceImageOnline::Documentation(), FixedRotation::Documentation(), LuaRotation::Documentation(), StaticRotation::Documentation(), LuaScale::Documentation(), StaticScale::Documentation(), LuaTranslation::Documentation(), StaticTranslation::Documentation(), modelgeometry::ModelGeometry::Documentation(), }; } std::vector BaseModule::luaLibraries() const { return { ScreenSpaceDashboard::luaLibrary() }; } } // namespace openspace