solve merge conflict

This commit is contained in:
Michael Nilsson
2016-05-03 15:14:31 -04:00
11 changed files with 159 additions and 90 deletions

View File

@@ -1,13 +1,7 @@
return {
{
Name = "iSWA",
Parent = "SolarSystem",
Renderable = {
Type = "ISWAContainer",
TextureCygnets = "[]",
DataCygnets = "[-2]",
Frame = "GALACTIC"
},
Parent = "Root",
Ephemeris = {
Type = "Spice",
Body = "Sun",

View File

@@ -25,12 +25,13 @@
include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswacontainer.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/cygnetplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswacygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/dataplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/textureplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/kameleonplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/cygnetsphere.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datasphere.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspacecygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/colorbar.h
${CMAKE_CURRENT_SOURCE_DIR}/util/iswamanager.h
@@ -39,12 +40,13 @@ set(HEADER_FILES
source_group("Header Files" FILES ${HEADER_FILES})
set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswacontainer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswacygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/cygnetplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/dataplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/textureplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/kameleonplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/cygnetsphere.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datasphere.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspacecygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/colorbar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/iswamanager.cpp

View File

@@ -30,10 +30,10 @@
#include <ghoul/misc/assert.h>
#include <modules/iswa/rendering/iswacontainer.h>
#include <modules/iswa/rendering/textureplane.h>
#include <modules/iswa/rendering/dataplane.h>
#include <modules/iswa/rendering/kameleonplane.h>
#include <modules/iswa/rendering/datasphere.h>
#include <modules/iswa/rendering/screenspacecygnet.h>
namespace openspace {
@@ -47,10 +47,10 @@ namespace openspace {
auto fRenderable = FactoryManager::ref().factory<Renderable>();
ghoul_assert(fRenderable, "No renderable factory existed");
fRenderable->registerClass<ISWAContainer>("ISWAContainer");
fRenderable->registerClass<TexturePlane>("TexturePlane");
fRenderable->registerClass<DataPlane>("DataPlane");
fRenderable->registerClass<KameleonPlane>("KameleonPlane");
fRenderable->registerClass<DataSphere>("DataSphere");
auto fScreenSpaceRenderable = FactoryManager::ref().factory<ScreenSpaceRenderable>();
ghoul_assert(fScreenSpaceRenderable, "No fScreenSpaceRenderable factory existed");

View File

@@ -0,0 +1,46 @@
// * 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/iswa/rendering/cygnetsphere.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/time.h>
namespace openspace{
CygnetSphere::CygnetSphere(const ghoul::Dictionary& dictionary)
:ISWACygnet(dictionary)
,_futureObject(nullptr)
{}
CygnetSphere::~CygnetSphere(){}
bool CygnetSphere::isReady() const{
return true;
}
void CygnetSphere::render(const RenderData& data){
}
void CygnetSphere::update(const UpdateData& data){
}
} //namespace openspace

View File

@@ -22,29 +22,28 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __ISWACONTAINER_H__
#define __ISWACONTAINER_H__
#include <openspace/rendering/renderable.h>
#ifndef __CYGNETSPHERE_H__
#define __CYGNETSPHERE_H__
#include <modules/iswa/rendering/iswacygnet.h>
namespace openspace{
struct ExtensionFuture;
class ISWAContainer : public Renderable{
class CygnetSphere : public ISWACygnet {
public:
ISWAContainer(const ghoul::Dictionary& dictionary);
~ISWAContainer();
bool initialize() override;
bool deinitialize() override;
bool isReady() const override;
CygnetSphere(const ghoul::Dictionary& dictionary);
~CygnetSphere();
virtual bool isReady() const override;
virtual void render(const RenderData& data) override;
virtual void update(const UpdateData& data) override;
private:
};
protected:
virtual bool loadTexture() = 0;
virtual bool updateTexture() = 0;
}//namespace openspace
#endif
std::shared_ptr<DownloadManager::FileFuture> _futureObject;
};
} //namespace openspace
#endif // __CYGNETSPHERE_H__

View File

@@ -46,12 +46,12 @@ friend class ISWAGroup;
// virtual void update(const UpdateData& data) override; //moved to cygnetPlane
protected:
void transferFunctionsFile(std::string tfPath){ _transferFunctionsFile.setValue(tfPath); };
void normValues(glm::vec2 normValues){ _normValues.setValue(normValues); };
void backgroundValues(glm::vec2 backgroundValues){ _backgroundValues.setValue(backgroundValues); };
void useLog(bool useLog){ _useLog.setValue(useLog); };
void normValues(glm::vec2 normValues){ _normValues.setValue(normValues); };
void useHistogram(bool useHistogram){ _useHistogram.setValue(useHistogram); };
void dataOptions(std::vector<int> options){ _dataOptions.setValue(options); };
void transferFunctionsFile(std::string tfPath){ _transferFunctionsFile.setValue(tfPath); };
void backgroundValues(glm::vec2 backgroundValues){ _backgroundValues.setValue(backgroundValues); };
// const std::vector<openspace::properties::SelectionProperty::Option>& dataOptions() const {return _dataOptions.options(); };

View File

@@ -0,0 +1,52 @@
/*****************************************************************************************
* *
* 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/iswa/rendering/datasphere.h>
namespace openspace {
DataSphere::DataSphere(const ghoul::Dictionary& dictionary)
:CygnetSphere(dictionary)
{}
DataSphere::~DataSphere(){}
bool DataSphere::initialize(){
return true;
}
bool DataSphere::deinitialize(){
return true;
}
bool DataSphere::loadTexture(){
return true;
}
bool DataSphere::updateTexture(){
return true;
}
} //namespace openspace

View File

@@ -21,55 +21,30 @@
* 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/iswa/rendering/iswacontainer.h>
#include <ghoul/filesystem/filesystem>
#include <modules/kameleon/include/kameleonwrapper.h>
#include <modules/iswa/rendering/dataplane.h>
#include <modules/iswa/rendering/textureplane.h>
#include <modules/iswa/rendering/screenspacecygnet.h>
#include <modules/iswa/util/iswamanager.h>
#include <openspace/rendering/renderable.h>
#include <modules/iswa/ext/json/json.hpp>
#ifndef __DATASPHERE_H__
#define __DATASPHERE_H__
namespace {
using json = nlohmann::json;
const std::string _loggerCat = "ISWAContainer";
}
#include <modules/iswa/rendering/cygnetsphere.h>
namespace openspace{
ISWAContainer::ISWAContainer(const ghoul::Dictionary& dictionary)
:Renderable(dictionary)
{
// std::string textureCygnets;
// std::string dataCygnets;
// dictionary.getValue("TextureCygnets", textureCygnets);
// dictionary.getValue("DataCygnets", dataCygnets);
// std::cout << textureCygnets << std::endl;
// std::cout << dataCygnets << std::endl;
// if(textureCygnets != ""){
// json j = json::parse(textureCygnets);
// for (auto& id : j) {
// ISWAManager::ref().addISWACygnet(id, "TEXTURE");
// }
// }
// if(dataCygnets != ""){
// json j = json::parse(dataCygnets);
// for (auto& id : j) {
// ISWAManager::ref().addISWACygnet(id, "DATA");
// }
// }
}
class DataSphere : public CygnetSphere {
public:
DataSphere(const ghoul::Dictionary& dictionary);
~DataSphere();
ISWAContainer::~ISWAContainer(){}
bool ISWAContainer::initialize(){return true;}
bool ISWAContainer::deinitialize(){return true;}
bool ISWAContainer::isReady() const { return true; }
void ISWAContainer::render(const RenderData& data){}
virtual bool initialize() override;
virtual bool deinitialize() override;
void ISWAContainer::update(const UpdateData& data){}
protected:
}
private:
virtual bool loadTexture() override;
virtual bool updateTexture() override;
};
} //namespace openspace
#endif //__DATASPHERE_H__

View File

@@ -23,21 +23,22 @@
****************************************************************************************/
#include <modules/iswa/util/iswamanager.h>
#include <ghoul/filesystem/filesystem>
#include <modules/kameleon/include/kameleonwrapper.h>
#include <modules/iswa/rendering/dataplane.h>
#include <modules/iswa/rendering/textureplane.h>
#include <openspace/util/time.h>
#include <modules/iswa/rendering/iswacontainer.h>
#include <modules/iswa/rendering/datasphere.h>
#include <modules/iswa/rendering/screenspacecygnet.h>
#include <modules/iswa/ext/json/json.hpp>
#include <modules/iswa/rendering/iswacygnet.h>
#include <modules/iswa/rendering/iswagroup.h>
#include <fstream>
#include <ghoul/filesystem/filesystem>
#include <modules/kameleon/include/kameleonwrapper.h>
#include <openspace/util/time.h>
#include <modules/iswa/ext/json/json.hpp>
#include <openspace/scripting/scriptengine.h>
#include <openspace/scripting/script_helper.h>
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/lua/lua_helper.h>
#include <modules/iswa/rendering/iswacygnet.h>
#include <modules/iswa/rendering/iswagroup.h>
#include "iswamanager_lua.inl";
@@ -105,15 +106,14 @@ void ISWAManager::addISWACygnet(int id, std::string info, int group){
if(id > 0){
createScreenSpace(id);
}else if(id < 0){
//download metadata to texture plane
//std::shared_ptr<MetadataFuture> metadataFuture = downloadMetadata(id);
std::shared_ptr<MetadataFuture> metaFuture = std::make_shared<MetadataFuture>();
metaFuture->id = id;
metaFuture->group = group;
if(info == "TEXTURE"){
if(info == _type[CygnetType::Texture]){
metaFuture->type = CygnetType::Texture;
metaFuture->geom = CygnetGeometry::Plane;
} else if (info == "DATA") {
} else if (info == _type[CygnetType::Data]) {
metaFuture->type = CygnetType::Data;
metaFuture->geom = CygnetGeometry::Plane;
} else {
@@ -128,6 +128,7 @@ void ISWAManager::addISWACygnet(int id, std::string info, int group){
createPlane(metaFuture);
};
// Download metadata
DlManager.downloadToMemory(
"http://128.183.168.116:3000/" + std::to_string(-id),
// "http://10.0.0.76:3000/" + std::to_string(-id),
@@ -175,6 +176,7 @@ std::shared_ptr<DownloadManager::FileFuture> ISWAManager::downloadDataToMemory(i
);
}
std::string ISWAManager::iSWAurl(int id, std::string type){
std::string url;
if(id < 0){

View File

@@ -1,6 +1,6 @@
--[[ OpenSpace startup script ]]--
-- This Lua script get executed once at the start of the application
openspace.iswa.addCygnet("-1,DATA,1");
openspace.iswa.addCygnet("-2,DATA,1");
openspace.iswa.addCygnet("-3,DATA,1");
openspace.iswa.addCygnet("-1,Data,1");
openspace.iswa.addCygnet("-2,Data,1");
openspace.iswa.addCygnet("-3,Data,1");

View File

@@ -31,7 +31,6 @@
#include <openspace/scene/scene.h>
#include <openspace/scene/scenegraphnode.h>
#include <modules/iswa/rendering/iswacygnet.h>
#include <modules/iswa/rendering/iswacontainer.h>
#include <openspace/rendering/screenspacerenderable.h>
#include <modules/iswa/rendering/iswagroup.h>