Add functionality to check if the image collection has been loaded and pass that information to the GUI

This commit is contained in:
Ylva Selling
2022-04-18 15:35:56 -04:00
parent 17965a130d
commit 2829d726de
9 changed files with 79 additions and 26 deletions
+3 -4
View File
@@ -86,6 +86,9 @@ protected:
void executeJavascript(const std::string& script) const;
bool _isUrlDirty = false;
bool _isDimensionsDirty = false;
bool _shouldReload = false;
private:
class RenderHandler : public WebRenderHandler {
public:
@@ -98,10 +101,6 @@ private:
std::unique_ptr<BrowserInstance> _browserInstance;
CefRefPtr<RenderHandler> _renderHandler;
CefRefPtr<WebKeyboardHandler> _keyboardHandler;
bool _isUrlDirty = false;
bool _isDimensionsDirty = false;
bool _shouldReload = false;
};
} // namespace openspace
@@ -48,15 +48,14 @@ public:
float opacity() const;
glm::vec2 size() const;
glm::dvec2 fineTuneVector(const glm::dvec2& drag);
void setVerticalFovWithScroll(float scroll);
void setOpacity(float opacity);
void setScreenSpaceSize(glm::vec2 newSize);
void updateScreenSpaceSize();
glm::dvec2 fineTuneVector(const glm::dvec2& drag);
void setIdInBrowser() const;
void updateScreenSpaceSize();
void updateTextureResolution();
// Copies rendered
@@ -61,6 +61,7 @@ public:
void sendIdToBrowser() const;
void updateBrowserSize();
std::vector<std::pair<std::string, glm::dvec3>> renderCopies() const;
bool isImageCollectionLoaded();
// Target
void centerTargetOnScreen();
@@ -79,6 +80,7 @@ public:
void setBorderColor(const glm::ivec3& color);
void setScreenSpaceSize(const glm::vec2& dimensions);
void setVerticalFovWithScroll(float scroll);
void setImageCollectionIsLoaded(bool isLoaded);
double verticalFov() const;
glm::ivec3 borderColor() const;
@@ -97,6 +99,7 @@ public:
// WorldWide Telescope image handling
void setImageOrder(int i, int order);
void selectImage(const ImageData& image, int i);
void addImageLayerToWwt(const std::string& url, int i);
void removeSelectedImage(int i);
void loadImageCollection(const std::string& collection);
void setImageOpacity(int i, float opacity);
+5 -4
View File
@@ -44,21 +44,22 @@ public:
void update();
// WorldWide Telescope communication
void displayImage(const std::string& url, int i);
void selectImage(const std::string& url, int i);
void addImageLayerToWwt(const std::string& url, int i);
void removeSelectedImage(int i);
void setImageOrder(int i, int order);
void loadImageCollection(const std::string& collection);
void setImageOpacity(int i, float opacity) const;
void hideChromeInterface(bool shouldHide) const;
bool hasLoadedImages() const;
bool isImageCollectionLoaded() const;
double verticalFov() const;
glm::ivec3 borderColor() const;
glm::dvec2 equatorialAim() const;
glm::dvec2 fieldsOfView() const;
const std::deque<int>& getSelectedImages() const;
void setHasLoadedImages(bool isLoaded);
void setImageCollectionIsLoaded(bool isLoaded);
void setVerticalFov(double vfov);
void setIsSyncedWithWwt(bool isSynced);
void setEquatorialAim(glm::dvec2 equatorial);
@@ -78,7 +79,7 @@ protected:
glm::ivec3 _borderColor = glm::ivec3(70);
glm::dvec2 _equatorialAim = glm::dvec2(0.0);
double _targetRoll = 0.0;
bool _hasLoadedImages = false;
bool _isImageCollectionLoaded = false;
std::deque<int> _selectedImages;
private: