diff --git a/ext/ghoul b/ext/ghoul index 47565ecda4..e26ea6366c 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 47565ecda4877077831b80eb9c16a38ad9f7e18b +Subproject commit e26ea6366ca7e634b88ecf646da5b4adc8168b95 diff --git a/include/openspace/navigation/keyframenavigator.h b/include/openspace/navigation/keyframenavigator.h index c9e2b8153d..76d1f58554 100644 --- a/include/openspace/navigation/keyframenavigator.h +++ b/include/openspace/navigation/keyframenavigator.h @@ -68,8 +68,8 @@ public: * \param ignoreFutureKeyframes `true` if only past keyframes are to be used * \return true only if a new future keyframe is available to set camera pose */ - bool updateCamera(Camera& camera, bool ignoreFutureKeyframes); - static bool updateCamera(Camera* camera, const CameraPose& prevPose, + void updateCamera(Camera& camera, bool ignoreFutureKeyframes); + static void updateCamera(Camera* camera, const CameraPose& prevPose, const CameraPose& nextPose, double t, bool ignoreFutureKeyframes); Timeline& timeline(); diff --git a/modules/base/rendering/pointcloud/sizemappingcomponent.cpp b/modules/base/rendering/pointcloud/sizemappingcomponent.cpp index 4ed05e5ff5..1f3a65d711 100644 --- a/modules/base/rendering/pointcloud/sizemappingcomponent.cpp +++ b/modules/base/rendering/pointcloud/sizemappingcomponent.cpp @@ -170,10 +170,10 @@ SizeMappingComponent::SizeMappingComponent(const ghoul::Dictionary& dictionary) const Parameters::ScaleUnit scaleUnit = std::get(*p.scaleFactor); const DistanceUnit distanceUnit = codegen::map(scaleUnit); - scaleFactor = toMeter(distanceUnit); + scaleFactor = static_cast(toMeter(distanceUnit)); } else if (std::holds_alternative(*p.scaleFactor)) { - scaleFactor = std::get(*p.scaleFactor); + scaleFactor = static_cast(std::get(*p.scaleFactor)); } } diff --git a/modules/base/rotation/constantrotation.cpp b/modules/base/rotation/constantrotation.cpp index 292012ad04..639b4d9e9f 100644 --- a/modules/base/rotation/constantrotation.cpp +++ b/modules/base/rotation/constantrotation.cpp @@ -49,7 +49,7 @@ namespace { // [[codegen::verbatim(RotationInfo.description)]] std::optional rotationAxis [[codegen::inrange(glm::dvec3(-1.0), glm::dvec3(1.0))]]; - + // [[codegen::verbatim(RotationRateInfo.description)]] std::optional rotationRate; }; diff --git a/modules/globebrowsing/globebrowsingmodule_lua.inl b/modules/globebrowsing/globebrowsingmodule_lua.inl index df5170a851..af7d4a8269 100644 --- a/modules/globebrowsing/globebrowsingmodule_lua.inl +++ b/modules/globebrowsing/globebrowsingmodule_lua.inl @@ -284,7 +284,8 @@ namespace { * \param y The y value of the tile index * \param level The level of the tile index */ -[[codegen::luawrap]] void goToChunk(std::string globeIdentifier, int x, int y, int level) { +[[codegen::luawrap]] void goToChunk(std::string globeIdentifier, int x, int y, int level) +{ using namespace openspace; using namespace globebrowsing; @@ -495,8 +496,8 @@ void flyToGeoInternal(std::string globe, double latitude, } /** - * Fly the camera to a geographic coordinate (latitude, longitude and altitude) on a globe, - * using the path navigation system. + * Fly the camera to a geographic coordinate (latitude, longitude and altitude) on a + * globe, using the path navigation system. * * \param globe The identifier of a scene graph node that has a RenderableGlobe attached. * If an empty string is provided, the current anchor node is used diff --git a/modules/globebrowsing/src/layergroup.cpp b/modules/globebrowsing/src/layergroup.cpp index 037f038df4..7d4d4aa64d 100644 --- a/modules/globebrowsing/src/layergroup.cpp +++ b/modules/globebrowsing/src/layergroup.cpp @@ -177,10 +177,6 @@ void LayerGroup::deleteLayer(const std::string& layerName) { // which will no longer be valid once it is deleted removePropertySubOwner(it->get()); (*it)->deinitialize(); - properties::PropertyOwner* layerGroup = it->get()->owner(); - properties::PropertyOwner* layerManager = layerGroup->owner(); - properties::PropertyOwner* globe = layerManager->owner(); - properties::PropertyOwner* sceneGraphNode = globe->owner(); // We need to keep the name of the layer since we only get it as a reference // and the name needs to survive the deletion diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index ceb4822174..e4f95bbec1 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -280,7 +280,7 @@ namespace { std::optional useAccurateNormals; // [[codegen::verbatim(AmbientIntensityInfo.description)]] - std::optional ambientIntensity; + std::optional ambientIntensity; // [[codegen::verbatim(LightSourceNodeInfo.description)]] std::optional lightSourceNode; @@ -289,10 +289,10 @@ namespace { std::optional renderAtDistance; // [[codegen::verbatim(TargetLodScaleFactorInfo.description)]] - std::optional targetLodScaleFactor; + std::optional targetLodScaleFactor; // [[codegen::verbatim(OrenNayarRoughnessInfo.description)]] - std::optional orenNayarRoughness; + std::optional orenNayarRoughness; // A list of layers that should be added to the globe. std::optional> layers diff --git a/modules/multiresvolume/rendering/tsp.cpp b/modules/multiresvolume/rendering/tsp.cpp index 0cacd4cae6..1fcab6636f 100644 --- a/modules/multiresvolume/rendering/tsp.cpp +++ b/modules/multiresvolume/rendering/tsp.cpp @@ -571,11 +571,11 @@ bool TSP::writeCache() { } float TSP::spatialError(unsigned int brickIndex) const { - return *reinterpret_cast(_data[brickIndex*NUM_DATA + SPATIAL_ERR]); + return *reinterpret_cast(&_data[brickIndex*NUM_DATA + SPATIAL_ERR]); } float TSP::temporalError(unsigned int brickIndex) const { - return *reinterpret_cast(_data[brickIndex*NUM_DATA + TEMPORAL_ERR]); + return *reinterpret_cast(&_data[brickIndex*NUM_DATA + TEMPORAL_ERR]); } unsigned int TSP::firstOctreeChild(unsigned int brickIndex) const { diff --git a/modules/volume/tasks/generaterawvolumefromfiletask.cpp b/modules/volume/tasks/generaterawvolumefromfiletask.cpp index 5eb19ebbf8..5052a069be 100644 --- a/modules/volume/tasks/generaterawvolumefromfiletask.cpp +++ b/modules/volume/tasks/generaterawvolumefromfiletask.cpp @@ -71,7 +71,9 @@ documentation::Documentation GenerateRawVolumeFromFileTask::Documentation() { return codegen::doc("generate_raw_volume_task"); } -GenerateRawVolumeFromFileTask::GenerateRawVolumeFromFileTask(const ghoul::Dictionary& dictionary) { +GenerateRawVolumeFromFileTask::GenerateRawVolumeFromFileTask( + const ghoul::Dictionary& dictionary) +{ const Parameters p = codegen::bake(dictionary); _inputFilePath = absPath(p.dataInputPath); @@ -93,7 +95,7 @@ std::string GenerateRawVolumeFromFileTask::description() { ); } -void GenerateRawVolumeFromFileTask::perform(const Task::ProgressCallback& progressCallback) { +void GenerateRawVolumeFromFileTask::perform(const ProgressCallback& progressCallback) { dataloader::Dataset data = dataloader::csv::loadCsvFile(_inputFilePath); progressCallback(0.3f); diff --git a/modules/volume/transferfunction.cpp b/modules/volume/transferfunction.cpp index f07afd4ce8..9c3bf02b83 100644 --- a/modules/volume/transferfunction.cpp +++ b/modules/volume/transferfunction.cpp @@ -71,7 +71,9 @@ bool TransferFunction::setEnvelopesFromLua(lua_State* state) { // lua_pushnil(state); // while (lua_next(state, -2)) { // PrintTable(state); - // std::string color = static_cast(lua_tostring(state, -1)); + // std::string color = static_cast( + // lua_tostring(state, -1) + // ); // lua_pop(state, 1); // lua_pushnil(state); // lua_next(state, -2); diff --git a/modules/volume/volumemodule.cpp b/modules/volume/volumemodule.cpp index 6818fdfcb7..dfc7d0ab00 100644 --- a/modules/volume/volumemodule.cpp +++ b/modules/volume/volumemodule.cpp @@ -49,7 +49,9 @@ void VolumeModule::internalInitialize(const ghoul::Dictionary&) { ghoul::TemplateFactory* tFactory = FactoryManager::ref().factory(); ghoul_assert(tFactory, "No task factory existed"); tFactory->registerClass("GenerateRawVolumeTask"); - tFactory->registerClass("GenerateRawVolumeFromFileTask"); + tFactory->registerClass( + "GenerateRawVolumeFromFileTask" + ); } std::vector VolumeModule::documentations() const { diff --git a/modules/webbrowser/include/browserclient.h b/modules/webbrowser/include/browserclient.h index ef637f4048..962c38a6e2 100644 --- a/modules/webbrowser/include/browserclient.h +++ b/modules/webbrowser/include/browserclient.h @@ -55,7 +55,7 @@ public: bool OnCursorChange(CefRefPtr browser, CefCursorHandle cursor, cef_cursor_type_t type, - const CefCursorInfo& custom_cursor_info) override; + const CefCursorInfo& custom_cursor_info) override; IMPLEMENT_REFCOUNTING(DisplayHandler); }; BrowserClient(WebRenderHandler* handler, WebKeyboardHandler* keyboardHandler); diff --git a/modules/webbrowser/include/webrenderhandler.h b/modules/webbrowser/include/webrenderhandler.h index 6274fce02d..7119b7712a 100644 --- a/modules/webbrowser/include/webrenderhandler.h +++ b/modules/webbrowser/include/webrenderhandler.h @@ -69,7 +69,7 @@ public: // Used when the "shared_texture" flag is set to true for CEF. Uses a shared texture // from CEF that is allocated on another part of the GPU. Skip CPU allocationn for - // better performance. Needs OpenGl 4.5 or higher. + // better performance. Needs OpenGl 4.5 or higher. void OnAcceleratedPaint(CefRefPtr browser, PaintElementType type, const RectList& dirtyRects, const CefAcceleratedPaintInfo& info) override; @@ -78,7 +78,7 @@ public: bool hasContent(int x, int y); bool isTextureReady() const; - void updateTexture(); + void updateTexture(); void bindTexture(); protected: diff --git a/modules/webbrowser/src/browserclient.cpp b/modules/webbrowser/src/browserclient.cpp index 18d4f69f31..bdb6868395 100644 --- a/modules/webbrowser/src/browserclient.cpp +++ b/modules/webbrowser/src/browserclient.cpp @@ -83,9 +83,9 @@ bool BrowserClient::NoContextMenuHandler::RunContextMenu(CefRefPtr, } bool BrowserClient::DisplayHandler::OnCursorChange(CefRefPtr browser, - CefCursorHandle cursor, + CefCursorHandle, cef_cursor_type_t type, - const CefCursorInfo& custom_cursor_info) + const CefCursorInfo&) { WindowDelegate::Cursor newCursor; switch (type) { @@ -101,13 +101,13 @@ bool BrowserClient::DisplayHandler::OnCursorChange(CefRefPtr browser case cef_cursor_type_t::CT_HAND: newCursor = WindowDelegate::Cursor::PointingHand; break; - case cef_cursor_type_t::CT_EASTWESTRESIZE: + case cef_cursor_type_t::CT_EASTWESTRESIZE: case cef_cursor_type_t::CT_COLUMNRESIZE: case cef_cursor_type_t::CT_EASTRESIZE: case cef_cursor_type_t::CT_WESTRESIZE: newCursor = WindowDelegate::Cursor::ResizeEW; break; - case cef_cursor_type_t::CT_NORTHSOUTHRESIZE: + case cef_cursor_type_t::CT_NORTHSOUTHRESIZE: case cef_cursor_type_t::CT_ROWRESIZE: case cef_cursor_type_t::CT_NORTHRESIZE: case cef_cursor_type_t::CT_SOUTHRESIZE: diff --git a/modules/webbrowser/src/webrenderhandler.cpp b/modules/webbrowser/src/webrenderhandler.cpp index a6388cde1f..38c11b4aea 100644 --- a/modules/webbrowser/src/webrenderhandler.cpp +++ b/modules/webbrowser/src/webrenderhandler.cpp @@ -117,7 +117,7 @@ void WebRenderHandler::OnPaint(CefRefPtr, CefRenderHandler::PaintEle } void WebRenderHandler::OnAcceleratedPaint(CefRefPtr browser, - PaintElementType type, + PaintElementType, const RectList& dirtyRects, const CefAcceleratedPaintInfo& info) { @@ -135,7 +135,7 @@ void WebRenderHandler::OnAcceleratedPaint(CefRefPtr browser, // @TODO (ylvse 2024-08-20): minimizing window should be handled with the appropriate // function in the CefBrowser called WasHidden if (dirtyRects[0].height <= 1 || dirtyRects[0].width <= 1) { - return; + return; } // This function is called asynchronously after a reshape which means we have to check // for what we request. Validate the size. This prevents rendering a texture with the diff --git a/src/interaction/keyframerecording.cpp b/src/interaction/keyframerecording.cpp index bdc3919dc3..88d33e49d0 100644 --- a/src/interaction/keyframerecording.cpp +++ b/src/interaction/keyframerecording.cpp @@ -345,7 +345,7 @@ void KeyframeRecording::preSynchronization(double dt) { SceneGraphNode* node = scene->sceneGraphNode(curr.focusNode); global::navigationHandler->orbitalNavigator().setFocusNode(node); - bool success = interaction::KeyframeNavigator::updateCamera( + interaction::KeyframeNavigator::updateCamera( global::navigationHandler->camera(), curr, next, diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index 1a516c7c27..d1b2322c04 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -2088,13 +2088,14 @@ bool SessionRecording::processCameraKeyframe(double now) { global::navigationHandler->orbitalNavigator().setFocusNode(n->identifier()); } - return interaction::KeyframeNavigator::updateCamera( + interaction::KeyframeNavigator::updateCamera( global::navigationHandler->camera(), prevPose, nextPose, t, _ignoreRecordedScale ); + return true; } bool SessionRecording::processScriptKeyframe() { diff --git a/src/navigation/keyframenavigator.cpp b/src/navigation/keyframenavigator.cpp index 1e62597f17..571f7e82bc 100644 --- a/src/navigation/keyframenavigator.cpp +++ b/src/navigation/keyframenavigator.cpp @@ -45,12 +45,12 @@ KeyframeNavigator::CameraPose::CameraPose(datamessagestructures::CameraKeyframe& , followFocusNodeRotation(kf._followNodeRotation) {} -bool KeyframeNavigator::updateCamera(Camera& camera, bool ignoreFutureKeyframes) { +void KeyframeNavigator::updateCamera(Camera& camera, bool ignoreFutureKeyframes) { const double now = currentTime(); bool foundPrevKeyframe = false; if (_cameraPoseTimeline.nKeyframes() == 0) { - return false; + return; } const Keyframe* nextKeyframe = @@ -66,7 +66,7 @@ bool KeyframeNavigator::updateCamera(Camera& camera, bool ignoreFutureKeyframes) if (ignoreFutureKeyframes) { _cameraPoseTimeline.removeKeyframesBefore(now); } - return false; + return; } double prevTime = 0.0; @@ -87,14 +87,12 @@ bool KeyframeNavigator::updateCamera(Camera& camera, bool ignoreFutureKeyframes) const CameraPose nextPose = nextKeyframe->data; _cameraPoseTimeline.removeKeyframesBefore(prevTime); - if (!foundPrevKeyframe && ignoreFutureKeyframes) { - return false; + if (foundPrevKeyframe || !ignoreFutureKeyframes) { + updateCamera(&camera, prevPose, nextPose, t, ignoreFutureKeyframes); } - - return updateCamera(&camera, prevPose, nextPose, t, ignoreFutureKeyframes); } -bool KeyframeNavigator::updateCamera(Camera* camera, const CameraPose& prevPose, +void KeyframeNavigator::updateCamera(Camera* camera, const CameraPose& prevPose, const CameraPose& nextPose, double t, bool ignoreFutureKeyframes) { @@ -103,7 +101,7 @@ bool KeyframeNavigator::updateCamera(Camera* camera, const CameraPose& prevPose, SceneGraphNode* nextFocusNode = scene->sceneGraphNode(nextPose.focusNode); if (!prevFocusNode || !nextFocusNode) { - return false; + return; } glm::dvec3 prevKeyframeCameraPosition = prevPose.position; @@ -158,8 +156,6 @@ bool KeyframeNavigator::updateCamera(Camera* camera, const CameraPose& prevPose, ); camera->setScaling(1.f / glm::exp(interpolatedInvScaleExp)); } - - return true; } double KeyframeNavigator::currentTime() const { diff --git a/src/navigation/path.cpp b/src/navigation/path.cpp index 4a89772f36..99cc50305a 100644 --- a/src/navigation/path.cpp +++ b/src/navigation/path.cpp @@ -355,8 +355,8 @@ glm::dquat Path::linearPathRotation(double) const { //const double tHalf = 0.5; //if (t < tHalf) { // // Interpolate to look at target - // const glm::dvec3 halfWayPosition = _curve->positionAt(tHalf); - // const glm::dquat q = ghoul::lookAtQuaternion(halfWayPosition, endNodePos, endUp); + // const glm::dvec3 halfWayPos = _curve->positionAt(tHalf); + // const glm::dquat q = ghoul::lookAtQuaternion(halfWayPos, endNodePos, endUp); // const double tScaled = ghoul::sineEaseInOut(t / tHalf); // return glm::slerp(_start.rotation(), q, tScaled); @@ -375,13 +375,18 @@ glm::dquat Path::linearPathRotation(double) const { //if (distanceToEnd < closingUpDistance) { // // Interpolate to target rotation - // const double tScaled = ghoul::sineEaseInOut(1.0 - distanceToEnd / closingUpDistance); + // const double tScaled = + // ghoul::sineEaseInOut(1.0 - distanceToEnd / closingUpDistance); // // Compute a position in front of the camera at the end orientation // const double inFrontDistance = glm::distance(_end.position(), endNodePos); // const glm::dvec3 viewDir = ghoul::viewDirection(_end.rotation()); // const glm::dvec3 inFrontOfEnd = _end.position() + inFrontDistance * viewDir; - // const glm::dvec3 lookAtPos = ghoul::interpolateLinear(tScaled, endNodePos, inFrontOfEnd); + // const glm::dvec3 lookAtPos = ghoul::interpolateLinear( + // tScaled, + // endNodePos, + // inFrontOfEnd + // ); // return ghoul::lookAtQuaternion(_prevPose.position, lookAtPos, endUp); //} diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index e74ea97172..b1dd345960 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -334,7 +334,7 @@ namespace { // // The nodes without a given value will be placed at the bottom of the list // and sorted alphabetically. - std::optional orderingNumber; + std::optional orderingNumber; }; // Additional information that is passed to GUI applications. These are all hints // and do not have any impact on the actual function of the scene graph node