mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-09 13:14:53 -06:00
Merge branch 'feature/iSWA' of github.com:OpenSpace/OpenSpace-Development into feature/iSWA
This commit is contained in:
@@ -29,59 +29,7 @@ function postInitialization()
|
||||
openspace.setPropertyValue("MilkyWay.renderable.segments", 50)
|
||||
|
||||
openspace.printInfo("Done setting default values")
|
||||
|
||||
--openspace.iswa.addCygnet(-4,"Data","Ion");
|
||||
|
||||
--openspace.iswa.addCygnet(-1,"Data");
|
||||
--openspace.iswa.addCygnet(-2,"Data");
|
||||
--openspace.iswa.addCygnet(-3,"Data");
|
||||
|
||||
--openspace.iswa.addCygnet(-1,"Texture");
|
||||
--openspace.iswa.addCygnet(-2,"Texture");
|
||||
--openspace.iswa.addCygnet(-3,"Texture");
|
||||
|
||||
|
||||
--openspace.iswa.addCygnet(-3,"Data","GM");
|
||||
--openspace.iswa.addCygnet(-2,"Data","GM");
|
||||
--openspace.iswa.addCygnet(-1,"Data","GM");
|
||||
|
||||
openspace.iswa.addCdfFiles("${OPENSPACE_DATA}/cdflist.json");
|
||||
|
||||
--[[
|
||||
openspace.iswa.addScreenSpaceCygnet(
|
||||
{
|
||||
CygnetId = 2,
|
||||
Position = {-0.8, 0.3},
|
||||
Scale = 0.2
|
||||
});
|
||||
{
|
||||
Type = "ScreenSpaceCygnet",
|
||||
CygnetId = 7,
|
||||
Position = {0.0, 0.0},
|
||||
FlatScreen = true,
|
||||
Scale = 0.25,
|
||||
});
|
||||
|
||||
openspace.registerScreenSpaceRenderable(
|
||||
{
|
||||
Name = "Crazy Cat",
|
||||
Type = "ScreenSpaceImage",
|
||||
TexturePath = "${OPENSPACE_DATA}/test2.jpg",
|
||||
Position = {0.8, -0.3},
|
||||
FlatScreen = true,
|
||||
Scale = 0.25,
|
||||
});
|
||||
|
||||
openspace.registerScreenSpaceRenderable(
|
||||
{
|
||||
Name = "From Online",
|
||||
Type = "ScreenSpaceImage",
|
||||
URL = "http://i.imgur.com/KUunHgr.jpg",
|
||||
Position = {-0.8, 0.3},
|
||||
FlatScreen = true,
|
||||
Scale = 0.25,
|
||||
});
|
||||
]]--
|
||||
end
|
||||
|
||||
|
||||
@@ -94,20 +42,19 @@ return {
|
||||
},
|
||||
Modules = {
|
||||
"sun",
|
||||
--"mercury",
|
||||
--"venus",
|
||||
"mercury",
|
||||
"venus",
|
||||
"earth",
|
||||
--"mars",
|
||||
--"jupiter",
|
||||
--"saturn",
|
||||
--"uranus",
|
||||
--"neptune",
|
||||
"mars",
|
||||
"jupiter",
|
||||
"saturn",
|
||||
"uranus",
|
||||
"neptune",
|
||||
"stars",
|
||||
-- "stars-denver",
|
||||
--"stars-denver",
|
||||
"milkyway",
|
||||
-- "milkyway-eso",
|
||||
"milkyway-eso",
|
||||
--"constellationbounds",
|
||||
--"fieldlines",
|
||||
--"io",
|
||||
--"europa",
|
||||
--"ganymede",
|
||||
|
||||
@@ -1 +1 @@
|
||||
${SCENE}/iswa/tfs/colormap_hot.jpg
|
||||
${SCENE}/iswa/tfs/colormap_hot.png
|
||||
@@ -34,7 +34,7 @@ DataPlane::DataPlane(const ghoul::Dictionary& dictionary)
|
||||
:DataCygnet(dictionary)
|
||||
,_useLog("useLog","Use Logarithm", false)
|
||||
,_useHistogram("useHistogram", "Auto Contrast", false)
|
||||
,_autoFilter("autoFilter", "Auto Filter", false)
|
||||
,_autoFilter("autoFilter", "Auto Filter", true)
|
||||
,_normValues("normValues", "Normalize Values", glm::vec2(1.0,1.0), glm::vec2(0), glm::vec2(5.0))
|
||||
,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0))
|
||||
,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/default.tf")
|
||||
@@ -136,9 +136,9 @@ bool DataPlane::createGeometry() {
|
||||
// x y z w s t
|
||||
-x, -y, -z, w, 0, 1,
|
||||
x, y, z, w, 1, 0,
|
||||
-x, ((x>1)?y:-y), z, w, 0, 0,
|
||||
-x, ((x>0)?y:-y), z, w, 0, 0,
|
||||
-x, -y, -z, w, 0, 1,
|
||||
x, ((x>1)?-y:y), -z, w, 1, 1,
|
||||
x, ((x>0)?-y:y), -z, w, 1, 1,
|
||||
x, y, z, w, 1, 0,
|
||||
};
|
||||
|
||||
@@ -246,6 +246,8 @@ void DataPlane::subscribeToGroup(){
|
||||
|
||||
groupEvent->subscribe(name(), "updateGroup", [&](ghoul::Dictionary dict){
|
||||
LDEBUG(name() + " Event updateGroup");
|
||||
if(_autoFilter.value())
|
||||
_backgroundValues.setValue(_dataProcessor->filterValues());
|
||||
updateTexture();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -66,7 +66,9 @@ bool IswaBaseGroup::isType(std::string type){
|
||||
}
|
||||
|
||||
void IswaBaseGroup::updateGroup(){
|
||||
LDEBUG("Group " + name() + " published updateGroup");
|
||||
_groupEvent->publish("updateGroup", ghoul::Dictionary());
|
||||
|
||||
}
|
||||
|
||||
void IswaBaseGroup::clearGroup(){
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace {
|
||||
namespace openspace{
|
||||
IswaKameleonGroup::IswaKameleonGroup(std::string name, std::string type)
|
||||
:IswaDataGroup(name, type)
|
||||
,_resolution("resolution", "Resolution%", 1.0f, 0.1, 2.0f)
|
||||
,_resolution("resolution", "Resolution%", 100.0f, 10.0f, 200.0f)
|
||||
,_fieldlines("fieldlineSeedsIndexFile", "Fieldline Seedpoints")
|
||||
,_fieldlineIndexFile("")
|
||||
,_kameleonPath("")
|
||||
|
||||
@@ -46,7 +46,7 @@ KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
|
||||
,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0))
|
||||
,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/default.tf")
|
||||
,_fieldlines("fieldlineSeedsIndexFile", "Fieldline Seedpoints")
|
||||
,_resolution("resolution", "Resolution%", 1.0f, 0.1, 2.0f)
|
||||
,_resolution("resolution", "Resolution%", 100.0f, 10.0f, 200.0f)
|
||||
,_slice("slice", "Slice", 0.0, 0.0, 1.0)
|
||||
{
|
||||
|
||||
@@ -188,6 +188,11 @@ bool KameleonPlane::initialize(){
|
||||
|
||||
std::dynamic_pointer_cast<DataProcessorKameleon>(_dataProcessor)->dimensions(_dimensions);
|
||||
_dataProcessor->addDataValues(_kwPath, _dataOptions);
|
||||
// if this datacygnet has added new values then reload texture
|
||||
// for the whole group, including this datacygnet, and return after.
|
||||
if(_group){
|
||||
_group->updateGroup();
|
||||
}
|
||||
updateTextureResource();
|
||||
|
||||
return true;
|
||||
@@ -365,6 +370,8 @@ void KameleonPlane::subscribeToGroup(){
|
||||
|
||||
groupEvent->subscribe(name(), "updateGroup", [&](ghoul::Dictionary dict){
|
||||
LDEBUG(name() + " Event updateGroup");
|
||||
if(_autoFilter.value())
|
||||
_backgroundValues.setValue(_dataProcessor->filterValues());
|
||||
updateTexture();
|
||||
});
|
||||
|
||||
@@ -392,8 +399,8 @@ void KameleonPlane::subscribeToGroup(){
|
||||
void KameleonPlane::setDimensions(){
|
||||
// the cdf files has an offset of 0.5 in normali resolution.
|
||||
// with lower resolution the offset increases.
|
||||
_data->offset = _origOffset - 0.5f*(1.0f/_resolution.value());
|
||||
_dimensions = glm::size3_t(_data->scale*(float)_resolution.value());
|
||||
_data->offset = _origOffset - 0.5f*(100.0f/_resolution.value());
|
||||
_dimensions = glm::size3_t(_data->scale*((float)_resolution.value()/100.f));
|
||||
_dimensions[_cut] = 1;
|
||||
|
||||
if(_cut == 0){
|
||||
|
||||
@@ -70,21 +70,21 @@ void GuiIswaComponent::render() {
|
||||
bool iondatavalue = _iondata;
|
||||
|
||||
ImGui::Begin("ISWA", &_isEnabled, size, 0.5f);
|
||||
ImGui::Text("Global Magnetosphere");
|
||||
ImGui::Checkbox("Gm From Data", &_gmdata); ImGui::SameLine();
|
||||
ImGui::Checkbox("Gm From Images", &_gmimage);
|
||||
// ImGui::Text("Global Magnetosphere");
|
||||
// ImGui::Checkbox("Gm From Data", &_gmdata); ImGui::SameLine();
|
||||
// ImGui::Checkbox("Gm From Images", &_gmimage);
|
||||
|
||||
ImGui::Text("Ionosphere");
|
||||
ImGui::Checkbox("Ion From Data", &_iondata);
|
||||
// ImGui::Text("Ionosphere");
|
||||
// ImGui::Checkbox("Ion From Data", &_iondata);
|
||||
|
||||
|
||||
ImGui::Spacing();
|
||||
static const int addCygnetBufferSize = 256;
|
||||
static char addCygnetBuffer[addCygnetBufferSize];
|
||||
ImGui::InputText("addCynget", addCygnetBuffer, addCygnetBufferSize);
|
||||
// ImGui::Spacing();
|
||||
// static const int addCygnetBufferSize = 256;
|
||||
// static char addCygnetBuffer[addCygnetBufferSize];
|
||||
// ImGui::InputText("addCynget", addCygnetBuffer, addCygnetBufferSize);
|
||||
|
||||
if(ImGui::SmallButton("Add Cygnet"))
|
||||
OsEng.scriptEngine().queueScript("openspace.iswa.addCygnet("+std::string(addCygnetBuffer)+");");
|
||||
// if(ImGui::SmallButton("Add Cygnet"))
|
||||
// OsEng.scriptEngine().queueScript("openspace.iswa.addCygnet("+std::string(addCygnetBuffer)+");");
|
||||
|
||||
if(_gmdata != gmdatavalue){
|
||||
if(_gmdata){
|
||||
|
||||
Reference in New Issue
Block a user