mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-26 05:58:48 -05:00
Merge remote-tracking branch 'origin/master' into issue/2409
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
#include <openspace/properties/triggerproperty.h>
|
||||
#include <openspace/properties/vector/vec2property.h>
|
||||
#include <openspace/properties/vector/ivec2property.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (push)
|
||||
@@ -74,17 +74,17 @@ public:
|
||||
void updateBrowserSize();
|
||||
void reload();
|
||||
|
||||
glm::vec2 browserPixelDimensions() const;
|
||||
void setRatio(float ratio);
|
||||
float browserRatio() const;
|
||||
void setCallbackDimensions(const std::function<void(const glm::dvec2&)>& function);
|
||||
|
||||
protected:
|
||||
properties::Vec2Property _browserDimensions;
|
||||
properties::IVec2Property _browserDimensions;
|
||||
properties::StringProperty _url;
|
||||
properties::TriggerProperty _reload;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::Texture> _texture;
|
||||
|
||||
void updateBrowserDimensions();
|
||||
void executeJavascript(const std::string& script) const;
|
||||
|
||||
bool _isUrlDirty = false;
|
||||
|
||||
@@ -53,7 +53,6 @@ public:
|
||||
|
||||
double setVerticalFovWithScroll(float scroll);
|
||||
void setOpacity(float opacity);
|
||||
void setRatio(float ratio);
|
||||
void setIdInBrowser() const;
|
||||
void setIsInitialized(bool isInitialized);
|
||||
void setPointSpaceCraft(bool point);
|
||||
@@ -79,14 +78,11 @@ private:
|
||||
void bindTexture() override;
|
||||
|
||||
// Flags
|
||||
bool _isSyncedWithWwt = false;
|
||||
bool _textureDimensionsIsDirty = false;
|
||||
bool _ratioIsDirty = false;
|
||||
bool _radiusIsDirty = false;
|
||||
bool _isInitialized = false;
|
||||
bool _radiusIsDirty = false;
|
||||
int _borderRadiusTimer = -1;
|
||||
|
||||
float _ratio = 1.f;
|
||||
float _lastTextureQuality = 1.f;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -89,17 +89,17 @@ public:
|
||||
bool pointSpaceCraft() const;
|
||||
|
||||
ScreenSpaceSkyBrowser* browser() const;
|
||||
std::vector<int> selectedImages() const;
|
||||
std::vector<std::string> selectedImages() const;
|
||||
|
||||
ghoul::Dictionary dataAsDictionary() const;
|
||||
|
||||
// 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 setImageOrder(const std::string& imageUrl, int order);
|
||||
void selectImage(const ImageData& image);
|
||||
void addImageLayerToWwt(const std::string& imageUrl);
|
||||
void removeSelectedImage(const std::string& imageUrl);
|
||||
void loadImageCollection(const std::string& collection);
|
||||
void setImageOpacity(int i, float opacity);
|
||||
void setImageOpacity(const std::string& imageUrl, float opacity);
|
||||
void hideChromeInterface();
|
||||
|
||||
private:
|
||||
@@ -113,6 +113,7 @@ private:
|
||||
skybrowser::Animation<glm::dvec3> _targetAnimation =
|
||||
skybrowser::Animation(glm::dvec3(0.0), glm::dvec3(0.0), 0.0);
|
||||
bool _targetIsAnimating = false;
|
||||
bool _fovIsAnimating = false;
|
||||
|
||||
// Dragging
|
||||
glm::dvec3 _startTargetPosition = glm::dvec3(0.0);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <deque>
|
||||
|
||||
namespace openspace {
|
||||
using SelectedImageDeque = std::deque<std::pair<std::string, double>>;
|
||||
|
||||
class WwtCommunicator : public Browser {
|
||||
public:
|
||||
@@ -40,12 +41,12 @@ public:
|
||||
void update();
|
||||
|
||||
// WorldWide Telescope communication
|
||||
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 selectImage(const std::string& imageUrl);
|
||||
void addImageLayerToWwt(const std::string& imageUrl);
|
||||
void removeSelectedImage(const std::string& imageUrl);
|
||||
void setImageOrder(const std::string& imageUrl, int order);
|
||||
void loadImageCollection(const std::string& collection);
|
||||
void setImageOpacity(int i, float opacity);
|
||||
void setImageOpacity(const std::string& imageUrl, float opacity);
|
||||
void hideChromeInterface() const;
|
||||
|
||||
bool isImageCollectionLoaded() const;
|
||||
@@ -54,7 +55,7 @@ public:
|
||||
glm::ivec3 borderColor() const;
|
||||
glm::dvec2 equatorialAim() const;
|
||||
glm::dvec2 fieldsOfView() const;
|
||||
std::vector<int> selectedImages() const;
|
||||
std::vector<std::string> selectedImages() const;
|
||||
std::vector<double> opacities() const;
|
||||
double borderRadius() const;
|
||||
|
||||
@@ -70,7 +71,7 @@ public:
|
||||
|
||||
protected:
|
||||
void setIdInBrowser(const std::string& id) const;
|
||||
std::deque<std::pair<int, double>>::iterator findSelectedImage(int i);
|
||||
SelectedImageDeque::iterator findSelectedImage(const std::string& id);
|
||||
|
||||
properties::DoubleProperty _verticalFov;
|
||||
|
||||
@@ -79,7 +80,7 @@ protected:
|
||||
glm::dvec2 _equatorialAim = glm::dvec2(0.0);
|
||||
double _targetRoll = 0.0;
|
||||
bool _isImageCollectionLoaded = false;
|
||||
std::deque<std::pair<int, double>> _selectedImages;
|
||||
SelectedImageDeque _selectedImages;
|
||||
|
||||
private:
|
||||
void sendMessageToWwt(const ghoul::Dictionary& msg) const;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
namespace tinyxml2 { class XMLElement; }
|
||||
|
||||
@@ -45,19 +46,21 @@ struct ImageData {
|
||||
float fov = 0.f;
|
||||
glm::dvec2 equatorialSpherical = glm::dvec2(0.0);
|
||||
glm::dvec3 equatorialCartesian = glm::dvec3(0.0);
|
||||
std::string identifier;
|
||||
};
|
||||
|
||||
class WwtDataHandler {
|
||||
public:
|
||||
void loadImages(const std::string& root, const std::filesystem::path& directory);
|
||||
int nLoadedImages() const;
|
||||
const ImageData& image(int i) const;
|
||||
std::optional<const ImageData> image(const std::string& imageUrl) const;
|
||||
const std::map<std::string, ImageData>& images() const;
|
||||
|
||||
private:
|
||||
void saveImagesFromXml(const tinyxml2::XMLElement* root, std::string collection);
|
||||
|
||||
// Images
|
||||
std::vector<ImageData> _images;
|
||||
std::map<std::string, ImageData> _images;
|
||||
};
|
||||
} // namespace openspace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user