Coding style fixes

This commit is contained in:
Alexander Bock
2019-07-31 11:13:29 +02:00
parent f2a0cb18b0
commit c7c8375ca0
7 changed files with 13 additions and 16 deletions

View File

@@ -200,7 +200,7 @@ void Handler::onVREvent(const VRDataIndex& eventData) {
if (button == MouseButton::Right && action == MouseAction::Press) {
windowingGlobals.mouseButtons |= 1 << 2;
}
using KM = KeyModifier;
KM mod = KM::NoModifier;
mod |= keyboardState.modifierShift ? KM::Shift : KM::NoModifier;

View File

@@ -74,7 +74,7 @@ TimelineRotation::TimelineRotation(const ghoul::Dictionary& dictionary) {
for (const std::string& timeString : timeStrings) {
const double t = Time::convertTime(timeString);
std::unique_ptr<Rotation> rotation =
std::unique_ptr<Rotation> rotation =
Rotation::createFromDictionary(
keyframes.value<ghoul::Dictionary>(timeString)
);

View File

@@ -74,7 +74,7 @@ TimelineTranslation::TimelineTranslation(const ghoul::Dictionary& dictionary) {
for (const std::string& timeString : timeStrings) {
const double t = Time::convertTime(timeString);
std::unique_ptr<Translation> translation =
std::unique_ptr<Translation> translation =
Translation::createFromDictionary(
keyframes.value<ghoul::Dictionary>(timeString)
);
@@ -108,7 +108,7 @@ glm::dvec3 TimelineTranslation::position(const UpdateData& data) const {
if (nextTime - prevTime > 0.0) {
t = (now - prevTime) / (nextTime - prevTime);
}
return t * next->data->position(data) + (1.0 - t) * prev->data->position(data);
return t * next->data->position(data) + (1.0 - t) * prev->data->position(data);
}
} // namespace openspace

View File

@@ -265,7 +265,7 @@ void GlobeBrowsingModule::internalInitialize(const ghoul::Dictionary& dict) {
// >= as we might have multiple frames per postDraw call (stereo rendering,
// fisheye, etc)
const uint16_t next = _frameInfo.lastSavedFrame + _frameInfo.saveEveryNthFrame;
const bool shouldSave = _saveInstrumentation &&
const bool shouldSave = _saveInstrumentation &&
global::renderEngine.frameNumber() >= next;
if (shouldSave) {
using K = const globebrowsing::RenderableGlobe*;
@@ -512,7 +512,7 @@ void GlobeBrowsingModule::goToGeo(const globebrowsing::RenderableGlobe& globe,
);
}
void GlobeBrowsingModule::goToGeo(const globebrowsing::RenderableGlobe& globe,
void GlobeBrowsingModule::goToGeo(const globebrowsing::RenderableGlobe& globe,
double latitude, double longitude, double altitude)
{
using namespace globebrowsing;
@@ -571,7 +571,7 @@ void GlobeBrowsingModule::goToChunk(const globebrowsing::RenderableGlobe& globe,
const SurfacePositionHandle posHandle = globe.calculateSurfacePositionHandle(
cameraPositionModelSpace
);
const Geodetic2 geo2 = globe.ellipsoid().cartesianToGeodetic2(
posHandle.centerToReferenceSurface
);

View File

@@ -145,7 +145,7 @@ int getLayers(lua_State* L) {
return ghoul::lua::luaError(L, "Identifier must be a RenderableGlobe");
}
globebrowsing::layergroupid::GroupID group =
globebrowsing::layergroupid::GroupID group =
ghoul::from_string<globebrowsing::layergroupid::GroupID>(layer);
if (group == globebrowsing::layergroupid::GroupID::Unknown) {
return ghoul::lua::luaError(L, "Unknown layer groupd: " + layer);
@@ -166,7 +166,7 @@ int getLayers(lua_State* L) {
int moveLayer(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, 4, "lua::moveLayer");
const std::string& globeIdentifier = ghoul::lua::value<std::string>(L, 1);
const std::string& layer = ghoul::lua::value<std::string>(L, 2);
int oldPosition = ghoul::lua::value<int>(L, 3);
@@ -225,7 +225,7 @@ int goToChunk(lua_State* L) {
}
int goToGeo(lua_State* L) {
const int nArguments = ghoul::lua::checkArgumentsAndThrow(L, { 2, 4 }, "lua::goToGeo");
int nArguments = ghoul::lua::checkArgumentsAndThrow(L, { 2, 4 }, "lua::goToGeo");
// Check if the user provided a Scene graph node identifier as the first argument.
// lua_isstring returns true for both numbers and strings, so better use !lua_isnumber

View File

@@ -272,7 +272,7 @@ void NavigationHandler::applyNavigationState(const NavigationHandler::Navigation
// Construct vectors of a "neutral" view, i.e. when the aim is centered in view.
glm::dvec3 neutralView =
glm::normalize(aimNode->worldPosition() - cameraPositionWorld);
glm::dquat neutralCameraRotation = glm::inverse(glm::quat_cast(glm::lookAt(
glm::dvec3(0.0),
neutralView,

View File

@@ -52,9 +52,7 @@ int setNavigationState(lua_State* L) {
ghoul::Dictionary navigationStateDictionary;
ghoul::lua::luaDictionaryFromState(L, navigationStateDictionary);
using namespace openspace::documentation;
TestResult r = testSpecification(
openspace::documentation::TestResult r = openspace::documentation::testSpecification(
interaction::NavigationHandler::NavigationState::Documentation(),
navigationStateDictionary
);
@@ -62,8 +60,7 @@ int setNavigationState(lua_State* L) {
if (!r.success) {
lua_settop(L, 0);
return ghoul::lua::luaError(
L,
fmt::format("Could not set camera state: {}", ghoul::to_string(r))
L, fmt::format("Could not set camera state: {}", ghoul::to_string(r))
);
}