iswa module ready for api change in downloadmanager

This commit is contained in:
Michael Nilsson
2016-04-05 11:03:55 -04:00
parent 4da6d72985
commit 7263b251ca
6 changed files with 6 additions and 11 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -50,7 +50,7 @@
static int id();
DownloadManager::FileFuture* _futureTexture;
std::shared_ptr<DownloadManager::FileFuture> _futureTexture;
};
} // namespace openspace

View File

@@ -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){

View File

@@ -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);