mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-14 17:40:26 -05:00
solve mergeconflict
This commit is contained in:
@@ -305,7 +305,6 @@ float* DataPlane::readData(){
|
||||
std::vector<float> max;
|
||||
std::vector<std::vector<float>> optionValues;
|
||||
|
||||
|
||||
for(int i=0; i < selectedOptions.size(); i++){
|
||||
min.push_back(std::numeric_limits<float>::max());
|
||||
max.push_back(std::numeric_limits<float>::min());
|
||||
@@ -336,6 +335,8 @@ float* DataPlane::readData(){
|
||||
|
||||
min[i] = std::min(min[i], optionValues[i][numValues]);
|
||||
max[i] = std::max(max[i], optionValues[i][numValues]);
|
||||
|
||||
|
||||
}
|
||||
numValues++;
|
||||
}
|
||||
|
||||
@@ -40,35 +40,51 @@ ISWACygnet::ISWACygnet(const ghoul::Dictionary& dictionary)
|
||||
{
|
||||
_data = std::make_shared<Metadata>();
|
||||
|
||||
// dict.getValue can only set strings in _data directly
|
||||
float renderableId;
|
||||
glm::vec3 renderableScale;
|
||||
glm::vec3 renderableOffset;
|
||||
glm::vec2 spatialScale;
|
||||
// dict.getValue can only set strings in _data directly
|
||||
float renderableId;
|
||||
glm::vec3 min, max;
|
||||
glm::vec2 spatialScale;
|
||||
|
||||
dictionary.getValue("Id", renderableId);
|
||||
dictionary.getValue("Scale", renderableScale);
|
||||
dictionary.getValue("Offset", renderableOffset);
|
||||
dictionary.getValue("SpatialScale", spatialScale);
|
||||
_data->id = (int) renderableId;
|
||||
_data->offset = renderableOffset;
|
||||
_data->scale = renderableScale;
|
||||
_data->spatialScale = spatialScale;
|
||||
dictionary.getValue("Id", renderableId);
|
||||
dictionary.getValue("SpatialScale", spatialScale);
|
||||
dictionary.getValue("Min", min);
|
||||
dictionary.getValue("Max", max);
|
||||
dictionary.getValue("Frame",_data->frame);
|
||||
|
||||
// dictionary.getValue("Path",_data->path);
|
||||
// dictionary.getValue("Parent",_data->parent);
|
||||
dictionary.getValue("Frame",_data->frame);
|
||||
|
||||
_data->id = (int) renderableId;
|
||||
_data->spatialScale = spatialScale;
|
||||
_data->min = min;
|
||||
_data->max = max;
|
||||
|
||||
_data->scale = glm::vec3(
|
||||
(max.x - min.x),
|
||||
(max.y - min.y),
|
||||
(max.z - min.z)
|
||||
);
|
||||
|
||||
_data->offset = glm::vec3(
|
||||
(min.x + (std::abs(min.x)+std::abs(max.x))/2.0f),
|
||||
(min.y + (std::abs(min.y)+std::abs(max.y))/2.0f),
|
||||
(min.z + (std::abs(min.z)+std::abs(max.z))/2.0f)
|
||||
);
|
||||
|
||||
|
||||
// dictionary.getValue("Path",_data->path);
|
||||
// dictionary.getValue("Parent",_data->parent);
|
||||
|
||||
// addProperty(_enabled);
|
||||
addProperty(_updateInterval);
|
||||
addProperty(_delete);
|
||||
|
||||
// std::cout << _data->id << std::endl;
|
||||
// std::cout << std::to_string(_data->offset) << std::endl;
|
||||
// std::cout << std::to_string(_data->scale) << std::endl;
|
||||
// std::cout << _data->path << std::endl;
|
||||
// std::cout << _data->parent << std::endl;
|
||||
// std::cout << _data->frame << std::endl;
|
||||
// std::cout << _data->id << std::endl;
|
||||
// std::cout << std::to_string(_data->offset) << std::endl;
|
||||
// std::cout << std::to_string(_data->scale) << std::endl;
|
||||
// std::cout << std::to_string(_data->max) << std::endl;
|
||||
// std::cout << std::to_string(_data->min) << std::endl;
|
||||
// std::cout << _data->path << std::endl;
|
||||
// std::cout << _data->parent << std::endl;
|
||||
// std::cout << _data->frame << std::endl;
|
||||
|
||||
_delete.onChange([this](){ISWAManager::ref().deleteISWACygnet(name());});
|
||||
}
|
||||
|
||||
@@ -220,34 +220,25 @@ namespace openspace{
|
||||
std::string parent = j["Central Body"];
|
||||
std::string frame = j["Coordinates"];
|
||||
|
||||
int xmax = j["Plot XMAX"];
|
||||
int ymax = j["Plot YMAX"];
|
||||
int zmax = j["Plot ZMAX"];
|
||||
int xmin = j["Plot XMIN"];
|
||||
int ymin = j["Plot YMIN"];
|
||||
int zmin = j["Plot ZMIN"];
|
||||
glm::vec3 max(
|
||||
j["Plot XMAX"],
|
||||
j["Plot YMAX"],
|
||||
j["Plot ZMAX"]
|
||||
);
|
||||
|
||||
glm::vec3 min(
|
||||
j["Plot XMIN"],
|
||||
j["Plot YMIN"],
|
||||
j["Plot ZMIN"]
|
||||
);
|
||||
|
||||
glm::vec2 spatialScale(1, 10);
|
||||
|
||||
// float spatScale=1, scalew=10;
|
||||
std::string spatial = j["Spatial Scale (Custom)"];
|
||||
if(spatial == "R_E"){
|
||||
spatialScale.x = 6.371f;
|
||||
spatialScale.y = 6;
|
||||
}
|
||||
|
||||
glm::vec3 scale(
|
||||
(xmax-xmin),
|
||||
(ymax-ymin),
|
||||
(zmax-zmin)
|
||||
);
|
||||
|
||||
glm::vec3 offset (
|
||||
(xmin + (std::abs(xmin)+std::abs(xmax))/2.0f),
|
||||
(ymin + (std::abs(ymin)+std::abs(ymax))/2.0f),
|
||||
(zmin + (std::abs(zmin)+std::abs(zmax))/2.0f)
|
||||
);
|
||||
|
||||
std::string table = "{"
|
||||
"Name = '" + type + std::to_string(id) +"' , "
|
||||
"Parent = '" + parent + "', "
|
||||
@@ -255,51 +246,50 @@ namespace openspace{
|
||||
"Type = '" + type + "', "
|
||||
"Id = " + std::to_string(id) + ", "
|
||||
"Frame = '" + frame + "' , "
|
||||
"Scale = " + std::to_string(scale) + ", "
|
||||
"Min = " + std::to_string(min) + ", "
|
||||
"Max = " + std::to_string(max) + ", "
|
||||
"SpatialScale = " + std::to_string(spatialScale) + ", "
|
||||
"Offset = " + std::to_string(offset) +
|
||||
"}"
|
||||
"}"
|
||||
;
|
||||
|
||||
// std::cout << table << std::endl;
|
||||
// ghoul::Dictionary dic;
|
||||
return table;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string ISWAManager::parseKWToLuaTable(std::string kwPath){
|
||||
|
||||
if(kwPath != ""){
|
||||
const std::string& extension = ghoul::filesystem::File(absPath(kwPath)).fileExtension();
|
||||
if(extension == "cdf"){
|
||||
KameleonWrapper kw = KameleonWrapper(absPath(kwPath));
|
||||
// std::string ISWAManager::parseKWToLuaTable(std::string kwPath){
|
||||
// //NEED TO REWRITE IF USED AGAIN
|
||||
// if(kwPath != ""){
|
||||
// const std::string& extension = ghoul::filesystem::File(absPath(kwPath)).fileExtension();
|
||||
// if(extension == "cdf"){
|
||||
// KameleonWrapper kw = KameleonWrapper(absPath(kwPath));
|
||||
|
||||
std::string parent = kw.getParent();
|
||||
std::string frame = kw.getFrame();
|
||||
glm::vec4 scale = kw.getModelScaleScaled();
|
||||
glm::vec4 offset = kw.getModelBarycenterOffsetScaled();
|
||||
// std::string parent = kw.getParent();
|
||||
// std::string frame = kw.getFrame();
|
||||
// glm::vec4 scale = kw.getModelScaleScaled();
|
||||
// glm::vec4 offset = kw.getModelBarycenterOffsetScaled();
|
||||
|
||||
std::string table = "{"
|
||||
"Name = 'DataPlane',"
|
||||
"Parent = '" + parent + "', "
|
||||
"Renderable = {"
|
||||
"Type = 'DataPlane', "
|
||||
"Id = 0 ,"
|
||||
"Frame = '" + frame + "' , "
|
||||
"Scale = " + std::to_string(scale) + ", "
|
||||
"Offset = " + std::to_string(offset) + ", "
|
||||
"kwPath = '" + kwPath + "'"
|
||||
"}"
|
||||
"}"
|
||||
;
|
||||
// std::cout << table << std::endl;
|
||||
return table;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
// std::string table = "{"
|
||||
// "Name = 'DataPlane',"
|
||||
// "Parent = '" + parent + "', "
|
||||
// "Renderable = {"
|
||||
// "Type = 'DataPlane', "
|
||||
// "Id = 0 ,"
|
||||
// "Frame = '" + frame + "' , "
|
||||
// "Scale = " + std::to_string(scale) + ", "
|
||||
// "Offset = " + std::to_string(offset) + ", "
|
||||
// "kwPath = '" + kwPath + "'"
|
||||
// "}"
|
||||
// "}"
|
||||
// ;
|
||||
// // std::cout << table << std::endl;
|
||||
// return table;
|
||||
// }
|
||||
// }
|
||||
// return "";
|
||||
// }
|
||||
|
||||
//Create KameleonPlane?
|
||||
// void ISWAManager::createDataPlane(std::string kwPath){
|
||||
|
||||
@@ -45,15 +45,17 @@ struct ExtensionFuture {
|
||||
};
|
||||
|
||||
struct Metadata {
|
||||
int id;
|
||||
std::string path;
|
||||
std::string parent;
|
||||
std::string frame;
|
||||
glm::vec3 offset;
|
||||
glm::vec3 scale;
|
||||
glm::vec2 spatialScale;
|
||||
std::string scaleVariable;
|
||||
std::shared_ptr<KameleonWrapper> kw;
|
||||
int id;
|
||||
std::string path;
|
||||
std::string parent;
|
||||
std::string frame;
|
||||
glm::vec3 min;
|
||||
glm::vec3 max;
|
||||
glm::vec3 offset;
|
||||
glm::vec3 scale;
|
||||
glm::vec2 spatialScale;
|
||||
std::string scaleVariable;
|
||||
std::shared_ptr<KameleonWrapper> kw;
|
||||
};
|
||||
|
||||
struct MetadataFuture {
|
||||
@@ -93,7 +95,7 @@ private:
|
||||
std::shared_ptr<MetadataFuture> downloadMetadata(int id);
|
||||
std::string getDictionaryTable(int id, std::string path);
|
||||
std::string parseJSONToLuaTable(int id, std::string json, std::string type);
|
||||
std::string parseKWToLuaTable(std::string kwPath);
|
||||
// std::string parseKWToLuaTable(std::string kwPath);
|
||||
|
||||
// void createDataPlane(std::string kwPath);
|
||||
// void createTexturePlane(int id, std::string json);
|
||||
|
||||
Reference in New Issue
Block a user