mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 04:30:09 -05:00
Add documentations and remove unused input argument
This commit is contained in:
@@ -55,6 +55,8 @@ public:
|
||||
void highlight(const glm::ivec3& addition);
|
||||
void removeHighlight(const glm::ivec3& removal);
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
private:
|
||||
// Properties
|
||||
properties::FloatProperty _crossHairSize;
|
||||
|
||||
@@ -64,6 +64,8 @@ public:
|
||||
std::vector<std::pair<std::string, glm::dvec3>> displayCopies() const;
|
||||
std::vector<std::pair<std::string, bool>> showDisplayCopies() const;
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
private:
|
||||
properties::FloatProperty _textureQuality;
|
||||
properties::BoolProperty _isHidden;
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
void removeSelectedImage(int i);
|
||||
void loadImageCollection(const std::string& collection);
|
||||
void setImageOpacity(int i, float opacity);
|
||||
void hideChromeInterface(bool shouldHide);
|
||||
void hideChromeInterface();
|
||||
|
||||
friend bool operator==(const TargetBrowserPair& lhs, const TargetBrowserPair& rhs);
|
||||
friend bool operator!=(const TargetBrowserPair& lhs, const TargetBrowserPair& rhs);
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
void setImageOrder(int i, int order);
|
||||
void loadImageCollection(const std::string& collection);
|
||||
void setImageOpacity(int i, float opacity);
|
||||
void hideChromeInterface(bool shouldHide) const;
|
||||
void hideChromeInterface() const;
|
||||
|
||||
bool isImageCollectionLoaded() const;
|
||||
|
||||
|
||||
@@ -509,6 +509,13 @@ void SkyBrowserModule::removePreSyncCallback(CallbackHandle handle) {
|
||||
_preSyncCallbacks.erase(it);
|
||||
}
|
||||
|
||||
std::vector<documentation::Documentation> SkyBrowserModule::documentations() const {
|
||||
return {
|
||||
RenderableSkyTarget::Documentation(),
|
||||
ScreenSpaceSkyBrowser::Documentation()
|
||||
};
|
||||
}
|
||||
|
||||
scripting::LuaLibrary SkyBrowserModule::luaLibrary() const {
|
||||
return {
|
||||
"skybrowser",
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
void removePreSyncCallback(CallbackHandle handle);
|
||||
|
||||
scripting::LuaLibrary luaLibrary() const override;
|
||||
//std::vector<documentation::Documentation> documentations() const override;
|
||||
std::vector<documentation::Documentation> documentations() const override;
|
||||
|
||||
protected:
|
||||
void internalInitialize(const ghoul::Dictionary& dict) override;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace {
|
||||
SkyBrowserModule* module = global::moduleEngine->module<SkyBrowserModule>();
|
||||
TargetBrowserPair* pair = module->getPair(identifier);
|
||||
if (pair) {
|
||||
pair->hideChromeInterface(true);
|
||||
pair->hideChromeInterface();
|
||||
pair->loadImageCollection(module->wwtImageCollectionUrl());
|
||||
}
|
||||
}
|
||||
@@ -640,12 +640,12 @@ namespace {
|
||||
|
||||
/**
|
||||
* Takes an identifier to a sky browser and adds a rendered copy to it. The first argument
|
||||
* is the position of the first copy. The position is in RAE or Cartesian coordinates,
|
||||
* depending on if 'Use Radius Azimuth Elevation' is checked. The second argument is the
|
||||
* number of copies. If RAE is used, they will be evenly spread out on the azimuth.
|
||||
* is the position of the first copy. The position is in RAE or Cartesian coordinates,
|
||||
* depending on if 'Use Radius Azimuth Elevation' is checked. The second argument is the
|
||||
* number of copies. If RAE is used, they will be evenly spread out on the azimuth.
|
||||
*/
|
||||
[[codegen::luawrap]] void addDisplayCopy(std::string identifier, int numberOfCopies = 1,
|
||||
glm::vec3 position = glm::vec3(2.1f, 0.f, 0.f))
|
||||
glm::vec3 position = glm::vec3(2.1f, 0.f, 0.f))
|
||||
{
|
||||
using namespace openspace;
|
||||
|
||||
@@ -704,7 +704,7 @@ namespace {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the image collection as loaded in the sky browser. Takes an identifier to the sky
|
||||
* Sets the image collection as loaded in the sky browser. Takes an identifier to the sky
|
||||
* browser.
|
||||
*/
|
||||
[[codegen::luawrap]] void loadingImageCollectionComplete(std::string identifier) {
|
||||
@@ -742,7 +742,7 @@ namespace {
|
||||
}
|
||||
|
||||
/**
|
||||
* Point spacecraft to the equatorial coordinates the target points to. Takes an
|
||||
* Point spacecraft to the equatorial coordinates the target points to. Takes an
|
||||
* identifier to a sky browser.
|
||||
*/
|
||||
[[codegen::luawrap]] void pointSpaceCraft(std::string identifier) {
|
||||
|
||||
@@ -85,6 +85,10 @@ namespace {
|
||||
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation RenderableSkyTarget::Documentation() {
|
||||
return codegen::doc<Parameters>("skybrowser_renderableskytarget");
|
||||
}
|
||||
|
||||
RenderableSkyTarget::RenderableSkyTarget(const ghoul::Dictionary& dictionary)
|
||||
: RenderablePlane(dictionary)
|
||||
, _crossHairSize(crossHairSizeInfo, 2.f, 1.f, 10.f)
|
||||
|
||||
@@ -97,6 +97,10 @@ namespace {
|
||||
|
||||
namespace openspace {
|
||||
|
||||
documentation::Documentation ScreenSpaceSkyBrowser::Documentation() {
|
||||
return codegen::doc<Parameters>("skybrowser_screenspaceskybrowser");
|
||||
}
|
||||
|
||||
ScreenSpaceSkyBrowser::ScreenSpaceSkyBrowser(const ghoul::Dictionary& dictionary)
|
||||
: ScreenSpaceRenderable(dictionary)
|
||||
, WwtCommunicator(dictionary)
|
||||
|
||||
@@ -130,7 +130,7 @@ void TargetBrowserPair::initialize() {
|
||||
glm::vec2 dim = _browser->screenSpaceDimensions();
|
||||
_targetRenderable->setRatio(dim.x / dim.y);
|
||||
_browser->updateBorderColor();
|
||||
_browser->hideChromeInterface(true);
|
||||
_browser->hideChromeInterface();
|
||||
_browser->setIsInitialized(true);
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ ghoul::Dictionary TargetBrowserPair::dataAsDictionary() const {
|
||||
res.setValue("selectedImages", selectedImages());
|
||||
res.setValue("scale", static_cast<double>(_browser->scale()));
|
||||
res.setValue("opacities", _browser->opacities());
|
||||
|
||||
|
||||
std::vector<std::pair<std::string, glm::dvec3>> copies = displayCopies();
|
||||
std::vector<std::pair<std::string, bool>> showCopies = _browser->showDisplayCopies();
|
||||
ghoul::Dictionary copiesData;
|
||||
@@ -241,8 +241,8 @@ void TargetBrowserPair::setImageOpacity(int i, float opacity) {
|
||||
_browser->setImageOpacity(i, opacity);
|
||||
}
|
||||
|
||||
void TargetBrowserPair::hideChromeInterface(bool shouldHide) {
|
||||
_browser->hideChromeInterface(shouldHide);
|
||||
void TargetBrowserPair::hideChromeInterface() {
|
||||
_browser->hideChromeInterface();
|
||||
}
|
||||
|
||||
void TargetBrowserPair::sendIdToBrowser() const {
|
||||
|
||||
@@ -180,7 +180,7 @@ void WwtCommunicator::setImageOpacity(int i, float opacity) {
|
||||
sendMessageToWwt(msg);
|
||||
}
|
||||
|
||||
void WwtCommunicator::hideChromeInterface(bool shouldHide) const {
|
||||
void WwtCommunicator::hideChromeInterface() const {
|
||||
std::string script = "sendMessageToWWT({event : \"modify_settings\", "
|
||||
"settings : [[\"hideAllChrome\", true]], target: \"app\"});";
|
||||
executeJavascript(script);
|
||||
|
||||
Reference in New Issue
Block a user