Merged master into NewAtmosphere.

This commit is contained in:
Jonathas Costa
2017-12-07 11:31:51 -05:00
43 changed files with 657 additions and 168 deletions
@@ -38,6 +38,8 @@ public:
T maximumValue);
NumericalProperty(Property::PropertyInfo info, T value, T minimumValue,
T maximumValue, T steppingValue);
NumericalProperty(Property::PropertyInfo info, T value, T minimumValue,
T maximumValue, T steppingValue, float exponent);
bool getLuaValue(lua_State* state) const override;
bool setLuaValue(lua_State* state) override;
@@ -52,6 +54,12 @@ public:
T maxValue() const;
void setMaxValue(T value);
T steppingValue() const;
void setSteppingValue(T value);
float exponent() const;
void setExponent(float exponent);
virtual std::string className() const override;
using TemplateProperty<T>::operator=;
@@ -60,12 +68,14 @@ protected:
static const std::string MinimumValueKey;
static const std::string MaximumValueKey;
static const std::string SteppingValueKey;
static const std::string ExponentValueKey;
std::string generateAdditionalDescription() const override;
T _minimumValue;
T _maximumValue;
T _stepping;
float _exponent;
};
} // namespace openspace::properties
@@ -229,6 +229,9 @@ const std::string NumericalProperty<T>::MaximumValueKey = "MaximumValue";
template <typename T>
const std::string NumericalProperty<T>::SteppingValueKey = "SteppingValue";
template <typename T>
const std::string NumericalProperty<T>::ExponentValueKey = "Exponent";
// Delegating constructors are necessary; automatic template deduction cannot
// deduce template argument for 'U' if 'default' methods are used as default values in
// a single constructor
@@ -240,7 +243,8 @@ NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info)
PropertyDelegate<NumericalProperty<T>>::template defaultValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultMinimumValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultMaximumValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>()
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>(),
1.f
)
{}
@@ -251,7 +255,8 @@ NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info, T value)
std::move(value),
PropertyDelegate<NumericalProperty<T>>::template defaultMinimumValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultMaximumValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>()
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>(),
1.f
)
{}
@@ -260,18 +265,36 @@ NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info, T value,
T minimumValue, T maximumValue)
: NumericalProperty<T>(
std::move(info),
std::move(value), std::move(minimumValue), std::move(maximumValue),
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>()
std::move(value),
std::move(minimumValue),
std::move(maximumValue),
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>(),
1.f
)
{}
template <typename T>
NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info, T value,
T minimumValue, T maximumValue, T steppingValue)
: NumericalProperty<T>(
std::move(info),
std::move(value),
std::move(minimumValue),
std::move(maximumValue),
std::move(steppingValue),
1.f
)
{}
template <typename T>
NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info, T value,
T minimumValue, T maximumValue, T steppingValue,
float exponent)
: TemplateProperty<T>(std::move(info), std::move(value))
, _minimumValue(std::move(minimumValue))
, _maximumValue(std::move(maximumValue))
, _stepping(std::move(steppingValue))
, _exponent(exponent)
{}
template <typename T>
@@ -342,12 +365,33 @@ void NumericalProperty<T>::setMaxValue(T value) {
_maximumValue = std::move(value);
}
template <typename T>
T NumericalProperty<T>::steppingValue() const {
return _steppingValue;
}
template <typename T>
void NumericalProperty<T>::setSteppingValue(T value) {
_steppingValue = std::move(value);
}
template <typename T>
float NumericalProperty<T>::exponent() const {
return _exponent;
}
template <typename T>
void NumericalProperty<T>::setExponent(float exponent) {
_exponent = exponent;
}
template <typename T>
std::string NumericalProperty<T>::generateAdditionalDescription() const {
std::string result;
result += MinimumValueKey + " = " + std::to_string(_minimumValue) + ",";
result += MaximumValueKey + " = " + std::to_string(_maximumValue) + ",";
result += SteppingValueKey + " = " + std::to_string(_stepping);
result += SteppingValueKey + " = " + std::to_string(_stepping) + ",";
result += ExponentValueKey + " = " + std::to_string(_exponent);
return result;
}
@@ -0,0 +1,39 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___STRINGLISTPROPERTY___H__
#define __OPENSPACE_CORE___STRINGLISTPROPERTY___H__
#include <openspace/properties/templateproperty.h>
#include <string>
#include <vector>
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(StringListProperty, std::vector<std::string>)
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___STRINGLISTPROPERTY___H__
+3 -3
View File
@@ -51,6 +51,7 @@ public:
using ShowMessage = ghoul::Boolean;
using ShowNodeNames = ghoul::Boolean;
using ShowProgressbar = ghoul::Boolean;
using CatastrophicError = ghoul::Boolean;
LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeNames,
ShowProgressbar showProgressbar);
@@ -59,6 +60,7 @@ public:
void render();
void postMessage(std::string message);
void setCatastrophicError(CatastrophicError catastrophicError);
void finalize();
@@ -110,6 +112,7 @@ private:
GLuint vboBox;
} _progressbar;
bool _hasCatastrophicErrorOccurred;
std::string _message;
std::mutex _messageMutex;
@@ -118,9 +121,6 @@ private:
ItemStatus status;
bool hasLocation;
#ifdef LOADINGSCREEN_DEBUGGING
bool exhaustedSearch;
#endif // LOADINGSCREEN_DEBUGGING
glm::vec2 ll;
glm::vec2 ur;
+8 -8
View File
@@ -160,22 +160,22 @@ public:
} sgctInternal;
// Deprecated
[[deprecated("Replaced by Camera::setPositionVec3()")]]
// [[deprecated("Replaced by Camera::setPositionVec3()")]]
void setPosition(psc pos);
[[deprecated("Replaced by Camera::setFocusPositionVec3()")]]
// [[deprecated("Replaced by Camera::setFocusPositionVec3()")]]
void setFocusPosition(psc pos);
[[deprecated("Replaced by Camera::positionVec3()")]]
// [[deprecated("Replaced by Camera::positionVec3()")]]
psc position() const;
[[deprecated("Replaced by Camera::unsynchedPositionVec3()")]]
// [[deprecated("Replaced by Camera::unsynchedPositionVec3()")]]
psc unsynchedPosition() const;
[[deprecated("Replaced by Camera::focusPositionVec3()")]]
// [[deprecated("Replaced by Camera::focusPositionVec3()")]]
psc focusPosition() const;
// @TODO use Camera::SgctInternal interface instead
[[deprecated("Replaced by Camera::SgctInternal::viewMatrix()")]]
// [[deprecated("Replaced by Camera::SgctInternal::viewMatrix()")]]
const glm::mat4& viewMatrix() const;
[[deprecated("Replaced by Camera::SgctInternal::projectionMatrix()")]]
// [[deprecated("Replaced by Camera::SgctInternal::projectionMatrix()")]]
const glm::mat4& projectionMatrix() const;
[[deprecated("Replaced by Camera::SgctInternal::viewProjectionMatrix()")]]
// [[deprecated("Replaced by Camera::SgctInternal::viewProjectionMatrix()")]]
const glm::mat4& viewProjectionMatrix() const;