mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Strict coding style adherence
This commit is contained in:
@@ -94,7 +94,10 @@ private:
|
||||
void clear();
|
||||
QStringList selectedScenes() const;
|
||||
|
||||
void handleFileFutureAddition(const std::vector<std::shared_ptr<openspace::DownloadManager::FileFuture>>& futures);
|
||||
void handleFileFutureAddition(
|
||||
const std::vector<std::shared_ptr<openspace::DownloadManager::FileFuture>>&
|
||||
futures
|
||||
);
|
||||
|
||||
void handleDirectFiles();
|
||||
void handleFileRequest();
|
||||
@@ -116,7 +119,10 @@ private:
|
||||
std::set<std::string> _filesDownloading;
|
||||
|
||||
std::vector<std::shared_ptr<openspace::DownloadManager::FileFuture>> _futures;
|
||||
std::map<std::shared_ptr<openspace::DownloadManager::FileFuture>, InfoWidget*> _futureInfoWidgetMap;
|
||||
std::map<
|
||||
std::shared_ptr<openspace::DownloadManager::FileFuture>,
|
||||
InfoWidget*
|
||||
> _futureInfoWidgetMap;
|
||||
|
||||
std::vector<std::shared_ptr<openspace::DownloadManager::FileFuture>> _futuresToAdd;
|
||||
std::atomic_flag _mutex;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace ghoul::fontrendering {
|
||||
|
||||
namespace ghoul::opengl {
|
||||
class ProgramObject;
|
||||
class Texture;
|
||||
class Texture;
|
||||
} // namespace ghoul::opengl
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
* Initalizes the SceneGraph
|
||||
*/
|
||||
void initialize();
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the OpenGL part of the SceneGraph
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,8 @@ namespace openspace {
|
||||
class BlockPlaneIntersectionGeometry {
|
||||
public:
|
||||
// initializers
|
||||
BlockPlaneIntersectionGeometry(glm::vec3 blockSize, glm::vec3 planeNormal, float planeDistance);
|
||||
BlockPlaneIntersectionGeometry(glm::vec3 blockSize, glm::vec3 planeNormal,
|
||||
float planeDistance);
|
||||
~BlockPlaneIntersectionGeometry();
|
||||
|
||||
bool initialize();
|
||||
|
||||
@@ -48,10 +48,11 @@ public:
|
||||
// Sets the power scaled coordinates with w = 0
|
||||
PowerScaledCoordinate(glm::vec3 v);
|
||||
|
||||
static PowerScaledCoordinate CreatePowerScaledCoordinate(double d1, double d2, double d3);
|
||||
static PowerScaledCoordinate CreatePowerScaledCoordinate(double d1, double d2,
|
||||
double d3);
|
||||
|
||||
// get functions
|
||||
// return the full, unmodified PSC
|
||||
// return the full, unmodified PSC
|
||||
const glm::vec4& vec4() const;
|
||||
|
||||
// returns the rescaled, "normal" coordinates
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace openspace {
|
||||
class PowerScaledSphere {
|
||||
public:
|
||||
// initializers
|
||||
PowerScaledSphere(const PowerScaledScalar& radius,
|
||||
PowerScaledSphere(const PowerScaledScalar& radius,
|
||||
int segments = 8);
|
||||
|
||||
PowerScaledSphere(glm::vec3 radius, int segments);
|
||||
|
||||
@@ -47,12 +47,12 @@ namespace documentation { struct Documentation; }
|
||||
class RenderableTrailOrbit : public RenderableTrail {
|
||||
public:
|
||||
explicit RenderableTrailOrbit(const ghoul::Dictionary& dictionary);
|
||||
|
||||
|
||||
void initializeGL() override;
|
||||
void deinitializeGL() override;
|
||||
|
||||
void update(const UpdateData& data) override;
|
||||
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
private:
|
||||
|
||||
@@ -164,7 +164,10 @@ bool ScreenSpaceDashboard::deinitializeGL() {
|
||||
}
|
||||
|
||||
bool ScreenSpaceDashboard::isReady() const {
|
||||
return (_fontRenderer != nullptr) && (_fontDate != nullptr) && (_fontInfo != nullptr) && ScreenSpaceFramebuffer::isReady();
|
||||
return (_fontRenderer != nullptr) &&
|
||||
(_fontDate != nullptr) &&
|
||||
(_fontInfo != nullptr) &&
|
||||
ScreenSpaceFramebuffer::isReady();
|
||||
}
|
||||
|
||||
void ScreenSpaceDashboard::update() {
|
||||
|
||||
@@ -40,7 +40,7 @@ class ScreenSpaceDashboard: public ScreenSpaceFramebuffer {
|
||||
public:
|
||||
ScreenSpaceDashboard(const ghoul::Dictionary& dictionary);
|
||||
~ScreenSpaceDashboard();
|
||||
|
||||
|
||||
bool initializeGL() override;
|
||||
bool deinitializeGL() override;
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
private:
|
||||
std::unique_ptr<ghoul::fontrendering::FontRenderer> _fontRenderer;
|
||||
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontDate;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontInfo;
|
||||
};
|
||||
|
||||
@@ -355,7 +355,6 @@ FixedRotation::FixedRotation(const ghoul::Dictionary& dictionary)
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
_xAxis.type.addOptions({
|
||||
{ Axis::Type::Object, "Object" },
|
||||
|
||||
@@ -48,7 +48,8 @@ public:
|
||||
void initialize();
|
||||
void deinitialize();
|
||||
|
||||
std::shared_ptr<Layer> addLayer(layergroupid::GroupID groupId, ghoul::Dictionary layerDict);
|
||||
std::shared_ptr<Layer> addLayer(layergroupid::GroupID groupId,
|
||||
ghoul::Dictionary layerDict);
|
||||
void deleteLayer(layergroupid::GroupID groupId, std::string layerName);
|
||||
|
||||
const LayerGroup& layerGroup(size_t groupId);
|
||||
|
||||
@@ -129,7 +129,7 @@ bool TileProviderByLevel::deinitialize() {
|
||||
for (const std::shared_ptr<TileProvider>& tp : _levelTileProviders) {
|
||||
success &= tp->deinitialize();
|
||||
}
|
||||
|
||||
|
||||
return TileProvider::deinitialize() && success;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,6 @@ private:
|
||||
|
||||
properties::Property::Visibility _currentVisibility;
|
||||
|
||||
|
||||
std::vector<ImGuiContext*> _contexts;
|
||||
};
|
||||
|
||||
|
||||
@@ -483,7 +483,11 @@ void GUI::initializeGL() {
|
||||
//_contexts[i] = ImGui::CreateContext();
|
||||
ImGui::SetCurrentContext(_contexts[i]);
|
||||
|
||||
ImGui::GetIO().Fonts->GetTexDataAsRGBA32(&pngData, &textureSize.x, &textureSize.y);
|
||||
ImGui::GetIO().Fonts->GetTexDataAsRGBA32(
|
||||
&pngData,
|
||||
&textureSize.x,
|
||||
&textureSize.y
|
||||
);
|
||||
}
|
||||
_fontTexture = std::make_unique<ghoul::opengl::Texture>(
|
||||
pngData,
|
||||
|
||||
@@ -667,7 +667,7 @@ void renderDMat2Property(Property* prop, const std::string& ownerName,
|
||||
isRegular
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace documentation { struct Documentation; }
|
||||
class RenderableFov : public Renderable {
|
||||
public:
|
||||
RenderableFov(const ghoul::Dictionary& dictionary);
|
||||
|
||||
|
||||
void initializeGL() override;
|
||||
void deinitializeGL() override;
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
void render(const RenderData& data, RendererTasks& rendererTask) override;
|
||||
void update(const UpdateData& data) override;
|
||||
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
private:
|
||||
@@ -153,7 +153,7 @@ private:
|
||||
properties::Vec4Property square; // Color for the orthogonal square
|
||||
} _colors;
|
||||
};
|
||||
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_MODULE_SPACECRAFTINSTRUMENTS___RENDERABLEFOV___H__
|
||||
|
||||
@@ -385,7 +385,7 @@ void TouchInteraction::directControl(const std::vector<TuioCursor>& list) {
|
||||
{ // Orbit (global rotation)
|
||||
dvec3 eulerAngles(q[1], q[0], 0);
|
||||
dquat rotationDiffCamSpace = dquat(eulerAngles);
|
||||
|
||||
|
||||
dvec3 centerToCamera = camPos - centerPos;
|
||||
|
||||
dquat rotationDiffWorldSpace =
|
||||
|
||||
@@ -611,7 +611,6 @@ void OpenSpaceEngine::loadScene(const std::string& scenePath) {
|
||||
if (configurationManager().hasKey(kProgress)) {
|
||||
showProgressbar = configurationManager().value<bool>(kProgress);
|
||||
}
|
||||
|
||||
|
||||
_loadingScreen = std::make_unique<LoadingScreen>(
|
||||
LoadingScreen::ShowMessage(showMessage),
|
||||
@@ -679,8 +678,6 @@ void OpenSpaceEngine::loadScene(const std::string& scenePath) {
|
||||
initializeFinished = true;
|
||||
});
|
||||
|
||||
|
||||
|
||||
// While the SceneGraphNodes initialize themselves, we can hand over control to the
|
||||
// Loading screen rendering
|
||||
|
||||
@@ -693,7 +690,7 @@ void OpenSpaceEngine::loadScene(const std::string& scenePath) {
|
||||
t.join();
|
||||
// It's okay to delete it since the last rendered image will remain on screen
|
||||
_loadingScreen = nullptr;
|
||||
|
||||
|
||||
if (errorWhileLoading) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
glm::mat4x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat4x3 result;
|
||||
int number = 1;
|
||||
@@ -106,7 +106,7 @@ bool toStringConversion(std::string& outValue, glm::mat4x3 inValue) {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <sstream>
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
unsigned short fromLuaConversion(lua_State* state, bool& success) {
|
||||
success = (lua_isnumber(state, -1) == 1);
|
||||
if (success) {
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace {
|
||||
{
|
||||
lhsLl -= glm::vec2(ItemStandoffDistance / 2.f);
|
||||
lhsUr += glm::vec2(ItemStandoffDistance / 2.f);
|
||||
|
||||
|
||||
rhsLl -= glm::vec2(ItemStandoffDistance / 2.f);
|
||||
rhsUr += glm::vec2(ItemStandoffDistance / 2.f);
|
||||
|
||||
@@ -149,7 +149,7 @@ LoadingScreen::LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeName
|
||||
absPath("${OPENSPACE_DATA}/openspace-logo.png")
|
||||
);
|
||||
_logoTexture->uploadTexture();
|
||||
|
||||
|
||||
glGenVertexArrays(1, &_logo.vao);
|
||||
glBindVertexArray(_logo.vao);
|
||||
glGenBuffers(1, &_logo.vbo);
|
||||
@@ -216,7 +216,7 @@ LoadingScreen::LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeName
|
||||
|
||||
LoadingScreen::~LoadingScreen() {
|
||||
_logoTexture = nullptr;
|
||||
|
||||
|
||||
_loadingFont = nullptr;
|
||||
_messageFont = nullptr;
|
||||
_itemFont = nullptr;
|
||||
@@ -234,7 +234,7 @@ LoadingScreen::~LoadingScreen() {
|
||||
void LoadingScreen::render() {
|
||||
// We have to recalculate the positions here because we will not be informed about a
|
||||
// window size change
|
||||
|
||||
|
||||
const glm::vec2 dpiScaling = OsEng.windowWrapper().dpiScaling();
|
||||
const glm::ivec2 res =
|
||||
glm::vec2(OsEng.windowWrapper().currentWindowResolution()) / dpiScaling;
|
||||
@@ -304,16 +304,14 @@ void LoadingScreen::render() {
|
||||
ProgressbarSize.x,
|
||||
ProgressbarSize.y * screenAspectRatio
|
||||
};
|
||||
|
||||
|
||||
glm::vec2 progressbarLl = {
|
||||
ProgressbarCenter.x - progressbarSize.x,
|
||||
ProgressbarCenter.y - progressbarSize.y
|
||||
|
||||
};
|
||||
glm::vec2 progressbarUr = {
|
||||
ProgressbarCenter.x + progressbarSize.x ,
|
||||
ProgressbarCenter.y + progressbarSize.y
|
||||
|
||||
};
|
||||
|
||||
if (_showProgressbar) {
|
||||
@@ -321,14 +319,14 @@ void LoadingScreen::render() {
|
||||
|
||||
// Depending on the progress, we only want to draw the progress bar to a mixture
|
||||
// of the lowerleft and upper right extent
|
||||
|
||||
|
||||
float progress = _nItems != 0 ?
|
||||
static_cast<float>(_iProgress) / static_cast<float>(_nItems) :
|
||||
0.f;
|
||||
|
||||
glm::vec2 ur = progressbarUr;
|
||||
ur.x = glm::mix(progressbarLl.x, progressbarUr.x, progress);
|
||||
|
||||
|
||||
GLfloat dataFill[] = {
|
||||
progressbarLl.x, progressbarLl.y,
|
||||
ur.x, ur.y,
|
||||
@@ -471,7 +469,7 @@ void LoadingScreen::render() {
|
||||
for (Item& item : _items) {
|
||||
if (!item.hasLocation) {
|
||||
// Compute a new location
|
||||
|
||||
|
||||
FR::BoundingBoxInformation b = renderer.boundingBox(
|
||||
*_itemFont,
|
||||
"%s",
|
||||
@@ -500,7 +498,6 @@ void LoadingScreen::render() {
|
||||
ur = ll + b.boundingBox;
|
||||
|
||||
// Test against logo and text
|
||||
|
||||
bool logoOverlap = rectOverlaps(
|
||||
ndcToScreen(logoLl, res), ndcToScreen(logoUr, res),
|
||||
ll, ur
|
||||
@@ -528,7 +525,6 @@ void LoadingScreen::render() {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Test against all other boxes
|
||||
bool overlap = false;
|
||||
for (const Item& j : _items) {
|
||||
@@ -569,11 +565,14 @@ void LoadingScreen::render() {
|
||||
return glm::vec4(1.f);
|
||||
}
|
||||
}();
|
||||
|
||||
if (item.status == ItemStatus::Finished) {
|
||||
auto t = std::chrono::duration_cast<std::chrono::milliseconds>(now - item.finishedTime);
|
||||
|
||||
color.a = 1.f - static_cast<float>(t.count()) / static_cast<float>(TTL.count());
|
||||
if (item.status == ItemStatus::Finished) {
|
||||
auto t = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
now - item.finishedTime
|
||||
);
|
||||
|
||||
color.a = 1.f - static_cast<float>(t.count()) /
|
||||
static_cast<float>(TTL.count());
|
||||
}
|
||||
|
||||
#ifdef LOADINGSCREEN_DEBUGGING
|
||||
|
||||
@@ -145,7 +145,7 @@ std::unique_ptr<Scene> SceneLoader::loadScene(const std::string& path) {
|
||||
std::unique_ptr<SceneGraphNode> rootNode = std::make_unique<SceneGraphNode>();
|
||||
rootNode->setName(SceneGraphNode::RootNodeName);
|
||||
scene->setRoot(std::move(rootNode));
|
||||
|
||||
|
||||
OsEng.loadingScreen().updateItem(
|
||||
SceneGraphNode::RootNodeName,
|
||||
LoadingScreen::ItemStatus::Started
|
||||
|
||||
@@ -338,7 +338,7 @@ def check_empty_character_at_end(lines):
|
||||
if not is_strict_mode:
|
||||
return ''
|
||||
|
||||
index = [i + 1 for i, s in enumerate(lines) if len(s) > 1 and s[-2] == ' ']
|
||||
index = [i + 1 for i, s in enumerate(lines) if len(s) > 1 and s[-2] == ' ' and not s.strip() == '']
|
||||
if len(index) > 0:
|
||||
return index
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user