mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-07 04:49:00 -06:00
iswa module ready for api change in downloadmanager
This commit is contained in:
@@ -40,7 +40,6 @@ ScreenSpaceCygnet::ScreenSpaceCygnet(int cygnetId, std::string path)
|
||||
, _cygnetId(cygnetId)
|
||||
, _path(path)
|
||||
{
|
||||
std::cout << "screenspacecygnet constructor 1" << std::endl;
|
||||
_id = id();
|
||||
setName("ScreenSpaceCygnet" + std::to_string(_id));
|
||||
addProperty(_updateInterval);
|
||||
@@ -125,14 +124,13 @@ void ScreenSpaceCygnet::update(){
|
||||
|
||||
loadTexture();
|
||||
|
||||
delete _futureTexture;
|
||||
_futureTexture = nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ScreenSpaceCygnet::updateTexture(){
|
||||
DownloadManager::FileFuture* future = ISWAManager::ref().downloadImage(_cygnetId, absPath(_path));
|
||||
std::shared_ptr<DownloadManager::FileFuture> future = ISWAManager::ref().downloadImage(_cygnetId, absPath(_path));
|
||||
if(future){
|
||||
_futureTexture = future;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
int _id;
|
||||
float _time;
|
||||
float _lastUpdateTime = 0.0f;
|
||||
DownloadManager::FileFuture* _futureTexture;
|
||||
std::shared_ptr<DownloadManager::FileFuture> _futureTexture;
|
||||
std::string _fileExtension;
|
||||
|
||||
float _openSpaceUpdateInterval;
|
||||
|
||||
@@ -137,7 +137,6 @@ void TexturePlane::update(){
|
||||
if(_futureTexture && _futureTexture->isFinished){
|
||||
loadTexture();
|
||||
|
||||
delete _futureTexture;
|
||||
_futureTexture = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -147,7 +146,7 @@ void TexturePlane::setParent(){
|
||||
}
|
||||
|
||||
void TexturePlane::updateTexture(){
|
||||
DownloadManager::FileFuture* future = ISWAManager::ref().downloadImage(_cygnetId, absPath(_path));
|
||||
std::shared_ptr<DownloadManager::FileFuture> future = ISWAManager::ref().downloadImage(_cygnetId, absPath(_path));
|
||||
if(future){
|
||||
_futureTexture = future;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
static int id();
|
||||
|
||||
DownloadManager::FileFuture* _futureTexture;
|
||||
std::shared_ptr<DownloadManager::FileFuture> _futureTexture;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace openspace{
|
||||
}
|
||||
|
||||
std::shared_ptr<ISWACygnet> ISWAManager::createISWACygnet(int id, std::string path){
|
||||
std::cout << "createISWACygnet " << id << std::endl;
|
||||
if(path != ""){
|
||||
const std::string& extension = ghoul::filesystem::File(absPath(path)).fileExtension();
|
||||
std::shared_ptr<ISWACygnet> cygnet;
|
||||
@@ -106,7 +105,7 @@ namespace openspace{
|
||||
}
|
||||
}
|
||||
|
||||
DownloadManager::FileFuture* ISWAManager::downloadImage(int id, std::string path){
|
||||
std::shared_ptr<DownloadManager::FileFuture> ISWAManager::downloadImage(int id, std::string path){
|
||||
|
||||
return DlManager.downloadFile(
|
||||
iSWAurl(id),
|
||||
@@ -126,7 +125,6 @@ namespace openspace{
|
||||
std::shared_ptr<ExtensionFuture> extFuture = std::make_shared<ExtensionFuture>();
|
||||
extFuture->isFinished = false;
|
||||
extFuture->id = id;
|
||||
std::cout << "extension id: "<< id << std::endl;
|
||||
DlManager.getFileExtension(
|
||||
iSWAurl(id),
|
||||
[extFuture](std::string extension){
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
std::shared_ptr<ISWACygnet> createISWACygnet(int, std::string);
|
||||
void addCygnet(std::string info);
|
||||
|
||||
DownloadManager::FileFuture* downloadImage(int, std::string);
|
||||
std::shared_ptr<DownloadManager::FileFuture> downloadImage(int, std::string);
|
||||
void downloadData();
|
||||
|
||||
std::shared_ptr<ExtensionFuture> fileExtension(int);
|
||||
|
||||
Reference in New Issue
Block a user