From 01cd85f93fbc9c06771546cbe2a91e647d33f523 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Sat, 21 May 2022 00:39:36 -0700 Subject: [PATCH 1/9] Migrate 'namespace ignition' -> 'namespace gz' ~~~ sed -i -e 's@namespace ignition@namespace gz@g' \ $(grep -rlI 'namespace ignition' .) ~~~ Signed-off-by: Steve Peters --- av/include/gz/common/AudioDecoder.hh | 2 +- av/include/gz/common/HWEncoder.hh | 2 +- av/include/gz/common/HWVideo.hh | 2 +- av/include/gz/common/Video.hh | 2 +- av/include/gz/common/VideoEncoder.hh | 2 +- av/include/gz/common/av/Util.hh | 2 +- av/include/gz/common/ffmpeg_inc.hh | 2 +- av/src/AudioDecoder.cc | 2 +- av/src/AudioDecoder_TEST.cc | 2 +- av/src/HWEncoder.cc | 2 +- av/src/Video.cc | 2 +- av/src/VideoEncoder.cc | 2 +- av/src/VideoEncoder_TEST.cc | 2 +- av/src/ffmpeg_inc.cc | 2 +- events/include/gz/common/Event.hh | 2 +- events/include/gz/common/KeyEvent.hh | 2 +- events/include/gz/common/MouseEvent.hh | 2 +- events/include/gz/common/events/Types.hh | 2 +- events/src/Event.cc | 2 +- events/src/Event_TEST.cc | 2 +- events/src/KeyEvent.cc | 2 +- events/src/KeyEvent_TEST.cc | 2 +- events/src/MouseEvent.cc | 2 +- events/src/MouseEvent_TEST.cc | 2 +- examples/events.cc | 2 +- geospatial/include/gz/common/geospatial/Dem.hh | 2 +- geospatial/include/gz/common/geospatial/HeightmapData.hh | 2 +- geospatial/include/gz/common/geospatial/ImageHeightmap.hh | 2 +- geospatial/src/Dem.cc | 2 +- geospatial/src/Dem_TEST.cc | 2 +- geospatial/src/ImageHeightmap.cc | 2 +- geospatial/src/ImageHeightmap_TEST.cc | 2 +- graphics/include/gz/common/Animation.hh | 2 +- graphics/include/gz/common/BVHLoader.hh | 2 +- graphics/include/gz/common/ColladaExporter.hh | 2 +- graphics/include/gz/common/ColladaLoader.hh | 2 +- graphics/include/gz/common/GTSMeshUtils.hh | 2 +- graphics/include/gz/common/Image.hh | 2 +- graphics/include/gz/common/KeyFrame.hh | 2 +- graphics/include/gz/common/Material.hh | 2 +- graphics/include/gz/common/Mesh.hh | 2 +- graphics/include/gz/common/MeshCSG.hh | 2 +- graphics/include/gz/common/MeshExporter.hh | 2 +- graphics/include/gz/common/MeshLoader.hh | 2 +- graphics/include/gz/common/MeshManager.hh | 2 +- graphics/include/gz/common/NodeAnimation.hh | 2 +- graphics/include/gz/common/NodeTransform.hh | 2 +- graphics/include/gz/common/OBJLoader.hh | 2 +- graphics/include/gz/common/Pbr.hh | 2 +- graphics/include/gz/common/STLLoader.hh | 2 +- graphics/include/gz/common/SVGLoader.hh | 2 +- graphics/include/gz/common/Skeleton.hh | 2 +- graphics/include/gz/common/SkeletonAnimation.hh | 2 +- graphics/include/gz/common/SkeletonNode.hh | 2 +- graphics/include/gz/common/SubMesh.hh | 2 +- graphics/include/gz/common/graphics/Types.hh | 2 +- graphics/src/Animation.cc | 6 +++--- graphics/src/Animation_TEST.cc | 2 +- graphics/src/BVHLoader.cc | 2 +- graphics/src/ColladaExporter.cc | 2 +- graphics/src/ColladaExporter_TEST.cc | 2 +- graphics/src/ColladaLoader.cc | 4 ++-- graphics/src/ColladaLoader_TEST.cc | 2 +- graphics/src/GTSMeshUtils.cc | 2 +- graphics/src/GTSMeshUtils_TEST.cc | 2 +- graphics/src/Image.cc | 4 ++-- graphics/src/Image_TEST.cc | 2 +- graphics/src/KeyFrame.cc | 4 ++-- graphics/src/Material.cc | 2 +- graphics/src/Material_TEST.cc | 2 +- graphics/src/Mesh.cc | 2 +- graphics/src/MeshCSG.cc | 2 +- graphics/src/MeshExporter.cc | 2 +- graphics/src/MeshManager.cc | 2 +- graphics/src/MeshManager_TEST.cc | 2 +- graphics/src/Mesh_TEST.cc | 2 +- graphics/src/NodeAnimation.cc | 2 +- graphics/src/NodeTransform.cc | 2 +- graphics/src/OBJLoader.cc | 4 ++-- graphics/src/OBJLoader_TEST.cc | 2 +- graphics/src/Pbr.cc | 2 +- graphics/src/STLLoader.cc | 2 +- graphics/src/SVGLoader.cc | 2 +- graphics/src/SVGLoader_TEST.cc | 2 +- graphics/src/Skeleton.cc | 2 +- graphics/src/SkeletonAnimation.cc | 2 +- graphics/src/SkeletonNode.cc | 2 +- graphics/src/SubMesh.cc | 2 +- graphics/src/SubMesh_TEST.cc | 2 +- graphics/src/tiny_obj_loader.h | 8 ++++---- graphics/src/tinyxml2/tinyxml2.cpp | 2 +- graphics/src/tinyxml2/tinyxml2.h | 2 +- include/gz/common/Base64.hh | 2 +- include/gz/common/Battery.hh | 2 +- include/gz/common/Console.hh | 2 +- include/gz/common/EnumIface.hh | 2 +- include/gz/common/Filesystem.hh | 2 +- include/gz/common/FlagSet.hh | 2 +- include/gz/common/MaterialDensity.hh | 2 +- include/gz/common/MovingWindowFilter.hh | 2 +- include/gz/common/Plugin.hh | 2 +- include/gz/common/PluginInfo.hh | 2 +- include/gz/common/PluginLoader.hh | 2 +- include/gz/common/PluginPtr.hh | 2 +- include/gz/common/SignalHandler.hh | 2 +- include/gz/common/SingletonT.hh | 2 +- include/gz/common/SpecializedPlugin.hh | 2 +- include/gz/common/SpecializedPluginPtr.hh | 2 +- include/gz/common/StringUtils.hh | 2 +- include/gz/common/SystemPaths.hh | 2 +- include/gz/common/TempDirectory.hh | 4 ++-- include/gz/common/TemplateHelpers.hh | 2 +- include/gz/common/Timer.hh | 2 +- include/gz/common/URI.hh | 2 +- include/gz/common/Util.hh | 2 +- include/gz/common/Uuid.hh | 2 +- include/gz/common/WorkerPool.hh | 2 +- include/gz/common/detail/Plugin.hh | 2 +- include/gz/common/detail/PluginLoader.hh | 2 +- include/gz/common/detail/PluginPtr.hh | 2 +- include/gz/common/detail/SpecializedPlugin.hh | 2 +- include/gz/common/detail/TemplateHelpers.hh | 2 +- profiler/include/gz/common/Profiler.hh | 2 +- profiler/src/Profiler.cc | 2 +- profiler/src/ProfilerImpl.hh | 2 +- profiler/src/Profiler_Disabled_TEST.cc | 2 +- profiler/src/Profiler_Remotery_TEST.cc | 2 +- profiler/src/RemoteryProfilerImpl.cc | 2 +- profiler/src/RemoteryProfilerImpl.hh | 2 +- src/Base64.cc | 2 +- src/Base64_TEST.cc | 2 +- src/Battery.cc | 2 +- src/Battery_TEST.cc | 2 +- src/Console.cc | 2 +- src/Console_TEST.cc | 4 ++-- src/DirIter.cc | 4 ++-- src/EnumIface_TEST.cc | 2 +- src/Filesystem_TEST.cc | 2 +- src/FlagSet_TEST.cc | 6 +++--- src/MaterialDensity.cc | 2 +- src/MaterialDensity_TEST.cc | 2 +- src/MovingWindowFilter_TEST.cc | 2 +- src/Plugin.cc | 2 +- src/PluginLoader.cc | 2 +- src/PluginUtils.hh | 2 +- src/PluginUtils_TEST.cc | 2 +- src/PrintWindowsSystemWarning.hh | 2 +- src/SignalHandler.cc | 2 +- src/SignalHandler_TEST.cc | 2 +- src/StringUtils.cc | 2 +- src/StringUtils_TEST.cc | 2 +- src/SystemPaths.cc | 2 +- src/SystemPaths_TEST.cc | 2 +- src/TempDirectory.cc | 2 +- src/TemplateHelpers_TEST.cc | 2 +- src/Timer.cc | 2 +- src/URI.cc | 2 +- src/URI_TEST.cc | 2 +- src/Util_TEST.cc | 2 +- src/Uuid.cc | 2 +- src/Uuid_TEST.cc | 2 +- src/WorkerPool.cc | 2 +- test/integration/encoder_timing.cc | 2 +- test/integration/mesh.cc | 2 +- test/integration/video_encoder.cc | 2 +- testing/include/gz/common/testing/AutoLogFixture.hh | 4 ++-- testing/include/gz/common/testing/BazelTestPaths.hh | 4 ++-- testing/include/gz/common/testing/CMakeTestPaths.hh | 4 ++-- testing/include/gz/common/testing/TestPaths.hh | 4 ++-- testing/include/gz/common/testing/Utils.hh | 4 ++-- .../include/gz/common/testing/detail/AutoLogFixture.hh | 4 ++-- testing/src/AutoLogFixture_TEST.cc | 4 ++-- testing/src/BazelTestPaths.cc | 4 ++-- testing/src/BazelTestPaths_TEST.cc | 2 +- testing/src/CMakeTestPaths.cc | 4 ++-- testing/src/CMakeTestPaths_TEST.cc | 4 ++-- testing/src/TestPaths.cc | 4 ++-- testing/src/Utils.cc | 4 ++-- testing/src/Utils_TEST.cc | 4 ++-- 179 files changed, 206 insertions(+), 206 deletions(-) diff --git a/av/include/gz/common/AudioDecoder.hh b/av/include/gz/common/AudioDecoder.hh index d6a864ee1..1cd43746d 100644 --- a/av/include/gz/common/AudioDecoder.hh +++ b/av/include/gz/common/AudioDecoder.hh @@ -23,7 +23,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/av/include/gz/common/HWEncoder.hh b/av/include/gz/common/HWEncoder.hh index 8a857434b..3b0d7e5ed 100644 --- a/av/include/gz/common/HWEncoder.hh +++ b/av/include/gz/common/HWEncoder.hh @@ -27,7 +27,7 @@ /// This is an internal-use only class encapsulating HW video encoding. All /// symbols defined here are hidden from the public API. -namespace ignition::common +namespace gz::common { /// \brief Representation of a GPU video encoder and its configuration. /// \note This class is intentionally hidden as it provides highly customized diff --git a/av/include/gz/common/HWVideo.hh b/av/include/gz/common/HWVideo.hh index 3576b1ae5..908a10c26 100644 --- a/av/include/gz/common/HWVideo.hh +++ b/av/include/gz/common/HWVideo.hh @@ -18,7 +18,7 @@ #include -namespace ignition::common +namespace gz::common { enum class IGNITION_COMMON_AV_VISIBLE HWEncoderType { diff --git a/av/include/gz/common/Video.hh b/av/include/gz/common/Video.hh index a6857d369..0bf3d6344 100644 --- a/av/include/gz/common/Video.hh +++ b/av/include/gz/common/Video.hh @@ -28,7 +28,7 @@ struct AVFrame; struct AVPicture; struct SwsContext; -namespace ignition +namespace gz { namespace common { diff --git a/av/include/gz/common/VideoEncoder.hh b/av/include/gz/common/VideoEncoder.hh index acc60b2c4..1956593f5 100644 --- a/av/include/gz/common/VideoEncoder.hh +++ b/av/include/gz/common/VideoEncoder.hh @@ -34,7 +34,7 @@ #define VIDEO_ENCODER_FPS_DEFAULT 25 #define VIDEO_ENCODER_FORMAT_DEFAULT "mp4" -namespace ignition +namespace gz { namespace common { diff --git a/av/include/gz/common/av/Util.hh b/av/include/gz/common/av/Util.hh index 58d3ad756..8bc433b28 100644 --- a/av/include/gz/common/av/Util.hh +++ b/av/include/gz/common/av/Util.hh @@ -18,7 +18,7 @@ #ifndef GZ_COMMON_AV_UTIL_HH_ #define GZ_COMMON_AV_UTIL_HH_ -namespace ignition +namespace gz { namespace common { diff --git a/av/include/gz/common/ffmpeg_inc.hh b/av/include/gz/common/ffmpeg_inc.hh index 5ca16c5a9..f5d162a33 100644 --- a/av/include/gz/common/ffmpeg_inc.hh +++ b/av/include/gz/common/ffmpeg_inc.hh @@ -51,7 +51,7 @@ extern "C" { #include -namespace ignition +namespace gz { namespace common { diff --git a/av/src/AudioDecoder.cc b/av/src/AudioDecoder.cc index 4ff2b237f..484c93b6d 100644 --- a/av/src/AudioDecoder.cc +++ b/av/src/AudioDecoder.cc @@ -23,7 +23,7 @@ #define AUDIO_INBUF_SIZE (20480 * 2) #define AUDIO_REFILL_THRESH 4096 -using namespace ignition; +using namespace gz; using namespace common; class ignition::common::AudioDecoder::Implementation diff --git a/av/src/AudioDecoder_TEST.cc b/av/src/AudioDecoder_TEST.cc index 367eefd6e..3aa4e45e2 100644 --- a/av/src/AudioDecoder_TEST.cc +++ b/av/src/AudioDecoder_TEST.cc @@ -20,7 +20,7 @@ #include #include -using namespace ignition; +using namespace gz; ///////////////////////////////////////////////// TEST(AudioDecoder, FileNotSet) diff --git a/av/src/HWEncoder.cc b/av/src/HWEncoder.cc index 63e4dbc20..a117102f6 100644 --- a/av/src/HWEncoder.cc +++ b/av/src/HWEncoder.cc @@ -25,7 +25,7 @@ #include "ignition/common/StringUtils.hh" #include "ignition/common/Console.hh" -using namespace ignition; +using namespace gz; using namespace common; using namespace std; diff --git a/av/src/Video.cc b/av/src/Video.cc index 68fb469f6..2e055c5d7 100644 --- a/av/src/Video.cc +++ b/av/src/Video.cc @@ -20,7 +20,7 @@ #include "ignition/common/Video.hh" #include "ignition/common/av/Util.hh" -using namespace ignition; +using namespace gz; using namespace common; // Private data structure for the Video class diff --git a/av/src/VideoEncoder.cc b/av/src/VideoEncoder.cc index 05a26c911..3925b4894 100644 --- a/av/src/VideoEncoder.cc +++ b/av/src/VideoEncoder.cc @@ -28,7 +28,7 @@ #include "ignition/common/HWEncoder.hh" #endif -using namespace ignition; +using namespace gz; using namespace common; using namespace std; diff --git a/av/src/VideoEncoder_TEST.cc b/av/src/VideoEncoder_TEST.cc index 8f376edef..5b7d8aea2 100644 --- a/av/src/VideoEncoder_TEST.cc +++ b/av/src/VideoEncoder_TEST.cc @@ -21,7 +21,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" #include "ignition/common/testing/TestPaths.hh" -using namespace ignition; +using namespace gz; using namespace common; class VideoEncoderTest : public common::testing::AutoLogFixture diff --git a/av/src/ffmpeg_inc.cc b/av/src/ffmpeg_inc.cc index 2899b2ca9..c6004a909 100644 --- a/av/src/ffmpeg_inc.cc +++ b/av/src/ffmpeg_inc.cc @@ -16,7 +16,7 @@ */ #include "ignition/common/ffmpeg_inc.hh" -using namespace ignition; +using namespace gz; ////////////////////////////////////////////////// AVFrame *common::AVFrameAlloc(void) diff --git a/events/include/gz/common/Event.hh b/events/include/gz/common/Event.hh index d814b445e..cfbdfdd3d 100644 --- a/events/include/gz/common/Event.hh +++ b/events/include/gz/common/Event.hh @@ -29,7 +29,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/events/include/gz/common/KeyEvent.hh b/events/include/gz/common/KeyEvent.hh index 0b1c2297b..65eaaa101 100644 --- a/events/include/gz/common/KeyEvent.hh +++ b/events/include/gz/common/KeyEvent.hh @@ -23,7 +23,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/events/include/gz/common/MouseEvent.hh b/events/include/gz/common/MouseEvent.hh index c31e3097a..b9116d8d4 100644 --- a/events/include/gz/common/MouseEvent.hh +++ b/events/include/gz/common/MouseEvent.hh @@ -23,7 +23,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/events/include/gz/common/events/Types.hh b/events/include/gz/common/events/Types.hh index f1ba2544f..39aacfef6 100644 --- a/events/include/gz/common/events/Types.hh +++ b/events/include/gz/common/events/Types.hh @@ -21,7 +21,7 @@ #include // This header contains forward declarations for some event types -namespace ignition +namespace gz { namespace common { diff --git a/events/src/Event.cc b/events/src/Event.cc index b4a24a71d..7b6022bd8 100644 --- a/events/src/Event.cc +++ b/events/src/Event.cc @@ -18,7 +18,7 @@ #include "ignition/common/Console.hh" #include "ignition/common/Event.hh" -using namespace ignition; +using namespace gz; using namespace common; ////////////////////////////////////////////////// diff --git a/events/src/Event_TEST.cc b/events/src/Event_TEST.cc index a3ee29e96..85a2f7014 100644 --- a/events/src/Event_TEST.cc +++ b/events/src/Event_TEST.cc @@ -23,7 +23,7 @@ #include #include -using namespace ignition; +using namespace gz; class EventTest : public common::testing::AutoLogFixture { }; diff --git a/events/src/KeyEvent.cc b/events/src/KeyEvent.cc index 8686600cd..2ad8dca77 100644 --- a/events/src/KeyEvent.cc +++ b/events/src/KeyEvent.cc @@ -16,7 +16,7 @@ */ #include "ignition/common/KeyEvent.hh" -using namespace ignition; +using namespace gz; using namespace common; class ignition::common::KeyEventPrivate diff --git a/events/src/KeyEvent_TEST.cc b/events/src/KeyEvent_TEST.cc index cd9d1fe60..e8f693578 100644 --- a/events/src/KeyEvent_TEST.cc +++ b/events/src/KeyEvent_TEST.cc @@ -18,7 +18,7 @@ #include #include "ignition/common/KeyEvent.hh" -using namespace ignition; +using namespace gz; using namespace common; ///////////////////////////////////////////////// diff --git a/events/src/MouseEvent.cc b/events/src/MouseEvent.cc index 4d9628401..87008f2d5 100644 --- a/events/src/MouseEvent.cc +++ b/events/src/MouseEvent.cc @@ -18,7 +18,7 @@ #include #include "ignition/common/MouseEvent.hh" -using namespace ignition; +using namespace gz; using namespace common; /// \brief Mouse event private data diff --git a/events/src/MouseEvent_TEST.cc b/events/src/MouseEvent_TEST.cc index 59db03c12..559d1ce81 100644 --- a/events/src/MouseEvent_TEST.cc +++ b/events/src/MouseEvent_TEST.cc @@ -21,7 +21,7 @@ #include "ignition/common/MouseEvent.hh" #include "ignition/common/config.hh" -using namespace ignition; +using namespace gz; class MouseEvent : public common::testing::AutoLogFixture { }; diff --git a/examples/events.cc b/examples/events.cc index 82276813c..ddba9b85c 100644 --- a/examples/events.cc +++ b/examples/events.cc @@ -19,7 +19,7 @@ #include #include -using namespace ignition; +using namespace gz; int g_callback = 0; common::EventT g_event; diff --git a/geospatial/include/gz/common/geospatial/Dem.hh b/geospatial/include/gz/common/geospatial/Dem.hh index c992cf49a..720b58c52 100644 --- a/geospatial/include/gz/common/geospatial/Dem.hh +++ b/geospatial/include/gz/common/geospatial/Dem.hh @@ -30,7 +30,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/geospatial/include/gz/common/geospatial/HeightmapData.hh b/geospatial/include/gz/common/geospatial/HeightmapData.hh index 9d261f946..30d982cb6 100644 --- a/geospatial/include/gz/common/geospatial/HeightmapData.hh +++ b/geospatial/include/gz/common/geospatial/HeightmapData.hh @@ -22,7 +22,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/geospatial/include/gz/common/geospatial/ImageHeightmap.hh b/geospatial/include/gz/common/geospatial/ImageHeightmap.hh index 4144371c1..de4657d9e 100644 --- a/geospatial/include/gz/common/geospatial/ImageHeightmap.hh +++ b/geospatial/include/gz/common/geospatial/ImageHeightmap.hh @@ -26,7 +26,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/geospatial/src/Dem.cc b/geospatial/src/Dem.cc index f004d7e7b..2e77349c6 100644 --- a/geospatial/src/Dem.cc +++ b/geospatial/src/Dem.cc @@ -24,7 +24,7 @@ #include "ignition/common/geospatial/Dem.hh" #include "ignition/math/SphericalCoordinates.hh" -using namespace ignition; +using namespace gz; using namespace common; class ignition::common::Dem::Implementation diff --git a/geospatial/src/Dem_TEST.cc b/geospatial/src/Dem_TEST.cc index 69b2cbe61..9cd48db56 100644 --- a/geospatial/src/Dem_TEST.cc +++ b/geospatial/src/Dem_TEST.cc @@ -25,7 +25,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" #include "ignition/common/testing/TestPaths.hh" -using namespace ignition; +using namespace gz; class DemTest : public common::testing::AutoLogFixture { }; diff --git a/geospatial/src/ImageHeightmap.cc b/geospatial/src/ImageHeightmap.cc index 3dc30cf30..55d039e8b 100644 --- a/geospatial/src/ImageHeightmap.cc +++ b/geospatial/src/ImageHeightmap.cc @@ -17,7 +17,7 @@ #include "ignition/common/Console.hh" #include "ignition/common/geospatial/ImageHeightmap.hh" -using namespace ignition; +using namespace gz; using namespace common; ////////////////////////////////////////////////// diff --git a/geospatial/src/ImageHeightmap_TEST.cc b/geospatial/src/ImageHeightmap_TEST.cc index ab14d197b..547713194 100644 --- a/geospatial/src/ImageHeightmap_TEST.cc +++ b/geospatial/src/ImageHeightmap_TEST.cc @@ -23,7 +23,7 @@ #define ELEVATION_TOL 1e-8 -using namespace ignition; +using namespace gz; class ImageHeightmapTest : public common::testing::AutoLogFixture { }; diff --git a/graphics/include/gz/common/Animation.hh b/graphics/include/gz/common/Animation.hh index 6a7cb9944..6185d0608 100644 --- a/graphics/include/gz/common/Animation.hh +++ b/graphics/include/gz/common/Animation.hh @@ -29,7 +29,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/BVHLoader.hh b/graphics/include/gz/common/BVHLoader.hh index 98d7660ab..70302a6a4 100644 --- a/graphics/include/gz/common/BVHLoader.hh +++ b/graphics/include/gz/common/BVHLoader.hh @@ -23,7 +23,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/ColladaExporter.hh b/graphics/include/gz/common/ColladaExporter.hh index 4f59dd933..5bb22964b 100644 --- a/graphics/include/gz/common/ColladaExporter.hh +++ b/graphics/include/gz/common/ColladaExporter.hh @@ -29,7 +29,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/ColladaLoader.hh b/graphics/include/gz/common/ColladaLoader.hh index a0dd39748..0760ac35a 100644 --- a/graphics/include/gz/common/ColladaLoader.hh +++ b/graphics/include/gz/common/ColladaLoader.hh @@ -23,7 +23,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/GTSMeshUtils.hh b/graphics/include/gz/common/GTSMeshUtils.hh index a14bdec87..ee3ec6f81 100644 --- a/graphics/include/gz/common/GTSMeshUtils.hh +++ b/graphics/include/gz/common/GTSMeshUtils.hh @@ -27,7 +27,7 @@ struct _GtsSurface; typedef _GtsSurface GtsSurface; -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/Image.hh b/graphics/include/gz/common/Image.hh index fabc61f23..0080f7eba 100644 --- a/graphics/include/gz/common/Image.hh +++ b/graphics/include/gz/common/Image.hh @@ -27,7 +27,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/KeyFrame.hh b/graphics/include/gz/common/KeyFrame.hh index e7829221e..e637ed729 100644 --- a/graphics/include/gz/common/KeyFrame.hh +++ b/graphics/include/gz/common/KeyFrame.hh @@ -25,7 +25,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/Material.hh b/graphics/include/gz/common/Material.hh index a5285f7e3..00dcaabfb 100644 --- a/graphics/include/gz/common/Material.hh +++ b/graphics/include/gz/common/Material.hh @@ -28,7 +28,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/Mesh.hh b/graphics/include/gz/common/Mesh.hh index 391d82bd7..efa28add7 100644 --- a/graphics/include/gz/common/Mesh.hh +++ b/graphics/include/gz/common/Mesh.hh @@ -29,7 +29,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/MeshCSG.hh b/graphics/include/gz/common/MeshCSG.hh index 56be57029..37b95c615 100644 --- a/graphics/include/gz/common/MeshCSG.hh +++ b/graphics/include/gz/common/MeshCSG.hh @@ -26,7 +26,7 @@ typedef _GtsSurface GtsSurface; struct _GPtrArray; typedef _GPtrArray GPtrArray; -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/MeshExporter.hh b/graphics/include/gz/common/MeshExporter.hh index 2372b14a1..df416ae5d 100644 --- a/graphics/include/gz/common/MeshExporter.hh +++ b/graphics/include/gz/common/MeshExporter.hh @@ -20,7 +20,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/MeshLoader.hh b/graphics/include/gz/common/MeshLoader.hh index 598feda61..bed8aec42 100644 --- a/graphics/include/gz/common/MeshLoader.hh +++ b/graphics/include/gz/common/MeshLoader.hh @@ -21,7 +21,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/MeshManager.hh b/graphics/include/gz/common/MeshManager.hh index ecdb51e4e..964c81765 100644 --- a/graphics/include/gz/common/MeshManager.hh +++ b/graphics/include/gz/common/MeshManager.hh @@ -36,7 +36,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/NodeAnimation.hh b/graphics/include/gz/common/NodeAnimation.hh index 48d3048a8..a7821d993 100644 --- a/graphics/include/gz/common/NodeAnimation.hh +++ b/graphics/include/gz/common/NodeAnimation.hh @@ -27,7 +27,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/NodeTransform.hh b/graphics/include/gz/common/NodeTransform.hh index 26b0e691a..07e74a7bc 100644 --- a/graphics/include/gz/common/NodeTransform.hh +++ b/graphics/include/gz/common/NodeTransform.hh @@ -27,7 +27,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/OBJLoader.hh b/graphics/include/gz/common/OBJLoader.hh index 4018d714a..0cb6bd5ee 100644 --- a/graphics/include/gz/common/OBJLoader.hh +++ b/graphics/include/gz/common/OBJLoader.hh @@ -26,7 +26,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/Pbr.hh b/graphics/include/gz/common/Pbr.hh index 00768a6c9..edf1bed70 100644 --- a/graphics/include/gz/common/Pbr.hh +++ b/graphics/include/gz/common/Pbr.hh @@ -23,7 +23,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/STLLoader.hh b/graphics/include/gz/common/STLLoader.hh index ab243ca3d..99d580fd0 100644 --- a/graphics/include/gz/common/STLLoader.hh +++ b/graphics/include/gz/common/STLLoader.hh @@ -30,7 +30,7 @@ #define ORDER_MAX 10 #define FACE_MAX 200000 -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/SVGLoader.hh b/graphics/include/gz/common/SVGLoader.hh index 88af0d17e..9ab56c7b7 100644 --- a/graphics/include/gz/common/SVGLoader.hh +++ b/graphics/include/gz/common/SVGLoader.hh @@ -29,7 +29,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/Skeleton.hh b/graphics/include/gz/common/Skeleton.hh index 939efaeb6..e602c579d 100644 --- a/graphics/include/gz/common/Skeleton.hh +++ b/graphics/include/gz/common/Skeleton.hh @@ -29,7 +29,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/SkeletonAnimation.hh b/graphics/include/gz/common/SkeletonAnimation.hh index ceab7e362..f4c771590 100644 --- a/graphics/include/gz/common/SkeletonAnimation.hh +++ b/graphics/include/gz/common/SkeletonAnimation.hh @@ -29,7 +29,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/SkeletonNode.hh b/graphics/include/gz/common/SkeletonNode.hh index df18bf3d9..f14cfa3de 100644 --- a/graphics/include/gz/common/SkeletonNode.hh +++ b/graphics/include/gz/common/SkeletonNode.hh @@ -26,7 +26,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/SubMesh.hh b/graphics/include/gz/common/SubMesh.hh index 25eb31fd4..acb91cf6b 100644 --- a/graphics/include/gz/common/SubMesh.hh +++ b/graphics/include/gz/common/SubMesh.hh @@ -30,7 +30,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/graphics/include/gz/common/graphics/Types.hh b/graphics/include/gz/common/graphics/Types.hh index f1202d2ea..569639007 100644 --- a/graphics/include/gz/common/graphics/Types.hh +++ b/graphics/include/gz/common/graphics/Types.hh @@ -21,7 +21,7 @@ #include // This header contains forward declarations for some graphics types -namespace ignition +namespace gz { namespace common { diff --git a/graphics/src/Animation.cc b/graphics/src/Animation.cc index ca4e762a1..cc6c32856 100644 --- a/graphics/src/Animation.cc +++ b/graphics/src/Animation.cc @@ -24,7 +24,7 @@ #include #include -using namespace ignition; +using namespace gz; using namespace common; using KeyFrame_V = std::vector>; @@ -56,7 +56,7 @@ namespace } ///////////////////////////////////////////////// -namespace ignition { +namespace gz { namespace common { class Animation::Implementation @@ -552,5 +552,5 @@ void TrajectoryInfo::SetWaypoints( this->dataPtr->waypoints = anim; this->dataPtr->translated = true; } -} // namespace ignition +} // namespace gz } // namespace common diff --git a/graphics/src/Animation_TEST.cc b/graphics/src/Animation_TEST.cc index 216bb43c8..793df6461 100644 --- a/graphics/src/Animation_TEST.cc +++ b/graphics/src/Animation_TEST.cc @@ -24,7 +24,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; class AnimationTest : public common::testing::AutoLogFixture { }; diff --git a/graphics/src/BVHLoader.cc b/graphics/src/BVHLoader.cc index 04866fadc..5d3c630e5 100644 --- a/graphics/src/BVHLoader.cc +++ b/graphics/src/BVHLoader.cc @@ -24,7 +24,7 @@ #include #include -using namespace ignition; +using namespace gz; using namespace common; ///////////////////////////////////////////////// diff --git a/graphics/src/ColladaExporter.cc b/graphics/src/ColladaExporter.cc index 726639820..9c8179a55 100644 --- a/graphics/src/ColladaExporter.cc +++ b/graphics/src/ColladaExporter.cc @@ -38,7 +38,7 @@ static const char pathSeparator = '/'; #endif -using namespace ignition; +using namespace gz; using namespace common; static void LogTinyXml2DocumentError( diff --git a/graphics/src/ColladaExporter_TEST.cc b/graphics/src/ColladaExporter_TEST.cc index d71e403a8..95901c1df 100644 --- a/graphics/src/ColladaExporter_TEST.cc +++ b/graphics/src/ColladaExporter_TEST.cc @@ -30,7 +30,7 @@ #define snprintf _snprintf #endif -using namespace ignition; +using namespace gz; class ColladaExporter : public common::testing::AutoLogFixture { /// \brief Setup the test fixture. This gets called by gtest. diff --git a/graphics/src/ColladaLoader.cc b/graphics/src/ColladaLoader.cc index 5018f0c3e..322550304 100644 --- a/graphics/src/ColladaLoader.cc +++ b/graphics/src/ColladaLoader.cc @@ -38,12 +38,12 @@ #include "ignition/common/Util.hh" #include "ignition/common/ColladaLoader.hh" -using namespace ignition; +using namespace gz; using namespace common; using RawNodeAnim = std::map >; using RawSkeletonAnim = std::map; -namespace ignition +namespace gz { namespace common { diff --git a/graphics/src/ColladaLoader_TEST.cc b/graphics/src/ColladaLoader_TEST.cc index ee8eee0bb..282b9b453 100644 --- a/graphics/src/ColladaLoader_TEST.cc +++ b/graphics/src/ColladaLoader_TEST.cc @@ -26,7 +26,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" #include "ignition/common/testing/TestPaths.hh" -using namespace ignition; +using namespace gz; class ColladaLoader : public common::testing::AutoLogFixture { }; ///////////////////////////////////////////////// diff --git a/graphics/src/GTSMeshUtils.cc b/graphics/src/GTSMeshUtils.cc index bbbdfcd34..c421c6998 100644 --- a/graphics/src/GTSMeshUtils.cc +++ b/graphics/src/GTSMeshUtils.cc @@ -23,7 +23,7 @@ #include #include -using namespace ignition; +using namespace gz; using namespace common; ////////////////////////////////////////////////// diff --git a/graphics/src/GTSMeshUtils_TEST.cc b/graphics/src/GTSMeshUtils_TEST.cc index 31c9114d2..97b86d1da 100644 --- a/graphics/src/GTSMeshUtils_TEST.cc +++ b/graphics/src/GTSMeshUtils_TEST.cc @@ -24,7 +24,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; class GTSMeshUtils : public common::testing::AutoLogFixture { }; diff --git a/graphics/src/Image.cc b/graphics/src/Image.cc index 87547f489..b9706932d 100644 --- a/graphics/src/Image.cc +++ b/graphics/src/Image.cc @@ -26,10 +26,10 @@ #include #include -using namespace ignition; +using namespace gz; using namespace common; -namespace ignition +namespace gz { namespace common { diff --git a/graphics/src/Image_TEST.cc b/graphics/src/Image_TEST.cc index 8efe14b8d..ac16b29db 100644 --- a/graphics/src/Image_TEST.cc +++ b/graphics/src/Image_TEST.cc @@ -22,7 +22,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" #include "ignition/common/testing/TestPaths.hh" -using namespace ignition; +using namespace gz; class ImageTest : public common::testing::AutoLogFixture { }; diff --git a/graphics/src/KeyFrame.cc b/graphics/src/KeyFrame.cc index 1c3d87b3a..b4cb2aa12 100644 --- a/graphics/src/KeyFrame.cc +++ b/graphics/src/KeyFrame.cc @@ -16,7 +16,7 @@ */ #include -namespace ignition { +namespace gz { namespace common { ///////////////////////////////////////////////// @@ -121,5 +121,5 @@ const double &NumericKeyFrame::Value() const { return this->dataPtr->value; } -} // namespace ignition +} // namespace gz } // namespace common diff --git a/graphics/src/Material.cc b/graphics/src/Material.cc index 8c2f3a507..7c38cdb73 100644 --- a/graphics/src/Material.cc +++ b/graphics/src/Material.cc @@ -20,7 +20,7 @@ #include "ignition/common/Material.hh" #include "ignition/common/Console.hh" -using namespace ignition; +using namespace gz; using namespace common; IGN_ENUM(shadeModeIface, Material::ShadeMode, diff --git a/graphics/src/Material_TEST.cc b/graphics/src/Material_TEST.cc index 3b9df9a63..9f5e2384a 100644 --- a/graphics/src/Material_TEST.cc +++ b/graphics/src/Material_TEST.cc @@ -22,7 +22,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" #include "ignition/common/testing/TestPaths.hh" -using namespace ignition; +using namespace gz; class MaterialTest : public common::testing::AutoLogFixture { }; diff --git a/graphics/src/Mesh.cc b/graphics/src/Mesh.cc index e8b9708cc..6b7e957b9 100644 --- a/graphics/src/Mesh.cc +++ b/graphics/src/Mesh.cc @@ -26,7 +26,7 @@ #include "ignition/common/SubMesh.hh" #include "ignition/common/Mesh.hh" -using namespace ignition; +using namespace gz; using namespace common; /// \brief Private data for Mesh diff --git a/graphics/src/MeshCSG.cc b/graphics/src/MeshCSG.cc index f1e266dbb..6ce80a72b 100644 --- a/graphics/src/MeshCSG.cc +++ b/graphics/src/MeshCSG.cc @@ -24,7 +24,7 @@ #include "ignition/common/SubMesh.hh" #include "ignition/common/MeshCSG.hh" -using namespace ignition; +using namespace gz; using namespace common; ////////////////////////////////////////////////// diff --git a/graphics/src/MeshExporter.cc b/graphics/src/MeshExporter.cc index 5503b2d74..11cd8c9f0 100644 --- a/graphics/src/MeshExporter.cc +++ b/graphics/src/MeshExporter.cc @@ -16,7 +16,7 @@ */ #include "ignition/common/MeshExporter.hh" -using namespace ignition; +using namespace gz; using namespace common; ////////////////////////////////////////////////// diff --git a/graphics/src/MeshManager.cc b/graphics/src/MeshManager.cc index bee5b581d..16fc10927 100644 --- a/graphics/src/MeshManager.cc +++ b/graphics/src/MeshManager.cc @@ -37,7 +37,7 @@ #include "ignition/common/MeshManager.hh" -using namespace ignition::common; +using namespace gz::common; class ignition::common::MeshManager::Implementation { diff --git a/graphics/src/MeshManager_TEST.cc b/graphics/src/MeshManager_TEST.cc index 5fe50d929..aca1f13aa 100644 --- a/graphics/src/MeshManager_TEST.cc +++ b/graphics/src/MeshManager_TEST.cc @@ -24,7 +24,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; #ifndef _WIN32 class MeshManager : public common::testing::AutoLogFixture { }; diff --git a/graphics/src/Mesh_TEST.cc b/graphics/src/Mesh_TEST.cc index 06f46a15f..1aa1b0231 100644 --- a/graphics/src/Mesh_TEST.cc +++ b/graphics/src/Mesh_TEST.cc @@ -25,7 +25,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; class MeshTest : public common::testing::AutoLogFixture { }; diff --git a/graphics/src/NodeAnimation.cc b/graphics/src/NodeAnimation.cc index e5b526e17..5464d7593 100644 --- a/graphics/src/NodeAnimation.cc +++ b/graphics/src/NodeAnimation.cc @@ -18,7 +18,7 @@ #include "ignition/common/Console.hh" #include "ignition/common/NodeAnimation.hh" -using namespace ignition; +using namespace gz; using namespace common; /// \brief NodeAnimation private data diff --git a/graphics/src/NodeTransform.cc b/graphics/src/NodeTransform.cc index 79446f8af..8d41bd143 100644 --- a/graphics/src/NodeTransform.cc +++ b/graphics/src/NodeTransform.cc @@ -19,7 +19,7 @@ #include -using namespace ignition; +using namespace gz; using namespace common; /// \brief Private data for NodeTransform diff --git a/graphics/src/OBJLoader.cc b/graphics/src/OBJLoader.cc index c1a92f164..8b25470ad 100644 --- a/graphics/src/OBJLoader.cc +++ b/graphics/src/OBJLoader.cc @@ -27,7 +27,7 @@ #define IGNITION_COMMON_TINYOBJLOADER_IMPLEMENTATION #include "tiny_obj_loader.h" -namespace ignition +namespace gz { namespace common { @@ -39,7 +39,7 @@ namespace ignition } } -using namespace ignition; +using namespace gz; using namespace common; ////////////////////////////////////////////////// diff --git a/graphics/src/OBJLoader_TEST.cc b/graphics/src/OBJLoader_TEST.cc index eb2dd52bf..509166bb0 100644 --- a/graphics/src/OBJLoader_TEST.cc +++ b/graphics/src/OBJLoader_TEST.cc @@ -24,7 +24,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" #include "ignition/common/testing/TestPaths.hh" -using namespace ignition; +using namespace gz; class OBJLoaderTest : public common::testing::AutoLogFixture { }; diff --git a/graphics/src/Pbr.cc b/graphics/src/Pbr.cc index a5d57cf15..0da3eea47 100644 --- a/graphics/src/Pbr.cc +++ b/graphics/src/Pbr.cc @@ -73,7 +73,7 @@ class ignition::common::Pbr::Implementation }; -using namespace ignition; +using namespace gz; using namespace common; ///////////////////////////////////////////////// diff --git a/graphics/src/STLLoader.cc b/graphics/src/STLLoader.cc index cf4770a36..6ef96f9bc 100644 --- a/graphics/src/STLLoader.cc +++ b/graphics/src/STLLoader.cc @@ -25,7 +25,7 @@ #include "ignition/common/SubMesh.hh" #include "ignition/common/STLLoader.hh" -using namespace ignition; +using namespace gz; using namespace common; diff --git a/graphics/src/SVGLoader.cc b/graphics/src/SVGLoader.cc index c81129910..cecf0137e 100644 --- a/graphics/src/SVGLoader.cc +++ b/graphics/src/SVGLoader.cc @@ -34,7 +34,7 @@ #include "ignition/common/SVGLoader.hh" -using namespace ignition; +using namespace gz; using namespace common; class ignition::common::SVGLoader::Implementation diff --git a/graphics/src/SVGLoader_TEST.cc b/graphics/src/SVGLoader_TEST.cc index aa2ed934c..89b8232ca 100644 --- a/graphics/src/SVGLoader_TEST.cc +++ b/graphics/src/SVGLoader_TEST.cc @@ -22,7 +22,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" #include "ignition/common/testing/TestPaths.hh" -using namespace ignition; +using namespace gz; using namespace common; diff --git a/graphics/src/Skeleton.cc b/graphics/src/Skeleton.cc index dbb46b8a5..da1bd1fe7 100644 --- a/graphics/src/Skeleton.cc +++ b/graphics/src/Skeleton.cc @@ -20,7 +20,7 @@ #include #include -using namespace ignition; +using namespace gz; using namespace common; /// Private data class diff --git a/graphics/src/SkeletonAnimation.cc b/graphics/src/SkeletonAnimation.cc index bf74a3cbd..9b4d252a9 100644 --- a/graphics/src/SkeletonAnimation.cc +++ b/graphics/src/SkeletonAnimation.cc @@ -19,7 +19,7 @@ #include "ignition/common/NodeAnimation.hh" #include "ignition/common/SkeletonAnimation.hh" -using namespace ignition; +using namespace gz; using namespace common; /// Prvate data class diff --git a/graphics/src/SkeletonNode.cc b/graphics/src/SkeletonNode.cc index 3b179a686..4b35c13e4 100644 --- a/graphics/src/SkeletonNode.cc +++ b/graphics/src/SkeletonNode.cc @@ -20,7 +20,7 @@ #include "ignition/common/Console.hh" #include "ignition/common/SkeletonNode.hh" -using namespace ignition; +using namespace gz; using namespace common; /// \brief SkeletonNode private data diff --git a/graphics/src/SubMesh.cc b/graphics/src/SubMesh.cc index 28bb83fee..597d18713 100644 --- a/graphics/src/SubMesh.cc +++ b/graphics/src/SubMesh.cc @@ -27,7 +27,7 @@ #include "ignition/common/Material.hh" #include "ignition/common/SubMesh.hh" -using namespace ignition; +using namespace gz; using namespace common; /// \brief Private data for SubMesh diff --git a/graphics/src/SubMesh_TEST.cc b/graphics/src/SubMesh_TEST.cc index 951fb9cba..578395e3b 100644 --- a/graphics/src/SubMesh_TEST.cc +++ b/graphics/src/SubMesh_TEST.cc @@ -24,7 +24,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; class SubMeshTest : public common::testing::AutoLogFixture { }; diff --git a/graphics/src/tiny_obj_loader.h b/graphics/src/tiny_obj_loader.h index a5859d128..dabcb64c8 100644 --- a/graphics/src/tiny_obj_loader.h +++ b/graphics/src/tiny_obj_loader.h @@ -53,7 +53,7 @@ THE SOFTWARE. #include #include -namespace ignition +namespace gz { namespace tinyobj { @@ -397,7 +397,7 @@ void LoadMtl(std::map *material_map, bool ParseTextureNameAndOption(std::string *texname, texture_option_t *texopt, const char *linebuf); } // namespace tinyobj -} // namespace ignition +} // namespace gz #endif // IGNITION_COMMON_TINY_OBJ_LOADER_H_ @@ -414,7 +414,7 @@ bool ParseTextureNameAndOption(std::string *texname, texture_option_t *texopt, #include #include -namespace ignition +namespace gz { namespace tinyobj { MaterialReader::~MaterialReader() {} @@ -2578,6 +2578,6 @@ bool LoadObjWithCallback(std::istream &inStream, const callback_t &callback, #pragma clang diagnostic pop #endif } // namespace tinyobj -} // namespace ignition +} // namespace gz #endif diff --git a/graphics/src/tinyxml2/tinyxml2.cpp b/graphics/src/tinyxml2/tinyxml2.cpp index 751f52887..0b239be71 100755 --- a/graphics/src/tinyxml2/tinyxml2.cpp +++ b/graphics/src/tinyxml2/tinyxml2.cpp @@ -116,7 +116,7 @@ static const unsigned char TIXML_UTF_LEAD_0 = 0xefU; static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; -namespace ignition +namespace gz { namespace tinyxml2 { diff --git a/graphics/src/tinyxml2/tinyxml2.h b/graphics/src/tinyxml2/tinyxml2.h index 188336280..d64cbde58 100755 --- a/graphics/src/tinyxml2/tinyxml2.h +++ b/graphics/src/tinyxml2/tinyxml2.h @@ -95,7 +95,7 @@ distribution. static const int TIXML2_MAJOR_VERSION = 3; static const int TIXML2_MINOR_VERSION = 0; static const int TIXML2_PATCH_VERSION = 0; -namespace ignition +namespace gz { namespace tinyxml2 { diff --git a/include/gz/common/Base64.hh b/include/gz/common/Base64.hh index 2f128c543..cdb247928 100644 --- a/include/gz/common/Base64.hh +++ b/include/gz/common/Base64.hh @@ -20,7 +20,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/Battery.hh b/include/gz/common/Battery.hh index fd5e042b2..0033e5f08 100644 --- a/include/gz/common/Battery.hh +++ b/include/gz/common/Battery.hh @@ -26,7 +26,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/Console.hh b/include/gz/common/Console.hh index 6a1f423d6..cfbecd7bb 100644 --- a/include/gz/common/Console.hh +++ b/include/gz/common/Console.hh @@ -27,7 +27,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/EnumIface.hh b/include/gz/common/EnumIface.hh index b95ce1b39..7069658eb 100644 --- a/include/gz/common/EnumIface.hh +++ b/include/gz/common/EnumIface.hh @@ -23,7 +23,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/Filesystem.hh b/include/gz/common/Filesystem.hh index a859a6af1..a0e6676a9 100644 --- a/include/gz/common/Filesystem.hh +++ b/include/gz/common/Filesystem.hh @@ -24,7 +24,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/FlagSet.hh b/include/gz/common/FlagSet.hh index 1c4e88bf1..fd336890c 100644 --- a/include/gz/common/FlagSet.hh +++ b/include/gz/common/FlagSet.hh @@ -35,7 +35,7 @@ #include #include -namespace ignition::common +namespace gz::common { /// \brief Set of flags defined by a C++11 enum class. diff --git a/include/gz/common/MaterialDensity.hh b/include/gz/common/MaterialDensity.hh index 7dfa3f089..626f2c790 100644 --- a/include/gz/common/MaterialDensity.hh +++ b/include/gz/common/MaterialDensity.hh @@ -23,7 +23,7 @@ #include #include "gz/common/Export.hh" -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/MovingWindowFilter.hh b/include/gz/common/MovingWindowFilter.hh index 83938e495..30d8f6af3 100644 --- a/include/gz/common/MovingWindowFilter.hh +++ b/include/gz/common/MovingWindowFilter.hh @@ -20,7 +20,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/Plugin.hh b/include/gz/common/Plugin.hh index 51cad8beb..c861d7f62 100644 --- a/include/gz/common/Plugin.hh +++ b/include/gz/common/Plugin.hh @@ -26,7 +26,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/PluginInfo.hh b/include/gz/common/PluginInfo.hh index 4ae4941b6..cf19f5b12 100644 --- a/include/gz/common/PluginInfo.hh +++ b/include/gz/common/PluginInfo.hh @@ -23,7 +23,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/PluginLoader.hh b/include/gz/common/PluginLoader.hh index 3f696c660..b1fbae02a 100644 --- a/include/gz/common/PluginLoader.hh +++ b/include/gz/common/PluginLoader.hh @@ -28,7 +28,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/PluginPtr.hh b/include/gz/common/PluginPtr.hh index 0cc07abda..b42c0ec70 100644 --- a/include/gz/common/PluginPtr.hh +++ b/include/gz/common/PluginPtr.hh @@ -25,7 +25,7 @@ #include "gz/common/Plugin.hh" -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/SignalHandler.hh b/include/gz/common/SignalHandler.hh index a8476de44..059b90756 100644 --- a/include/gz/common/SignalHandler.hh +++ b/include/gz/common/SignalHandler.hh @@ -21,7 +21,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/SingletonT.hh b/include/gz/common/SingletonT.hh index c7a556299..ecde948d4 100644 --- a/include/gz/common/SingletonT.hh +++ b/include/gz/common/SingletonT.hh @@ -17,7 +17,7 @@ #ifndef GZ_COMMON_SINGLETONT_HH_ #define GZ_COMMON_SINGLETONT_HH_ -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/SpecializedPlugin.hh b/include/gz/common/SpecializedPlugin.hh index 910ec9742..b47ce8593 100644 --- a/include/gz/common/SpecializedPlugin.hh +++ b/include/gz/common/SpecializedPlugin.hh @@ -21,7 +21,7 @@ #include "gz/common/Plugin.hh" -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/SpecializedPluginPtr.hh b/include/gz/common/SpecializedPluginPtr.hh index a27253aba..d8a1cf5a8 100644 --- a/include/gz/common/SpecializedPluginPtr.hh +++ b/include/gz/common/SpecializedPluginPtr.hh @@ -22,7 +22,7 @@ #include "gz/common/PluginPtr.hh" #include "gz/common/SpecializedPlugin.hh" -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/StringUtils.hh b/include/gz/common/StringUtils.hh index cf0b601b0..9aa5fff98 100644 --- a/include/gz/common/StringUtils.hh +++ b/include/gz/common/StringUtils.hh @@ -22,7 +22,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/SystemPaths.hh b/include/gz/common/SystemPaths.hh index 19ba715f0..2ee9e25fb 100644 --- a/include/gz/common/SystemPaths.hh +++ b/include/gz/common/SystemPaths.hh @@ -27,7 +27,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/TempDirectory.hh b/include/gz/common/TempDirectory.hh index 36a5d3a02..7305dfaeb 100644 --- a/include/gz/common/TempDirectory.hh +++ b/include/gz/common/TempDirectory.hh @@ -25,7 +25,7 @@ #include -namespace ignition +namespace gz { namespace common { @@ -119,6 +119,6 @@ namespace ignition IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } // namespace common -} // namespace ignition +} // namespace gz #endif // GZ_COMMON_TEMPDIRECTORY_HH_ diff --git a/include/gz/common/TemplateHelpers.hh b/include/gz/common/TemplateHelpers.hh index f85d44d88..74f926c1d 100644 --- a/include/gz/common/TemplateHelpers.hh +++ b/include/gz/common/TemplateHelpers.hh @@ -22,7 +22,7 @@ #include "gz/common/detail/TemplateHelpers.hh" -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/Timer.hh b/include/gz/common/Timer.hh index e155fe56c..74b0e8bb4 100644 --- a/include/gz/common/Timer.hh +++ b/include/gz/common/Timer.hh @@ -23,7 +23,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/URI.hh b/include/gz/common/URI.hh index c0b7e3ee2..f404c92f4 100644 --- a/include/gz/common/URI.hh +++ b/include/gz/common/URI.hh @@ -24,7 +24,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/Util.hh b/include/gz/common/Util.hh index f6055b6b1..b8d5d7743 100644 --- a/include/gz/common/Util.hh +++ b/include/gz/common/Util.hh @@ -97,7 +97,7 @@ #define IGN_ASSERT(_expr, _msg) assert((_msg, _expr)) /// \brief Forward declarations for the common classes -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/Uuid.hh b/include/gz/common/Uuid.hh index 48a648c43..7da4522f8 100644 --- a/include/gz/common/Uuid.hh +++ b/include/gz/common/Uuid.hh @@ -32,7 +32,7 @@ using portable_uuid_t = uuid_t; #endif -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/WorkerPool.hh b/include/gz/common/WorkerPool.hh index 6220cd0d8..89563201b 100644 --- a/include/gz/common/WorkerPool.hh +++ b/include/gz/common/WorkerPool.hh @@ -24,7 +24,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/detail/Plugin.hh b/include/gz/common/detail/Plugin.hh index 3a8a048c1..bc5a2e1a9 100644 --- a/include/gz/common/detail/Plugin.hh +++ b/include/gz/common/detail/Plugin.hh @@ -23,7 +23,7 @@ #include #include "gz/common/Plugin.hh" -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/detail/PluginLoader.hh b/include/gz/common/detail/PluginLoader.hh index 2ef11c625..6428b2987 100644 --- a/include/gz/common/detail/PluginLoader.hh +++ b/include/gz/common/detail/PluginLoader.hh @@ -22,7 +22,7 @@ #include #include "gz/common/PluginLoader.hh" -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/detail/PluginPtr.hh b/include/gz/common/detail/PluginPtr.hh index 93952868e..603de3b1b 100644 --- a/include/gz/common/detail/PluginPtr.hh +++ b/include/gz/common/detail/PluginPtr.hh @@ -24,7 +24,7 @@ #include "gz/common/PluginPtr.hh" #include "gz/common/TemplateHelpers.hh" -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/detail/SpecializedPlugin.hh b/include/gz/common/detail/SpecializedPlugin.hh index dff284cca..0da18f4d4 100644 --- a/include/gz/common/detail/SpecializedPlugin.hh +++ b/include/gz/common/detail/SpecializedPlugin.hh @@ -30,7 +30,7 @@ bool usedSpecializedInterfaceAccess; #endif -namespace ignition +namespace gz { namespace common { diff --git a/include/gz/common/detail/TemplateHelpers.hh b/include/gz/common/detail/TemplateHelpers.hh index 332755ed8..954f53c43 100644 --- a/include/gz/common/detail/TemplateHelpers.hh +++ b/include/gz/common/detail/TemplateHelpers.hh @@ -22,7 +22,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/profiler/include/gz/common/Profiler.hh b/profiler/include/gz/common/Profiler.hh index c2d0e9dac..ef48a9f2a 100644 --- a/profiler/include/gz/common/Profiler.hh +++ b/profiler/include/gz/common/Profiler.hh @@ -25,7 +25,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/profiler/src/Profiler.cc b/profiler/src/Profiler.cc index 333eb13ef..ec3db7226 100644 --- a/profiler/src/Profiler.cc +++ b/profiler/src/Profiler.cc @@ -23,7 +23,7 @@ #include "RemoteryProfilerImpl.hh" #endif // IGN_PROFILER_REMOTERY -using namespace ignition; +using namespace gz; using namespace common; ////////////////////////////////////////////////// diff --git a/profiler/src/ProfilerImpl.hh b/profiler/src/ProfilerImpl.hh index 3d910fec6..ad9c89df3 100644 --- a/profiler/src/ProfilerImpl.hh +++ b/profiler/src/ProfilerImpl.hh @@ -20,7 +20,7 @@ #include -namespace ignition +namespace gz { namespace common { diff --git a/profiler/src/Profiler_Disabled_TEST.cc b/profiler/src/Profiler_Disabled_TEST.cc index 2b8a53449..11fa2a919 100644 --- a/profiler/src/Profiler_Disabled_TEST.cc +++ b/profiler/src/Profiler_Disabled_TEST.cc @@ -22,7 +22,7 @@ #include // NOLINT(*) #include "ignition/common/Util.hh" // NOLINT(*) -using namespace ignition; +using namespace gz; using namespace common; ///////////////////////////////////////////////// diff --git a/profiler/src/Profiler_Remotery_TEST.cc b/profiler/src/Profiler_Remotery_TEST.cc index 36cef9ee5..f1aa6ee1e 100644 --- a/profiler/src/Profiler_Remotery_TEST.cc +++ b/profiler/src/Profiler_Remotery_TEST.cc @@ -22,7 +22,7 @@ #include // NOLINT(*) #include "ignition/common/Util.hh" // NOLINT(*) -using namespace ignition; +using namespace gz; using namespace common; ///////////////////////////////////////////////// diff --git a/profiler/src/RemoteryProfilerImpl.cc b/profiler/src/RemoteryProfilerImpl.cc index c78bdf0a9..e9f5f5e7a 100644 --- a/profiler/src/RemoteryProfilerImpl.cc +++ b/profiler/src/RemoteryProfilerImpl.cc @@ -21,7 +21,7 @@ #include "ignition/common/Console.hh" #include "ignition/common/Util.hh" -using namespace ignition; +using namespace gz; using namespace common; std::string rmtErrorToString(rmtError error) { diff --git a/profiler/src/RemoteryProfilerImpl.hh b/profiler/src/RemoteryProfilerImpl.hh index 9c271feda..acbe39451 100644 --- a/profiler/src/RemoteryProfilerImpl.hh +++ b/profiler/src/RemoteryProfilerImpl.hh @@ -25,7 +25,7 @@ #include "ProfilerImpl.hh" -namespace ignition +namespace gz { namespace common { diff --git a/src/Base64.cc b/src/Base64.cc index d82905fda..b80609481 100644 --- a/src/Base64.cc +++ b/src/Base64.cc @@ -44,7 +44,7 @@ #include #include -using namespace ignition; +using namespace gz; using namespace common; static const char base64Chars[] = diff --git a/src/Base64_TEST.cc b/src/Base64_TEST.cc index 214bcd356..cab0d6824 100644 --- a/src/Base64_TEST.cc +++ b/src/Base64_TEST.cc @@ -20,7 +20,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; class Base64 : public common::testing::AutoLogFixture { }; diff --git a/src/Battery.cc b/src/Battery.cc index a5530773e..a79e286cf 100644 --- a/src/Battery.cc +++ b/src/Battery.cc @@ -20,7 +20,7 @@ #include #include -using namespace ignition; +using namespace gz; using namespace common; /// \brief Private data for the Battery class diff --git a/src/Battery_TEST.cc b/src/Battery_TEST.cc index 718f89b3e..5c6267d64 100644 --- a/src/Battery_TEST.cc +++ b/src/Battery_TEST.cc @@ -21,7 +21,7 @@ #include "ignition/common/Battery.hh" #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; class BatteryTest : public common::testing::AutoLogFixture { }; diff --git a/src/Console.cc b/src/Console.cc index 2f81fdcef..62bf99771 100644 --- a/src/Console.cc +++ b/src/Console.cc @@ -24,7 +24,7 @@ #include #endif -using namespace ignition; +using namespace gz; using namespace common; diff --git a/src/Console_TEST.cc b/src/Console_TEST.cc index 7f13ab89a..17115e1de 100644 --- a/src/Console_TEST.cc +++ b/src/Console_TEST.cc @@ -23,8 +23,8 @@ #include "ignition/common/TempDirectory.hh" #include "ignition/common/Util.hh" -using namespace ignition; -using namespace ignition::common; +using namespace gz; +using namespace gz::common; const int g_messageRepeat = 4; diff --git a/src/DirIter.cc b/src/DirIter.cc index d8b19ab90..ffa179152 100644 --- a/src/DirIter.cc +++ b/src/DirIter.cc @@ -21,7 +21,7 @@ namespace fs = std::filesystem; -namespace ignition +namespace gz { namespace common { @@ -72,4 +72,4 @@ bool DirIter::operator!=(const DirIter &_other) const } } // namespace common -} // namespace ignition +} // namespace gz diff --git a/src/EnumIface_TEST.cc b/src/EnumIface_TEST.cc index b5287736d..08eb22cda 100644 --- a/src/EnumIface_TEST.cc +++ b/src/EnumIface_TEST.cc @@ -21,7 +21,7 @@ #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; class EnumIfaceTest : public common::testing::AutoLogFixture { }; diff --git a/src/Filesystem_TEST.cc b/src/Filesystem_TEST.cc index 2b0eb13c2..a68e3e7a5 100644 --- a/src/Filesystem_TEST.cc +++ b/src/Filesystem_TEST.cc @@ -34,7 +34,7 @@ #define BUILD_SYMLINK_TESTS #endif // _WIN32 -using namespace ignition; +using namespace gz; using namespace common; namespace fs = std::filesystem; diff --git a/src/FlagSet_TEST.cc b/src/FlagSet_TEST.cc index 047b8ad63..06ac1e87d 100644 --- a/src/FlagSet_TEST.cc +++ b/src/FlagSet_TEST.cc @@ -181,7 +181,7 @@ TEST(FlagSet, TestAnyAllNone) TEST(FlagSet, TestConstructors) { - using namespace ignition::common; + using namespace gz::common; ASSERT_EQ(5u, FlagSet::numElements); @@ -216,7 +216,7 @@ TEST(FlagSet, TestStaticConstructors) TEST(FlagSet, TestHash) { - using namespace ignition::common; + using namespace gz::common; const auto options1 = FlagSet::AllSet(); const auto options2 = FlagSet::NoneSet(); @@ -366,7 +366,7 @@ TEST(FlagSet, TestUnderlyingTypes) _ }; - using namespace ignition::common; + using namespace gz::common; EXPECT_TRUE(FlagSet(CharEnum::A).All()); EXPECT_TRUE(FlagSet(UCharEnum::A).All()); diff --git a/src/MaterialDensity.cc b/src/MaterialDensity.cc index 485f12376..383a8f1d6 100644 --- a/src/MaterialDensity.cc +++ b/src/MaterialDensity.cc @@ -19,7 +19,7 @@ #include "ignition/common/EnumIface.hh" #include "ignition/common/MaterialDensity.hh" -using namespace ignition; +using namespace gz; using namespace common; // Initialize enum iterator, and string converter diff --git a/src/MaterialDensity_TEST.cc b/src/MaterialDensity_TEST.cc index b364e3a67..6cc241fcf 100644 --- a/src/MaterialDensity_TEST.cc +++ b/src/MaterialDensity_TEST.cc @@ -19,7 +19,7 @@ #include "ignition/common/MaterialDensity.hh" #include "ignition/common/testing/AutoLogFixture.hh" -using namespace ignition; +using namespace gz; using namespace common; class MaterialDensityTest : public common::testing::AutoLogFixture { }; diff --git a/src/MovingWindowFilter_TEST.cc b/src/MovingWindowFilter_TEST.cc index 1c8955cd9..af4270611 100644 --- a/src/MovingWindowFilter_TEST.cc +++ b/src/MovingWindowFilter_TEST.cc @@ -20,7 +20,7 @@ #include "ignition/common/MovingWindowFilter.hh" -using namespace ignition; +using namespace gz; ///////////////////////////////////////////////// TEST(MovingWindowFilterTest, SetWindowSize) diff --git a/src/Plugin.cc b/src/Plugin.cc index 6fbfc21a6..938b6f78d 100644 --- a/src/Plugin.cc +++ b/src/Plugin.cc @@ -21,7 +21,7 @@ #include "ignition/common/Console.hh" #include "PluginUtils.hh" -namespace ignition +namespace gz { namespace common { diff --git a/src/PluginLoader.cc b/src/PluginLoader.cc index 230947407..a6dd4cdce 100644 --- a/src/PluginLoader.cc +++ b/src/PluginLoader.cc @@ -32,7 +32,7 @@ #include "PluginUtils.hh" -namespace ignition +namespace gz { namespace common { diff --git a/src/PluginUtils.hh b/src/PluginUtils.hh index 4c1284592..4e20cdca7 100644 --- a/src/PluginUtils.hh +++ b/src/PluginUtils.hh @@ -21,7 +21,7 @@ #include #include "ignition/common/StringUtils.hh" -namespace ignition +namespace gz { namespace common { diff --git a/src/PluginUtils_TEST.cc b/src/PluginUtils_TEST.cc index 5ef99d121..aa3cc71bd 100644 --- a/src/PluginUtils_TEST.cc +++ b/src/PluginUtils_TEST.cc @@ -19,7 +19,7 @@ #include "PluginUtils.hh" -using namespace ignition; +using namespace gz; ///////////////////////////////////////////////// TEST(PluginUtils, NormalizeName) diff --git a/src/PrintWindowsSystemWarning.hh b/src/PrintWindowsSystemWarning.hh index a2b2326e9..b45372c76 100644 --- a/src/PrintWindowsSystemWarning.hh +++ b/src/PrintWindowsSystemWarning.hh @@ -25,7 +25,7 @@ #include #include -namespace ignition +namespace gz { namespace common { diff --git a/src/SignalHandler.cc b/src/SignalHandler.cc index 4ea511546..6bf3ca716 100644 --- a/src/SignalHandler.cc +++ b/src/SignalHandler.cc @@ -26,7 +26,7 @@ #include // NOLINT(*) #include "ignition/common/Console.hh" // NOLINT(*) -using namespace ignition; +using namespace gz; using namespace common; // A wrapper for the sigaction sa_handler. diff --git a/src/SignalHandler_TEST.cc b/src/SignalHandler_TEST.cc index c44fbdbb2..55aa9fc0b 100644 --- a/src/SignalHandler_TEST.cc +++ b/src/SignalHandler_TEST.cc @@ -26,7 +26,7 @@ #include // NOLINT(*) #include "ignition/common/Util.hh" // NOLINT(*) -using namespace ignition; +using namespace gz; // Capture the gOnSignalWrappers map from SignalHandlers.cc #ifndef _WIN32 diff --git a/src/StringUtils.cc b/src/StringUtils.cc index ebd5562ba..8e0c0d38f 100644 --- a/src/StringUtils.cc +++ b/src/StringUtils.cc @@ -18,7 +18,7 @@ #include #include "ignition/common/StringUtils.hh" -namespace ignition +namespace gz { namespace common { diff --git a/src/StringUtils_TEST.cc b/src/StringUtils_TEST.cc index aa3ad29d0..cc7f3fce9 100644 --- a/src/StringUtils_TEST.cc +++ b/src/StringUtils_TEST.cc @@ -21,7 +21,7 @@ #include "ignition/common/StringUtils.hh" -using namespace ignition; +using namespace gz; ///////////////////////////////////////////////// TEST(StringUtils, SplitNoDelimiterPresent) diff --git a/src/SystemPaths.cc b/src/SystemPaths.cc index a8393d3eb..72800dffa 100644 --- a/src/SystemPaths.cc +++ b/src/SystemPaths.cc @@ -30,7 +30,7 @@ #include "ignition/common/SystemPaths.hh" #include "ignition/common/Util.hh" -using namespace ignition; +using namespace gz; using namespace common; // Private data class diff --git a/src/SystemPaths_TEST.cc b/src/SystemPaths_TEST.cc index 19b8623c4..ca58a8986 100644 --- a/src/SystemPaths_TEST.cc +++ b/src/SystemPaths_TEST.cc @@ -32,7 +32,7 @@ #define snprintf _snprintf #endif -using namespace ignition; +using namespace gz; const char kPluginPath[] = "IGN_PLUGIN_PATH"; const char kFilePath[] = "IGN_FILE_PATH"; diff --git a/src/TempDirectory.cc b/src/TempDirectory.cc index 7f3809b30..cb2521efa 100644 --- a/src/TempDirectory.cc +++ b/src/TempDirectory.cc @@ -33,7 +33,7 @@ namespace fs = std::filesystem; -using namespace ignition; +using namespace gz; using namespace common; ///////////////////////////////////////////////// diff --git a/src/TemplateHelpers_TEST.cc b/src/TemplateHelpers_TEST.cc index dd2fa4b0f..12d5ef14e 100644 --- a/src/TemplateHelpers_TEST.cc +++ b/src/TemplateHelpers_TEST.cc @@ -37,7 +37,7 @@ TEST(TemplateHelpers, ConstCompatible) // The extra pair of parentheses are so the comma between the template // arguments don't confuse the macro. - using namespace ignition::common; + using namespace gz::common; EXPECT_TRUE((ConstCompatible::value)); EXPECT_FALSE((ConstCompatible::value)); EXPECT_TRUE((ConstCompatible::value)); diff --git a/src/Timer.cc b/src/Timer.cc index 4fa56f85b..69588f2ff 100644 --- a/src/Timer.cc +++ b/src/Timer.cc @@ -17,7 +17,7 @@ #include -using namespace ignition; +using namespace gz; using namespace common; /// \brief Private data for the Timer class diff --git a/src/URI.cc b/src/URI.cc index 3f39b9600..66f9391b4 100644 --- a/src/URI.cc +++ b/src/URI.cc @@ -25,7 +25,7 @@ #include "ignition/common/Console.hh" #include "ignition/common/URI.hh" -using namespace ignition; +using namespace gz; using namespace common; static const char kSchemeDelim[] = ":"; diff --git a/src/URI_TEST.cc b/src/URI_TEST.cc index f321ed66c..5aa00d915 100644 --- a/src/URI_TEST.cc +++ b/src/URI_TEST.cc @@ -19,7 +19,7 @@ #include "ignition/common/Console.hh" #include "ignition/common/URI.hh" -using namespace ignition; +using namespace gz; using namespace common; ///////////////////////////////////////////////// diff --git a/src/Util_TEST.cc b/src/Util_TEST.cc index 407a40cc2..5171893c7 100644 --- a/src/Util_TEST.cc +++ b/src/Util_TEST.cc @@ -22,7 +22,7 @@ #include -using namespace ignition; +using namespace gz; ///////////////////////////////////////////////// /// \brief Test Util::SHA1 diff --git a/src/Uuid.cc b/src/Uuid.cc index 46dac2872..c670816f3 100644 --- a/src/Uuid.cc +++ b/src/Uuid.cc @@ -20,7 +20,7 @@ #include "ignition/common/Uuid.hh" -using namespace ignition; +using namespace gz; using namespace common; #ifdef _WIN32 diff --git a/src/Uuid_TEST.cc b/src/Uuid_TEST.cc index f0cc3a011..6e4e464d1 100644 --- a/src/Uuid_TEST.cc +++ b/src/Uuid_TEST.cc @@ -22,7 +22,7 @@ #include "ignition/common/Uuid.hh" #include "gtest/gtest.h" -using namespace ignition; +using namespace gz; ////////////////////////////////////////////////// /// \brief Check the Uuid helper class. diff --git a/src/WorkerPool.cc b/src/WorkerPool.cc index ef096cd86..2e1f4ec07 100644 --- a/src/WorkerPool.cc +++ b/src/WorkerPool.cc @@ -26,7 +26,7 @@ namespace igncmn = ignition::common; using namespace igncmn; -namespace ignition +namespace gz { namespace common { diff --git a/test/integration/encoder_timing.cc b/test/integration/encoder_timing.cc index 13cc11461..626bfeff3 100644 --- a/test/integration/encoder_timing.cc +++ b/test/integration/encoder_timing.cc @@ -18,7 +18,7 @@ #include "ignition/common/VideoEncoder.hh" #include "ignition/common/Video.hh" -using namespace ignition; +using namespace gz; using namespace common; const unsigned int kSize = 10; diff --git a/test/integration/mesh.cc b/test/integration/mesh.cc index 2db604f00..a0f2f7118 100644 --- a/test/integration/mesh.cc +++ b/test/integration/mesh.cc @@ -28,7 +28,7 @@ #include #include -using namespace ignition; +using namespace gz; class MeshTest : public common::testing::AutoLogFixture { }; diff --git a/test/integration/video_encoder.cc b/test/integration/video_encoder.cc index a833c2c13..41ead7af0 100644 --- a/test/integration/video_encoder.cc +++ b/test/integration/video_encoder.cc @@ -26,7 +26,7 @@ #include #include -using namespace ignition; +using namespace gz; using namespace common; using namespace std::chrono; auto Now = steady_clock::now; diff --git a/testing/include/gz/common/testing/AutoLogFixture.hh b/testing/include/gz/common/testing/AutoLogFixture.hh index 204b3107b..a63080279 100644 --- a/testing/include/gz/common/testing/AutoLogFixture.hh +++ b/testing/include/gz/common/testing/AutoLogFixture.hh @@ -24,7 +24,7 @@ #include -namespace ignition::common::testing +namespace gz::common::testing { /// \brief A utility class that stores test logs in ~/.ignition/test_logs. /// This functionality is needed to keep all the log information reported @@ -52,7 +52,7 @@ class AutoLogFixture : public ::testing::Test /// \brief Pointer to private data. IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; -} // namespace ignition::common::testing +} // namespace gz::common::testing #include diff --git a/testing/include/gz/common/testing/BazelTestPaths.hh b/testing/include/gz/common/testing/BazelTestPaths.hh index f50ff7718..2636fa43b 100644 --- a/testing/include/gz/common/testing/BazelTestPaths.hh +++ b/testing/include/gz/common/testing/BazelTestPaths.hh @@ -22,7 +22,7 @@ #include "gz/common/testing/TestPaths.hh" #include "gz/common/testing/Export.hh" -namespace ignition::common::testing +namespace gz::common::testing { /// \brief Implementation of TestPaths interface for Bazel @@ -53,6 +53,6 @@ class BazelTestPaths: public TestPaths TestTmpPath(std::string &_tmpDir) override; }; -} // namespace ignition::common::testing +} // namespace gz::common::testing #endif // GZ_COMMON_TESTING_AUTOLOGFIXTURE_HH_ diff --git a/testing/include/gz/common/testing/CMakeTestPaths.hh b/testing/include/gz/common/testing/CMakeTestPaths.hh index 1ce948bc4..e848ea0cc 100644 --- a/testing/include/gz/common/testing/CMakeTestPaths.hh +++ b/testing/include/gz/common/testing/CMakeTestPaths.hh @@ -22,7 +22,7 @@ #include "gz/common/testing/TestPaths.hh" #include "gz/common/testing/Export.hh" -namespace ignition::common::testing +namespace gz::common::testing { /// \brief Implementation of TestPaths interface for CMake /// @@ -44,5 +44,5 @@ class CMakeTestPaths: public TestPaths public: bool IGNITION_COMMON_TESTING_VISIBLE TestTmpPath(std::string &_tmpDir) override; }; -} // namespace ignition::common::testing +} // namespace gz::common::testing #endif // GZ_COMMON_TESTING_CMAKETESTPATHS_HH_ diff --git a/testing/include/gz/common/testing/TestPaths.hh b/testing/include/gz/common/testing/TestPaths.hh index 1fb7b3894..5a4bd77fe 100644 --- a/testing/include/gz/common/testing/TestPaths.hh +++ b/testing/include/gz/common/testing/TestPaths.hh @@ -30,7 +30,7 @@ #define TESTING_PROJECT_SOURCE_DIR "" #endif -namespace ignition::common::testing +namespace gz::common::testing { ////////////////////////////////////////////////// @@ -197,5 +197,5 @@ std::string TempPath(Args const &... args) testPaths->TestTmpPath(dataDir); return common::joinPaths(dataDir, args...); } -} // namespace ignition::common::testing +} // namespace gz::common::testing #endif // GZ_COMMON_TESTING_TESTPATHS_HH_ diff --git a/testing/include/gz/common/testing/Utils.hh b/testing/include/gz/common/testing/Utils.hh index 44ca5132c..ceeb526f0 100644 --- a/testing/include/gz/common/testing/Utils.hh +++ b/testing/include/gz/common/testing/Utils.hh @@ -23,7 +23,7 @@ #include "gz/common/testing/Export.hh" -namespace ignition::common::testing +namespace gz::common::testing { ///////////////////////////////////////////////// @@ -35,6 +35,6 @@ bool IGNITION_COMMON_TESTING_VISIBLE createNewEmptyFile(const std::string &_filename); -} // namespace ignition::common::testing +} // namespace gz::common::testing #endif // GZ_COMMON_TESTING_TESTPATHS_HH_ diff --git a/testing/include/gz/common/testing/detail/AutoLogFixture.hh b/testing/include/gz/common/testing/detail/AutoLogFixture.hh index 5c648a0bf..9e9a9ce0b 100644 --- a/testing/include/gz/common/testing/detail/AutoLogFixture.hh +++ b/testing/include/gz/common/testing/detail/AutoLogFixture.hh @@ -27,7 +27,7 @@ #include #include -namespace ignition::common::testing +namespace gz::common::testing { ////////////////////////////////////////////////// @@ -118,7 +118,7 @@ std::string AutoLogFixture::LogContent() const return loggedString; } -} // namespace ignition::common::testing +} // namespace gz::common::testing #endif // GZ_COMMON_TESTING_DETAIL_AUTOLOGFIXTURE_HH_ diff --git a/testing/src/AutoLogFixture_TEST.cc b/testing/src/AutoLogFixture_TEST.cc index c2118c695..fd9941f61 100644 --- a/testing/src/AutoLogFixture_TEST.cc +++ b/testing/src/AutoLogFixture_TEST.cc @@ -19,8 +19,8 @@ #include #include -using namespace ignition::common; -using namespace ignition::common::testing; +using namespace gz::common; +using namespace gz::common::testing; ///////////////////////////////////////////////// TEST_F(AutoLogFixture, AutoLogFixture) diff --git a/testing/src/BazelTestPaths.cc b/testing/src/BazelTestPaths.cc index c355df0f0..e2fa85115 100644 --- a/testing/src/BazelTestPaths.cc +++ b/testing/src/BazelTestPaths.cc @@ -20,7 +20,7 @@ #include #include -namespace ignition::common::testing +namespace gz::common::testing { ////////////////////////////////////////////////// @@ -51,5 +51,5 @@ bool BazelTestPaths::TestTmpPath(std::string &_tmpDir) return common::env("TEST_UNDECLARED_OUTPUTS_DIR", _tmpDir); } -} // namespace ignition::common::testing +} // namespace gz::common::testing diff --git a/testing/src/BazelTestPaths_TEST.cc b/testing/src/BazelTestPaths_TEST.cc index f0ea20a6a..7474b0286 100644 --- a/testing/src/BazelTestPaths_TEST.cc +++ b/testing/src/BazelTestPaths_TEST.cc @@ -20,7 +20,7 @@ #include "ignition/common/testing/TestPaths.hh" #include "ignition/common/testing/BazelTestPaths.hh" -using namespace ignition::common; +using namespace gz::common; ///////////////////////////////////////////////// TEST(BazelTestPaths, ProjectSourcePath) diff --git a/testing/src/CMakeTestPaths.cc b/testing/src/CMakeTestPaths.cc index cf9f69c1f..c15956858 100644 --- a/testing/src/CMakeTestPaths.cc +++ b/testing/src/CMakeTestPaths.cc @@ -17,7 +17,7 @@ #include "ignition/common/testing/CMakeTestPaths.hh" -namespace ignition::common::testing +namespace gz::common::testing { ////////////////////////////////////////////////// @@ -43,4 +43,4 @@ bool CMakeTestPaths::TestTmpPath(std::string &_tmpDir) return true; } -} // namespace ignition::common::testing +} // namespace gz::common::testing diff --git a/testing/src/CMakeTestPaths_TEST.cc b/testing/src/CMakeTestPaths_TEST.cc index f18aa0a8e..c478a02d3 100644 --- a/testing/src/CMakeTestPaths_TEST.cc +++ b/testing/src/CMakeTestPaths_TEST.cc @@ -20,8 +20,8 @@ #include "ignition/common/testing/TestPaths.hh" #include "ignition/common/testing/CMakeTestPaths.hh" -using namespace ignition::common; -using namespace ignition::common::testing; +using namespace gz::common; +using namespace gz::common::testing; constexpr char kFakeTestPaths[] = ""; diff --git a/testing/src/TestPaths.cc b/testing/src/TestPaths.cc index 54854ddac..b9f4dec74 100644 --- a/testing/src/TestPaths.cc +++ b/testing/src/TestPaths.cc @@ -21,7 +21,7 @@ #include #include -namespace ignition::common::testing +namespace gz::common::testing { ////////////////////////////////////////////////// TestPaths::TestPaths(const std::string &_projectSourcePath) @@ -98,4 +98,4 @@ MakeTestTempDirectoryImpl(const std::string &_projectSourcePath, dataDir, _prefix, _subDir, _cleanup); } -} // namespace ignition::common::testing +} // namespace gz::common::testing diff --git a/testing/src/Utils.cc b/testing/src/Utils.cc index 311853484..fd120f167 100644 --- a/testing/src/Utils.cc +++ b/testing/src/Utils.cc @@ -20,7 +20,7 @@ #include #include -namespace ignition::common::testing +namespace gz::common::testing { ///////////////////////////////////////////////// @@ -50,4 +50,4 @@ bool createNewEmptyFile(const std::string &_filename) return true; } -} // namespace ignition::common::testing +} // namespace gz::common::testing diff --git a/testing/src/Utils_TEST.cc b/testing/src/Utils_TEST.cc index 5a484a52f..8c0da263d 100644 --- a/testing/src/Utils_TEST.cc +++ b/testing/src/Utils_TEST.cc @@ -19,8 +19,8 @@ #include #include -using namespace ignition::common; -using namespace ignition::common::testing; +using namespace gz::common; +using namespace gz::common::testing; ///////////////////////////////////////////////// TEST(Utils, CreateNewEmptyFile) From f9a5d87973fe28e8c395e8bf56d53fe39b9e2c25 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Sat, 21 May 2022 00:42:46 -0700 Subject: [PATCH 2/9] Migrate 'ignition::' -> 'gz::' ~~~ sed -i -e 's@ignition::@gz::@g' \ $(grep -rlI 'ignition::' .) ~~~ Excluded changes to Changelog.md Signed-off-by: Steve Peters --- av/src/AudioDecoder.cc | 8 +- av/src/HWEncoder.cc | 4 +- av/src/Util.cc | 2 +- av/src/Video.cc | 6 +- av/src/VideoEncoder.cc | 6 +- av/src/VideoEncoder_TEST.cc | 2 +- events/include/gz/common/MouseEvent.hh | 16 +- events/src/KeyEvent.cc | 2 +- events/src/MouseEvent.cc | 26 +- events/src/MouseEvent_TEST.cc | 32 +-- examples/console.cc | 2 +- examples/logging_performance.cc | 2 +- examples/profiler.cc | 4 +- .../include/gz/common/geospatial/Dem.hh | 12 +- .../gz/common/geospatial/HeightmapData.hh | 4 +- .../gz/common/geospatial/ImageHeightmap.hh | 12 +- geospatial/src/Dem.cc | 34 +-- geospatial/src/Dem_TEST.cc | 10 +- geospatial/src/ImageHeightmap.cc | 34 +-- geospatial/src/ImageHeightmap_TEST.cc | 6 +- graphics/include/gz/common/GTSMeshUtils.hh | 8 +- graphics/include/gz/common/Image.hh | 2 +- graphics/include/gz/common/Material.hh | 2 +- graphics/include/gz/common/Mesh.hh | 22 +- graphics/include/gz/common/MeshCSG.hh | 2 +- graphics/include/gz/common/MeshManager.hh | 44 ++-- graphics/include/gz/common/NodeAnimation.hh | 2 +- graphics/include/gz/common/SVGLoader.hh | 8 +- graphics/include/gz/common/SubMesh.hh | 52 ++-- graphics/src/Animation.cc | 8 +- graphics/src/ColladaExporter.cc | 26 +- graphics/src/ColladaLoader.cc | 228 +++++++++--------- graphics/src/ColladaLoader_TEST.cc | 8 +- graphics/src/GTSMeshUtils.cc | 8 +- graphics/src/GTSMeshUtils_TEST.cc | 36 +-- graphics/src/Image.cc | 4 +- graphics/src/Image_TEST.cc | 4 +- graphics/src/KeyFrame.cc | 6 +- graphics/src/Material.cc | 6 +- graphics/src/Mesh.cc | 54 ++--- graphics/src/MeshCSG.cc | 6 +- graphics/src/MeshManager.cc | 174 ++++++------- graphics/src/MeshManager_TEST.cc | 148 ++++++------ graphics/src/NodeAnimation.cc | 4 +- graphics/src/NodeTransform.cc | 6 +- graphics/src/OBJLoader.cc | 8 +- graphics/src/OBJLoader_TEST.cc | 14 +- graphics/src/Pbr.cc | 10 +- graphics/src/Pbr_TEST.cc | 66 ++--- graphics/src/STLLoader.cc | 14 +- graphics/src/SVGLoader.cc | 154 ++++++------ graphics/src/SVGLoader_TEST.cc | 16 +- graphics/src/Skeleton.cc | 6 +- graphics/src/SkeletonAnimation.cc | 4 +- graphics/src/SkeletonNode.cc | 6 +- graphics/src/SubMesh.cc | 98 ++++---- graphics/src/SubMesh_TEST.cc | 10 +- include/gz/common/Console.hh | 16 +- include/gz/common/EnumIface.hh | 2 +- include/gz/common/FlagSet.hh | 10 +- include/gz/common/PluginPtr.hh | 2 +- include/gz/common/SignalHandler.hh | 2 +- include/gz/common/SystemPaths.hh | 6 +- include/gz/common/Timer.hh | 2 +- include/gz/common/Util.hh | 6 +- include/gz/common/Uuid.hh | 2 +- include/gz/common/detail/PluginMacros.hh | 16 +- include/gz/common/detail/PluginPtr.hh | 4 +- include/gz/common/detail/SpecializedPlugin.hh | 2 +- profiler/include/gz/common/Profiler.hh | 12 +- src/Battery.cc | 4 +- src/Console.cc | 10 +- src/Console_TEST.cc | 106 ++++---- src/DirIter.cc | 2 +- src/Filesystem.cc | 64 ++--- src/Filesystem_TEST.cc | 4 +- src/FlagSet_TEST.cc | 32 +-- src/MovingWindowFilter_TEST.cc | 8 +- src/PluginLoader.cc | 4 +- src/PluginLoader_TEST.cc | 28 +-- src/PluginUtils_TEST.cc | 4 +- src/PrintWindowsSystemWarning.hh | 2 +- src/SignalHandler.cc | 2 +- src/SystemPaths.cc | 26 +- src/SystemPaths_TEST.cc | 76 +++--- src/TempDirectory.cc | 10 +- src/TempDirectory_TEST.cc | 88 +++---- src/Timer.cc | 4 +- src/Timer_TEST.cc | 8 +- src/URI.cc | 20 +- src/URI_TEST.cc | 2 +- src/Util.cc | 72 +++--- src/Util_TEST.cc | 20 +- src/WorkerPool.cc | 4 +- src/WorkerPool_TEST.cc | 2 +- test/integration/console.cc | 12 +- test/integration/mesh.cc | 14 +- test/integration/plugin.cc | 62 ++--- test/performance/plugin_specialization.cc | 20 +- test/plugins/BadPluginAPIVersionNew.cc | 4 +- test/plugins/BadPluginAPIVersionOld.cc | 4 +- test/plugins/BadPluginAlign.cc | 6 +- test/plugins/BadPluginSize.cc | 6 +- .../plugin_bad_const_assignment.cc | 4 +- .../plugin_bad_const_construct.cc | 2 +- .../include/gz/common/testing/TestPaths.hh | 4 +- .../common/testing/detail/AutoLogFixture.hh | 10 +- testing/src/BazelTestPaths.cc | 2 +- testing/src/BazelTestPaths_TEST.cc | 10 +- testing/src/CMakeTestPaths.cc | 2 +- testing/src/CMakeTestPaths_TEST.cc | 10 +- testing/src/TestPaths.cc | 4 +- tutorials/hw-encoding.md | 4 +- tutorials/profiler.md | 2 +- 114 files changed, 1182 insertions(+), 1182 deletions(-) diff --git a/av/src/AudioDecoder.cc b/av/src/AudioDecoder.cc index 484c93b6d..092f022c0 100644 --- a/av/src/AudioDecoder.cc +++ b/av/src/AudioDecoder.cc @@ -26,7 +26,7 @@ using namespace gz; using namespace common; -class ignition::common::AudioDecoder::Implementation +class gz::common::AudioDecoder::Implementation { /// \brief Destructor public: ~Implementation(); @@ -48,7 +48,7 @@ class ignition::common::AudioDecoder::Implementation }; ///////////////////////////////////////////////// -ignition::common::AudioDecoder::Implementation::~Implementation() +gz::common::AudioDecoder::Implementation::~Implementation() { // Close the codec if (this->codecCtx) @@ -61,9 +61,9 @@ ignition::common::AudioDecoder::Implementation::~Implementation() ///////////////////////////////////////////////// AudioDecoder::AudioDecoder() - : dataPtr(ignition::utils::MakeUniqueImpl()) + : dataPtr(gz::utils::MakeUniqueImpl()) { - ignition::common::load(); + gz::common::load(); } ///////////////////////////////////////////////// diff --git a/av/src/HWEncoder.cc b/av/src/HWEncoder.cc index a117102f6..72cea0ca3 100644 --- a/av/src/HWEncoder.cc +++ b/av/src/HWEncoder.cc @@ -29,7 +29,7 @@ using namespace gz; using namespace common; using namespace std; -class ignition::common::HWEncoder::Implementation +class gz::common::HWEncoder::Implementation { /// \brief Device reference for HW-accelerated encoding. public: AVBufferRef* hwDevice = nullptr; @@ -679,7 +679,7 @@ AVFrame* HWEncoder::GetFrameForEncoder(AVFrame* _inFrame) HWEncoder::HWEncoder(const FlagSet _allowedHwEncoders, const std::string& _hwAccelDevice, std::optional _useHwSurface) - : dataPtr(ignition::utils::MakeUniqueImpl()) + : dataPtr(gz::utils::MakeUniqueImpl()) { this->dataPtr->initHwEncoders = _allowedHwEncoders; this->dataPtr->initHwDevice = _hwAccelDevice; diff --git a/av/src/Util.cc b/av/src/Util.cc index 1cf75596b..896125606 100644 --- a/av/src/Util.cc +++ b/av/src/Util.cc @@ -67,7 +67,7 @@ void logCallback(void *_ptr, int _level, const char *_fmt, va_list _args) } ///////////////////////////////////////////////// -void ignition::common::load() +void gz::common::load() { static bool first = true; if (first) diff --git a/av/src/Video.cc b/av/src/Video.cc index 2e055c5d7..ea9251c60 100644 --- a/av/src/Video.cc +++ b/av/src/Video.cc @@ -24,7 +24,7 @@ using namespace gz; using namespace common; // Private data structure for the Video class -class ignition::common::Video::Implementation +class gz::common::Video::Implementation { /// \brief libav Format I/O context public: AVFormatContext *formatCtx = nullptr; @@ -61,10 +61,10 @@ class ignition::common::Video::Implementation ///////////////////////////////////////////////// Video::Video() - : dataPtr(ignition::utils::MakeUniqueImpl()) + : dataPtr(gz::utils::MakeUniqueImpl()) { // Make sure libav is loaded. - ignition::common::load(); + gz::common::load(); } ///////////////////////////////////////////////// diff --git a/av/src/VideoEncoder.cc b/av/src/VideoEncoder.cc index 3925b4894..42f46218e 100644 --- a/av/src/VideoEncoder.cc +++ b/av/src/VideoEncoder.cc @@ -34,7 +34,7 @@ using namespace std; // Private data class // hidden visibility specifier has to be explicitly set to silent a gcc warning -class IGNITION_COMMON_AV_HIDDEN ignition::common::VideoEncoder::Implementation +class IGNITION_COMMON_AV_HIDDEN gz::common::VideoEncoder::Implementation { /// \brief Name of the file which stores the video while it is being /// recorded. @@ -144,10 +144,10 @@ AVFrame* VideoEncoder::Implementation::GetFrameForEncoder(AVFrame* _inFrame) ///////////////////////////////////////////////// VideoEncoder::VideoEncoder() - : dataPtr(ignition::utils::MakeUniqueImpl()) + : dataPtr(gz::utils::MakeUniqueImpl()) { // Make sure libav is loaded. - ignition::common::load(); + gz::common::load(); } ///////////////////////////////////////////////// diff --git a/av/src/VideoEncoder_TEST.cc b/av/src/VideoEncoder_TEST.cc index 5b7d8aea2..9008b0121 100644 --- a/av/src/VideoEncoder_TEST.cc +++ b/av/src/VideoEncoder_TEST.cc @@ -34,7 +34,7 @@ class VideoEncoderTest : public common::testing::AutoLogFixture ASSERT_TRUE(tempDir->Valid()) << tempDir->Path(); } - public: std::shared_ptr tempDir; + public: std::shared_ptr tempDir; }; ///////////////////////////////////////////////// diff --git a/events/include/gz/common/MouseEvent.hh b/events/include/gz/common/MouseEvent.hh index b9116d8d4..76a11737a 100644 --- a/events/include/gz/common/MouseEvent.hh +++ b/events/include/gz/common/MouseEvent.hh @@ -81,11 +81,11 @@ namespace gz /// \brief Get mouse pointer position on the screen. /// \return Mouse pointer position on the screen. - public: ignition::math::Vector2i Pos() const; + public: gz::math::Vector2i Pos() const; /// \brief Set mouse pointer position on the screen. /// \param[in] _pos Mouse pointer position on the screen. - public: void SetPos(const ignition::math::Vector2i &_pos); + public: void SetPos(const gz::math::Vector2i &_pos); /// \brief Set mouse pointer position on the screen. /// \param[in] _x Mouse pointer X position on the screen. @@ -94,11 +94,11 @@ namespace gz /// \brief Get the previous position. /// \return The previous mouse position. - public: ignition::math::Vector2i PrevPos() const; + public: gz::math::Vector2i PrevPos() const; /// \brief Set the previous position. /// \param[in] _pos Previous mouse pointer position on the screen. - public: void SetPrevPos(const ignition::math::Vector2i &_pos); + public: void SetPrevPos(const gz::math::Vector2i &_pos); /// \brief Set the previous position. /// \param[in] _x Previous mouse pointer X position on the screen. @@ -107,11 +107,11 @@ namespace gz /// \brief Get the position of button press. /// \return Screen position of a button press. - public: ignition::math::Vector2i PressPos() const; + public: gz::math::Vector2i PressPos() const; /// \brief Set the position of button press. /// \param[in] _pos Mouse pointer position on the screen. - public: void SetPressPos(const ignition::math::Vector2i &_pos); + public: void SetPressPos(const gz::math::Vector2i &_pos); /// \brief Set the position of button press. /// \param[in] _x Mouse pointer X position on the screen. @@ -120,11 +120,11 @@ namespace gz /// \brief Get the scroll position. /// \return The scroll position. - public: ignition::math::Vector2i Scroll() const; + public: gz::math::Vector2i Scroll() const; /// \brief Set the scroll position. /// \param[in] _scroll Scroll position. - public: void SetScroll(const ignition::math::Vector2i &_scroll); + public: void SetScroll(const gz::math::Vector2i &_scroll); /// \brief Set the scroll position. /// \param[in] _x Scroll X position. diff --git a/events/src/KeyEvent.cc b/events/src/KeyEvent.cc index 2ad8dca77..8fae383f4 100644 --- a/events/src/KeyEvent.cc +++ b/events/src/KeyEvent.cc @@ -19,7 +19,7 @@ using namespace gz; using namespace common; -class ignition::common::KeyEventPrivate +class gz::common::KeyEventPrivate { /// \brief Event type. public: KeyEvent::EventType type = KeyEvent::NO_EVENT; diff --git a/events/src/MouseEvent.cc b/events/src/MouseEvent.cc index 87008f2d5..54f4efaa0 100644 --- a/events/src/MouseEvent.cc +++ b/events/src/MouseEvent.cc @@ -22,7 +22,7 @@ using namespace gz; using namespace common; /// \brief Mouse event private data -class ignition::common::MouseEventPrivate +class gz::common::MouseEventPrivate { /// \brief Constructor. public: MouseEventPrivate() @@ -33,16 +33,16 @@ class ignition::common::MouseEventPrivate {} /// \brief Mouse pointer position on the screen. - public: ignition::math::Vector2i pos; + public: gz::math::Vector2i pos; /// \brief Previous position. - public: ignition::math::Vector2i prevPos; + public: gz::math::Vector2i prevPos; /// \brief Position of button press. - public: ignition::math::Vector2i pressPos; + public: gz::math::Vector2i pressPos; /// \brief Scroll position. - public: ignition::math::Vector2i scroll; + public: gz::math::Vector2i scroll; /// \brief Scaling factor. public: float moveScale; @@ -88,13 +88,13 @@ MouseEvent::~MouseEvent() } ///////////////////////////////////////////////// -ignition::math::Vector2i MouseEvent::Pos() const +gz::math::Vector2i MouseEvent::Pos() const { return this->dataPtr->pos; } ///////////////////////////////////////////////// -void MouseEvent::SetPos(const ignition::math::Vector2i &_pos) +void MouseEvent::SetPos(const gz::math::Vector2i &_pos) { this->dataPtr->pos = _pos; } @@ -106,13 +106,13 @@ void MouseEvent::SetPos(int _x, int _y) } ///////////////////////////////////////////////// -ignition::math::Vector2i MouseEvent::PrevPos() const +gz::math::Vector2i MouseEvent::PrevPos() const { return this->dataPtr->prevPos; } ///////////////////////////////////////////////// -void MouseEvent::SetPrevPos(const ignition::math::Vector2i &_pos) +void MouseEvent::SetPrevPos(const gz::math::Vector2i &_pos) { this->dataPtr->prevPos = _pos; } @@ -124,13 +124,13 @@ void MouseEvent::SetPrevPos(int _x, int _y) } ///////////////////////////////////////////////// -ignition::math::Vector2i MouseEvent::PressPos() const +gz::math::Vector2i MouseEvent::PressPos() const { return this->dataPtr->pressPos; } ///////////////////////////////////////////////// -void MouseEvent::SetPressPos(const ignition::math::Vector2i &_pos) +void MouseEvent::SetPressPos(const gz::math::Vector2i &_pos) { this->dataPtr->pressPos = _pos; } @@ -142,13 +142,13 @@ void MouseEvent::SetPressPos(int _x, int _y) } ///////////////////////////////////////////////// -ignition::math::Vector2i MouseEvent::Scroll() const +gz::math::Vector2i MouseEvent::Scroll() const { return this->dataPtr->scroll; } ///////////////////////////////////////////////// -void MouseEvent::SetScroll(const ignition::math::Vector2i &_scroll) +void MouseEvent::SetScroll(const gz::math::Vector2i &_scroll) { this->dataPtr->scroll = _scroll; } diff --git a/events/src/MouseEvent_TEST.cc b/events/src/MouseEvent_TEST.cc index 559d1ce81..fe8648d9f 100644 --- a/events/src/MouseEvent_TEST.cc +++ b/events/src/MouseEvent_TEST.cc @@ -28,10 +28,10 @@ class MouseEvent : public common::testing::AutoLogFixture { }; ///////////////////////////////////////////////// TEST_F(MouseEvent, CopyConstructor) { - ignition::math::Vector2i pos(1, 25); - ignition::math::Vector2i prevPos(2, 26); - ignition::math::Vector2i pressPos(3, 24); - ignition::math::Vector2i scroll(2, 3); + gz::math::Vector2i pos(1, 25); + gz::math::Vector2i prevPos(2, 26); + gz::math::Vector2i pressPos(3, 24); + gz::math::Vector2i scroll(2, 3); float moveScale = 0.3f; bool dragging = true; common::MouseEvent::EventType type = common::MouseEvent::PRESS; @@ -95,10 +95,10 @@ TEST_F(MouseEvent, CopyConstructor) EXPECT_EQ(otherEvent2.Control(), control); // update the original mouse event values - ignition::math::Vector2i newPos(3, 18); - ignition::math::Vector2i newPrevPos(2, 17); - ignition::math::Vector2i newPressPos(3, 16); - ignition::math::Vector2i newScroll(1, 2); + gz::math::Vector2i newPos(3, 18); + gz::math::Vector2i newPrevPos(2, 17); + gz::math::Vector2i newPressPos(3, 16); + gz::math::Vector2i newScroll(1, 2); float newMoveScale = 0.4f; bool newDragging = false; common::MouseEvent::EventType newType = common::MouseEvent::RELEASE; @@ -162,10 +162,10 @@ TEST_F(MouseEvent, CopyConstructor) ///////////////////////////////////////////////// TEST_F(MouseEvent, Assignment) { - ignition::math::Vector2i pos(1, 25); - ignition::math::Vector2i prevPos(2, 26); - ignition::math::Vector2i pressPos(3, 24); - ignition::math::Vector2i scroll(2, 3); + gz::math::Vector2i pos(1, 25); + gz::math::Vector2i prevPos(2, 26); + gz::math::Vector2i pressPos(3, 24); + gz::math::Vector2i scroll(2, 3); float moveScale = 0.3f; bool dragging = true; common::MouseEvent::EventType type = common::MouseEvent::PRESS; @@ -217,10 +217,10 @@ TEST_F(MouseEvent, Assignment) EXPECT_EQ(otherEvent.Control(), control); // update the original mouse event values - ignition::math::Vector2i newPos(3, 18); - ignition::math::Vector2i newPrevPos(2, 17); - ignition::math::Vector2i newPressPos(3, 16); - ignition::math::Vector2i newScroll(1, 2); + gz::math::Vector2i newPos(3, 18); + gz::math::Vector2i newPrevPos(2, 17); + gz::math::Vector2i newPressPos(3, 16); + gz::math::Vector2i newScroll(1, 2); float newMoveScale = 0.4f; bool newDragging = false; common::MouseEvent::EventType newType = common::MouseEvent::RELEASE; diff --git a/examples/console.cc b/examples/console.cc index 7b5194c57..ea50cf8c6 100644 --- a/examples/console.cc +++ b/examples/console.cc @@ -25,7 +25,7 @@ int main(int argc, char **argv) ignerr << "This is an error" << std::endl; // Change verbosity to level 4, all messages show - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); igndbg << "This is a debug message" << std::endl; ignmsg << "This is an informational message" << std::endl; ignwarn << "This is a warning" << std::endl; diff --git a/examples/logging_performance.cc b/examples/logging_performance.cc index d72bc6558..1ab0a4e4b 100644 --- a/examples/logging_performance.cc +++ b/examples/logging_performance.cc @@ -145,7 +145,7 @@ void SaveResultToBucketFile( void run(size_t number_of_threads) { g_counter = 0; - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); std::vector threads(number_of_threads); std::map> threads_result; diff --git a/examples/profiler.cc b/examples/profiler.cc index b2c41e3ef..367a7e637 100644 --- a/examples/profiler.cc +++ b/examples/profiler.cc @@ -115,13 +115,13 @@ void sigHandler(int _signal) int main(int argc, char** argv) { - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); IGN_PROFILE_THREAD_NAME("main"); running = true; // Connect signal handler - ignition::common::SignalHandler handler; + gz::common::SignalHandler handler; handler.AddCallback(sigHandler); // Spin up a couple threads with interesting content. diff --git a/geospatial/include/gz/common/geospatial/Dem.hh b/geospatial/include/gz/common/geospatial/Dem.hh index 720b58c52..2b6ad03e4 100644 --- a/geospatial/include/gz/common/geospatial/Dem.hh +++ b/geospatial/include/gz/common/geospatial/Dem.hh @@ -79,8 +79,8 @@ namespace gz /// \param[out] _latitude Georeferenced latitude. /// \param[out] _longitude Georeferenced longitude. /// \return True if able to retrieve origin coordinates. False otherwise. - public: bool GeoReferenceOrigin(ignition::math::Angle &_latitude, - ignition::math::Angle &_longitude) const; + public: bool GeoReferenceOrigin(gz::math::Angle &_latitude, + gz::math::Angle &_longitude) const; /// \brief Get the terrain's height. Due to the Ogre constrains, this /// value will be a power of two plus one. The value returned might be @@ -120,8 +120,8 @@ namespace gz /// \param[out] _heights Vector containing the terrain heights. public: void FillHeightMap(const int _subSampling, const unsigned int _vertSize, - const ignition::math::Vector3d &_size, - const ignition::math::Vector3d &_scale, + const gz::math::Vector3d &_size, + const gz::math::Vector3d &_scale, const bool _flipY, std::vector &_heights) const override; @@ -133,8 +133,8 @@ namespace gz /// \param[out] _longitude Georeferenced longitude. /// \return True if able to retrieve coordinates. False otherwise. private: bool GeoReference(double _x, double _y, - ignition::math::Angle &_latitude, - ignition::math::Angle &_longitude) const; + gz::math::Angle &_latitude, + gz::math::Angle &_longitude) const; /// \brief Get the terrain file as a data array. Due to the Ogre /// constrains, the data might be stored in a bigger vector representing diff --git a/geospatial/include/gz/common/geospatial/HeightmapData.hh b/geospatial/include/gz/common/geospatial/HeightmapData.hh index 30d982cb6..8fca2b167 100644 --- a/geospatial/include/gz/common/geospatial/HeightmapData.hh +++ b/geospatial/include/gz/common/geospatial/HeightmapData.hh @@ -43,8 +43,8 @@ namespace gz /// is filled. /// \param[out] _heights Vector containing the terrain heights. public: virtual void FillHeightMap(int _subSampling, - unsigned int _vertSize, const ignition::math::Vector3d &_size, - const ignition::math::Vector3d &_scale, bool _flipY, + unsigned int _vertSize, const gz::math::Vector3d &_size, + const gz::math::Vector3d &_scale, bool _flipY, std::vector &_heights) const = 0; /// \brief Get the terrain's height. diff --git a/geospatial/include/gz/common/geospatial/ImageHeightmap.hh b/geospatial/include/gz/common/geospatial/ImageHeightmap.hh index de4657d9e..dc46d0bae 100644 --- a/geospatial/include/gz/common/geospatial/ImageHeightmap.hh +++ b/geospatial/include/gz/common/geospatial/ImageHeightmap.hh @@ -32,7 +32,7 @@ namespace gz { /// \brief Encapsulates an image that will be interpreted as a heightmap. class IGNITION_COMMON_GEOSPATIAL_VISIBLE ImageHeightmap - : public ignition::common::HeightmapData + : public gz::common::HeightmapData { /// \brief Constructor /// \param[in] _filename the path to the image @@ -45,8 +45,8 @@ namespace gz // Documentation inherited. public: void FillHeightMap(int _subSampling, unsigned int _vertSize, - const ignition::math::Vector3d &_size, - const ignition::math::Vector3d &_scale, bool _flipY, + const gz::math::Vector3d &_size, + const gz::math::Vector3d &_scale, bool _flipY, std::vector &_heights) const; // Documentation inherited. @@ -62,7 +62,7 @@ namespace gz public: float MaxElevation() const; /// \brief Image containing the heightmap data. - private: ignition::common::Image img; + private: gz::common::Image img; /// \brief Get Heightmap heights given the image /// \param[in] _data Image data @@ -77,8 +77,8 @@ namespace gz private: template void FillHeights(T *_data, int _imgHeight, int _imgWidth, unsigned int _pitch, int _subSampling, unsigned int _vertSize, - const ignition::math::Vector3d &_size, - const ignition::math::Vector3d &_scale, + const gz::math::Vector3d &_size, + const gz::math::Vector3d &_scale, bool _flipY, std::vector &_heights) const { // bytes per pixel diff --git a/geospatial/src/Dem.cc b/geospatial/src/Dem.cc index 2e77349c6..5d6343759 100644 --- a/geospatial/src/Dem.cc +++ b/geospatial/src/Dem.cc @@ -27,7 +27,7 @@ using namespace gz; using namespace common; -class ignition::common::Dem::Implementation +class gz::common::Dem::Implementation { /// \brief A set of associated raster bands. public: GDALDataset *dataSet; @@ -67,7 +67,7 @@ class ignition::common::Dem::Implementation ////////////////////////////////////////////////// Dem::Dem() -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->dataSet = nullptr; GDALAllRegister(); @@ -101,8 +101,8 @@ int Dem::Load(const std::string &_filename) unsigned int height; int xSize, ySize; double upLeftX, upLeftY, upRightX, upRightY, lowLeftX, lowLeftY; - ignition::math::Angle upLeftLat, upLeftLong, upRightLat, upRightLong; - ignition::math::Angle lowLeftLat, lowLeftLong; + gz::math::Angle upLeftLat, upLeftLong, upRightLat, upRightLong; + gz::math::Angle lowLeftLat, lowLeftLong; // Sanity check std::string fullName = _filename; @@ -175,15 +175,15 @@ int Dem::Load(const std::string &_filename) } // Set the terrain's side (the terrain will be squared after the padding) - if (ignition::math::isPowerOfTwo(ySize - 1)) + if (gz::math::isPowerOfTwo(ySize - 1)) height = ySize; else - height = ignition::math::roundUpPowerOfTwo(ySize) + 1; + height = gz::math::roundUpPowerOfTwo(ySize) + 1; - if (ignition::math::isPowerOfTwo(xSize - 1)) + if (gz::math::isPowerOfTwo(xSize - 1)) width = xSize; else - width = ignition::math::roundUpPowerOfTwo(xSize) + 1; + width = gz::math::roundUpPowerOfTwo(xSize) + 1; this->dataPtr->side = std::max(width, height); @@ -204,8 +204,8 @@ int Dem::Load(const std::string &_filename) if (validNoData <= 0) noDataValue = defaultNoDataValue; - double min = ignition::math::MAX_D; - double max = -ignition::math::MAX_D; + double min = gz::math::MAX_D; + double max = -gz::math::MAX_D; for (const auto &d : this->dataPtr->demData) { if (math::equal(d, this->dataPtr->bufferVal)) @@ -225,8 +225,8 @@ int Dem::Load(const std::string &_filename) if (d > max) max = d; } - if (ignition::math::equal(min, ignition::math::MAX_D) || - ignition::math::equal(max, -ignition::math::MAX_D)) + if (gz::math::equal(min, gz::math::MAX_D) || + gz::math::equal(max, -gz::math::MAX_D)) { ignwarn << "DEM is composed of 'nodata' values!" << std::endl; } @@ -273,7 +273,7 @@ float Dem::MaxElevation() const ////////////////////////////////////////////////// bool Dem::GeoReference(double _x, double _y, - ignition::math::Angle &_latitude, ignition::math::Angle &_longitude) const + gz::math::Angle &_latitude, gz::math::Angle &_longitude) const { if (this->dataPtr->isNonEarthDem) { @@ -329,8 +329,8 @@ bool Dem::GeoReference(double _x, double _y, } ////////////////////////////////////////////////// -bool Dem::GeoReferenceOrigin(ignition::math::Angle &_latitude, - ignition::math::Angle &_longitude) const +bool Dem::GeoReferenceOrigin(gz::math::Angle &_latitude, + gz::math::Angle &_longitude) const { return this->GeoReference(0, 0, _latitude, _longitude); } @@ -371,8 +371,8 @@ double Dem::WorldHeight() const ////////////////////////////////////////////////// void Dem::FillHeightMap(int _subSampling, unsigned int _vertSize, - const ignition::math::Vector3d &_size, - const ignition::math::Vector3d &_scale, + const gz::math::Vector3d &_size, + const gz::math::Vector3d &_scale, bool _flipY, std::vector &_heights) const { if (_subSampling <= 0) diff --git a/geospatial/src/Dem_TEST.cc b/geospatial/src/Dem_TEST.cc index 9cd48db56..8fbfe5321 100644 --- a/geospatial/src/Dem_TEST.cc +++ b/geospatial/src/Dem_TEST.cc @@ -123,7 +123,7 @@ TEST_F(DemTest, BasicAPI) EXPECT_DOUBLE_EQ(inf, dem.Elevation(width, height)); // Check GeoReferenceOrigin() - ignition::math::Angle latitude, longitude; + gz::math::Angle latitude, longitude; EXPECT_TRUE(dem.GeoReferenceOrigin(latitude, longitude)); EXPECT_FLOAT_EQ(38.001667f, latitude.Degree()); EXPECT_FLOAT_EQ(-122.22278f, longitude.Degree()); @@ -139,8 +139,8 @@ TEST_F(DemTest, FillHeightmap) // Use FillHeightMap() to retrieve a vector after some transformations int subsampling; unsigned vertSize; - ignition::math::Vector3d size; - ignition::math::Vector3d scale; + gz::math::Vector3d size; + gz::math::Vector3d scale; bool flipY; std::vector elevations; @@ -152,7 +152,7 @@ TEST_F(DemTest, FillHeightmap) scale.X(size.X() / vertSize); scale.Y(size.Y() / vertSize); - if (ignition::math::equal(dem.MaxElevation(), 0.0f)) + if (gz::math::equal(dem.MaxElevation(), 0.0f)) scale.Z(fabs(size.Z())); else scale.Z(fabs(size.Z()) / dem.MaxElevation()); @@ -243,7 +243,7 @@ TEST_F(DemTest, NonEarthDem) EXPECT_FLOAT_EQ(-1, dem.WorldWidth()); // unable to get coordinates in WGS84 - ignition::math::Angle latitude, longitude; + gz::math::Angle latitude, longitude; EXPECT_FALSE(dem.GeoReferenceOrigin(latitude, longitude)); // The Load() method in Dem.cc should set the diff --git a/geospatial/src/ImageHeightmap.cc b/geospatial/src/ImageHeightmap.cc index 55d039e8b..5f58c99fa 100644 --- a/geospatial/src/ImageHeightmap.cc +++ b/geospatial/src/ImageHeightmap.cc @@ -39,8 +39,8 @@ int ImageHeightmap::Load(const std::string &_filename) ////////////////////////////////////////////////// void ImageHeightmap::FillHeightMap(int _subSampling, - unsigned int _vertSize, const ignition::math::Vector3d &_size, - const ignition::math::Vector3d &_scale, bool _flipY, + unsigned int _vertSize, const gz::math::Vector3d &_size, + const gz::math::Vector3d &_scale, bool _flipY, std::vector &_heights) const { // Resize the vector to match the size of the vertices. @@ -62,25 +62,25 @@ void ImageHeightmap::FillHeightMap(int _subSampling, unsigned int count; this->img.Data(&data, count); - if (imgFormat == ignition::common::Image::PixelFormatType::L_INT8 || - imgFormat == ignition::common::Image::PixelFormatType::RGB_INT8 || - imgFormat == ignition::common::Image::PixelFormatType::RGBA_INT8 || - imgFormat == ignition::common::Image::PixelFormatType::BAYER_BGGR8 || - imgFormat == ignition::common::Image::PixelFormatType::BAYER_GBRG8 || - imgFormat == ignition::common::Image::PixelFormatType::BAYER_GRBG8 || - imgFormat == ignition::common::Image::PixelFormatType::BAYER_GRBG8 || - imgFormat == ignition::common::Image::PixelFormatType::BAYER_RGGB8 || - imgFormat == ignition::common::Image::PixelFormatType::BGR_INT8 || - imgFormat == ignition::common::Image::PixelFormatType::BGRA_INT8) + if (imgFormat == gz::common::Image::PixelFormatType::L_INT8 || + imgFormat == gz::common::Image::PixelFormatType::RGB_INT8 || + imgFormat == gz::common::Image::PixelFormatType::RGBA_INT8 || + imgFormat == gz::common::Image::PixelFormatType::BAYER_BGGR8 || + imgFormat == gz::common::Image::PixelFormatType::BAYER_GBRG8 || + imgFormat == gz::common::Image::PixelFormatType::BAYER_GRBG8 || + imgFormat == gz::common::Image::PixelFormatType::BAYER_GRBG8 || + imgFormat == gz::common::Image::PixelFormatType::BAYER_RGGB8 || + imgFormat == gz::common::Image::PixelFormatType::BGR_INT8 || + imgFormat == gz::common::Image::PixelFormatType::BGRA_INT8) { this->FillHeights(data, imgHeight, imgWidth, pitch, _subSampling, _vertSize, _size, _scale, _flipY, _heights); } - else if (imgFormat == ignition::common::Image::PixelFormatType::BGR_INT16 || - imgFormat == ignition::common::Image::PixelFormatType::L_INT16 || - imgFormat == ignition::common::Image::PixelFormatType::RGB_FLOAT16 || - imgFormat == ignition::common::Image::PixelFormatType::RGB_INT16 || - imgFormat == ignition::common::Image::PixelFormatType::R_FLOAT16) + else if (imgFormat == gz::common::Image::PixelFormatType::BGR_INT16 || + imgFormat == gz::common::Image::PixelFormatType::L_INT16 || + imgFormat == gz::common::Image::PixelFormatType::RGB_FLOAT16 || + imgFormat == gz::common::Image::PixelFormatType::RGB_INT16 || + imgFormat == gz::common::Image::PixelFormatType::R_FLOAT16) { uint16_t *dataShort = reinterpret_cast(data); this->FillHeights(dataShort, imgHeight, imgWidth, pitch, diff --git a/geospatial/src/ImageHeightmap_TEST.cc b/geospatial/src/ImageHeightmap_TEST.cc index 547713194..5782c0b9e 100644 --- a/geospatial/src/ImageHeightmap_TEST.cc +++ b/geospatial/src/ImageHeightmap_TEST.cc @@ -73,8 +73,8 @@ TEST_F(ImageHeightmapTest, FillHeightmap) // Use FillHeightMap() to retrieve a vector after some transformations int subsampling; unsigned vertSize; - ignition::math::Vector3d size; - ignition::math::Vector3d scale; + gz::math::Vector3d size; + gz::math::Vector3d scale; bool flipY; std::vector elevations; @@ -85,7 +85,7 @@ TEST_F(ImageHeightmapTest, FillHeightmap) size.Z(10); scale.X(size.X() / vertSize); scale.Y(size.Y() / vertSize); - if (ignition::math::equal(img.MaxElevation(), 0.0f)) + if (gz::math::equal(img.MaxElevation(), 0.0f)) scale.Z(fabs(size.Z())); else scale.Z(fabs(size.Z()) / img.MaxElevation()); diff --git a/graphics/include/gz/common/GTSMeshUtils.hh b/graphics/include/gz/common/GTSMeshUtils.hh index ee3ec6f81..1d0912817 100644 --- a/graphics/include/gz/common/GTSMeshUtils.hh +++ b/graphics/include/gz/common/GTSMeshUtils.hh @@ -45,8 +45,8 @@ namespace gz /// resulting triangles. /// \return True on success. public: static bool DelaunayTriangulation( - const std::vector &_vertices, - const std::vector &_edges, + const std::vector &_vertices, + const std::vector &_edges, SubMesh *_submesh); /// \brief Perform delaunay triangulation on input vertices. @@ -55,8 +55,8 @@ namespace gz /// indices from _vertices /// \return Triangulated GTS surface. private: static GtsSurface *DelaunayTriangulation( - const std::vector &_vertices, - const std::vector &_edges); + const std::vector &_vertices, + const std::vector &_edges); }; } } diff --git a/graphics/include/gz/common/Image.hh b/graphics/include/gz/common/Image.hh index 0080f7eba..90d0a5806 100644 --- a/graphics/include/gz/common/Image.hh +++ b/graphics/include/gz/common/Image.hh @@ -234,7 +234,7 @@ namespace gz // convert to rgb image // color is grayscale, i.e. r == b == g double range = static_cast(max - min); - if (ignition::math::equal(range, 0.0)) + if (gz::math::equal(range, 0.0)) range = 1.0; unsigned int idx = 0; for (unsigned int j = 0; j < _height; ++j) diff --git a/graphics/include/gz/common/Material.hh b/graphics/include/gz/common/Material.hh index 00dcaabfb..c4367f565 100644 --- a/graphics/include/gz/common/Material.hh +++ b/graphics/include/gz/common/Material.hh @@ -263,7 +263,7 @@ namespace gz /// param[in] _out the output stream to extract from /// param[out] _m the material information public: friend std::ostream &operator<<(std::ostream &_out, - const ignition::common::Material &_m) + const gz::common::Material &_m) { _out << "Material:\n"; _out << " Name: " << _m.Name() << "\n"; diff --git a/graphics/include/gz/common/Mesh.hh b/graphics/include/gz/common/Mesh.hh index efa28add7..7a3d7488d 100644 --- a/graphics/include/gz/common/Mesh.hh +++ b/graphics/include/gz/common/Mesh.hh @@ -64,11 +64,11 @@ namespace gz /// \brief Get the maximun X, Y, Z values /// \return The upper bounds of the bounding box - public: ignition::math::Vector3d Max() const; + public: gz::math::Vector3d Max() const; /// \brief Get the minimum X, Y, Z values /// \return The lower bounds of the bounding box - public: ignition::math::Vector3d Min() const; + public: gz::math::Vector3d Min() const; /// \brief Get the number of vertices /// \return The number of vertices @@ -149,15 +149,15 @@ namespace gz /// \param[out] _center Center of the bounding box /// \param[out] _minXYZ Bounding box minimum values /// \param[out] _maxXYZ Bounding box maximum values - public: void AABB(ignition::math::Vector3d &_center, - ignition::math::Vector3d &_minXYZ, - ignition::math::Vector3d &_maxXYZ) const; + public: void AABB(gz::math::Vector3d &_center, + gz::math::Vector3d &_minXYZ, + gz::math::Vector3d &_maxXYZ) const; /// \brief Generate texture coordinates using spherical projection /// from center /// \param[in] _center Center of the projection public: void GenSphericalTexCoord( - const ignition::math::Vector3d &_center); + const gz::math::Vector3d &_center); /// \brief Get the skeleton to which this mesh is attached. /// \return Pointer to skeleton or nullptr if none is present. @@ -173,21 +173,21 @@ namespace gz /// \brief Scale all vertices by _factor /// \param _factor Scaling factor - public: void Scale(const ignition::math::Vector3d &_factor); + public: void Scale(const gz::math::Vector3d &_factor); /// \brief Set the scale all vertices /// \param[in] _factor Scaling vector - public: void SetScale(const ignition::math::Vector3d &_factor); + public: void SetScale(const gz::math::Vector3d &_factor); /// \brief Move the center of the mesh to the given coordinate in the /// mesh frame. This will move all the vertices in all submeshes. /// \param[in] _center Location of the mesh center. - public: void Center(const ignition::math::Vector3d &_center = - ignition::math::Vector3d::Zero); + public: void Center(const gz::math::Vector3d &_center = + gz::math::Vector3d::Zero); /// \brief Move all vertices in all submeshes by _vec. /// \param[in] _vec Amount to translate vertices. - public: void Translate(const ignition::math::Vector3d &_vec); + public: void Translate(const gz::math::Vector3d &_vec); /// \brief Compute the volume of this mesh. The primitive type /// must be TRIANGLES. diff --git a/graphics/include/gz/common/MeshCSG.hh b/graphics/include/gz/common/MeshCSG.hh index 37b95c615..6cb2430c6 100644 --- a/graphics/include/gz/common/MeshCSG.hh +++ b/graphics/include/gz/common/MeshCSG.hh @@ -53,7 +53,7 @@ namespace gz /// \return a pointer to the created mesh public: Mesh *CreateBoolean(const Mesh *_m1, const Mesh *_m2, const int _operation, - const ignition::math::Pose3d &_offset = ignition::math::Pose3d::Zero); + const gz::math::Pose3d &_offset = gz::math::Pose3d::Zero); /// \brief Helper method for converting Mesh to GTS Surface private: void ConvertMeshToGTS(const Mesh *mesh, GtsSurface *surface); diff --git a/graphics/include/gz/common/MeshManager.hh b/graphics/include/gz/common/MeshManager.hh index 964c81765..9defab24e 100644 --- a/graphics/include/gz/common/MeshManager.hh +++ b/graphics/include/gz/common/MeshManager.hh @@ -83,15 +83,15 @@ namespace gz /// \param[out] _min_xyz the bounding box minimum /// \param[out] _max_xyz the bounding box maximum public: void MeshAABB(const Mesh *_mesh, - ignition::math::Vector3d &_center, - ignition::math::Vector3d &_min_xyz, - ignition::math::Vector3d &_max_xyz); + gz::math::Vector3d &_center, + gz::math::Vector3d &_min_xyz, + gz::math::Vector3d &_max_xyz); /// \brief generate spherical texture coordinates /// \param[in] _mesh Pointer to the mesh /// \param[in] _center Center of the mesh public: void GenSphericalTexCoord(const Mesh *_mesh, - const ignition::math::Vector3d &_center); + const gz::math::Vector3d &_center); /// \brief Add a mesh to the manager. /// @@ -112,7 +112,7 @@ namespace gz /// \brief Get a mesh by name. /// \param[in] _name the name of the mesh to look for /// \return the mesh or nullptr if not found - public: const ignition::common::Mesh *MeshByName( + public: const gz::common::Mesh *MeshByName( const std::string &_name) const; /// \brief Return true if the mesh exists. @@ -132,8 +132,8 @@ namespace gz /// \param[in] _sides the x y x dimentions of eah side in meter /// \param[in] _uvCoords the texture coordinates public: void CreateBox(const std::string &_name, - const ignition::math::Vector3d &_sides, - const ignition::math::Vector2d &_uvCoords); + const gz::math::Vector3d &_sides, + const gz::math::Vector2d &_uvCoords); /// \brief Create an extruded mesh from polylines. The polylines are /// assumed to be closed and non-intersecting. Delaunay triangulation is @@ -148,7 +148,7 @@ namespace gz /// edges and remove the holes in the shape. /// \param[in] _height the height of extrusion public: void CreateExtrudedPolyline(const std::string &_name, - const std::vector > + const std::vector > &_vertices, const double _height); /// \brief Create a cylinder mesh @@ -169,7 +169,7 @@ namespace gz /// \param[in] _rings the number of circles along the height /// \param[in] _segments the number of segment per circle public: void CreateEllipsoid(const std::string &_name, - const ignition::math::Vector3d &_radii, + const gz::math::Vector3d &_radii, const unsigned int _rings, const unsigned int _segments); @@ -222,9 +222,9 @@ namespace gz /// \param[in] _segments number of segments in x and y /// \param[in] _uvTile the texture tile size in x and y public: void CreatePlane(const std::string &_name, - const ignition::math::Planed &_plane, - const ignition::math::Vector2d &_segments, - const ignition::math::Vector2d &_uvTile); + const gz::math::Planed &_plane, + const gz::math::Vector2d &_segments, + const gz::math::Vector2d &_uvTile); /// \brief Create mesh for a plane /// \param[in] _name the name of the new mesh @@ -234,11 +234,11 @@ namespace gz /// \param[in] _segments the number of segments in x and y /// \param[in] _uvTile the texture tile size in x and y public: void CreatePlane(const std::string &_name, - const ignition::math::Vector3d &_normal, + const gz::math::Vector3d &_normal, const double _d, - const ignition::math::Vector2d &_size, - const ignition::math::Vector2d &_segments, - const ignition::math::Vector2d &_uvTile); + const gz::math::Vector2d &_size, + const gz::math::Vector2d &_segments, + const gz::math::Vector2d &_uvTile); /// \brief Tesselate a 2D mesh /// @@ -265,7 +265,7 @@ namespace gz /// \param[in] _offset _m2's pose offset from _m1 public: void CreateBoolean(const std::string &_name, const Mesh *_m1, const Mesh *_m2, const int _operation, - const ignition::math::Pose3d &_offset = ignition::math::Pose3d::Zero); + const gz::math::Pose3d &_offset = gz::math::Pose3d::Zero); /// \brief Converts a vector of polylines into a table of vertices and /// a list of edges (each made of 2 points from the table of vertices. @@ -275,11 +275,11 @@ namespace gz /// \param[out] _edges a list of edges (made of start/end point indices /// from the vertex table) private: static void ConvertPolylinesToVerticesAndEdges( - const std::vector > + const std::vector > &_polys, const double _tol, - std::vector &_vertices, - std::vector &_edges); + std::vector &_vertices, + std::vector &_edges); /// \brief Check a point againts a list, and only adds it to the list /// if it is not there already. @@ -289,8 +289,8 @@ namespace gz /// considered to be the same point. /// \return the index of the point. private: static size_t AddUniquePointToVerticesTable( - std::vector &_vertices, - const ignition::math::Vector2d &_p, + std::vector &_vertices, + const gz::math::Vector2d &_p, const double _tol); /// \brief Private data pointer. diff --git a/graphics/include/gz/common/NodeAnimation.hh b/graphics/include/gz/common/NodeAnimation.hh index a7821d993..7656a20a8 100644 --- a/graphics/include/gz/common/NodeAnimation.hh +++ b/graphics/include/gz/common/NodeAnimation.hh @@ -92,7 +92,7 @@ namespace gz /// \param[in] _time the time /// \param[in] _loop when true, the time is divided by the duration /// (see GetLength) - public: ignition::math::Matrix4d FrameAt(const double _time, + public: gz::math::Matrix4d FrameAt(const double _time, const bool _loop = true) const; /// \brief Scales each transformation in the key frames. This only affects diff --git a/graphics/include/gz/common/SVGLoader.hh b/graphics/include/gz/common/SVGLoader.hh index 9ab56c7b7..699fb997f 100644 --- a/graphics/include/gz/common/SVGLoader.hh +++ b/graphics/include/gz/common/SVGLoader.hh @@ -73,13 +73,13 @@ namespace gz std::string style; /// \brief A 2D transform (or a list of transforms) - ignition::math::Matrix3d transform; + gz::math::Matrix3d transform; /// \brief A list of subpaths (as lists of commands) std::vector< std::vector > subpaths; /// \brief The polylines described by the commands - std::vector< std::vector > polylines; + std::vector< std::vector > polylines; #ifdef _WIN32 #pragma warning(pop) #endif @@ -112,8 +112,8 @@ namespace gz public: static void PathsToClosedPolylines( const std::vector &_paths, const double _tol, - std::vector< std::vector > &_closedPolys, - std::vector< std::vector > &_openPolys); + std::vector< std::vector > &_closedPolys, + std::vector< std::vector > &_openPolys); /// \brief Outputs the content of the paths to file (or console) /// \param[in] _paths The paths diff --git a/graphics/include/gz/common/SubMesh.hh b/graphics/include/gz/common/SubMesh.hh index acb91cf6b..97afb0744 100644 --- a/graphics/include/gz/common/SubMesh.hh +++ b/graphics/include/gz/common/SubMesh.hh @@ -94,7 +94,7 @@ namespace gz /// \brief Add a vertex to the mesh /// \param[in] _v The new position - public: void AddVertex(const ignition::math::Vector3d &_v); + public: void AddVertex(const gz::math::Vector3d &_v); /// \brief Add a vertex to the mesh /// \param[in] _x Position along x @@ -104,7 +104,7 @@ namespace gz /// \brief Add a normal to the mesh /// \param[in] _n The normal - public: void AddNormal(const ignition::math::Vector3d &_n); + public: void AddNormal(const gz::math::Vector3d &_n); /// \brief Add a normal to the mesh /// \param[in] _x Position along x @@ -127,7 +127,7 @@ namespace gz /// exist, it is added to set 0. /// \param[in] _uv The texture coordinate /// \sa AddTexCoordBySet - public: void AddTexCoord(const ignition::math::Vector2d &_uv); + public: void AddTexCoord(const gz::math::Vector2d &_uv); /// \brief Add a texture coord to a texture coordinate set of the mesh /// \param[in] _u Position along u @@ -140,7 +140,7 @@ namespace gz /// \param[in] _u Position along u /// \param[in] _v Position along v /// \param[in] _setIndex Texture coordinate set index - public: void AddTexCoordBySet(const ignition::math::Vector2d &_uv, + public: void AddTexCoordBySet(const gz::math::Vector2d &_uv, unsigned int _setIndex); /// \brief Add a vertex - skeleton node assignment @@ -152,46 +152,46 @@ namespace gz const float _weight); /// \brief Get a vertex /// \param[in] _index Index of the vertex - /// \return Coordinates of the vertex or ignition::math::Vector3d::Zero + /// \return Coordinates of the vertex or gz::math::Vector3d::Zero /// if the index is out of bounds. /// \sa bool HasVertex(const unsigned int) const - public: ignition::math::Vector3d Vertex(const unsigned int _index) const; + public: gz::math::Vector3d Vertex(const unsigned int _index) const; /// \brief Set a vertex /// \param[in] _index Index of the vertex /// \param[in] _v The new vertex coordinate public: void SetVertex(const unsigned int _index, - const ignition::math::Vector3d &_v); + const gz::math::Vector3d &_v); /// \brief Get a normal /// \param[in] _index The normal index - /// \return The normal direction or ignition::math::Vector3d::Zero + /// \return The normal direction or gz::math::Vector3d::Zero /// if index is out of bounds. /// \sa bool HasNormal(const unsigned int _index); - public: ignition::math::Vector3d Normal(const unsigned int _index) const; + public: gz::math::Vector3d Normal(const unsigned int _index) const; /// \brief Set a normal /// \param[in] _index Index of the normal that will be set. /// \param[in] _n The new normal direction public: void SetNormal(const unsigned int _index, - const ignition::math::Vector3d &_n); + const gz::math::Vector3d &_n); /// \brief Get a texture coordinate /// \param[in] _index the texture index - /// \return The texture coordinate or ignition::math::Vector2d::Zero + /// \return The texture coordinate or gz::math::Vector2d::Zero /// if index is out of bounds. /// \sa bool HasTexCoord(const unsigned int _index) const - public: ignition::math::Vector2d TexCoord( + public: gz::math::Vector2d TexCoord( const unsigned int _index) const; /// \brief Get a texture coordinate for a texture coordinate set /// \param[in] _index the texture index - /// \return The texture coordinate or ignition::math::Vector2d::Zero + /// \return The texture coordinate or gz::math::Vector2d::Zero /// if index is out of bounds. /// \param[in] _setIndex Texture coordinate set index /// \sa bool HasTexCoordBySet(unsigned int _index, unsigned int _setIndex) /// const - public: ignition::math::Vector2d TexCoordBySet( + public: gz::math::Vector2d TexCoordBySet( unsigned int _index, unsigned int _setIndex) const; @@ -202,14 +202,14 @@ namespace gz /// \param[in] _uv The new texture coordinate /// \sa SetTexCoordBySet public: void SetTexCoord(const unsigned int _index, - const ignition::math::Vector2d &_uv); + const gz::math::Vector2d &_uv); /// \brief Set a texture coordinate for a texture coordinate set /// \param[in] _index Index of the texture coordinate that will be set. /// \param[in] _uv The new texture coordinate /// \param[in] _setIndex Texture coordinate set index public: void SetTexCoordBySet(unsigned int _index, - const ignition::math::Vector2d &_uv, + const gz::math::Vector2d &_uv, unsigned int _setIdex); /// \brief Get an index value from the index array @@ -234,11 +234,11 @@ namespace gz /// \brief Get the maximum X, Y, Z values from all the vertices /// \return Max X,Y,Z values from all vertices in submesh - public: ignition::math::Vector3d Max() const; + public: gz::math::Vector3d Max() const; /// \brief Get the minimum X, Y, Z values from all the vertices /// \return Min X,Y,Z values from all vertices in submesh - public: ignition::math::Vector3d Min() const; + public: gz::math::Vector3d Min() const; /// \brief Get the number of vertices /// \return The number of vertices. @@ -298,7 +298,7 @@ namespace gz /// \brief Return true if this submesh has the vertex /// \param[in] _v Vertex coordinate /// \return Return true if this submesh has the vertex - public: bool HasVertex(const ignition::math::Vector3d &_v) const; + public: bool HasVertex(const gz::math::Vector3d &_v) const; /// \brief Return true if this submesh has the vertex with the given /// index @@ -345,7 +345,7 @@ namespace gz /// \brief Get the index of the vertex /// \param[in] _v Vertex to check /// \return Index of the vertex that matches _v. - public: int IndexOfVertex(const ignition::math::Vector3d &_v) const; + public: int IndexOfVertex(const gz::math::Vector3d &_v) const; /// \brief Put all the data into flat arrays /// \param[in] _verArr The vertex array to be filled. @@ -359,19 +359,19 @@ namespace gz /// from center /// \param[in] _center Center of the projection. public: void GenSphericalTexCoord( - const ignition::math::Vector3d &_center); + const gz::math::Vector3d &_center); /// \brief Generate texture coordinates for a texture coordinate set /// using spherical projection from center /// \param[in] _center Center of the projection. /// \param[in] _setIndex Texture coordinate set index public: void GenSphericalTexCoordBySet( - const ignition::math::Vector3d &_center, + const gz::math::Vector3d &_center, unsigned int _setIndex); /// \brief Scale all vertices by _factor /// \param[in] _factor Scaling factor - public: void Scale(const ignition::math::Vector3d &_factor); + public: void Scale(const gz::math::Vector3d &_factor); /// \brief Scale all vertices by _factor /// \param[in] _factor Scaling factor @@ -380,12 +380,12 @@ namespace gz /// \brief Move the center of the submesh to the given coordinate. This /// will move all the vertices. /// \param[in] _center Location of the mesh center. - public: void Center(const ignition::math::Vector3d &_center = - ignition::math::Vector3d::Zero); + public: void Center(const gz::math::Vector3d &_center = + gz::math::Vector3d::Zero); /// \brief Move all vertices by _vec. /// \param[in] _vec Amount to translate vertices. - public: void Translate(const ignition::math::Vector3d &_vec); + public: void Translate(const gz::math::Vector3d &_vec); /// \brief Compute the volume of this submesh. The primitive type /// must be TRIANGLES. diff --git a/graphics/src/Animation.cc b/graphics/src/Animation.cc index cc6c32856..478e53063 100644 --- a/graphics/src/Animation.cc +++ b/graphics/src/Animation.cc @@ -133,7 +133,7 @@ class TrajectoryInfo::Implementation ///////////////////////////////////////////////// Animation::Animation(const std::string &_name, const double _length, const bool _loop) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->name = _name; this->dataPtr->length = _length; @@ -289,7 +289,7 @@ double Animation::KeyFramesAtTime(double _time, common::KeyFrame **_kf1, PoseAnimation::PoseAnimation(const std::string &_name, const double _length, const bool _loop, double _tension) : Animation(_name, _length, _loop), - dataPtr(ignition::utils::MakeImpl()) + dataPtr(gz::utils::MakeImpl()) { this->dataPtr->tension = math::clamp(_tension, 0.0, 1.0); } @@ -367,7 +367,7 @@ void PoseAnimation::InterpolatedKeyFrame(const double _time, NumericAnimation::NumericAnimation(const std::string &_name, const double _length, const bool _loop) : Animation(_name, _length, _loop), - dataPtr(ignition::utils::MakeImpl()) + dataPtr(gz::utils::MakeImpl()) { } @@ -406,7 +406,7 @@ void NumericAnimation::InterpolatedKeyFrame(NumericKeyFrame &_kf) const ///////////////////////////////////////////////// TrajectoryInfo::TrajectoryInfo() - : dataPtr(ignition::utils::MakeImpl()) + : dataPtr(gz::utils::MakeImpl()) { } diff --git a/graphics/src/ColladaExporter.cc b/graphics/src/ColladaExporter.cc index 9c8179a55..903aba983 100644 --- a/graphics/src/ColladaExporter.cc +++ b/graphics/src/ColladaExporter.cc @@ -78,7 +78,7 @@ static void LogTinyXml2DocumentError( } /// Private data for the ColladaExporter class -class ignition::common::ColladaExporter::Implementation +class gz::common::ColladaExporter::Implementation { /// \brief Geometry types public: enum GeometryType {POSITION, NORMAL, UVMAP}; @@ -151,7 +151,7 @@ class ignition::common::ColladaExporter::Implementation ////////////////////////////////////////////////// ColladaExporter::ColladaExporter() -: MeshExporter(), dataPtr(ignition::utils::MakeImpl()) +: MeshExporter(), dataPtr(gz::utils::MakeImpl()) { } @@ -331,12 +331,12 @@ void ColladaExporter::Export(const Mesh *_mesh, const std::string &_filename, // Save file if (this->dataPtr->exportTextures) { - const std::string directory = ignition::common::joinPaths( + const std::string directory = gz::common::joinPaths( this->dataPtr->path, this->dataPtr->filename, "meshes"); createDirectories(directory); - const std::string finalFilename = ignition::common::joinPaths( + const std::string finalFilename = gz::common::joinPaths( this->dataPtr->path, this->dataPtr->filename, "meshes", this->dataPtr->filename + ".dae"); @@ -350,7 +350,7 @@ void ColladaExporter::Export(const Mesh *_mesh, const std::string &_filename, } else { - const std::string finalFilename = ignition::common::joinPaths( + const std::string finalFilename = gz::common::joinPaths( this->dataPtr->path, this->dataPtr->filename + std::string(".dae")); const tinyxml2::XMLError error = xmlDoc.SaveFile(finalFilename.c_str()); @@ -379,7 +379,7 @@ void ColladaExporter::Implementation::ExportAsset( ////////////////////////////////////////////////// void ColladaExporter::Implementation::ExportGeometrySource( - const ignition::common::SubMesh *_subMesh, + const gz::common::SubMesh *_subMesh, tinyxml2::XMLElement *_meshXml, GeometryType _type, const char *_meshID) { char sourceId[100], sourceArrayId[107]; @@ -394,7 +394,7 @@ void ColladaExporter::Implementation::ExportGeometrySource( snprintf(sourceId, sizeof(sourceId), "%s-Positions", _meshID); count = _subMesh->VertexCount(); stride = 3; - ignition::math::Vector3d vertex; + gz::math::Vector3d vertex; for (unsigned int i = 0; i < count; ++i) { vertex = _subMesh->Vertex(i); @@ -406,7 +406,7 @@ void ColladaExporter::Implementation::ExportGeometrySource( snprintf(sourceId, sizeof(sourceId), "%s-Normals", _meshID); count = _subMesh->NormalCount(); stride = 3; - ignition::math::Vector3d normal; + gz::math::Vector3d normal; for (unsigned int i = 0; i < count; ++i) { normal = _subMesh->Normal(i); @@ -418,7 +418,7 @@ void ColladaExporter::Implementation::ExportGeometrySource( snprintf(sourceId, sizeof(sourceId), "%s-UVMap", _meshID); count = _subMesh->VertexCount(); stride = 2; - ignition::math::Vector2d inTexCoord; + gz::math::Vector2d inTexCoord; for (unsigned int i = 0; i < count; ++i) { inTexCoord = _subMesh->TexCoordBySet(i, 0); @@ -592,7 +592,7 @@ int ColladaExporter::Implementation::ExportImages( int imageCount = 0; for (unsigned int i = 0; i < this->materialCount; ++i) { - const ignition::common::MaterialPtr material = + const gz::common::MaterialPtr material = this->mesh->MaterialByIndex(i); std::string imageString = material->TextureImage(); @@ -610,7 +610,7 @@ int ColladaExporter::Implementation::ExportImages( _libraryImagesXml->GetDocument()->NewElement("init_from"); const auto imageName = imageString.substr( imageString.rfind(pathSeparator)); - const auto imagePath = ignition::common::joinPaths("..", "materials", + const auto imagePath = gz::common::joinPaths("..", "materials", "textures", imageName); initFromXml->LinkEndChild( _libraryImagesXml->GetDocument()->NewText(imagePath.c_str())); @@ -674,7 +674,7 @@ void ColladaExporter::Implementation::ExportEffects( effectXml->LinkEndChild(profileCommonXml); // Image - const ignition::common::MaterialPtr material = + const gz::common::MaterialPtr material = this->mesh->MaterialByIndex(i); std::string imageString = material->TextureImage(); @@ -892,7 +892,7 @@ void ColladaExporter::Implementation::ExportVisualScenes( if (!subMesh->GetMaterialIndex()) continue; const auto materialIndex = subMesh->GetMaterialIndex().value(); - const ignition::common::MaterialPtr material = + const gz::common::MaterialPtr material = this->mesh->MaterialByIndex(materialIndex); if (material) diff --git a/graphics/src/ColladaLoader.cc b/graphics/src/ColladaLoader.cc index 322550304..171133c07 100644 --- a/graphics/src/ColladaLoader.cc +++ b/graphics/src/ColladaLoader.cc @@ -70,15 +70,15 @@ namespace gz /// \brief Map of collada POSITION ids to list of vectors. public: std::map > positionIds; + std::vector > positionIds; /// \brief Map of collada NORMAL ids to list of normals. public: std::map > normalIds; + std::vector > normalIds; /// \brief Map of collada TEXCOORD ids to list of texture coordinates. public: std::map >texcoordIds; + std::vector >texcoordIds; /// \brief Map of collada Material ids to Gazebo materials. public: std::map materialIds; @@ -108,7 +108,7 @@ namespace gz /// \param[in,out] _mesh The mesh being loaded public: void LoadController(tinyxml2::XMLElement *_contrXml, std::vector _skelXmls, - const ignition::math::Matrix4d &_transform, + const gz::math::Matrix4d &_transform, Mesh *_mesh); /// \brief Load animations for a skeleton @@ -146,7 +146,7 @@ namespace gz /// \param[in] _tranform Transform to apply to the loaded geometry /// \param[in,out] _mesh Pointer to the mesh currently being loaded public: void LoadGeometry(tinyxml2::XMLElement *_xml, - const ignition::math::Matrix4d &_transform, + const gz::math::Matrix4d &_transform, Mesh *_mesh); /// \brief Get an XML element by ID @@ -171,12 +171,12 @@ namespace gz /// \param[in] _transform Transform to apply to the node public: void LoadNode(tinyxml2::XMLElement *_elem, Mesh *_mesh, - const ignition::math::Matrix4d &_transform); + const gz::math::Matrix4d &_transform); /// \brief Load a transform /// \param[in] _elem Pointer to the transform XML instance /// \return A Matrix4 transform - public: ignition::math::Matrix4d LoadNodeTransform( + public: gz::math::Matrix4d LoadNodeTransform( tinyxml2::XMLElement *_elem); /// \brief Load vertices @@ -185,9 +185,9 @@ namespace gz /// \param[out] _verts Holds the resulting vertices /// \param[out] _norms Holds the resulting normals public: void LoadVertices(const std::string &_id, - const ignition::math::Matrix4d &_transform, - std::vector &_verts, - std::vector &_norms); + const gz::math::Matrix4d &_transform, + std::vector &_verts, + std::vector &_norms); /// \brief Load vertices /// \param[in] _id String id of the vertices XML node @@ -197,9 +197,9 @@ namespace gz /// \param[out] _vertDup Holds a map of duplicate position indices /// \param[out] _normDup Holds a map of duplicate normal indices public: void LoadVertices(const std::string &_id, - const ignition::math::Matrix4d &_transform, - std::vector &_verts, - std::vector &_norms, + const gz::math::Matrix4d &_transform, + std::vector &_verts, + std::vector &_norms, std::map &_vertDup, std::map &_normDup); @@ -209,8 +209,8 @@ namespace gz /// \param[out] _values Holds the resulting position values /// \param[out] _duplicates Holds a map of duplicate position indices public: void LoadPositions(const std::string &_id, - const ignition::math::Matrix4d &_transform, - std::vector &_values, + const gz::math::Matrix4d &_transform, + std::vector &_values, std::map &_duplicates); /// \brief Load normals @@ -219,8 +219,8 @@ namespace gz /// \param[out] _values Holds the resulting normal values /// \param[out] _duplicates Holds a map of duplicate normal indices public: void LoadNormals(const std::string &_id, - const ignition::math::Matrix4d &_transform, - std::vector &_values, + const gz::math::Matrix4d &_transform, + std::vector &_values, std::map &_duplicates); /// \brief Load texture coordinates @@ -228,7 +228,7 @@ namespace gz /// \param[out] _values Holds the resulting uv values /// \param[out] _duplicates Holds a map of duplicate uv indices public: void LoadTexCoords(const std::string &_id, - std::vector &_values, + std::vector &_values, std::map &_duplicates); /// \brief Load a material @@ -249,7 +249,7 @@ namespace gz /// \param[in] _transform Transform to apply to all triangles /// \param[out] _mesh Mesh that is currently being loaded public: void LoadTriangles(tinyxml2::XMLElement *_trianglesXml, - const ignition::math::Matrix4d &_transform, + const gz::math::Matrix4d &_transform, Mesh *_mesh); /// \brief Load a polygon list @@ -257,7 +257,7 @@ namespace gz /// \param[in] _transform Transform to apply to each polygon /// \param[out] _mesh Mesh that is currently being loaded public: void LoadPolylist(tinyxml2::XMLElement *_polylistXml, - const ignition::math::Matrix4d &_transform, + const gz::math::Matrix4d &_transform, Mesh *_mesh); /// \brief Load lines @@ -265,7 +265,7 @@ namespace gz /// \param[in] _transform Transform to apply /// \param[out] _mesh Mesh that is currently being loaded public: void LoadLines(tinyxml2::XMLElement *_xml, - const ignition::math::Matrix4d &_transform, + const gz::math::Matrix4d &_transform, Mesh *_mesh); /// \brief Load an entire scene @@ -336,7 +336,7 @@ void hash_combine(std::size_t &_seed, const double &_v) ///////////////////////////////////////////////// struct Vector3Hash { - std::size_t operator()(const ignition::math::Vector3d &_v) const + std::size_t operator()(const gz::math::Vector3d &_v) const { std::size_t seed = 0; hash_combine(seed, _v.X()); @@ -349,7 +349,7 @@ struct Vector3Hash ///////////////////////////////////////////////// struct Vector2dHash { - std::size_t operator()(const ignition::math::Vector2d &_v) const + std::size_t operator()(const gz::math::Vector2d &_v) const { std::size_t seed = 0; hash_combine(seed, _v.X()); @@ -360,7 +360,7 @@ struct Vector2dHash ////////////////////////////////////////////////// ColladaLoader::ColladaLoader() -: MeshLoader(), dataPtr(ignition::utils::MakeImpl()) +: MeshLoader(), dataPtr(gz::utils::MakeImpl()) { this->dataPtr->meter = 1.0; } @@ -414,7 +414,7 @@ Mesh *ColladaLoader::Load(const std::string &_filename) { tinyxml2::XMLElement *unitXml = assetXml->FirstChildElement("unit"); if (unitXml && unitXml->Attribute("meter")) - this->dataPtr->meter = ignition::math::parseFloat( + this->dataPtr->meter = gz::math::parseFloat( unitXml->Attribute("meter")); } @@ -427,7 +427,7 @@ Mesh *ColladaLoader::Load(const std::string &_filename) this->dataPtr->ApplyInvBindTransform(mesh->MeshSkeleton()); // This will make the model the correct size. - mesh->Scale(ignition::math::Vector3d( + mesh->Scale(gz::math::Vector3d( this->dataPtr->meter, this->dataPtr->meter, this->dataPtr->meter)); if (mesh->HasSkeleton()) mesh->MeshSkeleton()->Scale(this->dataPtr->meter); @@ -454,7 +454,7 @@ void ColladaLoader::Implementation::LoadScene(Mesh *_mesh) tinyxml2::XMLElement *nodeXml = visSceneXml->FirstChildElement("node"); while (nodeXml) { - this->LoadNode(nodeXml, _mesh, ignition::math::Matrix4d::Identity); + this->LoadNode(nodeXml, _mesh, gz::math::Matrix4d::Identity); nodeXml = nodeXml->NextSiblingElement("node"); } } @@ -462,12 +462,12 @@ void ColladaLoader::Implementation::LoadScene(Mesh *_mesh) ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadNode( tinyxml2::XMLElement *_elem, Mesh *_mesh, - const ignition::math::Matrix4d &_transform) + const gz::math::Matrix4d &_transform) { tinyxml2::XMLElement *nodeXml; tinyxml2::XMLElement *instGeomXml; - ignition::math::Matrix4d transform = this->LoadNodeTransform(_elem); + gz::math::Matrix4d transform = this->LoadNodeTransform(_elem); transform = _transform * transform; nodeXml = _elem->FirstChildElement("node"); @@ -607,10 +607,10 @@ void ColladaLoader::Implementation::LoadNode( } ///////////////////////////////////////////////// -ignition::math::Matrix4d ColladaLoader::Implementation::LoadNodeTransform( +gz::math::Matrix4d ColladaLoader::Implementation::LoadNodeTransform( tinyxml2::XMLElement *_elem) { - ignition::math::Matrix4d transform(ignition::math::Matrix4d::Identity); + gz::math::Matrix4d transform(gz::math::Matrix4d::Identity); if (_elem->FirstChildElement("matrix")) { @@ -629,7 +629,7 @@ ignition::math::Matrix4d ColladaLoader::Implementation::LoadNodeTransform( if (_elem->FirstChildElement("translate")) { std::string transStr = _elem->FirstChildElement("translate")->GetText(); - ignition::math::Vector3d translate; + gz::math::Vector3d translate; std::istringstream stream(transStr); stream >> translate; // translate *= this->meter; @@ -639,8 +639,8 @@ ignition::math::Matrix4d ColladaLoader::Implementation::LoadNodeTransform( tinyxml2::XMLElement *rotateXml = _elem->FirstChildElement("rotate"); while (rotateXml) { - ignition::math::Matrix3d mat; - ignition::math::Vector3d axis; + gz::math::Matrix3d mat; + gz::math::Vector3d axis; double angle; std::string rotateStr = rotateXml->GetText(); @@ -649,7 +649,7 @@ ignition::math::Matrix4d ColladaLoader::Implementation::LoadNodeTransform( iss >> axis.X() >> axis.Y() >> axis.Z(); iss >> angle; mat.SetFromAxisAngle(axis, IGN_DTOR(angle)); - ignition::math::Matrix4d mat4(ignition::math::Matrix4d::Identity); + gz::math::Matrix4d mat4(gz::math::Matrix4d::Identity); mat4 = mat; transform = transform * mat4; @@ -660,10 +660,10 @@ ignition::math::Matrix4d ColladaLoader::Implementation::LoadNodeTransform( if (_elem->FirstChildElement("scale")) { std::string scaleStr = _elem->FirstChildElement("scale")->GetText(); - ignition::math::Vector3d scale; + gz::math::Vector3d scale; std::istringstream stream(scaleStr); stream >> scale; - ignition::math::Matrix4d scaleMat; + gz::math::Matrix4d scaleMat; scaleMat.Scale(scale); transform = transform * scaleMat; } @@ -676,7 +676,7 @@ ignition::math::Matrix4d ColladaLoader::Implementation::LoadNodeTransform( void ColladaLoader::Implementation::LoadController( tinyxml2::XMLElement *_contrXml, std::vector _skelXmls, - const ignition::math::Matrix4d &_transform, + const gz::math::Matrix4d &_transform, Mesh *_mesh) { if (nullptr == _contrXml) @@ -706,7 +706,7 @@ void ColladaLoader::Implementation::LoadController( for (unsigned int i = 0; i < 16; ++i) iss >> values[i]; - ignition::math::Matrix4d bindTrans; + gz::math::Matrix4d bindTrans; bindTrans.Set(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], @@ -817,23 +817,23 @@ void ColladaLoader::Implementation::LoadController( } unsigned int id = i * 16; - ignition::math::Matrix4d mat; - mat.Set(ignition::math::parseFloat(strs[id + 0]), - ignition::math::parseFloat(strs[id + 1]), - ignition::math::parseFloat(strs[id + 2]), - ignition::math::parseFloat(strs[id + 3]), - ignition::math::parseFloat(strs[id + 4]), - ignition::math::parseFloat(strs[id + 5]), - ignition::math::parseFloat(strs[id + 6]), - ignition::math::parseFloat(strs[id + 7]), - ignition::math::parseFloat(strs[id + 8]), - ignition::math::parseFloat(strs[id + 9]), - ignition::math::parseFloat(strs[id + 10]), - ignition::math::parseFloat(strs[id + 11]), - ignition::math::parseFloat(strs[id + 12]), - ignition::math::parseFloat(strs[id + 13]), - ignition::math::parseFloat(strs[id + 14]), - ignition::math::parseFloat(strs[id + 15])); + gz::math::Matrix4d mat; + mat.Set(gz::math::parseFloat(strs[id + 0]), + gz::math::parseFloat(strs[id + 1]), + gz::math::parseFloat(strs[id + 2]), + gz::math::parseFloat(strs[id + 3]), + gz::math::parseFloat(strs[id + 4]), + gz::math::parseFloat(strs[id + 5]), + gz::math::parseFloat(strs[id + 6]), + gz::math::parseFloat(strs[id + 7]), + gz::math::parseFloat(strs[id + 8]), + gz::math::parseFloat(strs[id + 9]), + gz::math::parseFloat(strs[id + 10]), + gz::math::parseFloat(strs[id + 11]), + gz::math::parseFloat(strs[id + 12]), + gz::math::parseFloat(strs[id + 13]), + gz::math::parseFloat(strs[id + 14]), + gz::math::parseFloat(strs[id + 15])); node->SetInverseBindTransform(mat); } @@ -986,11 +986,11 @@ void ColladaLoader::Implementation::LoadAnimationSet(tinyxml2::XMLElement *_xml, if (sep == '(') { std::string idx1Str = idxStr.substr(0, 1); - idx1 = ignition::math::parseInt(idx1Str); + idx1 = gz::math::parseInt(idx1Str); if (idxStr.length() > 4) { std::string idx2Str = idxStr.substr(3, 1); - idx2 = ignition::math::parseInt(idx2Str); + idx2 = gz::math::parseInt(idx2Str); } } } @@ -1042,7 +1042,7 @@ void ColladaLoader::Implementation::LoadAnimationSet(tinyxml2::XMLElement *_xml, if (strideAttribute) { stride = static_cast( - ignition::math::parseInt(strideAttribute)); + gz::math::parseInt(strideAttribute)); } SkeletonNode *targetNode = _skel->NodeById(targetBone); @@ -1121,7 +1121,7 @@ void ColladaLoader::Implementation::LoadAnimationSet(tinyxml2::XMLElement *_xml, for (RawNodeAnim::iterator niter = iter->second.begin(); niter != iter->second.end(); ++niter) { - ignition::math::Matrix4d transform(ignition::math::Matrix4d::Identity); + gz::math::Matrix4d transform(gz::math::Matrix4d::Identity); for (unsigned int i = 0; i < niter->second.size(); ++i) { niter->second[i].RecalculateMatrix(); @@ -1219,7 +1219,7 @@ void ColladaLoader::Implementation::SetSkeletonNodeTransform( return; } - ignition::math::Matrix4d transform(ignition::math::Matrix4d::Identity); + gz::math::Matrix4d transform(gz::math::Matrix4d::Identity); if (_elem->FirstChildElement("matrix")) { @@ -1244,7 +1244,7 @@ void ColladaLoader::Implementation::SetSkeletonNodeTransform( if (_elem->FirstChildElement("translate")) { std::string transStr = _elem->FirstChildElement("translate")->GetText(); - ignition::math::Vector3d translate; + gz::math::Vector3d translate; std::istringstream stream(transStr); stream >> translate; // translate *= this->meter; @@ -1262,8 +1262,8 @@ void ColladaLoader::Implementation::SetSkeletonNodeTransform( tinyxml2::XMLElement *rotateXml = _elem->FirstChildElement("rotate"); while (rotateXml) { - ignition::math::Matrix3d mat; - ignition::math::Vector3d axis; + gz::math::Matrix3d mat; + gz::math::Vector3d axis; double angle; std::string rotateStr = rotateXml->GetText(); @@ -1273,7 +1273,7 @@ void ColladaLoader::Implementation::SetSkeletonNodeTransform( iss >> angle; mat.SetFromAxisAngle(axis, IGN_DTOR(angle)); - ignition::math::Matrix4d mat4(ignition::math::Matrix4d::Identity); + gz::math::Matrix4d mat4(gz::math::Matrix4d::Identity); mat4 = mat; NodeTransform nt(mat4); if (rotateXml->Attribute("sid")) @@ -1290,10 +1290,10 @@ void ColladaLoader::Implementation::SetSkeletonNodeTransform( if (_elem->FirstChildElement("scale")) { std::string scaleStr = _elem->FirstChildElement("scale")->GetText(); - ignition::math::Vector3d scale; + gz::math::Vector3d scale; std::istringstream stream(scaleStr); stream >> scale; - ignition::math::Matrix4d scaleMat; + gz::math::Matrix4d scaleMat; scaleMat.Scale(scale); NodeTransform nt(scaleMat); @@ -1313,7 +1313,7 @@ void ColladaLoader::Implementation::SetSkeletonNodeTransform( ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadGeometry(tinyxml2::XMLElement *_xml, - const ignition::math::Matrix4d &_transform, Mesh *_mesh) + const gz::math::Matrix4d &_transform, Mesh *_mesh) { tinyxml2::XMLElement *meshXml = _xml->FirstChildElement("mesh"); tinyxml2::XMLElement *childXml; @@ -1383,9 +1383,9 @@ tinyxml2::XMLElement *ColladaLoader::Implementation::ElementId( ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadVertices(const std::string &_id, - const ignition::math::Matrix4d &_transform, - std::vector &_verts, - std::vector &_norms) + const gz::math::Matrix4d &_transform, + std::vector &_verts, + std::vector &_norms) { std::map vertDup; std::map normDup; @@ -1394,9 +1394,9 @@ void ColladaLoader::Implementation::LoadVertices(const std::string &_id, ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadVertices(const std::string &_id, - const ignition::math::Matrix4d &_transform, - std::vector &_verts, - std::vector &_norms, + const gz::math::Matrix4d &_transform, + std::vector &_verts, + std::vector &_norms, std::map &_vertDups, std::map &_normDups) { @@ -1429,8 +1429,8 @@ void ColladaLoader::Implementation::LoadVertices(const std::string &_id, ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadPositions(const std::string &_id, - const ignition::math::Matrix4d &_transform, - std::vector &_values, + const gz::math::Matrix4d &_transform, + std::vector &_values, std::map &_duplicates) { if (this->positionIds.find(_id) != this->positionIds.end()) @@ -1479,7 +1479,7 @@ void ColladaLoader::Implementation::LoadPositions(const std::string &_id, } std::string valueStr = floatArrayXml->GetText(); - std::unordered_map unique; std::vector::iterator iter, end; @@ -1487,9 +1487,9 @@ void ColladaLoader::Implementation::LoadPositions(const std::string &_id, end = strs.end(); for (iter = strs.begin(); iter != end; iter += 3) { - ignition::math::Vector3d vec(math::parseFloat(*iter), - ignition::math::parseFloat(*(iter+1)), - ignition::math::parseFloat(*(iter+2))); + gz::math::Vector3d vec(math::parseFloat(*iter), + gz::math::parseFloat(*(iter+1)), + gz::math::parseFloat(*(iter+2))); vec = _transform * vec; _values.push_back(vec); @@ -1507,8 +1507,8 @@ void ColladaLoader::Implementation::LoadPositions(const std::string &_id, ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadNormals(const std::string &_id, - const ignition::math::Matrix4d &_transform, - std::vector &_values, + const gz::math::Matrix4d &_transform, + std::vector &_values, std::map &_duplicates) { if (this->normalIds.find(_id) != this->normalIds.end()) @@ -1518,8 +1518,8 @@ void ColladaLoader::Implementation::LoadNormals(const std::string &_id, return; } - ignition::math::Matrix4d rotMat = _transform; - rotMat.SetTranslation(ignition::math::Vector3d::Zero); + gz::math::Matrix4d rotMat = _transform; + rotMat.SetTranslation(gz::math::Vector3d::Zero); tinyxml2::XMLElement *normalsXml = this->ElementId("source", _id); if (!normalsXml) @@ -1559,14 +1559,14 @@ void ColladaLoader::Implementation::LoadNormals(const std::string &_id, return; } - std::unordered_map unique; std::string valueStr = floatArrayXml->GetText(); std::istringstream iss(valueStr); do { - ignition::math::Vector3d vec; + gz::math::Vector3d vec; iss >> vec.X() >> vec.Y() >> vec.Z(); if (iss) { @@ -1588,7 +1588,7 @@ void ColladaLoader::Implementation::LoadNormals(const std::string &_id, ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadTexCoords(const std::string &_id, - std::vector &_values, + std::vector &_values, std::map &_duplicates) { if (this->texcoordIds.find(_id) != this->texcoordIds.end()) @@ -1709,7 +1709,7 @@ void ColladaLoader::Implementation::LoadTexCoords(const std::string &_id, if (totCount == 0) return; - std::unordered_map unique; // Read the raw texture values, and split them on spaces. @@ -1720,7 +1720,7 @@ void ColladaLoader::Implementation::LoadTexCoords(const std::string &_id, for (int i = 0; i < totCount; i += stride) { // We only handle 2D texture coordinates right now. - ignition::math::Vector2d vec(std::stod(values[i]), + gz::math::Vector2d vec(std::stod(values[i]), 1.0 - std::stod(values[i+1])); _values.push_back(vec); @@ -1959,7 +1959,7 @@ void ColladaLoader::Implementation::LoadColorOrTexture( ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadPolylist( tinyxml2::XMLElement *_polylistXml, - const ignition::math::Matrix4d &_transform, + const gz::math::Matrix4d &_transform, Mesh *_mesh) { // This function parses polylist types in collada into @@ -1997,9 +1997,9 @@ void ColladaLoader::Implementation::LoadPolylist( tinyxml2::XMLElement *polylistInputXml = _polylistXml->FirstChildElement("input"); - std::vector verts; - std::vector norms; - std::map> texcoords; + std::vector verts; + std::vector norms; + std::map> texcoords; std::vector> texcoordsOffsetToSet; const unsigned int VERTEX = 0; @@ -2013,7 +2013,7 @@ void ColladaLoader::Implementation::LoadPolylist( std::map normalDupMap; std::map positionDupMap; - ignition::math::Matrix4d bindShapeMat(ignition::math::Matrix4d::Identity); + gz::math::Matrix4d bindShapeMat(gz::math::Matrix4d::Identity); if (_mesh->HasSkeleton()) bindShapeMat = _mesh->MeshSkeleton()->BindShapeTransform(); @@ -2033,28 +2033,28 @@ void ColladaLoader::Implementation::LoadPolylist( positionDupMap, normalDupMap); if (norms.size() > count) combinedVertNorms = true; - inputs[VERTEX].insert(ignition::math::parseInt(offset)); + inputs[VERTEX].insert(gz::math::parseInt(offset)); } else if (semantic == "NORMAL") { this->LoadNormals(source, _transform, norms, normalDupMap); combinedVertNorms = false; - inputs[NORMAL].insert(ignition::math::parseInt(offset)); + inputs[NORMAL].insert(gz::math::parseInt(offset)); } else if (semantic == "TEXCOORD") { - int offsetInt = ignition::math::parseInt(offset); + int offsetInt = gz::math::parseInt(offset); unsigned int set = 0u; auto setStr = polylistInputXml->Attribute("set"); if (setStr) - set = ignition::math::parseInt(setStr); + set = gz::math::parseInt(setStr); this->LoadTexCoords(source, texcoords[set], texDupMap[set]); inputs[TEXCOORD].insert(offsetInt); texcoordsOffsetToSet.push_back(std::make_pair(offsetInt, set)); } else { - inputs[otherSemantics++].insert(ignition::math::parseInt(offset)); + inputs[otherSemantics++].insert(gz::math::parseInt(offset)); ignwarn << "Polylist input semantic: '" << semantic << "' is currently" << " not supported" << std::endl; } @@ -2113,7 +2113,7 @@ void ColladaLoader::Implementation::LoadPolylist( for (unsigned int i = 0; i < inputSize; ++i) { - values[i] = ignition::math::parseInt(strs_iter[triangle_index+i]); + values[i] = gz::math::parseInt(strs_iter[triangle_index+i]); } unsigned int daeVertIndex = 0; @@ -2297,7 +2297,7 @@ void ColladaLoader::Implementation::LoadPolylist( ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadTriangles( tinyxml2::XMLElement *_trianglesXml, - const ignition::math::Matrix4d &_transform, Mesh *_mesh) + const gz::math::Matrix4d &_transform, Mesh *_mesh) { std::unique_ptr subMesh(new SubMesh); subMesh->SetName(this->currentNodeName); @@ -2329,9 +2329,9 @@ void ColladaLoader::Implementation::LoadTriangles( tinyxml2::XMLElement *trianglesInputXml = _trianglesXml->FirstChildElement("input"); - std::vector verts; - std::vector norms; - std::map> texcoords; + std::vector verts; + std::vector norms; + std::map> texcoords; std::vector> texcoordsOffsetToSet; const unsigned int VERTEX = 0; @@ -2365,24 +2365,24 @@ void ColladaLoader::Implementation::LoadTriangles( positionDupMap, normalDupMap); if (norms.size() > count) combinedVertNorms = true; - inputs[VERTEX].insert(ignition::math::parseInt(offset)); + inputs[VERTEX].insert(gz::math::parseInt(offset)); hasVertices = true; } else if (semantic == "NORMAL") { this->LoadNormals(source, _transform, norms, normalDupMap); combinedVertNorms = false; - inputs[NORMAL].insert(ignition::math::parseInt(offset)); + inputs[NORMAL].insert(gz::math::parseInt(offset)); if (norms.size() > 0) hasNormals = true; } else if (semantic == "TEXCOORD") { - int offsetInt = ignition::math::parseInt(offset); + int offsetInt = gz::math::parseInt(offset); unsigned int set = 0u; auto setStr = trianglesInputXml->Attribute("set"); if (setStr) - set = ignition::math::parseInt(setStr); + set = gz::math::parseInt(setStr); this->LoadTexCoords(source, texcoords[set], texDupMap[set]); inputs[TEXCOORD].insert(offsetInt); texcoordsOffsetToSet.push_back(std::make_pair(offsetInt, set)); @@ -2390,7 +2390,7 @@ void ColladaLoader::Implementation::LoadTriangles( } else { - inputs[otherSemantics++].insert(ignition::math::parseInt(offset)); + inputs[otherSemantics++].insert(gz::math::parseInt(offset)); ignwarn << "Triangle input semantic: '" << semantic << "' is currently" << " not supported" << std::endl; } @@ -2449,7 +2449,7 @@ void ColladaLoader::Implementation::LoadTriangles( for (unsigned int j = 0; j < strs.size(); j += offsetSize) { for (unsigned int i = 0; i < offsetSize; ++i) - values.at(i) = ignition::math::parseInt(strs[j+i]); + values.at(i) = gz::math::parseInt(strs[j+i]); unsigned int daeVertIndex = 0; bool addIndex = !hasVertices; @@ -2617,7 +2617,7 @@ void ColladaLoader::Implementation::LoadTriangles( ///////////////////////////////////////////////// void ColladaLoader::Implementation::LoadLines(tinyxml2::XMLElement *_xml, - const ignition::math::Matrix4d &_transform, Mesh *_mesh) + const gz::math::Matrix4d &_transform, Mesh *_mesh) { std::unique_ptr subMesh(new SubMesh); subMesh->SetName(this->currentNodeName); @@ -2627,8 +2627,8 @@ void ColladaLoader::Implementation::LoadLines(tinyxml2::XMLElement *_xml, // std::string semantic = inputXml->Attribute("semantic"); std::string source = inputXml->Attribute("source"); - std::vector verts; - std::vector norms; + std::vector verts; + std::vector norms; this->LoadVertices(source, _transform, verts, norms); tinyxml2::XMLElement *pXml = _xml->FirstChildElement("p"); @@ -2659,7 +2659,7 @@ float ColladaLoader::Implementation::LoadFloat(tinyxml2::XMLElement *_elem) if (_elem->FirstChildElement("float")) { value = - ignition::math::parseFloat(_elem->FirstChildElement("float")->GetText()); + gz::math::parseFloat(_elem->FirstChildElement("float")->GetText()); } return value; diff --git a/graphics/src/ColladaLoader_TEST.cc b/graphics/src/ColladaLoader_TEST.cc index 282b9b453..a9587cbcb 100644 --- a/graphics/src/ColladaLoader_TEST.cc +++ b/graphics/src/ColladaLoader_TEST.cc @@ -37,8 +37,8 @@ TEST_F(ColladaLoader, LoadBox) common::testing::TestFile("data", "box.dae")); EXPECT_STREQ("unknown", mesh->Name().c_str()); - EXPECT_EQ(ignition::math::Vector3d(1, 1, 1), mesh->Max()); - EXPECT_EQ(ignition::math::Vector3d(-1, -1, -1), mesh->Min()); + EXPECT_EQ(gz::math::Vector3d(1, 1, 1), mesh->Max()); + EXPECT_EQ(gz::math::Vector3d(-1, -1, -1), mesh->Min()); // 36 vertices, 24 unique, 12 shared. EXPECT_EQ(24u, mesh->VertexCount()); EXPECT_EQ(24u, mesh->NormalCount()); @@ -87,8 +87,8 @@ TEST_F(ColladaLoader, ShareVertices) mesh->SubMeshByIndex(i).lock(); for (unsigned int j = 0; j < subMesh->VertexCount(); ++j) { - ignition::math::Vector3d v = subMesh->Vertex(j); - ignition::math::Vector3d n = subMesh->Normal(j); + gz::math::Vector3d v = subMesh->Vertex(j); + gz::math::Vector3d n = subMesh->Normal(j); // Verify there is no other vertex with the same position AND normal for (unsigned int k = j+1; k < subMesh->VertexCount(); ++k) diff --git a/graphics/src/GTSMeshUtils.cc b/graphics/src/GTSMeshUtils.cc index c421c6998..5a76f0582 100644 --- a/graphics/src/GTSMeshUtils.cc +++ b/graphics/src/GTSMeshUtils.cc @@ -131,8 +131,8 @@ int TriangleIsHole(GtsTriangle *_t, GtsFifo *_edgeList) ////////////////////////////////////////////////// GtsSurface *GTSMeshUtils::DelaunayTriangulation( - const std::vector &_vertices, - const std::vector &_edges) + const std::vector &_vertices, + const std::vector &_edges) { GSList *l, *verticesList = nullptr; @@ -208,8 +208,8 @@ GtsSurface *GTSMeshUtils::DelaunayTriangulation( ////////////////////////////////////////////////// bool GTSMeshUtils::DelaunayTriangulation( - const std::vector &_vertices, - const std::vector &_edges, + const std::vector &_vertices, + const std::vector &_edges, SubMesh *_subMesh) { if (_edges.empty() || _vertices.empty()) diff --git a/graphics/src/GTSMeshUtils_TEST.cc b/graphics/src/GTSMeshUtils_TEST.cc index 97b86d1da..cd3cc6577 100644 --- a/graphics/src/GTSMeshUtils_TEST.cc +++ b/graphics/src/GTSMeshUtils_TEST.cc @@ -40,28 +40,28 @@ TEST_F(GTSMeshUtils, DelaunayTriangulation) // a smaller square inside a bigger square. // The smaller square should be treated as a hole inside the bigger square. - std::vector vertices; + std::vector vertices; // outside square - vertices.push_back(ignition::math::Vector2d(0, 0)); - vertices.push_back(ignition::math::Vector2d(1, 0)); - vertices.push_back(ignition::math::Vector2d(1, 1)); - vertices.push_back(ignition::math::Vector2d(0, 1)); + vertices.push_back(gz::math::Vector2d(0, 0)); + vertices.push_back(gz::math::Vector2d(1, 0)); + vertices.push_back(gz::math::Vector2d(1, 1)); + vertices.push_back(gz::math::Vector2d(0, 1)); // inside square - vertices.push_back(ignition::math::Vector2d(0.25, 0.25)); - vertices.push_back(ignition::math::Vector2d(0.25, 0.75)); - vertices.push_back(ignition::math::Vector2d(0.75, 0.75)); - vertices.push_back(ignition::math::Vector2d(0.75, 0.25)); + vertices.push_back(gz::math::Vector2d(0.25, 0.25)); + vertices.push_back(gz::math::Vector2d(0.25, 0.75)); + vertices.push_back(gz::math::Vector2d(0.75, 0.75)); + vertices.push_back(gz::math::Vector2d(0.75, 0.25)); - std::vector edges; - edges.push_back(ignition::math::Vector2i(0, 1)); - edges.push_back(ignition::math::Vector2i(1, 2)); - edges.push_back(ignition::math::Vector2i(2, 3)); - edges.push_back(ignition::math::Vector2i(3, 0)); + std::vector edges; + edges.push_back(gz::math::Vector2i(0, 1)); + edges.push_back(gz::math::Vector2i(1, 2)); + edges.push_back(gz::math::Vector2i(2, 3)); + edges.push_back(gz::math::Vector2i(3, 0)); - edges.push_back(ignition::math::Vector2i(4, 5)); - edges.push_back(ignition::math::Vector2i(5, 6)); - edges.push_back(ignition::math::Vector2i(6, 7)); - edges.push_back(ignition::math::Vector2i(7, 4)); + edges.push_back(gz::math::Vector2i(4, 5)); + edges.push_back(gz::math::Vector2i(5, 6)); + edges.push_back(gz::math::Vector2i(6, 7)); + edges.push_back(gz::math::Vector2i(7, 4)); auto mesh = std::make_unique(); mesh->SetName("extruded"); diff --git a/graphics/src/Image.cc b/graphics/src/Image.cc index b9706932d..6c2a75fb4 100644 --- a/graphics/src/Image.cc +++ b/graphics/src/Image.cc @@ -70,7 +70,7 @@ static int count = 0; ////////////////////////////////////////////////// Image::Image(const std::string &_filename) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { if (count == 0) FreeImage_Initialise(); @@ -80,7 +80,7 @@ Image::Image(const std::string &_filename) this->dataPtr->bitmap = NULL; if (!_filename.empty()) { - std::string filename = ignition::common::findFile(_filename); + std::string filename = gz::common::findFile(_filename); if (!filename.empty()) this->Load(filename); else diff --git a/graphics/src/Image_TEST.cc b/graphics/src/Image_TEST.cc index ac16b29db..4c5d7ee8b 100644 --- a/graphics/src/Image_TEST.cc +++ b/graphics/src/Image_TEST.cc @@ -280,7 +280,7 @@ TEST_F(ImageTest, SetFromData) ///////////////////////////////////////////////// TEST_F(ImageTest, ConvertPixelFormat) { - using Image = ignition::common::Image; + using Image = gz::common::Image; EXPECT_EQ(Image::PixelFormatType::UNKNOWN_PIXEL_FORMAT, Image::ConvertPixelFormat("fake")); EXPECT_EQ(Image::PixelFormatType::UNKNOWN_PIXEL_FORMAT, @@ -553,7 +553,7 @@ void ImagePerformanceTest::MaxColor(const std::string &_filePath, EXPECT_EQ(0, img.Load(fileName)); EXPECT_EQ(_width, img.Width()); EXPECT_EQ(_height, img.Height()); - EXPECT_EQ(ignition::math::Color(0., 0., 0., 0), img.MaxColor()); + EXPECT_EQ(gz::math::Color(0., 0., 0., 0), img.MaxColor()); EXPECT_TRUE(img.Valid()); } diff --git a/graphics/src/KeyFrame.cc b/graphics/src/KeyFrame.cc index b4cb2aa12..82ca95a2d 100644 --- a/graphics/src/KeyFrame.cc +++ b/graphics/src/KeyFrame.cc @@ -45,7 +45,7 @@ class NumericKeyFrame::Implementation ///////////////////////////////////////////////// KeyFrame::KeyFrame(const double _time) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->time = _time; } @@ -65,7 +65,7 @@ double KeyFrame::Time() const ///////////////////////////////////////////////// PoseKeyFrame::PoseKeyFrame(const double _time) : KeyFrame(_time), - dataPtr(ignition::utils::MakeImpl()) + dataPtr(gz::utils::MakeImpl()) { } @@ -101,7 +101,7 @@ const math::Quaterniond &PoseKeyFrame::Rotation() const ///////////////////////////////////////////////// NumericKeyFrame::NumericKeyFrame(const double _time) : KeyFrame(_time), - dataPtr(ignition::utils::MakeImpl()) + dataPtr(gz::utils::MakeImpl()) { } diff --git a/graphics/src/Material.cc b/graphics/src/Material.cc index 7c38cdb73..ee27db531 100644 --- a/graphics/src/Material.cc +++ b/graphics/src/Material.cc @@ -32,7 +32,7 @@ IGN_ENUM(blendModeIface, Material::BlendMode, "ADD", "MODULATE", "REPLACE") /// \brief Private data for Material -class ignition::common::Material::Implementation +class gz::common::Material::Implementation { /// \brief the name of the material public: std::string name; @@ -102,7 +102,7 @@ unsigned int Material::Implementation::counter = 0; ////////////////////////////////////////////////// Material::Material() -: dataPtr(ignition::utils::MakeUniqueImpl()) +: dataPtr(gz::utils::MakeUniqueImpl()) { this->dataPtr->name = "ignition_material_" + std::to_string(this->dataPtr->counter++); @@ -116,7 +116,7 @@ Material::Material() ////////////////////////////////////////////////// Material::Material(const math::Color &_clr) -: dataPtr(ignition::utils::MakeUniqueImpl()) +: dataPtr(gz::utils::MakeUniqueImpl()) { this->dataPtr->name = "ignition_material_" + std::to_string(this->dataPtr->counter++); diff --git a/graphics/src/Mesh.cc b/graphics/src/Mesh.cc index 6b7e957b9..448baf331 100644 --- a/graphics/src/Mesh.cc +++ b/graphics/src/Mesh.cc @@ -30,7 +30,7 @@ using namespace gz; using namespace common; /// \brief Private data for Mesh -class ignition::common::Mesh::Implementation +class gz::common::Mesh::Implementation { /// \brief The name of the mesh public: std::string name; @@ -50,7 +50,7 @@ class ignition::common::Mesh::Implementation ////////////////////////////////////////////////// Mesh::Mesh() -: dataPtr(ignition::utils::MakeUniqueImpl()) +: dataPtr(gz::utils::MakeUniqueImpl()) { this->dataPtr->name = "unknown"; this->dataPtr->skeleton = NULL; @@ -86,20 +86,20 @@ std::string Mesh::Name() const } ////////////////////////////////////////////////// -ignition::math::Vector3d Mesh::Max() const +gz::math::Vector3d Mesh::Max() const { if (this->dataPtr->submeshes.empty()) - return ignition::math::Vector3d::Zero; + return gz::math::Vector3d::Zero; - ignition::math::Vector3d max; + gz::math::Vector3d max; - max.X(-ignition::math::MAX_F); - max.Y(-ignition::math::MAX_F); - max.Z(-ignition::math::MAX_F); + max.X(-gz::math::MAX_F); + max.Y(-gz::math::MAX_F); + max.Z(-gz::math::MAX_F); for (const auto &submesh : this->dataPtr->submeshes) { - ignition::math::Vector3d smax = submesh->Max(); + gz::math::Vector3d smax = submesh->Max(); max.X(std::max(max.X(), smax.X())); max.Y(std::max(max.Y(), smax.Y())); max.Z(std::max(max.Z(), smax.Z())); @@ -109,20 +109,20 @@ ignition::math::Vector3d Mesh::Max() const } ////////////////////////////////////////////////// -ignition::math::Vector3d Mesh::Min() const +gz::math::Vector3d Mesh::Min() const { if (this->dataPtr->submeshes.empty()) - return ignition::math::Vector3d::Zero; + return gz::math::Vector3d::Zero; - ignition::math::Vector3d min; + gz::math::Vector3d min; - min.X(ignition::math::MAX_F); - min.Y(ignition::math::MAX_F); - min.Z(ignition::math::MAX_F); + min.X(gz::math::MAX_F); + min.Y(gz::math::MAX_F); + min.Z(gz::math::MAX_F); for (const auto &submesh : this->dataPtr->submeshes) { - ignition::math::Vector3d smin = submesh->Min(); + gz::math::Vector3d smin = submesh->Min(); min.X(std::min(min.X(), smin.X())); min.Y(std::min(min.Y(), smin.Y())); min.Z(std::min(min.Z(), smin.Z())); @@ -339,30 +339,30 @@ bool Mesh::HasSkeleton() const } ////////////////////////////////////////////////// -void Mesh::Scale(const ignition::math::Vector3d &_factor) +void Mesh::Scale(const gz::math::Vector3d &_factor) { for (auto &submesh : this->dataPtr->submeshes) submesh->Scale(_factor); } ////////////////////////////////////////////////// -void Mesh::SetScale(const ignition::math::Vector3d &_factor) +void Mesh::SetScale(const gz::math::Vector3d &_factor) { for (auto &submesh : this->dataPtr->submeshes) submesh->Scale(_factor); } ////////////////////////////////////////////////// -void Mesh::GenSphericalTexCoord(const ignition::math::Vector3d &_center) +void Mesh::GenSphericalTexCoord(const gz::math::Vector3d &_center) { for (auto &submesh : this->dataPtr->submeshes) submesh->GenSphericalTexCoord(_center); } ////////////////////////////////////////////////// -void Mesh::Center(const ignition::math::Vector3d &_center) +void Mesh::Center(const gz::math::Vector3d &_center) { - ignition::math::Vector3d min, max, half; + gz::math::Vector3d min, max, half; min = this->Min(); max = this->Max(); half = (max - min) * 0.5; @@ -371,16 +371,16 @@ void Mesh::Center(const ignition::math::Vector3d &_center) } ////////////////////////////////////////////////// -void Mesh::Translate(const ignition::math::Vector3d &_vec) +void Mesh::Translate(const gz::math::Vector3d &_vec) { for (auto &submesh : this->dataPtr->submeshes) submesh->Translate(_vec); } ////////////////////////////////////////////////// -void Mesh::AABB(ignition::math::Vector3d &_center, - ignition::math::Vector3d &_minXYZ, - ignition::math::Vector3d &_maxXYZ) const +void Mesh::AABB(gz::math::Vector3d &_center, + gz::math::Vector3d &_minXYZ, + gz::math::Vector3d &_maxXYZ) const { // find aabb center _minXYZ.X(1e15); @@ -395,8 +395,8 @@ void Mesh::AABB(ignition::math::Vector3d &_center, for (auto const &submesh : this->dataPtr->submeshes) { - ignition::math::Vector3d max = submesh->Max(); - ignition::math::Vector3d min = submesh->Min(); + gz::math::Vector3d max = submesh->Max(); + gz::math::Vector3d min = submesh->Min(); _minXYZ.X(std::min(_minXYZ.X(), min.X())); _maxXYZ.X(std::max(_maxXYZ.X(), max.X())); diff --git a/graphics/src/MeshCSG.cc b/graphics/src/MeshCSG.cc index 6ce80a72b..fd3e82189 100644 --- a/graphics/src/MeshCSG.cc +++ b/graphics/src/MeshCSG.cc @@ -144,7 +144,7 @@ static int TriangleRevert(GtsTriangle *_t, void *) ////////////////////////////////////////////////// Mesh *MeshCSG::CreateBoolean(const Mesh *_m1, const Mesh *_m2, int _operation, - const ignition::math::Pose3d &_offset) + const gz::math::Pose3d &_offset) { GtsSurface *s1, *s2, *s3; GtsSurfaceInter *si; @@ -163,7 +163,7 @@ Mesh *MeshCSG::CreateBoolean(const Mesh *_m1, const Mesh *_m2, int _operation, this->ConvertMeshToGTS(_m1, s1); - if (_offset != ignition::math::Pose3d::Zero) + if (_offset != gz::math::Pose3d::Zero) { Mesh *m2 = new Mesh(); for (unsigned int i = 0; i < _m2->SubMeshCount(); ++i) @@ -301,7 +301,7 @@ void MeshCSG::ConvertMeshToGTS(const Mesh *_mesh, GtsSurface *_surface) for (unsigned int j = 0; j < subMesh->VertexCount(); ++j) { - ignition::math::Vector3d vertex = subMesh->Vertex(j); + gz::math::Vector3d vertex = subMesh->Vertex(j); g_ptr_array_add(vertices, gts_vertex_new(gts_vertex_class(), vertex.X(), vertex.Y(), vertex.Z())); } diff --git a/graphics/src/MeshManager.cc b/graphics/src/MeshManager.cc index 16fc10927..806f06dd2 100644 --- a/graphics/src/MeshManager.cc +++ b/graphics/src/MeshManager.cc @@ -39,7 +39,7 @@ using namespace gz::common; -class ignition::common::MeshManager::Implementation +class gz::common::MeshManager::Implementation { #ifdef _WIN32 // Disable warning C4251 @@ -73,21 +73,21 @@ class ignition::common::MeshManager::Implementation ////////////////////////////////////////////////// MeshManager::MeshManager() -: dataPtr(ignition::utils::MakeUniqueImpl()) +: dataPtr(gz::utils::MakeUniqueImpl()) { // Create some basic shapes this->CreatePlane("unit_plane", - ignition::math::Planed( - ignition::math::Vector3d(0, 0, 1), ignition::math::Vector2d(1, 1), 0), - ignition::math::Vector2d(1, 1), - ignition::math::Vector2d(1, 1)); + gz::math::Planed( + gz::math::Vector3d(0, 0, 1), gz::math::Vector2d(1, 1), 0), + gz::math::Vector2d(1, 1), + gz::math::Vector2d(1, 1)); this->CreateSphere("unit_sphere", 0.5f, 32, 32); this->CreateSphere("joint_anchor", 0.01f, 32, 32); - this->CreateBox("body_cg", ignition::math::Vector3d(0.014, 0.014, 0.014), - ignition::math::Vector2d(0.014, 0.014)); - this->CreateBox("unit_box", ignition::math::Vector3d(1, 1, 1), - ignition::math::Vector2d(1, 1)); + this->CreateBox("body_cg", gz::math::Vector3d(0.014, 0.014, 0.014), + gz::math::Vector2d(0.014, 0.014)); + this->CreateBox("unit_box", gz::math::Vector3d(1, 1, 1), + gz::math::Vector2d(1, 1)); this->CreateCylinder("unit_cylinder", 0.5, 1.0, 1, 32); this->CreateCone("unit_cone", 0.5, 1.0, 5, 32); this->CreateCamera("unit_camera", 0.5); @@ -206,8 +206,8 @@ bool MeshManager::IsValidFilename(const std::string &_filename) ////////////////////////////////////////////////// void MeshManager::MeshAABB(const Mesh *_mesh, - ignition::math::Vector3d &_center, - ignition::math::Vector3d &_minXYZ, ignition::math::Vector3d &_maxXYZ) + gz::math::Vector3d &_center, + gz::math::Vector3d &_minXYZ, gz::math::Vector3d &_maxXYZ) { if (this->HasMesh(_mesh->Name())) this->dataPtr->meshes[_mesh->Name()]->AABB(_center, _minXYZ, _maxXYZ); @@ -215,7 +215,7 @@ void MeshManager::MeshAABB(const Mesh *_mesh, ////////////////////////////////////////////////// void MeshManager::GenSphericalTexCoord(const Mesh *_mesh, - const ignition::math::Vector3d &_center) + const gz::math::Vector3d &_center) { if (this->HasMesh(_mesh->Name())) this->dataPtr->meshes[_mesh->Name()]->GenSphericalTexCoord(_center); @@ -292,7 +292,7 @@ void MeshManager::CreateSphere(const std::string &name, float radius, int ring, seg; float deltaSegAngle = (2.0 * IGN_PI / segments); float deltaRingAngle = (IGN_PI / rings); - ignition::math::Vector3d vert, norm; + gz::math::Vector3d vert, norm; unsigned int verticeIndex = 0; Mesh *mesh = new Mesh(); @@ -342,9 +342,9 @@ void MeshManager::CreateSphere(const std::string &name, float radius, ////////////////////////////////////////////////// void MeshManager::CreatePlane(const std::string &_name, - const ignition::math::Planed &_plane, - const ignition::math::Vector2d &_segments, - const ignition::math::Vector2d &_uvTile) + const gz::math::Planed &_plane, + const gz::math::Vector2d &_segments, + const gz::math::Vector2d &_uvTile) { this->CreatePlane(_name, _plane.Normal(), _plane.Offset(), _plane.Size(), _segments, _uvTile); @@ -352,11 +352,11 @@ void MeshManager::CreatePlane(const std::string &_name, ////////////////////////////////////////////////// void MeshManager::CreatePlane(const std::string &_name, - const ignition::math::Vector3d &_normal, + const gz::math::Vector3d &_normal, const double _d, - const ignition::math::Vector2d &_size, - const ignition::math::Vector2d &_segments, - const ignition::math::Vector2d &_uvTile) + const gz::math::Vector2d &_size, + const gz::math::Vector2d &_segments, + const gz::math::Vector2d &_uvTile) { if (this->HasMesh(_name)) { @@ -369,16 +369,16 @@ void MeshManager::CreatePlane(const std::string &_name, SubMesh subMesh; - ignition::math::Vector3d zAxis, yAxis, xAxis; + gz::math::Vector3d zAxis, yAxis, xAxis; zAxis = _normal; zAxis.Normalize(); yAxis = zAxis.Perpendicular(); xAxis = yAxis.Cross(zAxis); - ignition::math::Matrix4d xlate, xform, rot; - xlate = rot = ignition::math::Matrix4d::Identity; + gz::math::Matrix4d xlate, xform, rot; + xlate = rot = gz::math::Matrix4d::Identity; - ignition::math::Matrix3d rot3; + gz::math::Matrix3d rot3; rot3.SetAxes(xAxis, yAxis, zAxis); rot = rot3; @@ -386,8 +386,8 @@ void MeshManager::CreatePlane(const std::string &_name, xlate.SetTranslation(_normal * -_d); xform = xlate * rot; - ignition::math::Vector3d vec; - ignition::math::Vector3d norm(0, 0, 1); + gz::math::Vector3d vec; + gz::math::Vector3d norm(0, 0, 1); double xSpace = _size.X() / _segments.X(); double ySpace = _size.Y() / _segments.Y(); double halfWidth = _size.X() / 2.0; @@ -439,8 +439,8 @@ void MeshManager::CreatePlane(const std::string &_name, ////////////////////////////////////////////////// void MeshManager::CreateBox(const std::string &_name, - const ignition::math::Vector3d &_sides, - const ignition::math::Vector2d &_uvCoords) + const gz::math::Vector3d &_sides, + const gz::math::Vector2d &_uvCoords) { int i, k; @@ -541,7 +541,7 @@ void MeshManager::CreateBox(const std::string &_name, ////////////////////////////////////////////////// void MeshManager::CreateExtrudedPolyline(const std::string &_name, - const std::vector > &_polys, + const std::vector > &_polys, double _height) { #ifndef _WIN32 @@ -576,8 +576,8 @@ void MeshManager::CreateExtrudedPolyline(const std::string &_name, SubMesh subMesh; - std::vector vertices; - std::vector edges; + std::vector vertices; + std::vector edges; MeshManager::ConvertPolylinesToVerticesAndEdges(polys, tol, vertices, @@ -589,23 +589,23 @@ void MeshManager::CreateExtrudedPolyline(const std::string &_name, return; } - std::vector normals; + std::vector normals; for (unsigned int i = 0; i < edges.size(); ++i) { // we retrieve each edge's coordinates int i0 = edges[i][0]; int i1 = edges[i][1]; - ignition::math::Vector2d edgeV0 = vertices[i0]; - ignition::math::Vector2d edgeV1 = vertices[i1]; + gz::math::Vector2d edgeV0 = vertices[i0]; + gz::math::Vector2d edgeV1 = vertices[i1]; // we look for those points in the subMesh (where indices may have changed) for (unsigned int j = 0; j < subMesh.IndexCount(); j+=3) { - ignition::math::Vector3d v0 = subMesh.Vertex(subMesh.Index(j)); - ignition::math::Vector3d v1 = subMesh.Vertex(subMesh.Index(j+1)); - ignition::math::Vector3d v2 = subMesh.Vertex(subMesh.Index(j+2)); + gz::math::Vector3d v0 = subMesh.Vertex(subMesh.Index(j)); + gz::math::Vector3d v1 = subMesh.Vertex(subMesh.Index(j+1)); + gz::math::Vector3d v2 = subMesh.Vertex(subMesh.Index(j+2)); - std::vector triangle; + std::vector triangle; triangle.push_back(v0); triangle.push_back(v1); triangle.push_back(v2); @@ -613,7 +613,7 @@ void MeshManager::CreateExtrudedPolyline(const std::string &_name, int ev0 = -1; for (unsigned int k = 0; k < triangle.size(); ++k) { - if (ignition::math::Vector2d(triangle[k].X(), triangle[k].Y()) == + if (gz::math::Vector2d(triangle[k].X(), triangle[k].Y()) == edgeV0) { // found a vertex in triangle that matches the vertex of the edge @@ -628,7 +628,7 @@ void MeshManager::CreateExtrudedPolyline(const std::string &_name, for (unsigned int k = 0; k < triangle.size()-1; ++k) { int index = (ev0 + k + 1) % triangle.size(); - ignition::math::Vector3d triV = triangle[index]; + gz::math::Vector3d triV = triangle[index]; if (math::Vector2d(triV.X(), triV.Y()) == edgeV1) { // found another vertex in triangle that matches the vertex of the @@ -645,11 +645,11 @@ void MeshManager::CreateExtrudedPolyline(const std::string &_name, // Found an edge in triangle that matches the exterior edge. // Now find its normal. - ignition::math::Vector3d edgeVec = triangle[ev0] - triangle[ev1]; + gz::math::Vector3d edgeVec = triangle[ev0] - triangle[ev1]; edgeVec.Normalize(); - ignition::math::Vector3d normal(edgeVec.Y(), -edgeVec.X(), 0); + gz::math::Vector3d normal(edgeVec.Y(), -edgeVec.X(), 0); - ignition::math::Vector3d otherEdgeVec = triangle[ev0] - triangle[ev2]; + gz::math::Vector3d otherEdgeVec = triangle[ev0] - triangle[ev2]; otherEdgeVec.Normalize(); double angle0 = otherEdgeVec.Dot(normal); double angle1 = otherEdgeVec.Dot(-normal); @@ -682,14 +682,14 @@ void MeshManager::CreateExtrudedPolyline(const std::string &_name, // add normal for bottom face for (unsigned int i = 0; i < numVertices; ++i) - subMesh.AddNormal(-ignition::math::Vector3d::UnitZ); + subMesh.AddNormal(-gz::math::Vector3d::UnitZ); // create the top face for (unsigned int i = 0; i < numVertices; ++i) { - ignition::math::Vector3d v = subMesh.Vertex(i); + gz::math::Vector3d v = subMesh.Vertex(i); subMesh.AddVertex(v.X(), v.Y(), _height); - subMesh.AddNormal(ignition::math::Vector3d::UnitZ); + subMesh.AddNormal(gz::math::Vector3d::UnitZ); } unsigned int numIndices = subMesh.IndexCount(); for (unsigned int i = 0; i < numIndices; i+=3) @@ -708,36 +708,36 @@ void MeshManager::CreateExtrudedPolyline(const std::string &_name, // we retrieve each edge's coordinates int i0 = edges[i][0]; int i1 = edges[i][1]; - ignition::math::Vector2d v0 = vertices[i0]; - ignition::math::Vector2d v1 = vertices[i1]; + gz::math::Vector2d v0 = vertices[i0]; + gz::math::Vector2d v1 = vertices[i1]; - ignition::math::Vector2d edge2d = v1 - v0; - ignition::math::Vector3d edge(edge2d.X(), edge2d.Y(), 0); - ignition::math::Vector3d cross = edge.Cross(normals[i]); + gz::math::Vector2d edge2d = v1 - v0; + gz::math::Vector3d edge(edge2d.X(), edge2d.Y(), 0); + gz::math::Vector3d cross = edge.Cross(normals[i]); unsigned int vCount = subMesh.VertexCount(); - subMesh.AddVertex(ignition::math::Vector3d(v0.X(), v0.Y(), 0)); + subMesh.AddVertex(gz::math::Vector3d(v0.X(), v0.Y(), 0)); if (cross.Z() >0) { - subMesh.AddVertex(ignition::math::Vector3d(v0.X(), v0.Y(), _height)); - subMesh.AddVertex(ignition::math::Vector3d(v1.X(), v1.Y(), _height)); + subMesh.AddVertex(gz::math::Vector3d(v0.X(), v0.Y(), _height)); + subMesh.AddVertex(gz::math::Vector3d(v1.X(), v1.Y(), _height)); } else { - subMesh.AddVertex(ignition::math::Vector3d(v1.X(), v1.Y(), _height)); - subMesh.AddVertex(ignition::math::Vector3d(v0.X(), v0.Y(), _height)); + subMesh.AddVertex(gz::math::Vector3d(v1.X(), v1.Y(), _height)); + subMesh.AddVertex(gz::math::Vector3d(v0.X(), v0.Y(), _height)); } - subMesh.AddVertex(ignition::math::Vector3d(v0.X(), v0.Y(), 0)); + subMesh.AddVertex(gz::math::Vector3d(v0.X(), v0.Y(), 0)); if (cross.Z() >0) { - subMesh.AddVertex(ignition::math::Vector3d(v1.X(), v1.Y(), _height)); - subMesh.AddVertex(ignition::math::Vector3d(v1.X(), v1.Y(), 0)); + subMesh.AddVertex(gz::math::Vector3d(v1.X(), v1.Y(), _height)); + subMesh.AddVertex(gz::math::Vector3d(v1.X(), v1.Y(), 0)); } else { - subMesh.AddVertex(ignition::math::Vector3d(v1.X(), v1.Y(), 0)); - subMesh.AddVertex(ignition::math::Vector3d(v1.X(), v1.Y(), _height)); + subMesh.AddVertex(gz::math::Vector3d(v1.X(), v1.Y(), 0)); + subMesh.AddVertex(gz::math::Vector3d(v1.X(), v1.Y(), _height)); } for (unsigned int j = 0; j < 6; ++j) { @@ -851,7 +851,7 @@ void MeshManager::CreateCamera(const std::string &_name, float _scale) ////////////////////////////////////////////////// void MeshManager::CreateEllipsoid(const std::string &_name, - const ignition::math::Vector3d &_radii, + const gz::math::Vector3d &_radii, const unsigned int _rings, const unsigned int _segments) { @@ -887,22 +887,22 @@ void MeshManager::CreateEllipsoid(const std::string &_name, const auto s_phi = sin(phi); // Compute vertex - subMesh.AddVertex(ignition::math::Vector3d( + subMesh.AddVertex(gz::math::Vector3d( _radii.X() * c_phi * c_theta, _radii.Y() * c_phi * s_theta, _radii.Z() * s_phi)); // Compute unit normal at vertex - ignition::math::Vector3d du( + gz::math::Vector3d du( -(_radii.X() * c_phi) * s_theta, +(_radii.Y() * c_phi) * c_theta, 0.0); - ignition::math::Vector3d dv( + gz::math::Vector3d dv( -_radii.X() * s_phi * c_theta, -_radii.Y() * s_phi * s_theta, _radii.Z() * c_phi); - ignition::math::Vector3d normal = du.Cross(dv); + gz::math::Vector3d normal = du.Cross(dv); subMesh.AddNormal(normal); @@ -974,10 +974,10 @@ void MeshManager::CreateCapsule(const std::string &_name, x = -sin(u * (IGN_PI * 2.0)); y = cos(u * (IGN_PI * 2.0)); - ignition::math::Vector3d p(x * _radius * w, y * _radius * w, z); + gz::math::Vector3d p(x * _radius * w, y * _radius * w, z); // Compute vertex - subMesh.AddVertex(ignition::math::Vector3d( - p + ignition::math::Vector3d(0.0, 0.0, 0.5 * _length))); + subMesh.AddVertex(gz::math::Vector3d( + p + gz::math::Vector3d(0.0, 0.0, 0.5 * _length))); subMesh.AddTexCoord({u, v * oneThird}); subMesh.AddNormal(p.Normalize()); @@ -1017,12 +1017,12 @@ void MeshManager::CreateCapsule(const std::string &_name, x = -sin(u * (IGN_PI * 2.0)); y = cos(u * (IGN_PI * 2.0)); - ignition::math::Vector3d p(x * _radius, y * _radius, z); + gz::math::Vector3d p(x * _radius, y * _radius, z); // Compute vertex subMesh.AddVertex(p); subMesh.AddTexCoord({u, oneThird + (v * oneThird)}); - subMesh.AddNormal(ignition::math::Vector3d(x, y, 0.0)); + subMesh.AddNormal(gz::math::Vector3d(x, y, 0.0)); point++; if (i > 0 && j > 0) @@ -1060,10 +1060,10 @@ void MeshManager::CreateCapsule(const std::string &_name, x = -sin(u2 * (IGN_PI * 2.0)); y = cos(u2 * (IGN_PI * 2.0)); - ignition::math::Vector3d p(x * _radius * w, y * _radius * w, z); + gz::math::Vector3d p(x * _radius * w, y * _radius * w, z); // Compute vertex - subMesh.AddVertex(ignition::math::Vector3d( - p + ignition::math::Vector3d(0.0, 0.0, -0.5 * _length))); + subMesh.AddVertex(gz::math::Vector3d( + p + gz::math::Vector3d(0.0, 0.0, -0.5 * _length))); subMesh.AddTexCoord({u2, twoThirds + ((v - 1.0) * oneThird)}); subMesh.AddNormal(p.Normalize()); point++; @@ -1091,7 +1091,7 @@ void MeshManager::CreateCapsule(const std::string &_name, void MeshManager::CreateCylinder(const std::string &name, float radius, float height, int rings, int segments) { - ignition::math::Vector3d vert, norm; + gz::math::Vector3d vert, norm; unsigned int verticeIndex = 0; int ring, seg; float deltaSegAngle = (2.0 * IGN_PI / segments); @@ -1208,7 +1208,7 @@ void MeshManager::CreateCylinder(const std::string &name, float radius, void MeshManager::CreateCone(const std::string &name, float radius, float height, int rings, int segments) { - ignition::math::Vector3d vert, norm; + gz::math::Vector3d vert, norm; unsigned int verticeIndex = 0; unsigned int i, j; int ring, seg; @@ -1318,7 +1318,7 @@ void MeshManager::CreateCone(const std::string &name, float radius, void MeshManager::CreateTube(const std::string &_name, float _innerRadius, float _outerRadius, float _height, int _rings, int _segments, double _arc) { - ignition::math::Vector3d vert, norm; + gz::math::Vector3d vert, norm; unsigned int verticeIndex = 0; int ring, seg; @@ -1453,7 +1453,7 @@ void MeshManager::CreateTube(const std::string &_name, float _innerRadius, } // Close ends in case it's not a full circle - if (!ignition::math::equal(_arc, 2.0 * IGN_PI)) + if (!gz::math::equal(_arc, 2.0 * IGN_PI)) { for (ring = 0; ring < rings; ++ring) { @@ -1549,7 +1549,7 @@ void MeshManager::Tesselate2DMesh(SubMesh *sm, int meshWidth, int meshHeight, ////////////////////////////////////////////////// void MeshManager::CreateBoolean(const std::string &_name, const Mesh *_m1, - const Mesh *_m2, int _operation, const ignition::math::Pose3d &_offset) + const Mesh *_m2, int _operation, const gz::math::Pose3d &_offset) { if (this->HasMesh(_name)) return; @@ -1564,8 +1564,8 @@ void MeshManager::CreateBoolean(const std::string &_name, const Mesh *_m1, ////////////////////////////////////////////////// size_t MeshManager::AddUniquePointToVerticesTable( - std::vector &_vertices, - const ignition::math::Vector2d &_p, + std::vector &_vertices, + const gz::math::Vector2d &_p, double _tol) { double sqrTol = _tol * _tol; @@ -1585,14 +1585,14 @@ size_t MeshManager::AddUniquePointToVerticesTable( ////////////////////////////////////////////////// void MeshManager::ConvertPolylinesToVerticesAndEdges( - const std::vector > &_polys, + const std::vector > &_polys, double _tol, - std::vector &_vertices, - std::vector &edges) + std::vector &_vertices, + std::vector &edges) { for (auto poly : _polys) { - ignition::math::Vector2d previous = poly[0]; + gz::math::Vector2d previous = poly[0]; for (auto i = 1u; i != poly.size(); ++i) { auto p = poly[i]; @@ -1608,7 +1608,7 @@ void MeshManager::ConvertPolylinesToVerticesAndEdges( continue; } // add the new edge - ignition::math::Vector2i e(startPointIndex, endPointIndex); + gz::math::Vector2i e(startPointIndex, endPointIndex); edges.push_back(e); } } diff --git a/graphics/src/MeshManager_TEST.cc b/graphics/src/MeshManager_TEST.cc index aca1f13aa..bea727763 100644 --- a/graphics/src/MeshManager_TEST.cc +++ b/graphics/src/MeshManager_TEST.cc @@ -35,20 +35,20 @@ TEST_F(MeshManager, CreateExtrudedPolyline) // test extrusion of a path with two subpaths: // a smaller square inside a bigger square. // The smaller square should be treated as a hole inside the bigger square. - std::vector > path; - std::vector subpath01; - subpath01.push_back(ignition::math::Vector2d(0, 0)); - subpath01.push_back(ignition::math::Vector2d(1, 0)); - subpath01.push_back(ignition::math::Vector2d(1, 1)); - subpath01.push_back(ignition::math::Vector2d(0, 1)); - subpath01.push_back(ignition::math::Vector2d(0, 0)); - - std::vector subpath02; - subpath02.push_back(ignition::math::Vector2d(0.25, 0.25)); - subpath02.push_back(ignition::math::Vector2d(0.25, 0.75)); - subpath02.push_back(ignition::math::Vector2d(0.75, 0.75)); - subpath02.push_back(ignition::math::Vector2d(0.75, 0.25)); - subpath02.push_back(ignition::math::Vector2d(0.25, 0.25)); + std::vector > path; + std::vector subpath01; + subpath01.push_back(gz::math::Vector2d(0, 0)); + subpath01.push_back(gz::math::Vector2d(1, 0)); + subpath01.push_back(gz::math::Vector2d(1, 1)); + subpath01.push_back(gz::math::Vector2d(0, 1)); + subpath01.push_back(gz::math::Vector2d(0, 0)); + + std::vector subpath02; + subpath02.push_back(gz::math::Vector2d(0.25, 0.25)); + subpath02.push_back(gz::math::Vector2d(0.25, 0.75)); + subpath02.push_back(gz::math::Vector2d(0.75, 0.75)); + subpath02.push_back(gz::math::Vector2d(0.75, 0.25)); + subpath02.push_back(gz::math::Vector2d(0.25, 0.25)); path.push_back(subpath01); path.push_back(subpath02); @@ -70,21 +70,21 @@ TEST_F(MeshManager, CreateExtrudedPolyline) // check submesh bounds auto submesh = mesh->SubMeshByIndex(0).lock(); EXPECT_TRUE(submesh != nullptr); - EXPECT_EQ(ignition::math::Vector3d(0, 0, 0), submesh->Min()); - EXPECT_EQ(ignition::math::Vector3d(1.0, 1.0, 10.0), submesh->Max()); + EXPECT_EQ(gz::math::Vector3d(0, 0, 0), submesh->Min()); + EXPECT_EQ(gz::math::Vector3d(1.0, 1.0, 10.0), submesh->Max()); // check vertices for (unsigned int i = 0; i < submesh->VertexCount(); ++i) { - ignition::math::Vector3d v = submesh->Vertex(i); + gz::math::Vector3d v = submesh->Vertex(i); // check no vertices are in the region of the hole EXPECT_FALSE((v.X() > 0.25 && v.X() < 0.75)); EXPECT_FALSE((v.Y() > 0.25 && v.Y() < 0.75)); // check extruded height - EXPECT_TRUE((ignition::math::equal(v.Z(), 0.0) || - ignition::math::equal(v.Z(), 10.0))); + EXPECT_TRUE((gz::math::equal(v.Z(), 0.0) || + gz::math::equal(v.Z(), 10.0))); } // verify same number of normals and vertices @@ -93,40 +93,40 @@ TEST_F(MeshManager, CreateExtrudedPolyline) // check normals for (unsigned int i = 0; i < submesh->NormalCount(); ++i) { - ignition::math::Vector3d v = submesh->Vertex(i); - ignition::math::Vector3d n = submesh->Normal(i); + gz::math::Vector3d v = submesh->Vertex(i); + gz::math::Vector3d n = submesh->Normal(i); // vertex at 0 could be a bottom face or side face - if (ignition::math::equal(v.Z(), 0.0)) + if (gz::math::equal(v.Z(), 0.0)) { - if (ignition::math::equal(n.Z(), 0.0)) + if (gz::math::equal(n.Z(), 0.0)) { // side face - check non-zero normal - EXPECT_TRUE(!(ignition::math::equal(n.X(), 0.0) && - ignition::math::equal(n.Y(), 0.0))); + EXPECT_TRUE(!(gz::math::equal(n.X(), 0.0) && + gz::math::equal(n.Y(), 0.0))); } else { // bottom face - normal in -z direction - EXPECT_TRUE((n == -ignition::math::Vector3d::UnitZ) || - (ignition::math::equal(n.Z(), 0.0))); + EXPECT_TRUE((n == -gz::math::Vector3d::UnitZ) || + (gz::math::equal(n.Z(), 0.0))); } } // vertex at height could be a top face or side face - if (ignition::math::equal(v.Z(), 10.0)) + if (gz::math::equal(v.Z(), 10.0)) { - if (ignition::math::equal(n.Z(), 0.0)) + if (gz::math::equal(n.Z(), 0.0)) { // side face - check non-zero normal - EXPECT_TRUE(!(ignition::math::equal(n.X(), 0.0) && - ignition::math::equal(n.Y(), 0.0))); + EXPECT_TRUE(!(gz::math::equal(n.X(), 0.0) && + gz::math::equal(n.Y(), 0.0))); } else { // top face - normal in +z direction - EXPECT_TRUE((n == ignition::math::Vector3d::UnitZ) || - (ignition::math::equal(n.Z(), 0.0))); + EXPECT_TRUE((n == gz::math::Vector3d::UnitZ) || + (gz::math::equal(n.Z(), 0.0))); } } } @@ -138,21 +138,21 @@ TEST_F(MeshManager, CreateExtrudedPolylineClosedPath) // test extrusion of a path that has two closed subpaths, i.e., // first and last vertices are the same. // The following two subpaths form the letter 'A'. - std::vector > path2; - std::vector subpath03; - subpath03.push_back(ignition::math::Vector2d(2.27467, 1.0967)); - subpath03.push_back(ignition::math::Vector2d(1.81094, 2.35418)); - subpath03.push_back(ignition::math::Vector2d(2.74009, 2.35418)); - - std::vector subpath04; - subpath04.push_back(ignition::math::Vector2d(2.08173, 0.7599)); - subpath04.push_back(ignition::math::Vector2d(2.4693, 0.7599)); - subpath04.push_back(ignition::math::Vector2d(3.4323, 3.28672)); - subpath04.push_back(ignition::math::Vector2d(3.07689, 3.28672)); - subpath04.push_back(ignition::math::Vector2d(2.84672, 2.63851)); - subpath04.push_back(ignition::math::Vector2d(1.7077, 2.63851)); - subpath04.push_back(ignition::math::Vector2d(1.47753, 3.28672)); - subpath04.push_back(ignition::math::Vector2d(1.11704, 3.28672)); + std::vector > path2; + std::vector subpath03; + subpath03.push_back(gz::math::Vector2d(2.27467, 1.0967)); + subpath03.push_back(gz::math::Vector2d(1.81094, 2.35418)); + subpath03.push_back(gz::math::Vector2d(2.74009, 2.35418)); + + std::vector subpath04; + subpath04.push_back(gz::math::Vector2d(2.08173, 0.7599)); + subpath04.push_back(gz::math::Vector2d(2.4693, 0.7599)); + subpath04.push_back(gz::math::Vector2d(3.4323, 3.28672)); + subpath04.push_back(gz::math::Vector2d(3.07689, 3.28672)); + subpath04.push_back(gz::math::Vector2d(2.84672, 2.63851)); + subpath04.push_back(gz::math::Vector2d(1.7077, 2.63851)); + subpath04.push_back(gz::math::Vector2d(1.47753, 3.28672)); + subpath04.push_back(gz::math::Vector2d(1.11704, 3.28672)); path2.push_back(subpath03); path2.push_back(subpath04); @@ -174,12 +174,12 @@ TEST_F(MeshManager, CreateExtrudedPolylineClosedPath) // check submesh bounds auto submesh = mesh->SubMeshByIndex(0).lock(); EXPECT_TRUE(submesh != nullptr); - EXPECT_EQ(submesh->Min(), ignition::math::Vector3d(1.11704, 0.7599, 0)); - EXPECT_EQ(submesh->Max(), ignition::math::Vector3d(3.4323, 3.28672, 2.0)); + EXPECT_EQ(submesh->Min(), gz::math::Vector3d(1.11704, 0.7599, 0)); + EXPECT_EQ(submesh->Max(), gz::math::Vector3d(3.4323, 3.28672, 2.0)); for (unsigned int i = 0; i < submesh->VertexCount(); ++i) { - ignition::math::Vector3d v = submesh->Vertex(i); + gz::math::Vector3d v = submesh->Vertex(i); // check no vertices are in the region of the hole using a point-in-polygon // algorithm @@ -198,8 +198,8 @@ TEST_F(MeshManager, CreateExtrudedPolylineClosedPath) EXPECT_FALSE(pointInPolygon); // check extruded height - EXPECT_TRUE((ignition::math::equal(v.Z(), 0.0) || - ignition::math::equal(v.Z(), 2.0))); + EXPECT_TRUE((gz::math::equal(v.Z(), 0.0) || + gz::math::equal(v.Z(), 2.0))); } // verify same number of normals and vertices @@ -208,40 +208,40 @@ TEST_F(MeshManager, CreateExtrudedPolylineClosedPath) // check normals for (unsigned int i = 0; i < submesh->NormalCount(); ++i) { - ignition::math::Vector3d v = submesh->Vertex(i); - ignition::math::Vector3d n = submesh->Normal(i); + gz::math::Vector3d v = submesh->Vertex(i); + gz::math::Vector3d n = submesh->Normal(i); // vertex at 0 could be a bottom face or side face - if (ignition::math::equal(v.Z(), 0.0)) + if (gz::math::equal(v.Z(), 0.0)) { - if (ignition::math::equal(n.Z(), 0.0)) + if (gz::math::equal(n.Z(), 0.0)) { // side face - check non-zero normal - EXPECT_TRUE(!(ignition::math::equal(n.X(), 0.0) && - ignition::math::equal(n.Y(), 0.0))); + EXPECT_TRUE(!(gz::math::equal(n.X(), 0.0) && + gz::math::equal(n.Y(), 0.0))); } else { // bottom face - normal in -z direction - EXPECT_TRUE((n == -ignition::math::Vector3d::UnitZ) || - (ignition::math::equal(n.Z(), 0.0))); + EXPECT_TRUE((n == -gz::math::Vector3d::UnitZ) || + (gz::math::equal(n.Z(), 0.0))); } } // vertex at height could be a top face or side face - if (ignition::math::equal(v.Z(), 10.0)) + if (gz::math::equal(v.Z(), 10.0)) { - if (ignition::math::equal(n.Z(), 0.0)) + if (gz::math::equal(n.Z(), 0.0)) { // side face - check non-zero normal - EXPECT_TRUE(!(ignition::math::equal(n.X(), 0.0) && - ignition::math::equal(n.Y(), 0.0))); + EXPECT_TRUE(!(gz::math::equal(n.X(), 0.0) && + gz::math::equal(n.Y(), 0.0))); } else { // top face - normal in +z direction - EXPECT_TRUE((n == ignition::math::Vector3d::UnitZ) || - (ignition::math::equal(n.Z(), 0.0))); + EXPECT_TRUE((n == gz::math::Vector3d::UnitZ) || + (gz::math::equal(n.Z(), 0.0))); } } } @@ -251,11 +251,11 @@ TEST_F(MeshManager, CreateExtrudedPolylineClosedPath) TEST_F(MeshManager, CreateExtrudedPolylineInvalid) { // test extruding invalid polyline - std::vector > path; - std::vector subpath01; - subpath01.push_back(ignition::math::Vector2d(0, 0)); - subpath01.push_back(ignition::math::Vector2d(0, 1)); - subpath01.push_back(ignition::math::Vector2d(0, 2)); + std::vector > path; + std::vector subpath01; + subpath01.push_back(gz::math::Vector2d(0, 0)); + subpath01.push_back(gz::math::Vector2d(0, 1)); + subpath01.push_back(gz::math::Vector2d(0, 2)); path.push_back(subpath01); @@ -275,8 +275,8 @@ TEST_F(MeshManager, Remove) EXPECT_FALSE(mgr->HasMesh("box")); mgr->CreateBox("box", - ignition::math::Vector3d(1, 1, 1), - ignition::math::Vector2d(0, 0)); + gz::math::Vector3d(1, 1, 1), + gz::math::Vector2d(0, 0)); EXPECT_TRUE(mgr->HasMesh("box")); mgr->CreateSphere("sphere", 1.0, 1, 1); diff --git a/graphics/src/NodeAnimation.cc b/graphics/src/NodeAnimation.cc index 5464d7593..ee4630184 100644 --- a/graphics/src/NodeAnimation.cc +++ b/graphics/src/NodeAnimation.cc @@ -22,7 +22,7 @@ using namespace gz; using namespace common; /// \brief NodeAnimation private data -class ignition::common::NodeAnimation::Implementation +class gz::common::NodeAnimation::Implementation { /// \brief the name of the animation public: std::string name; @@ -36,7 +36,7 @@ class ignition::common::NodeAnimation::Implementation ////////////////////////////////////////////////// NodeAnimation::NodeAnimation(const std::string &_name) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->name = _name; } diff --git a/graphics/src/NodeTransform.cc b/graphics/src/NodeTransform.cc index 8d41bd143..3c6f1d64b 100644 --- a/graphics/src/NodeTransform.cc +++ b/graphics/src/NodeTransform.cc @@ -23,7 +23,7 @@ using namespace gz; using namespace common; /// \brief Private data for NodeTransform -class ignition::common::NodeTransform::Implementation +class gz::common::NodeTransform::Implementation { /// \brief the sid public: std::string sid; @@ -40,7 +40,7 @@ class ignition::common::NodeTransform::Implementation ////////////////////////////////////////////////// NodeTransform::NodeTransform(const NodeTransformType _type) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->sid = "_default_"; this->dataPtr->type = _type; @@ -50,7 +50,7 @@ NodeTransform::NodeTransform(const NodeTransformType _type) ////////////////////////////////////////////////// NodeTransform::NodeTransform(const math::Matrix4d &_mat, const std::string &_sid, const NodeTransformType _type) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->sid = _sid; this->dataPtr->type = _type; diff --git a/graphics/src/OBJLoader.cc b/graphics/src/OBJLoader.cc index 8b25470ad..252ae9959 100644 --- a/graphics/src/OBJLoader.cc +++ b/graphics/src/OBJLoader.cc @@ -44,7 +44,7 @@ using namespace common; ////////////////////////////////////////////////// OBJLoader::OBJLoader() -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { } @@ -222,7 +222,7 @@ Mesh *OBJLoader::Load(const std::string &_filename) // vertices int vIdx = i.vertex_index; - ignition::math::Vector3d vertex(attrib.vertices[3 * vIdx], + gz::math::Vector3d vertex(attrib.vertices[3 * vIdx], attrib.vertices[3 * vIdx + 1], attrib.vertices[3 * vIdx + 2]); subMesh->AddVertex(vertex); @@ -231,7 +231,7 @@ Mesh *OBJLoader::Load(const std::string &_filename) if (attrib.normals.size() > 0) { int nIdx = i.normal_index; - ignition::math::Vector3d normal(attrib.normals[3 * nIdx], + gz::math::Vector3d normal(attrib.normals[3 * nIdx], attrib.normals[3 * nIdx + 1], attrib.normals[3 * nIdx + 2]); normal.Normalize(); @@ -241,7 +241,7 @@ Mesh *OBJLoader::Load(const std::string &_filename) if (attrib.texcoords.size() > 0) { int tIdx = i.texcoord_index; - ignition::math::Vector2d uv(attrib.texcoords[2 * tIdx], + gz::math::Vector2d uv(attrib.texcoords[2 * tIdx], attrib.texcoords[2 * tIdx + 1]); subMesh->AddTexCoord(uv.X(), 1.0-uv.Y()); } diff --git a/graphics/src/OBJLoader_TEST.cc b/graphics/src/OBJLoader_TEST.cc index 509166bb0..89bbd6e36 100644 --- a/graphics/src/OBJLoader_TEST.cc +++ b/graphics/src/OBJLoader_TEST.cc @@ -36,8 +36,8 @@ TEST_F(OBJLoaderTest, LoadObjBox) common::testing::TestFile("data", "box.obj")); EXPECT_STREQ("unknown", mesh->Name().c_str()); - EXPECT_EQ(ignition::math::Vector3d(1, 1, 1), mesh->Max()); - EXPECT_EQ(ignition::math::Vector3d(-1, -1, -1), mesh->Min()); + EXPECT_EQ(gz::math::Vector3d(1, 1, 1), mesh->Max()); + EXPECT_EQ(gz::math::Vector3d(-1, -1, -1), mesh->Min()); // 36 vertices EXPECT_EQ(36u, mesh->VertexCount()); EXPECT_EQ(36u, mesh->NormalCount()); @@ -65,12 +65,12 @@ TEST_F(OBJLoaderTest, LoadObjBox) // This tests opening an OBJ file that has an invalid material reference TEST_F(OBJLoaderTest, InvalidMaterial) { - ignition::common::OBJLoader objLoader; + gz::common::OBJLoader objLoader; std::string meshFilename = common::testing::TestFile("data", "invalid_material.obj"); - ignition::common::Mesh *mesh = objLoader.Load(meshFilename); + gz::common::Mesh *mesh = objLoader.Load(meshFilename); EXPECT_TRUE(mesh != nullptr); } @@ -79,14 +79,14 @@ TEST_F(OBJLoaderTest, InvalidMaterial) // This tests opening an OBJ file that has PBR fields TEST_F(OBJLoaderTest, PBR) { - ignition::common::OBJLoader objLoader; + gz::common::OBJLoader objLoader; // load obj file exported by 3ds max that has pbr extension { std::string meshFilename = common::testing::TestFile("data", "cube_pbr.obj"); - ignition::common::Mesh *mesh = objLoader.Load(meshFilename); + gz::common::Mesh *mesh = objLoader.Load(meshFilename); EXPECT_NE(nullptr, mesh); const common::MaterialPtr mat = mesh->MaterialByIndex(0u); @@ -112,7 +112,7 @@ TEST_F(OBJLoaderTest, PBR) std::string meshFilename = common::testing::TestFile("data", "blender_pbr.obj"); - ignition::common::Mesh *mesh = objLoader.Load(meshFilename); + gz::common::Mesh *mesh = objLoader.Load(meshFilename); EXPECT_NE(nullptr, mesh); const common::MaterialPtr mat = mesh->MaterialByIndex(0u); diff --git a/graphics/src/Pbr.cc b/graphics/src/Pbr.cc index 0da3eea47..7be872c76 100644 --- a/graphics/src/Pbr.cc +++ b/graphics/src/Pbr.cc @@ -21,7 +21,7 @@ #include "ignition/common/Pbr.hh" /// \brief Private data for Pbr class -class ignition::common::Pbr::Implementation +class gz::common::Pbr::Implementation { /// \brief Workflow type public: PbrType type = PbrType::NONE; @@ -78,7 +78,7 @@ using namespace common; ///////////////////////////////////////////////// Pbr::Pbr() - : dataPtr(ignition::utils::MakeImpl()) + : dataPtr(gz::utils::MakeImpl()) { } @@ -100,11 +100,11 @@ bool Pbr::operator==(const Pbr &_pbr) const && (this->dataPtr->emissiveMap == _pbr.dataPtr->emissiveMap) && (this->dataPtr->ambientOcclusionMap == _pbr.dataPtr->ambientOcclusionMap) - && (ignition::math::equal( + && (gz::math::equal( this->dataPtr->metalness, _pbr.dataPtr->metalness)) - && (ignition::math::equal( + && (gz::math::equal( this->dataPtr->roughness, _pbr.dataPtr->roughness)) - && (ignition::math::equal( + && (gz::math::equal( this->dataPtr->glossiness, _pbr.dataPtr->glossiness)); } diff --git a/graphics/src/Pbr_TEST.cc b/graphics/src/Pbr_TEST.cc index de9a923d2..d9814a8d6 100644 --- a/graphics/src/Pbr_TEST.cc +++ b/graphics/src/Pbr_TEST.cc @@ -24,11 +24,11 @@ TEST(Pbr, BasicAPI) { // initial state - ignition::common::Pbr pbr; - EXPECT_EQ(ignition::common::PbrType::NONE, pbr.Type()); + gz::common::Pbr pbr; + EXPECT_EQ(gz::common::PbrType::NONE, pbr.Type()); EXPECT_EQ(std::string(), pbr.AlbedoMap()); EXPECT_EQ(std::string(), pbr.NormalMap()); - EXPECT_EQ(ignition::common::NormalMapSpace::TANGENT, pbr.NormalMapType()); + EXPECT_EQ(gz::common::NormalMapSpace::TANGENT, pbr.NormalMapType()); EXPECT_EQ(std::string(), pbr.RoughnessMap()); EXPECT_EQ(std::string(), pbr.MetalnessMap()); EXPECT_EQ(std::string(), pbr.EmissiveMap()); @@ -43,8 +43,8 @@ TEST(Pbr, BasicAPI) EXPECT_EQ(std::string(), pbr.AmbientOcclusionMap()); // set / get - pbr.SetType(ignition::common::PbrType::METAL); - EXPECT_EQ(ignition::common::PbrType::METAL, pbr.Type()); + pbr.SetType(gz::common::PbrType::METAL); + EXPECT_EQ(gz::common::PbrType::METAL, pbr.Type()); pbr.SetAlbedoMap("metal_albedo_map.png"); EXPECT_EQ("metal_albedo_map.png", pbr.AlbedoMap()); @@ -88,8 +88,8 @@ TEST(Pbr, MoveCopy) { // copy constructor { - ignition::common::Pbr pbr; - pbr.SetType(ignition::common::PbrType::SPECULAR); + gz::common::Pbr pbr; + pbr.SetType(gz::common::PbrType::SPECULAR); pbr.SetAlbedoMap("specular_albedo_map.png"); pbr.SetNormalMap("specular_normal_map.png"); pbr.SetEnvironmentMap("specular_env_map.png"); @@ -100,11 +100,11 @@ TEST(Pbr, MoveCopy) pbr.SetSpecularMap("specular_map.png"); pbr.SetGlossiness(0.1); - ignition::common::Pbr pbr2(pbr); - EXPECT_EQ(ignition::common::PbrType::SPECULAR, pbr2.Type()); + gz::common::Pbr pbr2(pbr); + EXPECT_EQ(gz::common::PbrType::SPECULAR, pbr2.Type()); EXPECT_EQ("specular_albedo_map.png", pbr2.AlbedoMap()); EXPECT_EQ("specular_normal_map.png", pbr2.NormalMap()); - EXPECT_EQ(ignition::common::NormalMapSpace::TANGENT, pbr2.NormalMapType()); + EXPECT_EQ(gz::common::NormalMapSpace::TANGENT, pbr2.NormalMapType()); EXPECT_EQ("specular_env_map.png", pbr2.EnvironmentMap()); EXPECT_EQ("specular_ambient_occlusion_map.png", pbr2.AmbientOcclusionMap()); @@ -123,11 +123,11 @@ TEST(Pbr, MoveCopy) // move { - ignition::common::Pbr pbr; - pbr.SetType(ignition::common::PbrType::METAL); + gz::common::Pbr pbr; + pbr.SetType(gz::common::PbrType::METAL); pbr.SetAlbedoMap("metal_albedo_map.png"); pbr.SetNormalMap("metal_normal_map.png", - ignition::common::NormalMapSpace::TANGENT); + gz::common::NormalMapSpace::TANGENT); pbr.SetEnvironmentMap("metal_env_map.png"); pbr.SetAmbientOcclusionMap("metal_ambient_occlusion_map.png"); pbr.SetEmissiveMap("metal_emissive_map.png"); @@ -137,11 +137,11 @@ TEST(Pbr, MoveCopy) pbr.SetRoughness(0.8); pbr.SetMetalness(0.3); - ignition::common::Pbr pbr2(std::move(pbr)); - EXPECT_EQ(ignition::common::PbrType::METAL, pbr2.Type()); + gz::common::Pbr pbr2(std::move(pbr)); + EXPECT_EQ(gz::common::PbrType::METAL, pbr2.Type()); EXPECT_EQ("metal_albedo_map.png", pbr2.AlbedoMap()); EXPECT_EQ("metal_normal_map.png", pbr2.NormalMap()); - EXPECT_EQ(ignition::common::NormalMapSpace::TANGENT, pbr2.NormalMapType()); + EXPECT_EQ(gz::common::NormalMapSpace::TANGENT, pbr2.NormalMapType()); EXPECT_EQ("metal_env_map.png", pbr2.EnvironmentMap()); EXPECT_EQ("metal_ambient_occlusion_map.png", pbr2.AmbientOcclusionMap()); @@ -160,11 +160,11 @@ TEST(Pbr, MoveCopy) // move assignment { - ignition::common::Pbr pbr; - pbr.SetType(ignition::common::PbrType::METAL); + gz::common::Pbr pbr; + pbr.SetType(gz::common::PbrType::METAL); pbr.SetAlbedoMap("metal_albedo_map.png"); pbr.SetNormalMap("metal_normal_map.png", - ignition::common::NormalMapSpace::TANGENT); + gz::common::NormalMapSpace::TANGENT); pbr.SetEnvironmentMap("metal_env_map.png"); pbr.SetAmbientOcclusionMap("metal_ambient_occlusion_map.png"); pbr.SetEmissiveMap("metal_emissive_map.png"); @@ -174,12 +174,12 @@ TEST(Pbr, MoveCopy) pbr.SetRoughness(0.8); pbr.SetMetalness(0.3); - ignition::common::Pbr pbr2; + gz::common::Pbr pbr2; pbr2 = std::move(pbr); - EXPECT_EQ(ignition::common::PbrType::METAL, pbr2.Type()); + EXPECT_EQ(gz::common::PbrType::METAL, pbr2.Type()); EXPECT_EQ("metal_albedo_map.png", pbr2.AlbedoMap()); EXPECT_EQ("metal_normal_map.png", pbr2.NormalMap()); - EXPECT_EQ(ignition::common::NormalMapSpace::TANGENT, pbr2.NormalMapType()); + EXPECT_EQ(gz::common::NormalMapSpace::TANGENT, pbr2.NormalMapType()); EXPECT_EQ("metal_env_map.png", pbr2.EnvironmentMap()); EXPECT_EQ("metal_ambient_occlusion_map.png", pbr2.AmbientOcclusionMap()); @@ -199,8 +199,8 @@ TEST(Pbr, MoveCopy) // assignment { - ignition::common::Pbr pbr; - pbr.SetType(ignition::common::PbrType::METAL); + gz::common::Pbr pbr; + pbr.SetType(gz::common::PbrType::METAL); pbr.SetAlbedoMap("metal_albedo_map.png"); pbr.SetNormalMap("metal_normal_map.png"); pbr.SetEnvironmentMap("metal_env_map.png"); @@ -212,9 +212,9 @@ TEST(Pbr, MoveCopy) pbr.SetRoughness(0.18); pbr.SetMetalness(0.13); - ignition::common::Pbr pbr2; + gz::common::Pbr pbr2; pbr2 = pbr; - EXPECT_EQ(ignition::common::PbrType::METAL, pbr2.Type()); + EXPECT_EQ(gz::common::PbrType::METAL, pbr2.Type()); EXPECT_EQ("metal_albedo_map.png", pbr2.AlbedoMap()); EXPECT_EQ("metal_normal_map.png", pbr2.NormalMap()); EXPECT_EQ("metal_env_map.png", pbr2.EnvironmentMap()); @@ -235,19 +235,19 @@ TEST(Pbr, MoveCopy) // copy assignment after move { - ignition::common::Pbr pbr1; - pbr1.SetType(ignition::common::PbrType::METAL); + gz::common::Pbr pbr1; + pbr1.SetType(gz::common::PbrType::METAL); - ignition::common::Pbr pbr2; - pbr2.SetType(ignition::common::PbrType::SPECULAR); + gz::common::Pbr pbr2; + pbr2.SetType(gz::common::PbrType::SPECULAR); // This is similar to what std::swap does except it uses std::move for each // assignment - ignition::common::Pbr tmp = std::move(pbr1); + gz::common::Pbr tmp = std::move(pbr1); pbr1 = pbr2; pbr2 = tmp; - EXPECT_EQ(ignition::common::PbrType::SPECULAR, pbr1.Type()); - EXPECT_EQ(ignition::common::PbrType::METAL, pbr2.Type()); + EXPECT_EQ(gz::common::PbrType::SPECULAR, pbr1.Type()); + EXPECT_EQ(gz::common::PbrType::METAL, pbr2.Type()); } } diff --git a/graphics/src/STLLoader.cc b/graphics/src/STLLoader.cc index 6ef96f9bc..b2b418923 100644 --- a/graphics/src/STLLoader.cc +++ b/graphics/src/STLLoader.cc @@ -30,14 +30,14 @@ using namespace common; ////////////////////////////////////////////////// -class ignition::common::STLLoader::Implementation +class gz::common::STLLoader::Implementation { }; ////////////////////////////////////////////////// STLLoader::STLLoader() : MeshLoader(), - dataPtr(ignition::utils::MakeImpl()) + dataPtr(gz::utils::MakeImpl()) { } @@ -110,7 +110,7 @@ bool STLLoader::ReadAscii(FILE *_filein, Mesh *_mesh) // FACET if (this->Leqi(token, const_cast("facet"))) { - ignition::math::Vector3d normal; + gz::math::Vector3d normal; // Get the XYZ coordinates of the normal vector to the face. sscanf(next, "%*s %e %e %e", &r1, &r2, &r3); @@ -127,7 +127,7 @@ bool STLLoader::ReadAscii(FILE *_filein, Mesh *_mesh) for (; result; ) { - ignition::math::Vector3d vertex; + gz::math::Vector3d vertex; if (fgets (input, LINE_MAX_LEN, _filein) == nullptr) { result = false; @@ -203,8 +203,8 @@ bool STLLoader::ReadBinary(FILE *_filein, Mesh *_mesh) // Number of faces. face_num = this->LongIntRead(_filein); - ignition::math::Vector3d normal; - ignition::math::Vector3d vertex; + gz::math::Vector3d normal; + gz::math::Vector3d vertex; // For each (triangular) face, // components of normal vector, @@ -310,7 +310,7 @@ int STLLoader::RcolFind(float _a[][COR3_MAX], int _m, int _n, float _r[]) { for (i = 0; i < _m; ++i) { - if (!ignition::math::equal(_a[i][j], _r[i])) + if (!gz::math::equal(_a[i][j], _r[i])) break; if (i == _m-1) return j; diff --git a/graphics/src/SVGLoader.cc b/graphics/src/SVGLoader.cc index cecf0137e..d3fb368c7 100644 --- a/graphics/src/SVGLoader.cc +++ b/graphics/src/SVGLoader.cc @@ -37,17 +37,17 @@ using namespace gz; using namespace common; -class ignition::common::SVGLoader::Implementation +class gz::common::SVGLoader::Implementation { /// \brief Generates polylines for each SVG subpath /// \param[in] _subpath The subpath commands /// \param[in] _last The previous position (for relative path commands) /// \param[out] _polyline The polyline that receives the data /// \return The last point of the subpath - public: ignition::math::Vector2d SubpathToPolyline( + public: gz::math::Vector2d SubpathToPolyline( const std::vector &_subpath, - ignition::math::Vector2d _last, - std::vector &_polyline); + gz::math::Vector2d _last, + std::vector &_polyline); /// \brief Splits a list of commands into subpaths /// \param[in] _cmds The flat list of commands for all the subpaths. @@ -94,14 +94,14 @@ class ignition::common::SVGLoader::Implementation ///////////////////////////////////////////////// // This local helper function takes in a SVG transformation string // and returns the corresponding transformation matrix -ignition::math::Matrix3d ParseTransformMatrixStr( +gz::math::Matrix3d ParseTransformMatrixStr( const std::string &_transformStr) { // check for transformation if (_transformStr.empty()) { ignerr << "no data for ParseTransformMatrixStr"; - return ignition::math::Matrix3d::Identity; + return gz::math::Matrix3d::Identity; } // _transfromStr should not have a closing paren and look like this @@ -113,7 +113,7 @@ ignition::math::Matrix3d ParseTransformMatrixStr( { ignerr << "Invalid path transform: '" << &_transformStr << "'" << std::endl; - return ignition::math::Matrix3d::Identity; + return gz::math::Matrix3d::Identity; } std::string transform = tx[0]; std::vector numbers = split(tx[1], ","); @@ -127,7 +127,7 @@ ignition::math::Matrix3d ParseTransformMatrixStr( ignerr << "Unsupported matrix transform with " << numbers.size() << " parameters. Should be 6." << std::endl; - return ignition::math::Matrix3d::Identity; + return gz::math::Matrix3d::Identity; } double a = stod(numbers[0]); // 00 double b = stod(numbers[1]); // 10 @@ -135,7 +135,7 @@ ignition::math::Matrix3d ParseTransformMatrixStr( double d = stod(numbers[3]); // 11 double e = stod(numbers[4]); // 02 double f = stod(numbers[5]); // 12 - ignition::math::Matrix3d m(a, c, e, b, d, f, 0, 0, 1); + gz::math::Matrix3d m(a, c, e, b, d, f, 0, 0, 1); return m; } @@ -145,14 +145,14 @@ ignition::math::Matrix3d ParseTransformMatrixStr( { ignerr << "Unsupported skewX transform. Needs 1 parameter only" << std::endl; - return ignition::math::Matrix3d::Identity; + return gz::math::Matrix3d::Identity; } double deg = stod(numbers[0]); - ignition::math::Angle angle; + gz::math::Angle angle; angle.SetDegree(deg); // get the tangent of the angle double t = tan(angle.Radian()); - ignition::math::Matrix3d m(1, t, 0, 0, 1, 0, 0, 0, 1); + gz::math::Matrix3d m(1, t, 0, 0, 1, 0, 0, 0, 1); return m; } @@ -162,14 +162,14 @@ ignition::math::Matrix3d ParseTransformMatrixStr( { ignerr << "Unsupported skewY transform. Needs 1 parameter only" << std::endl; - return ignition::math::Matrix3d::Identity; + return gz::math::Matrix3d::Identity; } double deg = stod(numbers[0]); - ignition::math::Angle angle; + gz::math::Angle angle; angle.SetDegree(deg); // get the tangent of the angle double t = tan(angle.Radian()); - ignition::math::Matrix3d m(1, 0, 0, t, 1, 0, 0, 0, 1); + gz::math::Matrix3d m(1, 0, 0, t, 1, 0, 0, 0, 1); return m; } @@ -181,7 +181,7 @@ ignition::math::Matrix3d ParseTransformMatrixStr( { ignerr << "Unsupported scale transform with more than 2 parameters" << std::endl; - return ignition::math::Matrix3d::Identity; + return gz::math::Matrix3d::Identity; } double x = stod(numbers[0]); double y = x; @@ -189,7 +189,7 @@ ignition::math::Matrix3d ParseTransformMatrixStr( { y = stod(numbers[1]); } - ignition::math::Matrix3d m(x, 0, 0, 0, y, 0, 0, 0, 1); + gz::math::Matrix3d m(x, 0, 0, 0, y, 0, 0, 0, 1); return m; } // translate( []) @@ -200,7 +200,7 @@ ignition::math::Matrix3d ParseTransformMatrixStr( { ignerr << "Unsupported translate transform with more than 2 parameters" << std::endl; - return ignition::math::Matrix3d::Identity; + return gz::math::Matrix3d::Identity; } double x = stod(numbers[0]); double y = 0; @@ -208,7 +208,7 @@ ignition::math::Matrix3d ParseTransformMatrixStr( { y = stod(numbers[1]); } - ignition::math::Matrix3d m(1, 0, x, 0, 1, y, 0, 0, 1); + gz::math::Matrix3d m(1, 0, x, 0, 1, y, 0, 0, 1); return m; } // rotate( [ ]) angle in degrees, center x and y @@ -219,10 +219,10 @@ ignition::math::Matrix3d ParseTransformMatrixStr( { ignerr << "Unsupported rotate transform. Only angle and optional x y" << " are supported" << std::endl; - return ignition::math::Matrix3d::Identity; + return gz::math::Matrix3d::Identity; } double deg = stod(numbers[0]); - ignition::math::Angle angle; + gz::math::Angle angle; angle.SetDegree(deg); double a = angle.Radian(); double sina = sin(a); @@ -235,25 +235,25 @@ ignition::math::Matrix3d ParseTransformMatrixStr( y = stod(numbers[2]); } // we apply a translation to x, y, the rotation and the translation -x,-y - ignition::math::Matrix3d transToXy(1, 0, x, 0, 1, y, 0, 0, 1); - ignition::math::Matrix3d transFromXy(1, 0, -x, 0, 1, -y, 0, 0, 1); - ignition::math::Matrix3d rotate(cosa, -sina, 0, sina, cosa, 0, 0, 0, 1); - ignition::math::Matrix3d m = transToXy * rotate * transFromXy; + gz::math::Matrix3d transToXy(1, 0, x, 0, 1, y, 0, 0, 1); + gz::math::Matrix3d transFromXy(1, 0, -x, 0, 1, -y, 0, 0, 1); + gz::math::Matrix3d rotate(cosa, -sina, 0, sina, cosa, 0, 0, 0, 1); + gz::math::Matrix3d m = transToXy * rotate * transFromXy; return m; } // we have no business being here ignerr << "Unknown transformation: " << transform << std::endl; - ignition::math::Matrix3d m = ignition::math::Matrix3d::Identity; + gz::math::Matrix3d m = gz::math::Matrix3d::Identity; return m; } ///////////////////////////////////////////////// // This local helper function interpolates a bezier curve at t (between 0 and 1) -ignition::math::Vector2d bezierInterpolate(double _t, - const ignition::math::Vector2d &_p0, - const ignition::math::Vector2d &_p1, - const ignition::math::Vector2d &_p2, - const ignition::math::Vector2d &_p3) +gz::math::Vector2d bezierInterpolate(double _t, + const gz::math::Vector2d &_p0, + const gz::math::Vector2d &_p1, + const gz::math::Vector2d &_p2, + const gz::math::Vector2d &_p3) { double t_1 = 1.0 - _t; double t_1_2 = t_1 * t_1; @@ -261,7 +261,7 @@ ignition::math::Vector2d bezierInterpolate(double _t, double t2 = _t * _t; double t3 = t2 * _t; - ignition::math::Vector2d p; + gz::math::Vector2d p; p.X(t_1_3 * _p0.X() + 3 * _t * t_1_2 * _p1.X() + 3 * t2 * t_1 * _p2.X() + t3 * _p3.X()); p.Y(t_1_3 * _p0.Y() + 3 * _t * t_1_2 * _p1.Y() + 3 * t2 * t_1 * _p2.Y() + @@ -271,12 +271,12 @@ ignition::math::Vector2d bezierInterpolate(double _t, ///////////////////////////////////////////////// // This helper function adds bezier interpolations to a list of points -void cubicBezier(const ignition::math::Vector2d &_p0, - const ignition::math::Vector2d &_p1, - const ignition::math::Vector2d &_p2, - const ignition::math::Vector2d &_p3, +void cubicBezier(const gz::math::Vector2d &_p0, + const gz::math::Vector2d &_p1, + const gz::math::Vector2d &_p2, + const gz::math::Vector2d &_p3, double _step, - std::vector &_points) + std::vector &_points) { // we don't start at t = 0, but t = step... // so we assume that the first point is there (from the last move) @@ -334,15 +334,15 @@ static float VecAng(float _ux, float _uy, float _vx, float _vy) ///////////////////////////////////////////////// // This helper function adds arc interpolations to a list of points -void arcPath(const ignition::math::Vector2d &_p0, +void arcPath(const gz::math::Vector2d &_p0, const double _rx, const double _ry, const double _rotxDeg, const size_t _largeArc, const size_t _sweepDirection, - const ignition::math::Vector2d &_pEnd, + const gz::math::Vector2d &_pEnd, const double _step, - std::vector &_points) + std::vector &_points) { // Ported from canvg (https://code.google.com/p/canvg/) double rx = _rx; @@ -471,10 +471,10 @@ void arcPath(const ignition::math::Vector2d &_p0, if (i > 0) { - ignition::math::Vector2d p0(px, py); - ignition::math::Vector2d p1(px + ptanx, py + ptany); - ignition::math::Vector2d p2(x - tanx, y - tany); - ignition::math::Vector2d p3(x, y); + gz::math::Vector2d p0(px, py); + gz::math::Vector2d p1(px + ptanx, py + ptany); + gz::math::Vector2d p2(x - tanx, y - tany); + gz::math::Vector2d p3(x, y); cubicBezier(p0, p1, p2, p3, _step, _points); } px = x; @@ -485,15 +485,15 @@ void arcPath(const ignition::math::Vector2d &_p0, } ///////////////////////////////////////////////// -ignition::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( +gz::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( const std::vector &_subpath, - ignition::math::Vector2d _last, - std::vector &_polyline) + gz::math::Vector2d _last, + std::vector &_polyline) { if (!_polyline.empty()) { ignerr << "polyline not empty"; - return ignition::math::Vector2d::Zero; + return gz::math::Vector2d::Zero; } for (SVGCommand cmd : _subpath) @@ -507,7 +507,7 @@ ignition::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( case 'l': while (i < count) { - ignition::math::Vector2d p; + gz::math::Vector2d p; p.X(cmd.numbers[i+0]); p.Y(cmd.numbers[i+1]); // m and l cmds are relative to the last point @@ -522,7 +522,7 @@ ignition::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( case 'L': while (i < count) { - ignition::math::Vector2d p; + gz::math::Vector2d p; p.X(cmd.numbers[i+0]); p.Y(cmd.numbers[i+1]); _polyline.push_back(p); @@ -533,8 +533,8 @@ ignition::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( case 'C': while (i < count) { - ignition::math::Vector2d p0 = _last; - ignition::math::Vector2d p1, p2, p3; + gz::math::Vector2d p0 = _last; + gz::math::Vector2d p1, p2, p3; p1.X(cmd.numbers[i+0]); p1.Y(cmd.numbers[i+1]); p2.X(cmd.numbers[i+2]); @@ -549,8 +549,8 @@ ignition::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( case 'c': while (i < count) { - ignition::math::Vector2d p0 = _last; - ignition::math::Vector2d p1, p2, p3; + gz::math::Vector2d p0 = _last; + gz::math::Vector2d p1, p2, p3; p1.X(cmd.numbers[i+0] + _last.X()); p1.Y(cmd.numbers[i+1] + _last.Y()); p2.X(cmd.numbers[i+2] + _last.X()); @@ -565,13 +565,13 @@ ignition::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( case 'A': while (i < count) { - ignition::math::Vector2d p0 = _last; + gz::math::Vector2d p0 = _last; double rx = cmd.numbers[i+0]; double ry = cmd.numbers[i+1]; double xRot = cmd.numbers[i+2]; unsigned int arc(static_cast(cmd.numbers[i+3])); unsigned int sweep(static_cast(cmd.numbers[i+4])); - ignition::math::Vector2d pEnd; + gz::math::Vector2d pEnd; pEnd.X(cmd.numbers[i+5]); pEnd.Y(cmd.numbers[i+6]); arcPath(p0, rx, ry, xRot, arc, sweep, pEnd, @@ -583,13 +583,13 @@ ignition::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( case 'a': while (i < count) { - ignition::math::Vector2d p0 = _last; + gz::math::Vector2d p0 = _last; double rx = cmd.numbers[i+0]; double ry = cmd.numbers[i+1]; double xRot = cmd.numbers[i+2]; unsigned int arc(static_cast(cmd.numbers[i+3])); unsigned int sweep(static_cast(cmd.numbers[i+4])); - ignition::math::Vector2d pEnd; + gz::math::Vector2d pEnd; pEnd.X(cmd.numbers[i+5] + _last.X()); pEnd.Y(cmd.numbers[i+6] + _last.Y()); arcPath(p0, rx, ry, xRot, arc, sweep, pEnd, @@ -620,7 +620,7 @@ ignition::math::Vector2d SVGLoader::Implementation::SubpathToPolyline( ///////////////////////////////////////////////// SVGLoader::SVGLoader(const unsigned int _samples) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->resolution = 1.0/std::max(1u, _samples); } @@ -760,17 +760,17 @@ bool SVGLoader::Implementation::PathCommands( // the starting point for the subpath // it is the end point of the previous one - ignition::math::Vector2d p; + gz::math::Vector2d p; for (std::vector subpath : subpaths) { - _path.polylines.push_back(std::vector()); - std::vector &polyline = _path.polylines.back(); + _path.polylines.push_back(std::vector()); + std::vector &polyline = _path.polylines.back(); p = this->SubpathToPolyline(subpath, p, polyline); } // if necessary, apply transform to p and polyline - if (_path.transform != ignition::math::Matrix3d::Identity) + if (_path.transform != gz::math::Matrix3d::Identity) { // we need to transform all the points in the path for (auto &polyline : _path.polylines) @@ -778,7 +778,7 @@ bool SVGLoader::Implementation::PathCommands( for (auto &polyPoint : polyline) { // make a 3d vector form the 2d point - ignition::math::Vector3d point3(polyPoint.X(), polyPoint.Y(), 1); + gz::math::Vector3d point3(polyPoint.X(), polyPoint.Y(), 1); // matrix multiply to get the new point, then save new coords in place auto transformed = _path.transform * point3; polyPoint.X(transformed.X()); @@ -800,7 +800,7 @@ bool SVGLoader::Implementation::PathAttribs(tinyxml2::XMLElement *_pElement, return false; } - _path.transform = ignition::math::Matrix3d::Identity; + _path.transform = gz::math::Matrix3d::Identity; const tinyxml2::XMLAttribute *pAttrib = _pElement->FirstAttribute(); // this attribute contains a list of coordinates @@ -1072,11 +1072,11 @@ function draw(showCtrlPoints) for (unsigned int i = 0; i < path.polylines.size(); ++i) { - std::vector poly = path.polylines[i]; + std::vector poly = path.polylines[i]; _out << psep << "[" << std::endl; psep = ','; char sep = ' '; - for (ignition::math::Vector2d p : poly) + for (gz::math::Vector2d p : poly) { _out << " " << sep << " [" << p.X() << ", " << p.Y() << "]" < &_paths, const double _tol, - std::vector< std::vector > &_closedPolys, - std::vector< std::vector > &_openPolys) + std::vector< std::vector > &_closedPolys, + std::vector< std::vector > &_openPolys) { // first we extract all polyline into a vector of line segments - std::list> segments; + std::list> segments; for (auto const &path : _paths) { for (auto const &poly : path.polylines) { - ignition::math::Vector2d startPoint = poly[0]; + gz::math::Vector2d startPoint = poly[0]; for (unsigned int i =1; i < poly.size(); ++i) { - const ignition::math::Vector2d &endPoint = poly[i]; + const gz::math::Vector2d &endPoint = poly[i]; double length = endPoint.Distance(startPoint); if (length < _tol) { @@ -1140,7 +1140,7 @@ void SVGLoader::PathsToClosedPolylines( { // start a new polyline, made from the 2 points of // the next available segment. - std::vector polyline; + std::vector polyline; auto &s = segments.front(); polyline.push_back(s.first); polyline.push_back(s.second); @@ -1158,7 +1158,7 @@ void SVGLoader::PathsToClosedPolylines( for (auto it = segments.begin(); it != segments.end(); ++it) { auto seg = *it; - ignition::math::Vector2d nextPoint; + gz::math::Vector2d nextPoint; if (Vector2dCompare(polyline.back(), seg.first, _tol)) { nextPoint = seg.second; diff --git a/graphics/src/SVGLoader_TEST.cc b/graphics/src/SVGLoader_TEST.cc index 89b8232ca..5dbf7eebe 100644 --- a/graphics/src/SVGLoader_TEST.cc +++ b/graphics/src/SVGLoader_TEST.cc @@ -207,8 +207,8 @@ TEST_F(SVGLoaderTest, ClosedLoops) out.close(); - std::vector< std::vector > closedPolys; - std::vector< std::vector > openPolys; + std::vector< std::vector > closedPolys; + std::vector< std::vector > openPolys; loader.PathsToClosedPolylines(paths, tol, closedPolys, openPolys); EXPECT_EQ(0u, openPolys.size()); @@ -231,8 +231,8 @@ TEST_F(SVGLoaderTest, Transforms) out.close(); - std::vector< std::vector > closedPolys; - std::vector< std::vector > openPolys; + std::vector< std::vector > closedPolys; + std::vector< std::vector > openPolys; loader.PathsToClosedPolylines(paths, tol, closedPolys, openPolys); @@ -267,8 +267,8 @@ TEST_F(SVGLoaderTest, Transforms2) out.close(); - std::vector< std::vector > closedPolys; - std::vector< std::vector > openPolys; + std::vector< std::vector > closedPolys; + std::vector< std::vector > openPolys; loader.PathsToClosedPolylines(paths, tol, closedPolys, openPolys); @@ -332,8 +332,8 @@ TEST_F(SVGLoaderTest, Transforms3) loader.DumpPaths(paths, out); out.close(); - std::vector< std::vector > closedPolys; - std::vector< std::vector > openPolys; + std::vector< std::vector > closedPolys; + std::vector< std::vector > openPolys; loader.PathsToClosedPolylines(paths, tol, closedPolys, openPolys); EXPECT_EQ(0u, openPolys.size()); diff --git a/graphics/src/Skeleton.cc b/graphics/src/Skeleton.cc index da1bd1fe7..ef4678f06 100644 --- a/graphics/src/Skeleton.cc +++ b/graphics/src/Skeleton.cc @@ -24,7 +24,7 @@ using namespace gz; using namespace common; /// Private data class -class ignition::common::Skeleton::Implementation +class gz::common::Skeleton::Implementation { typedef std::vector > > RawNodeWeights; @@ -66,13 +66,13 @@ class ignition::common::Skeleton::Implementation ////////////////////////////////////////////////// Skeleton::Skeleton() -: dataPtr(ignition::utils::MakeUniqueImpl()) +: dataPtr(gz::utils::MakeUniqueImpl()) { } ////////////////////////////////////////////////// Skeleton::Skeleton(SkeletonNode *_root) -: dataPtr(ignition::utils::MakeUniqueImpl()) +: dataPtr(gz::utils::MakeUniqueImpl()) { this->dataPtr->root = _root; this->BuildNodeMap(); diff --git a/graphics/src/SkeletonAnimation.cc b/graphics/src/SkeletonAnimation.cc index 9b4d252a9..a675bf414 100644 --- a/graphics/src/SkeletonAnimation.cc +++ b/graphics/src/SkeletonAnimation.cc @@ -23,7 +23,7 @@ using namespace gz; using namespace common; /// Prvate data class -class ignition::common::SkeletonAnimation::Implementation +class gz::common::SkeletonAnimation::Implementation { /// \brief the node name public: std::string name; @@ -37,7 +37,7 @@ class ignition::common::SkeletonAnimation::Implementation ////////////////////////////////////////////////// SkeletonAnimation::SkeletonAnimation(const std::string &_name) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->name = _name; } diff --git a/graphics/src/SkeletonNode.cc b/graphics/src/SkeletonNode.cc index 4b35c13e4..19bee0b52 100644 --- a/graphics/src/SkeletonNode.cc +++ b/graphics/src/SkeletonNode.cc @@ -24,7 +24,7 @@ using namespace gz; using namespace common; /// \brief SkeletonNode private data -class ignition::common::SkeletonNode::Implementation +class gz::common::SkeletonNode::Implementation { /// \brief the name of the skeletal node public: std::string name; @@ -62,7 +62,7 @@ class ignition::common::SkeletonNode::Implementation ////////////////////////////////////////////////// SkeletonNode::SkeletonNode(SkeletonNode *_parent) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->parent = _parent; @@ -74,7 +74,7 @@ SkeletonNode::SkeletonNode(SkeletonNode *_parent) SkeletonNode::SkeletonNode(SkeletonNode *_parent, const std::string &_name, const std::string &_id, const SkeletonNodeType _type) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->parent = _parent; diff --git a/graphics/src/SubMesh.cc b/graphics/src/SubMesh.cc index 597d18713..616b55171 100644 --- a/graphics/src/SubMesh.cc +++ b/graphics/src/SubMesh.cc @@ -31,16 +31,16 @@ using namespace gz; using namespace common; /// \brief Private data for SubMesh -class ignition::common::SubMesh::Implementation +class gz::common::SubMesh::Implementation { /// \brief the vertex array - public: std::vector vertices; + public: std::vector vertices; /// \brief the normal array - public: std::vector normals; + public: std::vector normals; /// \brief A map of texcoord set index to texture coordinate array - public: std::map> + public: std::map> texCoords; /// \brief the vertex index array @@ -62,13 +62,13 @@ class ignition::common::SubMesh::Implementation ////////////////////////////////////////////////// SubMesh::SubMesh() -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { } ////////////////////////////////////////////////// SubMesh::SubMesh(const std::string &_name) -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { this->dataPtr->name = _name; } @@ -97,7 +97,7 @@ void SubMesh::AddIndex(const unsigned int _index) } ////////////////////////////////////////////////// -void SubMesh::AddVertex(const ignition::math::Vector3d &_v) +void SubMesh::AddVertex(const gz::math::Vector3d &_v) { this->dataPtr->vertices.push_back(_v); } @@ -105,11 +105,11 @@ void SubMesh::AddVertex(const ignition::math::Vector3d &_v) ////////////////////////////////////////////////// void SubMesh::AddVertex(const double _x, const double _y, const double _z) { - this->AddVertex(ignition::math::Vector3d(_x, _y, _z)); + this->AddVertex(gz::math::Vector3d(_x, _y, _z)); } ////////////////////////////////////////////////// -void SubMesh::AddNormal(const ignition::math::Vector3d &_n) +void SubMesh::AddNormal(const gz::math::Vector3d &_n) { this->dataPtr->normals.push_back(_n); } @@ -117,7 +117,7 @@ void SubMesh::AddNormal(const ignition::math::Vector3d &_n) ////////////////////////////////////////////////// void SubMesh::AddNormal(const double _x, const double _y, const double _z) { - this->AddNormal(ignition::math::Vector3d(_x, _y, _z)); + this->AddNormal(gz::math::Vector3d(_x, _y, _z)); } ////////////////////////////////////////////////// @@ -130,7 +130,7 @@ void SubMesh::AddTexCoord(const double _u, const double _v) } ////////////////////////////////////////////////// -void SubMesh::AddTexCoord(const ignition::math::Vector2d &_uv) +void SubMesh::AddTexCoord(const gz::math::Vector2d &_uv) { this->AddTexCoord(_uv.X(), _uv.Y()); } @@ -139,11 +139,11 @@ void SubMesh::AddTexCoord(const ignition::math::Vector2d &_uv) void SubMesh::AddTexCoordBySet(double _u, double _v, unsigned int _setIndex) { this->dataPtr->texCoords[_setIndex].push_back( - ignition::math::Vector2d(_u, _v)); + gz::math::Vector2d(_u, _v)); } ////////////////////////////////////////////////// -void SubMesh::AddTexCoordBySet(const ignition::math::Vector2d &_uv, +void SubMesh::AddTexCoordBySet(const gz::math::Vector2d &_uv, unsigned int _setIndex) { this->AddTexCoordBySet(_uv.X(), _uv.Y(), _setIndex); @@ -162,7 +162,7 @@ void SubMesh::AddNodeAssignment(const unsigned int _vertex, } ////////////////////////////////////////////////// -ignition::math::Vector3d SubMesh::Vertex(const unsigned int _index) const +gz::math::Vector3d SubMesh::Vertex(const unsigned int _index) const { if (_index >= this->dataPtr->vertices.size()) { @@ -181,7 +181,7 @@ bool SubMesh::HasVertex(const unsigned int _index) const ////////////////////////////////////////////////// void SubMesh::SetVertex(const unsigned int _index, - const ignition::math::Vector3d &_v) + const gz::math::Vector3d &_v) { if (_index >= this->dataPtr->vertices.size()) { @@ -193,7 +193,7 @@ void SubMesh::SetVertex(const unsigned int _index, } ////////////////////////////////////////////////// -ignition::math::Vector3d SubMesh::Normal(const unsigned int _index) const +gz::math::Vector3d SubMesh::Normal(const unsigned int _index) const { if (_index >= this->dataPtr->normals.size()) { @@ -246,7 +246,7 @@ bool SubMesh::HasNodeAssignment(const unsigned int _index) const ////////////////////////////////////////////////// void SubMesh::SetNormal(const unsigned int _index, - const ignition::math::Vector3d &_n) + const gz::math::Vector3d &_n) { if (_index >= this->dataPtr->normals.size()) { @@ -258,7 +258,7 @@ void SubMesh::SetNormal(const unsigned int _index, } ////////////////////////////////////////////////// -ignition::math::Vector2d SubMesh::TexCoord(const unsigned int _index) const +gz::math::Vector2d SubMesh::TexCoord(const unsigned int _index) const { if (this->dataPtr->texCoords.empty()) { @@ -278,7 +278,7 @@ ignition::math::Vector2d SubMesh::TexCoord(const unsigned int _index) const } ////////////////////////////////////////////////// -ignition::math::Vector2d SubMesh::TexCoordBySet(unsigned int _index, +gz::math::Vector2d SubMesh::TexCoordBySet(unsigned int _index, unsigned int _setIndex) const { auto it = this->dataPtr->texCoords.find(_setIndex); @@ -300,7 +300,7 @@ ignition::math::Vector2d SubMesh::TexCoordBySet(unsigned int _index, ////////////////////////////////////////////////// void SubMesh::SetTexCoord(const unsigned int _index, - const ignition::math::Vector2d &_t) + const gz::math::Vector2d &_t) { unsigned firstSetIndex = 0u; if (!this->dataPtr->texCoords.empty()) @@ -318,7 +318,7 @@ void SubMesh::SetTexCoord(const unsigned int _index, ////////////////////////////////////////////////// void SubMesh::SetTexCoordBySet(unsigned int _index, - const ignition::math::Vector2d &_t, unsigned int _setIndex) + const gz::math::Vector2d &_t, unsigned int _setIndex) { auto it = this->dataPtr->texCoords.find(_setIndex); if (it == this->dataPtr->texCoords.end()) @@ -375,16 +375,16 @@ NodeAssignment SubMesh::NodeAssignmentByIndex( } ////////////////////////////////////////////////// -ignition::math::Vector3d SubMesh::Max() const +gz::math::Vector3d SubMesh::Max() const { if (this->dataPtr->vertices.empty()) - return ignition::math::Vector3d::Zero; + return gz::math::Vector3d::Zero; - ignition::math::Vector3d max; + gz::math::Vector3d max; - max.X(-ignition::math::MAX_F); - max.Y(-ignition::math::MAX_F); - max.Z(-ignition::math::MAX_F); + max.X(-gz::math::MAX_F); + max.Y(-gz::math::MAX_F); + max.Z(-gz::math::MAX_F); for (const auto &v : this->dataPtr->vertices) { @@ -397,16 +397,16 @@ ignition::math::Vector3d SubMesh::Max() const } ////////////////////////////////////////////////// -ignition::math::Vector3d SubMesh::Min() const +gz::math::Vector3d SubMesh::Min() const { if (this->dataPtr->vertices.empty()) - return ignition::math::Vector3d::Zero; + return gz::math::Vector3d::Zero; - ignition::math::Vector3d min; + gz::math::Vector3d min; - min.X(ignition::math::MAX_F); - min.Y(ignition::math::MAX_F); - min.Z(ignition::math::MAX_F); + min.X(gz::math::MAX_F); + min.Y(gz::math::MAX_F); + min.Z(gz::math::MAX_F); for (const auto &v : this->dataPtr->vertices) { @@ -507,7 +507,7 @@ std::optional SubMesh::GetMaterialIndex() const } ////////////////////////////////////////////////// -bool SubMesh::HasVertex(const ignition::math::Vector3d &_v) const +bool SubMesh::HasVertex(const gz::math::Vector3d &_v) const { for (const auto &v : this->dataPtr->vertices) if (_v.Equal(v)) @@ -517,7 +517,7 @@ bool SubMesh::HasVertex(const ignition::math::Vector3d &_v) const } ////////////////////////////////////////////////// -int SubMesh::IndexOfVertex(const ignition::math::Vector3d &_v) const +int SubMesh::IndexOfVertex(const gz::math::Vector3d &_v) const { for (auto iter = this->dataPtr->vertices.begin(); iter != this->dataPtr->vertices.end(); ++iter) @@ -577,17 +577,17 @@ void SubMesh::RecalculateNormals() // For each face, which is defined by three indices, calculate the normals for (unsigned int i = 0; i < this->dataPtr->indices.size(); i+= 3) { - ignition::math::Vector3d v1 = + gz::math::Vector3d v1 = this->dataPtr->vertices[this->dataPtr->indices[i]]; - ignition::math::Vector3d v2 = + gz::math::Vector3d v2 = this->dataPtr->vertices[this->dataPtr->indices[i+1]]; - ignition::math::Vector3d v3 = + gz::math::Vector3d v3 = this->dataPtr->vertices[this->dataPtr->indices[i+2]]; - ignition::math::Vector3d n = ignition::math::Vector3d::Normal(v1, v2, v3); + gz::math::Vector3d n = gz::math::Vector3d::Normal(v1, v2, v3); for (unsigned int j = 0; j < this->dataPtr->vertices.size(); ++j) { - ignition::math::Vector3d v = this->dataPtr->vertices[j]; + gz::math::Vector3d v = this->dataPtr->vertices[j]; if (v == v1 || v == v2 || v == v3) { this->dataPtr->normals[j] += n; @@ -603,7 +603,7 @@ void SubMesh::RecalculateNormals() } ////////////////////////////////////////////////// -void SubMesh::GenSphericalTexCoord(const ignition::math::Vector3d &_center) +void SubMesh::GenSphericalTexCoord(const gz::math::Vector3d &_center) { if (this->dataPtr->texCoords.empty()) return; @@ -613,7 +613,7 @@ void SubMesh::GenSphericalTexCoord(const ignition::math::Vector3d &_center) } ////////////////////////////////////////////////// -void SubMesh::GenSphericalTexCoordBySet(const ignition::math::Vector3d &_center, +void SubMesh::GenSphericalTexCoordBySet(const gz::math::Vector3d &_center, unsigned int _setIndex) { this->dataPtr->texCoords[_setIndex].clear(); @@ -636,7 +636,7 @@ void SubMesh::GenSphericalTexCoordBySet(const ignition::math::Vector3d &_center, } ////////////////////////////////////////////////// -void SubMesh::Scale(const ignition::math::Vector3d &_factor) +void SubMesh::Scale(const gz::math::Vector3d &_factor) { for (auto &v : this->dataPtr->vertices) v *= _factor; @@ -650,9 +650,9 @@ void SubMesh::Scale(const double &_factor) } ////////////////////////////////////////////////// -void SubMesh::Center(const ignition::math::Vector3d &_center) +void SubMesh::Center(const gz::math::Vector3d &_center) { - ignition::math::Vector3d min, max, half; + gz::math::Vector3d min, max, half; min = this->Min(); max = this->Max(); half = (max - min) * 0.5; @@ -661,7 +661,7 @@ void SubMesh::Center(const ignition::math::Vector3d &_center) } ////////////////////////////////////////////////// -void SubMesh::Translate(const ignition::math::Vector3d &_vec) +void SubMesh::Translate(const gz::math::Vector3d &_vec) { for (auto &v : this->dataPtr->vertices) v += _vec; @@ -689,11 +689,11 @@ double SubMesh::Volume() const { for (unsigned int idx = 0; idx < this->dataPtr->indices.size(); idx += 3) { - ignition::math::Vector3d v1 = + gz::math::Vector3d v1 = this->dataPtr->vertices[this->dataPtr->indices[idx]]; - ignition::math::Vector3d v2 = + gz::math::Vector3d v2 = this->dataPtr->vertices[this->dataPtr->indices[idx+1]]; - ignition::math::Vector3d v3 = + gz::math::Vector3d v3 = this->dataPtr->vertices[this->dataPtr->indices[idx+2]]; volume += std::abs(v1.Cross(v2).Dot(v3) / 6.0); diff --git a/graphics/src/SubMesh_TEST.cc b/graphics/src/SubMesh_TEST.cc index 578395e3b..2729e052d 100644 --- a/graphics/src/SubMesh_TEST.cc +++ b/graphics/src/SubMesh_TEST.cc @@ -383,7 +383,7 @@ TEST_F(SubMeshTest, Volume) // Box mesh tests { common::MeshManager::Instance()->CreateBox("unit_box", - ignition::math::Vector3d::One, ignition::math::Vector2d::One); + gz::math::Vector3d::One, gz::math::Vector2d::One); const common::Mesh *unitBox = common::MeshManager::Instance()->MeshByName("unit_box"); @@ -391,7 +391,7 @@ TEST_F(SubMeshTest, Volume) EXPECT_DOUBLE_EQ(1.0, unitBox->Volume()); common::MeshManager::Instance()->CreateBox("other_box", - ignition::math::Vector3d(2, 3, 4), ignition::math::Vector2d::One); + gz::math::Vector3d(2, 3, 4), gz::math::Vector2d::One); const common::Mesh *otherBox = common::MeshManager::Instance()->MeshByName("other_box"); ASSERT_TRUE(otherBox != nullptr); @@ -423,7 +423,7 @@ TEST_F(SubMeshTest, Volume) // Ellipsoid mesh tests { common::MeshManager::Instance()->CreateEllipsoid("ellipsoid", - ignition::math::Vector3d(2, 1.4, 7), 10, 10); + gz::math::Vector3d(2, 1.4, 7), 10, 10); const common::Mesh *unitEllipsoid = common::MeshManager::Instance()->MeshByName("ellipsoid"); @@ -433,7 +433,7 @@ TEST_F(SubMeshTest, Volume) // Checking that we can not add or modify a new mesh with the name common::MeshManager::Instance()->CreateEllipsoid("ellipsoid", - ignition::math::Vector3d(2, 1.4, 7), 100, 100); + gz::math::Vector3d(2, 1.4, 7), 100, 100); const common::Mesh *unitEllipsoid2 = common::MeshManager::Instance()->MeshByName("ellipsoid"); @@ -446,7 +446,7 @@ TEST_F(SubMeshTest, Volume) // A larger cylinder needs to have higher resolution in order to get the // volume close to Pi * r^2 * h. common::MeshManager::Instance()->CreateEllipsoid("other_ellipsoid", - ignition::math::Vector3d(0.8, 2.4, 7.5), 10, 10); + gz::math::Vector3d(0.8, 2.4, 7.5), 10, 10); const common::Mesh *otherEllipsoid = common::MeshManager::Instance()->MeshByName("other_ellipsoid"); diff --git a/include/gz/common/Console.hh b/include/gz/common/Console.hh index cfbecd7bb..68efb2dbf 100644 --- a/include/gz/common/Console.hh +++ b/include/gz/common/Console.hh @@ -32,19 +32,19 @@ namespace gz namespace common { /// \brief Output an error message, if the verbose level is >= 1 - #define ignerr (ignition::common::Console::err(__FILE__, __LINE__)) + #define ignerr (gz::common::Console::err(__FILE__, __LINE__)) /// \brief Output a warning message, if the verbose level is >= 2 - #define ignwarn (ignition::common::Console::warn(__FILE__, __LINE__)) + #define ignwarn (gz::common::Console::warn(__FILE__, __LINE__)) /// \brief Output a message, if the verbose level is >= 3 - #define ignmsg (ignition::common::Console::msg()) + #define ignmsg (gz::common::Console::msg()) /// \brief Output a debug message, if the verbose level is >= 4 - #define igndbg (ignition::common::Console::dbg(__FILE__, __LINE__)) + #define igndbg (gz::common::Console::dbg(__FILE__, __LINE__)) /// \brief Output a message to a log file, regardless of verbosity level - #define ignlog (ignition::common::Console::log()) + #define ignlog (gz::common::Console::log()) /// \brief Initialize log file with filename given by _dir/_file. /// If called twice, it will close the file currently in use and open a new @@ -54,16 +54,16 @@ namespace gz /// be relative to your home directory. /// \param[in] _file Name of log file for ignlog messages. #define ignLogInit(_dir, _file)\ - ignition::common::Console::log.Init(_dir, _file) + gz::common::Console::log.Init(_dir, _file) /// \brief Close the file used for logging. #define ignLogClose()\ - ignition::common::Console::log.Close() + gz::common::Console::log.Close() /// \brief Get the full path of the directory where the log files are stored /// \return Full path of the directory #define ignLogDirectory()\ - (ignition::common::Console::log.LogDirectory()) + (gz::common::Console::log.LogDirectory()) /// \class FileLogger FileLogger.hh common/common.hh /// \brief A logger that outputs messages to a file. diff --git a/include/gz/common/EnumIface.hh b/include/gz/common/EnumIface.hh index 7069658eb..24d0fae00 100644 --- a/include/gz/common/EnumIface.hh +++ b/include/gz/common/EnumIface.hh @@ -38,7 +38,7 @@ namespace gz /// \sa EnumIface /// \sa EnumIterator #define IGN_ENUM(name, enumType, begin, end, ...) \ - static ignition::common::EnumIface name( \ + static gz::common::EnumIface name( \ begin, end, {__VA_ARGS__}); /// \brief Enum interface. Use this interface to convert an enum to diff --git a/include/gz/common/FlagSet.hh b/include/gz/common/FlagSet.hh index fd336890c..deed48890 100644 --- a/include/gz/common/FlagSet.hh +++ b/include/gz/common/FlagSet.hh @@ -371,12 +371,12 @@ struct IsEnumThatContainsSentinel(T::_))> // enumeration contains the sentinel `_`. template std::enable_if_t< - ignition::common::IsEnumThatContainsSentinel::value, - ignition::common::FlagSet + gz::common::IsEnumThatContainsSentinel::value, + gz::common::FlagSet > operator|(const T& _lhs, const T& _rhs) { - ignition::common::FlagSet fs; + gz::common::FlagSet fs; fs |= _lhs; fs |= _rhs; @@ -386,10 +386,10 @@ operator|(const T& _lhs, const T& _rhs) namespace std { template -struct hash> +struct hash> { std::size_t operator()( - const ignition::common::FlagSet& _s) + const gz::common::FlagSet& _s) const noexcept { return _s.Hash(); diff --git a/include/gz/common/PluginPtr.hh b/include/gz/common/PluginPtr.hh index b42c0ec70..db4820760 100644 --- a/include/gz/common/PluginPtr.hh +++ b/include/gz/common/PluginPtr.hh @@ -34,7 +34,7 @@ namespace gz namespace detail { template class ComposePlugin; } /// \brief This class manages the lifecycle of a plugin instance. It can - /// receive a plugin instance from the ignition::common::PluginLoader class + /// receive a plugin instance from the gz::common::PluginLoader class /// or by copy-construction or assignment from another PluginPtr instance. /// /// This class behaves similarly to a std::shared_ptr where multiple diff --git a/include/gz/common/SignalHandler.hh b/include/gz/common/SignalHandler.hh index 059b90756..eb09993c9 100644 --- a/include/gz/common/SignalHandler.hh +++ b/include/gz/common/SignalHandler.hh @@ -38,7 +38,7 @@ namespace gz /// Example using a lambda callback: /// /// ~~~ - /// ignition::common::SignalHandler handler; + /// gz::common::SignalHandler handler; /// handler.AddCallback([] (int _sig) /// { /// printf("Signal[%d] received\n", _sig); diff --git a/include/gz/common/SystemPaths.hh b/include/gz/common/SystemPaths.hh index 2ee9e25fb..e53c5879b 100644 --- a/include/gz/common/SystemPaths.hh +++ b/include/gz/common/SystemPaths.hh @@ -55,7 +55,7 @@ namespace gz /// \param[in] _uri the uniform resource identifier /// \return Returns full path name to file with platform-specific /// directory separators, or an empty string if URI couldn't be found. - /// \sa FindFileURI(const ignition::common::URI &_uri) + /// \sa FindFileURI(const gz::common::URI &_uri) public: std::string FindFileURI(const std::string &_uri) const; /// \brief Find a file or path using a URI. @@ -65,7 +65,7 @@ namespace gz /// \param[in] _uri the uniform resource identifier /// \return Returns full path name to file with platform-specific /// directory separators, or an empty string if URI couldn't be found. - public: std::string FindFileURI(const ignition::common::URI &_uri) const; + public: std::string FindFileURI(const gz::common::URI &_uri) const; /// \brief Set the plugin path environment variable to use /// \param [in] _env name of the environment variable @@ -156,7 +156,7 @@ namespace gz /// \param[in] _cb The callback function, which takes a file path or URI /// and returns the full local path. public: void AddFindFileURICallback( - std::function _cb); + std::function _cb); /// \brief look for a file in a set of search paths (not recursive) /// \description This method checks if a file exists in given directories. diff --git a/include/gz/common/Timer.hh b/include/gz/common/Timer.hh index 74b0e8bb4..0bff59626 100644 --- a/include/gz/common/Timer.hh +++ b/include/gz/common/Timer.hh @@ -50,7 +50,7 @@ namespace gz /// \brief Stream operator friendly public: friend std::ostream &operator<<(std::ostream &out, - const ignition::common::Timer &t) + const gz::common::Timer &t) { out << t.ElapsedTime().count(); return out; diff --git a/include/gz/common/Util.hh b/include/gz/common/Util.hh index b8d5d7743..4f1498cfd 100644 --- a/include/gz/common/Util.hh +++ b/include/gz/common/Util.hh @@ -322,13 +322,13 @@ namespace gz /////////////////////////////////////////////// // Implementation of get_sha1 template -std::string ignition::common::sha1(const T &_buffer) +std::string gz::common::sha1(const T &_buffer) { if (_buffer.size() == 0) - return ignition::common::sha1(NULL, 0); + return gz::common::sha1(NULL, 0); else { - return ignition::common::sha1( + return gz::common::sha1( &(_buffer[0]), _buffer.size() * sizeof(_buffer[0])); } } diff --git a/include/gz/common/Uuid.hh b/include/gz/common/Uuid.hh index 7da4522f8..539ade220 100644 --- a/include/gz/common/Uuid.hh +++ b/include/gz/common/Uuid.hh @@ -53,7 +53,7 @@ namespace gz /// \param[out] _out The output stream. /// \param[in] _msg AdvMsg to write to the stream. public: friend std::ostream &operator<<(std::ostream &_out, - const ignition::common::Uuid &_uuid) + const gz::common::Uuid &_uuid) { _out << _uuid.String(); return _out; diff --git a/include/gz/common/detail/PluginMacros.hh b/include/gz/common/detail/PluginMacros.hh index 4e93ae447..89a4c6a04 100644 --- a/include/gz/common/detail/PluginMacros.hh +++ b/include/gz/common/detail/PluginMacros.hh @@ -51,13 +51,13 @@ #define DETAIL_IGN_COMMON_REGISTER_PLUGININFO_META_DATA \ extern "C" { \ std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = \ - sizeof(ignition::common::PluginInfo); \ + sizeof(gz::common::PluginInfo); \ \ std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoAlignment = \ - alignof(ignition::common::PluginInfo); \ + alignof(gz::common::PluginInfo); \ \ int DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginAPIVersion = \ - ignition::common::PLUGIN_API_VERSION; \ + gz::common::PLUGIN_API_VERSION; \ } @@ -92,18 +92,18 @@ IGN_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR \ const std::size_t _pluginId, \ const std::size_t _size) \ { \ - if (_size != sizeof(ignition::common::PluginInfo)) \ + if (_size != sizeof(gz::common::PluginInfo)) \ { \ return 0u; \ } \ std::unordered_set visitedPlugins; \ - ignition::common::PluginInfo * * const ptrToPlugin = \ - reinterpret_cast(_outputInfo); \ + gz::common::PluginInfo * * const ptrToPlugin = \ + reinterpret_cast(_outputInfo); \ if ( !(*ptrToPlugin) ) \ { \ - *ptrToPlugin = new ignition::common::PluginInfo; \ + *ptrToPlugin = new gz::common::PluginInfo; \ } \ - ignition::common::PluginInfo *plugin = *ptrToPlugin; \ + gz::common::PluginInfo *plugin = *ptrToPlugin; \ plugin->name.clear(); \ plugin->interfaces.clear(); \ plugin->factory = nullptr; \ diff --git a/include/gz/common/detail/PluginPtr.hh b/include/gz/common/detail/PluginPtr.hh index 603de3b1b..191bb6f84 100644 --- a/include/gz/common/detail/PluginPtr.hh +++ b/include/gz/common/detail/PluginPtr.hh @@ -185,10 +185,10 @@ namespace std /// so that it can easily be used in STL objects like std::unordered_set and /// std::unordered_map template - struct hash> + struct hash> { size_t operator()( - const ignition::common::TemplatePluginPtr &ptr) const + const gz::common::TemplatePluginPtr &ptr) const { return ptr.Hash(); } diff --git a/include/gz/common/detail/SpecializedPlugin.hh b/include/gz/common/detail/SpecializedPlugin.hh index 0da18f4d4..b613ab2f2 100644 --- a/include/gz/common/detail/SpecializedPlugin.hh +++ b/include/gz/common/detail/SpecializedPlugin.hh @@ -253,7 +253,7 @@ namespace gz // Declare friendship - template friend class ignition::common::SpecializedPlugin; + template friend class gz::common::SpecializedPlugin; template friend class ComposePlugin; private: ComposePlugin() = default; diff --git a/profiler/include/gz/common/Profiler.hh b/profiler/include/gz/common/Profiler.hh index ef48a9f2a..a765e1af7 100644 --- a/profiler/include/gz/common/Profiler.hh +++ b/profiler/include/gz/common/Profiler.hh @@ -130,21 +130,21 @@ namespace gz #if IGN_PROFILER_ENABLE /// \brief Set name of profiled thread #define IGN_PROFILE_THREAD_NAME(name) \ - ignition::common::Profiler::Instance()->SetThreadName(name); + gz::common::Profiler::Instance()->SetThreadName(name); /// \brief Log profiling text, if supported by implementation #define IGN_PROFILE_LOG_TEXT(name) \ - ignition::common::Profiler::Instance()->LogText(name); + gz::common::Profiler::Instance()->LogText(name); /// \brief Being profiling sample #define IGN_PROFILE_BEGIN(name) \ - ignition::common::Profiler::Instance()->BeginSample(name) + gz::common::Profiler::Instance()->BeginSample(name) /// \brief End profiling sample #define IGN_PROFILE_END() \ - ignition::common::Profiler::Instance()->EndSample() + gz::common::Profiler::Instance()->EndSample() /// \brief Convenience wrapper for scoped profiling sample. Use IGN_PROFILE #define IGN_PROFILE_L(name, line) \ static uint32_t __hash##line = 0; \ -ignition::common::ScopedProfile __profile##line(name, &__hash##line); +gz::common::ScopedProfile __profile##line(name, &__hash##line); /// \brief Scoped profiling sample. Sample will stop at end of scope. #define IGN_PROFILE(name) IGN_PROFILE_L(name, __LINE__); @@ -160,6 +160,6 @@ ignition::common::ScopedProfile __profile##line(name, &__hash##line); /// \brief Macro to determine if profiler is enabled and has an implementation. #define IGN_PROFILER_VALID \ - IGN_PROFILER_ENABLE && ignition::common::Profiler::Instance()->Valid() + IGN_PROFILER_ENABLE && gz::common::Profiler::Instance()->Valid() #endif // GZ_COMMON_PROFILER_HH_ diff --git a/src/Battery.cc b/src/Battery.cc index a79e286cf..de06452b8 100644 --- a/src/Battery.cc +++ b/src/Battery.cc @@ -24,7 +24,7 @@ using namespace gz; using namespace common; /// \brief Private data for the Battery class -class ignition::common::Battery::Implementation +class gz::common::Battery::Implementation { /// \brief Initial voltage in volts. public: double initVoltage = 0.0; @@ -51,7 +51,7 @@ class ignition::common::Battery::Implementation ///////////////////////////////////////////////// Battery::Battery() - : dataPtr(ignition::utils::MakeUniqueImpl()) + : dataPtr(gz::utils::MakeUniqueImpl()) { this->SetUpdateFunc(std::bind(&Battery::UpdateDefault, this, std::placeholders::_1)); diff --git a/src/Console.cc b/src/Console.cc index 62bf99771..2efb5c689 100644 --- a/src/Console.cc +++ b/src/Console.cc @@ -28,7 +28,7 @@ using namespace gz; using namespace common; -FileLogger ignition::common::Console::log(""); +FileLogger gz::common::Console::log(""); // On UNIX, these are ANSI-based color codes. On Windows, these are colors from // docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences . @@ -87,7 +87,7 @@ Logger::~Logger() ///////////////////////////////////////////////// Logger &Logger::operator()() { - Console::log() << "(" << ignition::common::systemTimeIso() << ") "; + Console::log() << "(" << gz::common::systemTimeIso() << ") "; (*this) << Console::Prefix() << this->prefix; return (*this); @@ -98,7 +98,7 @@ Logger &Logger::operator()(const std::string &_file, int _line) { int index = _file.find_last_of("/") + 1; - Console::log() << "(" << ignition::common::systemTimeIso() << ") "; + Console::log() << "(" << gz::common::systemTimeIso() << ") "; std::stringstream prefixString; prefixString << Console::Prefix() << this->prefix << "[" << _file.substr(index , _file.size() - index) << ":" @@ -306,7 +306,7 @@ FileLogger &FileLogger::operator()() if (!this->initialized) this->Init(".ignition", "auto_default.log"); - (*this) << "(" << ignition::common::systemTimeIso() << ") "; + (*this) << "(" << gz::common::systemTimeIso() << ") "; return (*this); } @@ -317,7 +317,7 @@ FileLogger &FileLogger::operator()(const std::string &_file, int _line) this->Init(".ignition", "auto_default.log"); int index = _file.find_last_of("/") + 1; - (*this) << "(" << ignition::common::systemTimeIso() << ") [" + (*this) << "(" << gz::common::systemTimeIso() << ") [" << _file.substr(index , _file.size() - index) << ":" << _line << "]"; return (*this); diff --git a/src/Console_TEST.cc b/src/Console_TEST.cc index 17115e1de..909fe8bfd 100644 --- a/src/Console_TEST.cc +++ b/src/Console_TEST.cc @@ -41,7 +41,7 @@ class Console_TEST : public ::testing::Test { public: virtual void TearDown() { ignLogClose(); - EXPECT_TRUE(ignition::common::unsetenv(IGN_HOMEDIR)); + EXPECT_TRUE(gz::common::unsetenv(IGN_HOMEDIR)); } /// \brief Temporary directory to run test in @@ -52,9 +52,9 @@ std::string GetLogContent(const std::string &_filename) { // Get the absolute path std::string path; - EXPECT_TRUE(ignition::common::env(IGN_HOMEDIR, path)); - path = ignition::common::joinPaths(path, _filename); - EXPECT_TRUE(ignition::common::exists(path)); + EXPECT_TRUE(gz::common::env(IGN_HOMEDIR, path)); + path = gz::common::joinPaths(path, _filename); + EXPECT_TRUE(gz::common::exists(path)); // Open the log file, and read back the string std::ifstream ifs(path.c_str(), std::ios::in); @@ -87,9 +87,9 @@ TEST_F(Console_TEST, NoInitAndLog) // Cleanup ignLogClose(); std::string path; - EXPECT_TRUE(ignition::common::env(IGN_HOMEDIR, path)); - path = ignition::common::joinPaths(path, logPath); - EXPECT_TRUE(ignition::common::removeAll(path)); + EXPECT_TRUE(gz::common::env(IGN_HOMEDIR, path)); + path = gz::common::joinPaths(path, logPath); + EXPECT_TRUE(gz::common::removeAll(path)); } ///////////////////////////////////////////////// @@ -97,7 +97,7 @@ TEST_F(Console_TEST, NoInitAndLog) TEST_F(Console_TEST, InitAndLog) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); @@ -108,18 +108,18 @@ TEST_F(Console_TEST, InitAndLog) // Get the absolute path std::string basePath; - EXPECT_TRUE(ignition::common::env(IGN_HOMEDIR, basePath)); - basePath = ignition::common::joinPaths(basePath, path); + EXPECT_TRUE(gz::common::env(IGN_HOMEDIR, basePath)); + basePath = gz::common::joinPaths(basePath, path); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); // Expect to find the string in the log file EXPECT_TRUE(GetLogContent(logPath).find(logString) != std::string::npos); // Cleanup ignLogClose(); - EXPECT_TRUE(ignition::common::removeAll(basePath)); + EXPECT_TRUE(gz::common::removeAll(basePath)); } ////////////////////////////////////////////////// @@ -127,13 +127,13 @@ TEST_F(Console_TEST, InitAndLog) TEST_F(Console_TEST, LogSlashN) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a log test"; @@ -157,13 +157,13 @@ TEST_F(Console_TEST, LogSlashN) TEST_F(Console_TEST, LogStdEndl) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a log test"; @@ -187,13 +187,13 @@ TEST_F(Console_TEST, LogStdEndl) TEST_F(Console_TEST, ColorWarnSlashN) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a warning test"; @@ -217,13 +217,13 @@ TEST_F(Console_TEST, ColorWarnSlashN) TEST_F(Console_TEST, ColorWarnStdEndl) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a warning test"; @@ -247,13 +247,13 @@ TEST_F(Console_TEST, ColorWarnStdEndl) TEST_F(Console_TEST, ColorDbgSlashN) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a dbg test"; @@ -277,13 +277,13 @@ TEST_F(Console_TEST, ColorDbgSlashN) TEST_F(Console_TEST, ColorDbgStdEndl) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a dbg test"; @@ -307,13 +307,13 @@ TEST_F(Console_TEST, ColorDbgStdEndl) TEST_F(Console_TEST, ColorMsgSlashN) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a msg test"; @@ -337,13 +337,13 @@ TEST_F(Console_TEST, ColorMsgSlashN) TEST_F(Console_TEST, ColorMsgStdEndl) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a msg test"; @@ -367,13 +367,13 @@ TEST_F(Console_TEST, ColorMsgStdEndl) TEST_F(Console_TEST, ColorErrSlashN) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is an error test"; @@ -397,13 +397,13 @@ TEST_F(Console_TEST, ColorErrSlashN) TEST_F(Console_TEST, ColorErrStdEndl) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is an error test"; @@ -427,13 +427,13 @@ TEST_F(Console_TEST, ColorErrStdEndl) TEST_F(Console_TEST, ColorMsg) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is a msg test"; @@ -449,13 +449,13 @@ TEST_F(Console_TEST, ColorMsg) TEST_F(Console_TEST, ColorErr) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); // Get the absolute log file path - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); std::string logString = "this is an error test"; @@ -470,13 +470,13 @@ TEST_F(Console_TEST, ColorErr) /// \brief Test Console::Verbosity TEST_F(Console_TEST, Verbosity) { - EXPECT_EQ(ignition::common::Console::Verbosity(), 1); + EXPECT_EQ(gz::common::Console::Verbosity(), 1); - ignition::common::Console::SetVerbosity(2); - EXPECT_EQ(ignition::common::Console::Verbosity(), 2); + gz::common::Console::SetVerbosity(2); + EXPECT_EQ(gz::common::Console::Verbosity(), 2); - ignition::common::Console::SetVerbosity(-1); - EXPECT_EQ(ignition::common::Console::Verbosity(), -1); + gz::common::Console::SetVerbosity(-1); + EXPECT_EQ(gz::common::Console::Verbosity(), -1); } ///////////////////////////////////////////////// @@ -484,20 +484,20 @@ TEST_F(Console_TEST, Verbosity) TEST_F(Console_TEST, Prefix) { // Max verbosity - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); // Path to log file - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); ignLogInit(path, "test.log"); - std::string logPath = ignition::common::joinPaths(path, "test.log"); + std::string logPath = gz::common::joinPaths(path, "test.log"); // Check default prefix - EXPECT_EQ(ignition::common::Console::Prefix(), ""); + EXPECT_EQ(gz::common::Console::Prefix(), ""); // Set new prefix - ignition::common::Console::SetPrefix("**test** "); - EXPECT_EQ(ignition::common::Console::Prefix(), "**test** "); + gz::common::Console::SetPrefix("**test** "); + EXPECT_EQ(gz::common::Console::Prefix(), "**test** "); // Use the console ignerr << "error" << std::endl; @@ -515,8 +515,8 @@ TEST_F(Console_TEST, Prefix) EXPECT_TRUE(logContent.find("**test** [Dbg]") != std::string::npos); // Reset - ignition::common::Console::SetPrefix(""); - EXPECT_EQ(ignition::common::Console::Prefix(), ""); + gz::common::Console::SetPrefix(""); + EXPECT_EQ(gz::common::Console::Prefix(), ""); } ///////////////////////////////////////////////// @@ -524,7 +524,7 @@ TEST_F(Console_TEST, Prefix) TEST_F(Console_TEST, LogDirectory) { // Create a unique directory path - auto path = ignition::common::uuid(); + auto path = gz::common::uuid(); // Initialize logging ignLogInit(path, "test.log"); @@ -533,8 +533,8 @@ TEST_F(Console_TEST, LogDirectory) // Get the absolute path std::string absPath; - EXPECT_TRUE(ignition::common::env(IGN_HOMEDIR, absPath)); - absPath = ignition::common::joinPaths(absPath, path); + EXPECT_TRUE(gz::common::env(IGN_HOMEDIR, absPath)); + absPath = gz::common::joinPaths(absPath, path); EXPECT_EQ(logDir, absPath); } @@ -545,7 +545,7 @@ TEST_F(Console_TEST, LogDirectory) TEST_F(Console_TEST, NoInitAndLogNoHome) { ignLogClose(); - EXPECT_TRUE(ignition::common::unsetenv(IGN_HOMEDIR)); + EXPECT_TRUE(gz::common::unsetenv(IGN_HOMEDIR)); // This should not throw ignlog << "this is a test" << std::endl; } diff --git a/src/DirIter.cc b/src/DirIter.cc index ffa179152..c03498ddd 100644 --- a/src/DirIter.cc +++ b/src/DirIter.cc @@ -34,7 +34,7 @@ class DirIter::Implementation ////////////////////////////////////////////////// DirIter::DirIter(): - dataPtr(ignition::utils::MakeImpl()) + dataPtr(gz::utils::MakeImpl()) { this->dataPtr->it = fs::directory_iterator(); } diff --git a/src/Filesystem.cc b/src/Filesystem.cc index 2b1b26f68..4d80a2ac4 100644 --- a/src/Filesystem.cc +++ b/src/Filesystem.cc @@ -38,14 +38,14 @@ namespace fs = std::filesystem; // Return true if success, false if error inline bool fsWarn(const std::string &_fcn, const std::error_code &_ec, - const ignition::common::FilesystemWarningOp &_warningOp = - ignition::common::FSWO_LOG_WARNINGS) + const gz::common::FilesystemWarningOp &_warningOp = + gz::common::FSWO_LOG_WARNINGS) { if (_ec) { - if (ignition::common::FSWO_LOG_WARNINGS == _warningOp) + if (gz::common::FSWO_LOG_WARNINGS == _warningOp) { - ignwarn << "Failed ignition::common::" << _fcn + ignwarn << "Failed gz::common::" << _fcn << " (ec: " << _ec << " " << _ec.message() << ")\n"; } return false; @@ -54,31 +54,31 @@ inline bool fsWarn(const std::string &_fcn, } ///////////////////////////////////////////////// -bool ignition::common::exists(const std::string &_path) +bool gz::common::exists(const std::string &_path) { return fs::exists(_path); } ///////////////////////////////////////////////// -bool ignition::common::isDirectory(const std::string &_path) +bool gz::common::isDirectory(const std::string &_path) { return fs::is_directory(_path); } ///////////////////////////////////////////////// -bool ignition::common::isFile(const std::string &_path) +bool gz::common::isFile(const std::string &_path) { return fs::is_regular_file(_path); } ///////////////////////////////////////////////// -bool ignition::common::isRelativePath(const std::string &_path) +bool gz::common::isRelativePath(const std::string &_path) { return fs::path(_path).is_relative(); } ///////////////////////////////////////////////// -bool ignition::common::createDirectory(const std::string &_path) +bool gz::common::createDirectory(const std::string &_path) { std::error_code ec; fs::create_directory(_path, ec); @@ -86,7 +86,7 @@ bool ignition::common::createDirectory(const std::string &_path) } ///////////////////////////////////////////////// -bool ignition::common::createDirectories(const std::string &_path) +bool gz::common::createDirectories(const std::string &_path) { std::error_code ec; // Disregard return of create_directories, because it may return false if the @@ -97,19 +97,19 @@ bool ignition::common::createDirectories(const std::string &_path) } ///////////////////////////////////////////////// -std::string const ignition::common::separator(std::string const &_s) +std::string const gz::common::separator(std::string const &_s) { return _s + std::string{fs::path::preferred_separator}; } ///////////////////////////////////////////////// -void ignition::common::changeFromUnixPath(std::string &_path) { +void gz::common::changeFromUnixPath(std::string &_path) { std::replace(_path.begin(), _path.end(), '/', static_cast(fs::path::preferred_separator)); } ///////////////////////////////////////////////// -std::string ignition::common::copyFromUnixPath(const std::string &_path) +std::string gz::common::copyFromUnixPath(const std::string &_path) { std::string copy = _path; changeFromUnixPath(copy); @@ -117,13 +117,13 @@ std::string ignition::common::copyFromUnixPath(const std::string &_path) } ///////////////////////////////////////////////// -void ignition::common::changeToUnixPath(std::string &_path) { +void gz::common::changeToUnixPath(std::string &_path) { std::replace(_path.begin(), _path.end(), static_cast(fs::path::preferred_separator), '/'); } ///////////////////////////////////////////////// -std::string ignition::common::copyToUnixPath(const std::string &_path) +std::string gz::common::copyToUnixPath(const std::string &_path) { std::string copy = _path; changeToUnixPath(copy); @@ -131,13 +131,13 @@ std::string ignition::common::copyToUnixPath(const std::string &_path) } ///////////////////////////////////////////////// -std::string ignition::common::absPath(const std::string &_path) +std::string gz::common::absPath(const std::string &_path) { return fs::absolute(_path).string(); } ///////////////////////////////////////////////// -std::string ignition::common::joinPaths( +std::string gz::common::joinPaths( const std::string &_path1, const std::string &_path2) { fs::path p1{_path1}; @@ -145,7 +145,7 @@ std::string ignition::common::joinPaths( if (p1.empty()) { - p1 = ignition::common::separator(""); + p1 = gz::common::separator(""); } bool is_url = false; @@ -181,7 +181,7 @@ std::string ignition::common::joinPaths( } ///////////////////////////////////////////////// -std::string ignition::common::cwd() +std::string gz::common::cwd() { std::error_code ec; auto curdir = fs::current_path(ec); @@ -195,7 +195,7 @@ std::string ignition::common::cwd() } ///////////////////////////////////////////////// -bool ignition::common::chdir(const std::string &_dir) +bool gz::common::chdir(const std::string &_dir) { std::error_code ec; fs::current_path(_dir, ec); @@ -203,7 +203,7 @@ bool ignition::common::chdir(const std::string &_dir) } ///////////////////////////////////////////////// -std::string ignition::common::basename(const std::string &_path) +std::string gz::common::basename(const std::string &_path) { fs::path p(_path); p /= "FOO.TXT"; @@ -214,7 +214,7 @@ std::string ignition::common::basename(const std::string &_path) } ///////////////////////////////////////////////// -std::string ignition::common::parentPath(const std::string &_path) +std::string gz::common::parentPath(const std::string &_path) { std::string result; size_t last_sep = _path.find_last_of(separator("")); @@ -226,7 +226,7 @@ std::string ignition::common::parentPath(const std::string &_path) } ///////////////////////////////////////////////// -bool ignition::common::copyFile( +bool gz::common::copyFile( const std::string &_existingFilename, const std::string &_newFilename, const FilesystemWarningOp _warningOp) @@ -238,7 +238,7 @@ bool ignition::common::copyFile( } ///////////////////////////////////////////////// -bool ignition::common::copyDirectory( +bool gz::common::copyDirectory( const std::string &_existingDirname, const std::string &_newDirname, const FilesystemWarningOp _warningOp) @@ -248,7 +248,7 @@ bool ignition::common::copyDirectory( // std::filesystem won't create intermediate directories // before copying, this maintains compatibility with ignition behavior. - if (!ignition::common::createDirectories(_newDirname)) + if (!gz::common::createDirectories(_newDirname)) { return false; } @@ -259,7 +259,7 @@ bool ignition::common::copyDirectory( } ///////////////////////////////////////////////// -bool ignition::common::moveFile( +bool gz::common::moveFile( const std::string &_existingFilename, const std::string &_newFilename, const FilesystemWarningOp _warningOp) @@ -270,7 +270,7 @@ bool ignition::common::moveFile( } ///////////////////////////////////////////////// -bool ignition::common::removeDirectory( +bool gz::common::removeDirectory( const std::string &_path, const FilesystemWarningOp _warningOp) { @@ -288,7 +288,7 @@ bool ignition::common::removeDirectory( } ///////////////////////////////////////////////// -bool ignition::common::removeFile( +bool gz::common::removeFile( const std::string &_existingFilename, const FilesystemWarningOp _warningOp) { @@ -305,7 +305,7 @@ bool ignition::common::removeFile( } ///////////////////////////////////////////////// -bool ignition::common::removeDirectoryOrFile( +bool gz::common::removeDirectoryOrFile( const std::string &_path, const FilesystemWarningOp _warningOp) { @@ -316,7 +316,7 @@ bool ignition::common::removeDirectoryOrFile( } ///////////////////////////////////////////////// -bool ignition::common::removeAll( +bool gz::common::removeAll( const std::string &_path, const FilesystemWarningOp _warningOp) { @@ -326,7 +326,7 @@ bool ignition::common::removeAll( } ///////////////////////////////////////////////// -std::string ignition::common::uniqueFilePath( +std::string gz::common::uniqueFilePath( const std::string &_pathAndName, const std::string &_extension) { @@ -344,7 +344,7 @@ std::string ignition::common::uniqueFilePath( } ///////////////////////////////////////////////// -std::string ignition::common::uniqueDirectoryPath(const std::string &_dir) +std::string gz::common::uniqueDirectoryPath(const std::string &_dir) { std::string result = _dir; int count = 1; diff --git a/src/Filesystem_TEST.cc b/src/Filesystem_TEST.cc index a68e3e7a5..155f1a687 100644 --- a/src/Filesystem_TEST.cc +++ b/src/Filesystem_TEST.cc @@ -636,8 +636,8 @@ TEST_F(FilesystemTest, uniquePaths) TEST_F(FilesystemTest, separator) { #ifndef _WIN32 - EXPECT_EQ("/", ignition::common::separator("")); + EXPECT_EQ("/", gz::common::separator("")); #else - EXPECT_EQ("\\", ignition::common::separator("")); + EXPECT_EQ("\\", gz::common::separator("")); #endif } diff --git a/src/FlagSet_TEST.cc b/src/FlagSet_TEST.cc index 06ac1e87d..53b675cbb 100644 --- a/src/FlagSet_TEST.cc +++ b/src/FlagSet_TEST.cc @@ -23,7 +23,7 @@ * SOFTWARE. */ -// ignition::common::FlagSet is a type-safe class for using enums as flags in +// gz::common::FlagSet is a type-safe class for using enums as flags in // C++14 with an underlying std::bitset. // See https://github.com/mrts/flag-set-cpp // Licence: MIT @@ -66,7 +66,7 @@ enum class OptionsNoEnd : uint8_t TEST(FlagSet, TestAnd) { - ignition::common::FlagSet red( + gz::common::FlagSet red( Options::RED_FOREGROUND | Options::RED_BACKGROUND); auto result = red & Options::RED_BACKGROUND; @@ -85,26 +85,26 @@ TEST(FlagSet, TestAnd) EXPECT_FALSE(result); EXPECT_EQ(result.Count(), 0u); - ignition::common::FlagSet red_foreground(Options::RED_FOREGROUND); + gz::common::FlagSet red_foreground(Options::RED_FOREGROUND); red &= Options::RED_FOREGROUND; EXPECT_TRUE(red == red_foreground); } TEST(FlagSet, TestOr) { - ignition::common::FlagSet red; + gz::common::FlagSet red; red |= Options::RED_FOREGROUND | Options::RED_BACKGROUND; EXPECT_TRUE(red); EXPECT_EQ(red.Count(), 2u); - ignition::common::FlagSet options; + gz::common::FlagSet options; options |= (Options::FULLSCREEN | Options::FLASH); auto result = options & (Options::FULLSCREEN | Options::FLASH | Options::RED_FOREGROUND); EXPECT_TRUE(result); - ignition::common::FlagSet expected; + gz::common::FlagSet expected; expected |= Options::FULLSCREEN; EXPECT_EQ(options & expected, expected); @@ -122,7 +122,7 @@ TEST(FlagSet, TestOr) TEST(FlagSet, TestSetReset) { - ignition::common::FlagSet options; + gz::common::FlagSet options; EXPECT_EQ(options.Count(), 0u); options.Set(); @@ -147,7 +147,7 @@ TEST(FlagSet, TestSetReset) TEST(FlagSet, TestAnyAllNone) { - ignition::common::FlagSet options; + gz::common::FlagSet options; EXPECT_TRUE(options.None()); EXPECT_FALSE(options.Any()); EXPECT_FALSE(options.All()); @@ -204,13 +204,13 @@ TEST(FlagSet, TestConstructors) TEST(FlagSet, TestStaticConstructors) { - EXPECT_TRUE(ignition::common::FlagSet::AllSet().All()); - EXPECT_FALSE(ignition::common::FlagSet::AllSet().None()); - EXPECT_TRUE(ignition::common::FlagSet::AllSet().Any()); + EXPECT_TRUE(gz::common::FlagSet::AllSet().All()); + EXPECT_FALSE(gz::common::FlagSet::AllSet().None()); + EXPECT_TRUE(gz::common::FlagSet::AllSet().Any()); - EXPECT_FALSE(ignition::common::FlagSet::NoneSet().All()); - EXPECT_TRUE(ignition::common::FlagSet::NoneSet().None()); - EXPECT_FALSE(ignition::common::FlagSet::NoneSet().Any()); + EXPECT_FALSE(gz::common::FlagSet::NoneSet().All()); + EXPECT_TRUE(gz::common::FlagSet::NoneSet().None()); + EXPECT_FALSE(gz::common::FlagSet::NoneSet().Any()); } @@ -237,7 +237,7 @@ TEST(FlagSet, TestEnumWithoutUnderscore) { using ONU = OptionsNoUnderscore; - using TestSet = ignition::common::FlagSet; + using TestSet = gz::common::FlagSet; ASSERT_EQ(5u, TestSet::numElements); @@ -272,7 +272,7 @@ TEST(FlagSet, TestEnumWithoutEnd) { using ONE = OptionsNoEnd; - using TestSet = ignition::common::FlagSet; + using TestSet = gz::common::FlagSet; ASSERT_EQ(5u, TestSet::numElements); diff --git a/src/MovingWindowFilter_TEST.cc b/src/MovingWindowFilter_TEST.cc index af4270611..6062acbf9 100644 --- a/src/MovingWindowFilter_TEST.cc +++ b/src/MovingWindowFilter_TEST.cc @@ -40,7 +40,7 @@ TEST(MovingWindowFilterTest, FilterSomething) { common::MovingWindowFilter doubleMWF; common::MovingWindowFilter doubleMWF2; - common::MovingWindowFilter vectorMWF; + common::MovingWindowFilter vectorMWF; doubleMWF.SetWindowSize(10); doubleMWF2.SetWindowSize(2); @@ -50,7 +50,7 @@ TEST(MovingWindowFilterTest, FilterSomething) { doubleMWF.Update(static_cast(i)); doubleMWF2.Update(static_cast(i)); - ignition::math::Vector3d v(1.0*static_cast(i), + gz::math::Vector3d v(1.0*static_cast(i), 2.0*static_cast(i), 3.0*static_cast(i)); vectorMWF.Update(v); @@ -62,9 +62,9 @@ TEST(MovingWindowFilterTest, FilterSomething) EXPECT_DOUBLE_EQ(doubleMWF.Value(), sum/10.0); EXPECT_DOUBLE_EQ(doubleMWF2.Value(), (18.0+19.0)/2.0); - ignition::math::Vector3d vsum; + gz::math::Vector3d vsum; for (unsigned int i = 0; i < 20; ++i) - vsum += ignition::math::Vector3d(1.0*static_cast(i), + vsum += gz::math::Vector3d(1.0*static_cast(i), 2.0*static_cast(i), 3.0*static_cast(i)); EXPECT_EQ(vectorMWF.Value(), vsum / 20.0); diff --git a/src/PluginLoader.cc b/src/PluginLoader.cc index a6dd4cdce..8821904b2 100644 --- a/src/PluginLoader.cc +++ b/src/PluginLoader.cc @@ -261,7 +261,7 @@ namespace gz if (version < PLUGIN_API_VERSION) { ignwarn << "The library [" << _pathToLibrary <<"] is using an outdated " - << "version [" << version << "] of the ignition::common Plugin " + << "version [" << version << "] of the gz::common Plugin " << "API. The version in this library is [" << PLUGIN_API_VERSION << "].\n"; } @@ -269,7 +269,7 @@ namespace gz if (version > PLUGIN_API_VERSION) { ignerr << "The library [" << _pathToLibrary << "] is using a newer " - << "version [" << version << "] of the ignition::common Plugin " + << "version [" << version << "] of the gz::common Plugin " << "API. The version in this library is [" << PLUGIN_API_VERSION << "].\n"; return loadedPlugins; diff --git a/src/PluginLoader_TEST.cc b/src/PluginLoader_TEST.cc index 913a81451..009e7566f 100644 --- a/src/PluginLoader_TEST.cc +++ b/src/PluginLoader_TEST.cc @@ -28,10 +28,10 @@ #include "ignition/common/testing/Utils.hh" ///////////////////////////////////////////////// -class TestTempDirectory : public ignition::common::TempDirectory +class TestTempDirectory : public gz::common::TempDirectory { public: TestTempDirectory(): - ignition::common::TempDirectory("plugin_loader", "ign_common", true) + gz::common::TempDirectory("plugin_loader", "ign_common", true) { } }; @@ -39,14 +39,14 @@ class TestTempDirectory : public ignition::common::TempDirectory ///////////////////////////////////////////////// TEST(PluginLoader, InitialNoInterfacesImplemented) { - ignition::common::PluginLoader pm; + gz::common::PluginLoader pm; EXPECT_EQ(0u, pm.InterfacesImplemented().size()); } ///////////////////////////////////////////////// TEST(PluginLoader, LoadNonexistantLibrary) { - ignition::common::PluginLoader pm; + gz::common::PluginLoader pm; EXPECT_TRUE(pm.LoadLibrary("/path/to/libDoesNotExist.so").empty()); } @@ -54,9 +54,9 @@ TEST(PluginLoader, LoadNonexistantLibrary) TEST(PluginLoader, LoadNonLibrary) { TestTempDirectory tempDir; - ignition::common::testing::createNewEmptyFile("not_a_library.txt"); + gz::common::testing::createNewEmptyFile("not_a_library.txt"); - ignition::common::PluginLoader pm; + gz::common::PluginLoader pm; EXPECT_TRUE(pm.LoadLibrary("not_a_library.txt").empty()); } @@ -67,30 +67,30 @@ TEST(PluginLoader, LoadNonPluginLibrary) std::string libName = "foobar"; TestTempDirectory tempDir; - ignition::common::createDirectory(libDir); - ignition::common::testing::createNewEmptyFile( - ignition::common::joinPaths(libDir, "lib" + libName + ".so")); + gz::common::createDirectory(libDir); + gz::common::testing::createNewEmptyFile( + gz::common::joinPaths(libDir, "lib" + libName + ".so")); - ignition::common::SystemPaths sp; + gz::common::SystemPaths sp; // Fails without plugin dirs setup std::string path = sp.FindSharedLibrary("foo"); ASSERT_TRUE(path.empty()); sp.AddPluginPaths( - ignition::common::joinPaths(ignition::common::cwd(), libDir)); + gz::common::joinPaths(gz::common::cwd(), libDir)); path = sp.FindSharedLibrary(libName); ASSERT_FALSE(path.empty()); - ignition::common::PluginLoader pm; + gz::common::PluginLoader pm; EXPECT_TRUE(pm.LoadLibrary(path).empty()); } ///////////////////////////////////////////////// TEST(PluginLoader, InstantiateUnloadedPlugin) { - ignition::common::PluginLoader pm; - ignition::common::PluginPtr plugin = + gz::common::PluginLoader pm; + gz::common::PluginPtr plugin = pm.Instantiate("plugin::that::is::not::loaded"); EXPECT_FALSE(plugin); } diff --git a/src/PluginUtils_TEST.cc b/src/PluginUtils_TEST.cc index aa3cc71bd..7ea60f24f 100644 --- a/src/PluginUtils_TEST.cc +++ b/src/PluginUtils_TEST.cc @@ -30,6 +30,6 @@ TEST(PluginUtils, NormalizeName) EXPECT_EQ("::ignition", common::NormalizeName("ignition")); EXPECT_EQ("::ignition", common::NormalizeName("::ignition")); - EXPECT_EQ("::ignition::math", common::NormalizeName("ignition::math")); - EXPECT_EQ("::ignition::math", common::NormalizeName("::ignition::math")); + EXPECT_EQ("::gz::math", common::NormalizeName("gz::math")); + EXPECT_EQ("::gz::math", common::NormalizeName("::gz::math")); } diff --git a/src/PrintWindowsSystemWarning.hh b/src/PrintWindowsSystemWarning.hh index b45372c76..b5eb9cf90 100644 --- a/src/PrintWindowsSystemWarning.hh +++ b/src/PrintWindowsSystemWarning.hh @@ -31,7 +31,7 @@ namespace gz { /// \brief This is a Windows-specific function that prints warnings from the /// system in a pretty and convenient way. They get logged using the - /// ignition::common::Console. + /// gz::common::Console. inline void PrintWindowsSystemWarning(const std::string &_flavorText) { // Based on example code by Microsoft: "Retrieving the Last-Error Code" diff --git a/src/SignalHandler.cc b/src/SignalHandler.cc index 6bf3ca716..4b4d4b894 100644 --- a/src/SignalHandler.cc +++ b/src/SignalHandler.cc @@ -47,7 +47,7 @@ void onSignal(int _value) } ///////////////////////////////////////////////// -class ignition::common::SignalHandlerPrivate +class gz::common::SignalHandlerPrivate { /// \brief Handle a signal. /// \param[in] _sig Signal number diff --git a/src/SystemPaths.cc b/src/SystemPaths.cc index 72800dffa..451a55cdb 100644 --- a/src/SystemPaths.cc +++ b/src/SystemPaths.cc @@ -34,7 +34,7 @@ using namespace gz; using namespace common; // Private data class -class ignition::common::SystemPaths::Implementation +class gz::common::SystemPaths::Implementation { /// \brief Name of the environment variable to check for plugin paths public: std::string pluginPathEnv = "IGN_PLUGIN_PATH"; @@ -60,7 +60,7 @@ class ignition::common::SystemPaths::Implementation /// \brief Callbacks to be called in order in case a file can't be found. public: std::vector > findFileURICbs; + const gz::common::URI &)> > findFileURICbs; /// \brief generates paths to try searching for the named library public: std::vector GenerateLibraryPaths( @@ -79,7 +79,7 @@ void insertUnique(const std::string &_path, std::list &_list) ////////////////////////////////////////////////// SystemPaths::SystemPaths() -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { std::string home, path, fullPath; if (!env(IGN_HOMEDIR, home)) @@ -279,19 +279,19 @@ std::vector SystemPaths::Implementation::GenerateLibraryPaths( ////////////////////////////////////////////////// std::string SystemPaths::FindFileURI(const std::string &_uri) const { - if (!ignition::common::URI::Valid(_uri)) + if (!gz::common::URI::Valid(_uri)) { ignerr << "The passed value [" << _uri << "] is not a valid URI, " "trying as a file" << std::endl; return this->FindFile(_uri); } - const auto uri = ignition::common::URI(_uri); + const auto uri = gz::common::URI(_uri); return this->FindFileURI(uri); } ////////////////////////////////////////////////// -std::string SystemPaths::FindFileURI(const ignition::common::URI &_uri) const +std::string SystemPaths::FindFileURI(const gz::common::URI &_uri) const { std::string prefix = _uri.Scheme(); std::string suffix; @@ -313,7 +313,7 @@ std::string SystemPaths::FindFileURI(const ignition::common::URI &_uri) const std::string filename; // First try to find the file on the current system - filename = this->FindFile(ignition::common::copyFromUnixPath(suffix), + filename = this->FindFile(gz::common::copyFromUnixPath(suffix), true, false); // Look in custom paths. @@ -325,7 +325,7 @@ std::string SystemPaths::FindFileURI(const ignition::common::URI &_uri) const auto withSuffix = NormalizeDirectoryPath(filePath) + suffix; if (exists(withSuffix)) { - filename = ignition::common::copyFromUnixPath(withSuffix); + filename = gz::common::copyFromUnixPath(withSuffix); break; } } @@ -371,9 +371,9 @@ std::string SystemPaths::FindFile(const std::string &_filename, return path; // Handle as URI - if (ignition::common::URI::Valid(filename)) + if (gz::common::URI::Valid(filename)) { - path = this->FindFileURI(ignition::common::URI(filename)); + path = this->FindFileURI(gz::common::URI(filename)); } // Handle as local absolute path else if (filename[0] == '/') @@ -409,7 +409,7 @@ std::string SystemPaths::FindFile(const std::string &_filename, auto withSuffix = NormalizeDirectoryPath(filePath) + filename; if (exists(withSuffix)) { - path = ignition::common::copyFromUnixPath(withSuffix); + path = gz::common::copyFromUnixPath(withSuffix); break; } } @@ -510,7 +510,7 @@ void SystemPaths::AddFindFileCallback( ///////////////////////////////////////////////// void SystemPaths::AddFindFileURICallback( - std::function _cb) + std::function _cb) { this->dataPtr->findFileURICbs.push_back(_cb); } @@ -527,7 +527,7 @@ std::list SystemPaths::PathsFromEnv(const std::string &_env) if (envPathsStr.empty()) return paths; - auto ps = ignition::common::Split(envPathsStr, Delimiter()); + auto ps = gz::common::Split(envPathsStr, Delimiter()); for (auto const &path : ps) { std::string normalPath = NormalizeDirectoryPath(path); diff --git a/src/SystemPaths_TEST.cc b/src/SystemPaths_TEST.cc index ca58a8986..a0886de5d 100644 --- a/src/SystemPaths_TEST.cc +++ b/src/SystemPaths_TEST.cc @@ -37,10 +37,10 @@ using namespace gz; const char kPluginPath[] = "IGN_PLUGIN_PATH"; const char kFilePath[] = "IGN_FILE_PATH"; -class TestTempDirectory : public ignition::common::TempDirectory +class TestTempDirectory : public gz::common::TempDirectory { public: TestTempDirectory(): - ignition::common::TempDirectory("systempaths", "ign_common", true) + gz::common::TempDirectory("systempaths", "ign_common", true) { } }; @@ -128,9 +128,9 @@ TEST_F(SystemPathsFixture, FileSystemPaths) EXPECT_EQ(static_cast(0), paths.FilePaths().size()); std::string dir1 = "test_dir1"; - ignition::common::createDirectories(dir1); - auto file1 = ignition::common::copyFromUnixPath( - ignition::common::joinPaths(dir1, "test_f1")); + gz::common::createDirectories(dir1); + auto file1 = gz::common::copyFromUnixPath( + gz::common::joinPaths(dir1, "test_f1")); std::ofstream fout; fout.open(file1, std::ofstream::out); fout << "asdf"; @@ -200,14 +200,14 @@ TEST_F(SystemPathsFixture, SearchPathUsesForwardSlashes) ////////////////////////////////////////////////// TEST_F(SystemPathsFixture, FindFileURI) { - auto dir1 = ignition::common::absPath("test_dir1"); - auto dir2 = ignition::common::absPath("test_dir2"); - ignition::common::createDirectories(dir1); - ignition::common::createDirectories(dir2); - auto file1 = ignition::common::absPath( - ignition::common::joinPaths(dir1, "test_f1")); - auto file2 = ignition::common::absPath( - ignition::common::joinPaths(dir2, "test_f2")); + auto dir1 = gz::common::absPath("test_dir1"); + auto dir2 = gz::common::absPath("test_dir2"); + gz::common::createDirectories(dir1); + gz::common::createDirectories(dir2); + auto file1 = gz::common::absPath( + gz::common::joinPaths(dir1, "test_f1")); + auto file2 = gz::common::absPath( + gz::common::joinPaths(dir2, "test_f2")); std::ofstream fout; fout.open(file1, std::ofstream::out); @@ -218,13 +218,13 @@ TEST_F(SystemPathsFixture, FindFileURI) fout.close(); common::SystemPaths sp; - auto filesystemRootUnix = ignition::common::copyToUnixPath( + auto filesystemRootUnix = gz::common::copyToUnixPath( this->filesystemRoot); EXPECT_EQ("", sp.FindFileURI("file://no_such_file")); EXPECT_EQ(file1, sp.FindFileURI("file:test_dir1/test_f1")); EXPECT_EQ(file1, sp.FindFileURI("file://" + - ignition::common::copyToUnixPath(file1))); + gz::common::copyToUnixPath(file1))); EXPECT_EQ("", sp.FindFileURI("osrf://unknown.protocol")); EXPECT_EQ("", sp.FindFileURI(this->filesystemRoot + "no_such_file")); EXPECT_EQ("", sp.FindFileURI("file://" + filesystemRootUnix + @@ -242,21 +242,21 @@ TEST_F(SystemPathsFixture, FindFileURI) // sp.FindFileURI("file://" + this->filesystemRoot + "Windows")); #endif - auto robotCb = [dir1](const ignition::common::URI &_uri) + auto robotCb = [dir1](const gz::common::URI &_uri) { return _uri.Scheme() == "robot" ? - ignition::common::joinPaths(dir1, _uri.Path().Str()) : ""; + gz::common::joinPaths(dir1, _uri.Path().Str()) : ""; }; - auto osrfCb = [dir2](const ignition::common::URI &_uri) + auto osrfCb = [dir2](const gz::common::URI &_uri) { return _uri.Scheme() == "osrf" ? - ignition::common::joinPaths(dir2, ignition::common::copyFromUnixPath( + gz::common::joinPaths(dir2, gz::common::copyFromUnixPath( _uri.Path().Str())) : ""; }; - auto robot2Cb = [dir2](const ignition::common::URI &_uri) + auto robot2Cb = [dir2](const gz::common::URI &_uri) { return _uri.Scheme() == "robot" ? - ignition::common::joinPaths(dir2, _uri.Path().Str()) : ""; + gz::common::joinPaths(dir2, _uri.Path().Str()) : ""; }; EXPECT_EQ("", sp.FindFileURI("robot://test_f1")); @@ -294,14 +294,14 @@ TEST_F(SystemPathsFixture, FindFileURI) ////////////////////////////////////////////////// TEST_F(SystemPathsFixture, FindFile) { - auto dir1 = ignition::common::absPath("test_dir1"); - auto dir2 = ignition::common::absPath("test_dir2"); - ignition::common::createDirectories(dir1); - ignition::common::createDirectories(dir2); - auto file1 = ignition::common::absPath( - ignition::common::joinPaths(dir1, "test_f1")); - auto file2 = ignition::common::absPath( - ignition::common::joinPaths(dir2, "test_f2")); + auto dir1 = gz::common::absPath("test_dir1"); + auto dir2 = gz::common::absPath("test_dir2"); + gz::common::createDirectories(dir1); + gz::common::createDirectories(dir2); + auto file1 = gz::common::absPath( + gz::common::joinPaths(dir1, "test_f1")); + auto file2 = gz::common::absPath( + gz::common::joinPaths(dir2, "test_f2")); std::ofstream fout; fout.open(file1, std::ofstream::out); @@ -313,10 +313,10 @@ TEST_F(SystemPathsFixture, FindFile) // LocateLocalFile common::SystemPaths sp; - EXPECT_EQ(ignition::common::copyToUnixPath(file1), + EXPECT_EQ(gz::common::copyToUnixPath(file1), sp.LocateLocalFile("test_f1", {dir1, dir2})); - EXPECT_EQ(ignition::common::copyToUnixPath(file2), + EXPECT_EQ(gz::common::copyToUnixPath(file2), sp.LocateLocalFile("test_f2", {dir1, dir2})); EXPECT_EQ("", sp.LocateLocalFile("test_f3", {dir1, dir2})); @@ -381,17 +381,17 @@ TEST_F(SystemPathsFixture, FindFile) ////////////////////////////////////////////////// TEST_F(SystemPathsFixture, NormalizeDirectoryPath) { - EXPECT_EQ(ignition::common::SystemPaths::NormalizeDirectoryPath("a/b/c/"), + EXPECT_EQ(gz::common::SystemPaths::NormalizeDirectoryPath("a/b/c/"), "a/b/c/"); - EXPECT_EQ(ignition::common::SystemPaths::NormalizeDirectoryPath("a/b/c"), + EXPECT_EQ(gz::common::SystemPaths::NormalizeDirectoryPath("a/b/c"), "a/b/c/"); - EXPECT_EQ(ignition::common::SystemPaths::NormalizeDirectoryPath("/a/b/c/"), + EXPECT_EQ(gz::common::SystemPaths::NormalizeDirectoryPath("/a/b/c/"), "/a/b/c/"); - EXPECT_EQ(ignition::common::SystemPaths::NormalizeDirectoryPath("/a/b/c"), + EXPECT_EQ(gz::common::SystemPaths::NormalizeDirectoryPath("/a/b/c"), "/a/b/c/"); - EXPECT_EQ(ignition::common::SystemPaths::NormalizeDirectoryPath("a\\b\\c"), + EXPECT_EQ(gz::common::SystemPaths::NormalizeDirectoryPath("a\\b\\c"), "a/b/c/"); - EXPECT_EQ(ignition::common::SystemPaths::NormalizeDirectoryPath("a\\b\\c\\"), + EXPECT_EQ(gz::common::SystemPaths::NormalizeDirectoryPath("a\\b\\c\\"), "a/b/c/"); } @@ -401,7 +401,7 @@ TEST_F(SystemPathsFixture, PathsFromEnv) common::setenv(kPluginPath, SystemPathsJoin({"/tmp/plugin", "/test/plugin/now/", "/tmp/plugin"})); - auto paths = ignition::common::SystemPaths::PathsFromEnv(kPluginPath); + auto paths = gz::common::SystemPaths::PathsFromEnv(kPluginPath); EXPECT_EQ(paths.size(), 2u); diff --git a/src/TempDirectory.cc b/src/TempDirectory.cc index cb2521efa..58a123e10 100644 --- a/src/TempDirectory.cc +++ b/src/TempDirectory.cc @@ -46,7 +46,7 @@ inline bool fs_warn(const std::string &_fcn, { if (FSWO_LOG_WARNINGS == _warningOp) { - ignwarn << "Failed ignition::common::" << _fcn + ignwarn << "Failed gz::common::" << _fcn << " (ec: " << _ec << " " << _ec.message() << ")\n"; } return false; @@ -55,7 +55,7 @@ inline bool fs_warn(const std::string &_fcn, } ///////////////////////////////////////////////// -std::string ignition::common::tempDirectoryPath() +std::string gz::common::tempDirectoryPath() { std::error_code ec; auto ret = fs::temp_directory_path(ec); @@ -119,7 +119,7 @@ std::string createTempDirectory( } ///////////////////////////////////////////////// -std::string ignition::common::createTempDirectory( +std::string gz::common::createTempDirectory( const std::string &_baseName, const std::string &_parentPath, const FilesystemWarningOp _warningOp) @@ -141,7 +141,7 @@ std::string ignition::common::createTempDirectory( } -class ignition::common::TempDirectory::Implementation +class gz::common::TempDirectory::Implementation { /// \brief Current working directory before creation of temporary dir. public: std::string oldPath {""}; @@ -170,7 +170,7 @@ TempDirectory::TempDirectory(const std::string &_root, const std::string &_prefix, const std::string &_subDir, bool _cleanup): - dataPtr(ignition::utils::MakeUniqueImpl()) + dataPtr(gz::utils::MakeUniqueImpl()) { this->dataPtr->oldPath = common::cwd(); this->dataPtr->doCleanup = _cleanup; diff --git a/src/TempDirectory_TEST.cc b/src/TempDirectory_TEST.cc index 77c3f56c5..349e75913 100644 --- a/src/TempDirectory_TEST.cc +++ b/src/TempDirectory_TEST.cc @@ -24,27 +24,27 @@ TEST(TempDirectory, tempDirectoryPath) { // OS TMPDIR should never be empty - ASSERT_FALSE(ignition::common::tempDirectoryPath().empty()); + ASSERT_FALSE(gz::common::tempDirectoryPath().empty()); } ///////////////////////////////////////////////// TEST(TempDirectory, createTempDirectory) { // OS TMPDIR should never be empty - auto tmpDir = ignition::common::tempDirectoryPath(); + auto tmpDir = gz::common::tempDirectoryPath(); ASSERT_FALSE(tmpDir.empty()); // Nominal case // eg /tmp/fooXXXXXX - auto tmp = ignition::common::createTempDirectory("foo", tmpDir); + auto tmp = gz::common::createTempDirectory("foo", tmpDir); ASSERT_FALSE(tmp.empty()); EXPECT_NE(std::string::npos, tmp.find("foo")); EXPECT_NE(std::string::npos, tmp.find(tmpDir)); // Should also work for subdirectories // eg /tmp/bar/fooXXXXXX - tmpDir = ignition::common::joinPaths(tmpDir, "bar"); - auto tmp2 = ignition::common::createTempDirectory("bar", tmpDir); + tmpDir = gz::common::joinPaths(tmpDir, "bar"); + auto tmp2 = gz::common::createTempDirectory("bar", tmpDir); ASSERT_FALSE(tmp2.empty()); } @@ -52,11 +52,11 @@ TEST(TempDirectory, createTempDirectory) TEST(TempDirectory, createTempDirectoryEmptyBase) { // OS TMPDIR should never be empty - auto tmpDir = ignition::common::tempDirectoryPath(); + auto tmpDir = gz::common::tempDirectoryPath(); ASSERT_FALSE(tmpDir.empty()); // Create with an empty basename (eg /tmp/XXXXXX) - auto tmp = ignition::common::createTempDirectory("", tmpDir); + auto tmp = gz::common::createTempDirectory("", tmpDir); ASSERT_FALSE(tmp.empty()); EXPECT_EQ(std::string::npos, tmp.find("foo")); EXPECT_NE(std::string::npos, tmp.find(tmpDir)); @@ -66,103 +66,103 @@ TEST(TempDirectory, createTempDirectoryEmptyBase) TEST(TempDirectory, TempDirectory) { std::string path; - auto curDir = ignition::common::cwd(); + auto curDir = gz::common::cwd(); { - ignition::common::TempDirectory tmp("temp_dir", "ignition", true); + gz::common::TempDirectory tmp("temp_dir", "ignition", true); EXPECT_TRUE(tmp.Valid()); EXPECT_TRUE(tmp.DoCleanup()); // Current directory changed to tempdir - EXPECT_NE(curDir, ignition::common::cwd()); + EXPECT_NE(curDir, gz::common::cwd()); path = tmp.Path(); EXPECT_FALSE(path.empty()); - EXPECT_TRUE(ignition::common::exists(path)); - EXPECT_EQ(path, ignition::common::cwd()); + EXPECT_TRUE(gz::common::exists(path)); + EXPECT_EQ(path, gz::common::cwd()); } // Current directory changed back to previous - EXPECT_EQ(curDir, ignition::common::cwd()); - EXPECT_FALSE(ignition::common::exists(path)); + EXPECT_EQ(curDir, gz::common::cwd()); + EXPECT_FALSE(gz::common::exists(path)); } ///////////////////////////////////////////////// TEST(TempDirectory, TempDirectoryRoot) { std::string path; - auto curDir = ignition::common::cwd(); + auto curDir = gz::common::cwd(); { - auto p = ignition::common::tempDirectoryPath(); - ignition::common::TempDirectory tmp(p, "temp_dir", "ignition", true); + auto p = gz::common::tempDirectoryPath(); + gz::common::TempDirectory tmp(p, "temp_dir", "ignition", true); EXPECT_TRUE(tmp.Valid()); EXPECT_TRUE(tmp.DoCleanup()); - EXPECT_NE(curDir, ignition::common::cwd()); + EXPECT_NE(curDir, gz::common::cwd()); path = tmp.Path(); EXPECT_FALSE(path.empty()); - EXPECT_TRUE(ignition::common::exists(path)); - EXPECT_EQ(path, ignition::common::cwd()); + EXPECT_TRUE(gz::common::exists(path)); + EXPECT_EQ(path, gz::common::cwd()); } // Current directory changed back to previous - EXPECT_EQ(curDir, ignition::common::cwd()); - EXPECT_FALSE(ignition::common::exists(path)); + EXPECT_EQ(curDir, gz::common::cwd()); + EXPECT_FALSE(gz::common::exists(path)); } ///////////////////////////////////////////////// TEST(TempDirectory, TempDirectoryEmptyRoot) { std::string path; - auto curDir = ignition::common::cwd(); + auto curDir = gz::common::cwd(); { - ignition::common::TempDirectory tmp("", "temp_dir", "ignition", true); + gz::common::TempDirectory tmp("", "temp_dir", "ignition", true); EXPECT_FALSE(tmp.Valid()); EXPECT_TRUE(tmp.DoCleanup()); // Since not successfully created, no update - EXPECT_EQ(curDir, ignition::common::cwd()); + EXPECT_EQ(curDir, gz::common::cwd()); path = tmp.Path(); EXPECT_TRUE(path.empty()); - EXPECT_FALSE(ignition::common::exists(path)); + EXPECT_FALSE(gz::common::exists(path)); } - EXPECT_EQ(curDir, ignition::common::cwd()); - EXPECT_FALSE(ignition::common::exists(path)); + EXPECT_EQ(curDir, gz::common::cwd()); + EXPECT_FALSE(gz::common::exists(path)); } ///////////////////////////////////////////////// TEST(TempDirectory, TempDirectoryNoClean) { std::string path; - auto curDir = ignition::common::cwd(); + auto curDir = gz::common::cwd(); { - ignition::common::TempDirectory tmp("temp_dir", "ignition", false); + gz::common::TempDirectory tmp("temp_dir", "ignition", false); EXPECT_TRUE(tmp.Valid()); EXPECT_FALSE(tmp.DoCleanup()); - EXPECT_NE(curDir, ignition::common::cwd()); + EXPECT_NE(curDir, gz::common::cwd()); path = tmp.Path(); EXPECT_FALSE(path.empty()); - EXPECT_TRUE(ignition::common::exists(path)); - EXPECT_EQ(path, ignition::common::cwd()); + EXPECT_TRUE(gz::common::exists(path)); + EXPECT_EQ(path, gz::common::cwd()); } // Current directory always changes back, regardless of doClean - EXPECT_EQ(curDir, ignition::common::cwd()); - EXPECT_TRUE(ignition::common::exists(path)); - EXPECT_TRUE(ignition::common::removeDirectory(path)); + EXPECT_EQ(curDir, gz::common::cwd()); + EXPECT_TRUE(gz::common::exists(path)); + EXPECT_TRUE(gz::common::removeDirectory(path)); } ///////////////////////////////////////////////// TEST(TempDirectory, TempDirectoryNoCleanLater) { std::string path; - auto curDir = ignition::common::cwd(); + auto curDir = gz::common::cwd(); { - ignition::common::TempDirectory tmp("temp_dir", "ignition", true); + gz::common::TempDirectory tmp("temp_dir", "ignition", true); EXPECT_TRUE(tmp.Valid()); EXPECT_TRUE(tmp.DoCleanup()); - EXPECT_NE(curDir, ignition::common::cwd()); + EXPECT_NE(curDir, gz::common::cwd()); path = tmp.Path(); EXPECT_FALSE(path.empty()); - EXPECT_TRUE(ignition::common::exists(path)); - EXPECT_EQ(path, ignition::common::cwd()); + EXPECT_TRUE(gz::common::exists(path)); + EXPECT_EQ(path, gz::common::cwd()); tmp.DoCleanup(false); EXPECT_FALSE(tmp.DoCleanup()); } // Current directory always changes back, regardless of doClean - EXPECT_EQ(curDir, ignition::common::cwd()); - EXPECT_TRUE(ignition::common::exists(path)); - EXPECT_TRUE(ignition::common::removeDirectory(path)); + EXPECT_EQ(curDir, gz::common::cwd()); + EXPECT_TRUE(gz::common::exists(path)); + EXPECT_TRUE(gz::common::removeDirectory(path)); } diff --git a/src/Timer.cc b/src/Timer.cc index 69588f2ff..8eb52116d 100644 --- a/src/Timer.cc +++ b/src/Timer.cc @@ -21,7 +21,7 @@ using namespace gz; using namespace common; /// \brief Private data for the Timer class -class ignition::common::Timer::Implementation +class gz::common::Timer::Implementation { /// \brief The time of the last call to Start public: std::chrono::steady_clock::time_point start; @@ -35,7 +35,7 @@ class ignition::common::Timer::Implementation ////////////////////////////////////////////////// Timer::Timer() - : dataPtr(ignition::utils::MakeImpl()) + : dataPtr(gz::utils::MakeImpl()) { } diff --git a/src/Timer_TEST.cc b/src/Timer_TEST.cc index 651ae8e5d..f574f1243 100644 --- a/src/Timer_TEST.cc +++ b/src/Timer_TEST.cc @@ -25,7 +25,7 @@ ///////////////////////////////////////////////// TEST(Timer_TEST, Sequence) { - ignition::common::Timer t; + gz::common::Timer t; EXPECT_FALSE(t.Running()); EXPECT_DOUBLE_EQ(0.0, t.ElapsedTime().count()); @@ -47,7 +47,7 @@ TEST(Timer_TEST, Sequence) ///////////////////////////////////////////////// TEST(Timer_TEST, Elapsed) { - ignition::common::Timer t; + gz::common::Timer t; t.Start(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); t.Stop(); @@ -60,11 +60,11 @@ TEST(Timer_TEST, Elapsed) ///////////////////////////////////////////////// TEST(Timer_TEST, Copy) { - ignition::common::Timer t1; + gz::common::Timer t1; t1.Start(); EXPECT_TRUE(t1.Running()); - ignition::common::Timer t2 = t1; + gz::common::Timer t2 = t1; EXPECT_TRUE(t2.Running()); // Stop the original diff --git a/src/URI.cc b/src/URI.cc index 66f9391b4..c27050086 100644 --- a/src/URI.cc +++ b/src/URI.cc @@ -32,7 +32,7 @@ static const char kSchemeDelim[] = ":"; static const char kAuthDelim[] = "//"; /// \brief URIAuthority private data. -class ignition::common::URIAuthority::Implementation +class gz::common::URIAuthority::Implementation { /// \brief The user information. public: std::string userInfo; @@ -52,7 +52,7 @@ class ignition::common::URIAuthority::Implementation }; /// \brief URIPath private data. -class ignition::common::URIPath::Implementation +class gz::common::URIPath::Implementation { /// \brief A helper method to determine if the given string represents /// an absolute path starting segment or not. @@ -73,21 +73,21 @@ class ignition::common::URIPath::Implementation }; /// \brief URIQuery private data. -class ignition::common::URIQuery::Implementation +class gz::common::URIQuery::Implementation { /// \brief The key/value tuples that compose the query. public: std::vector> values; }; /// \brief URIFragment private data. -class ignition::common::URIFragment::Implementation +class gz::common::URIFragment::Implementation { /// \brief The value of the fragment. public: std::string value; }; /// \brief URI private data. -class ignition::common::URI::Implementation +class gz::common::URI::Implementation { /// \brief The URI scheme. public: std::string scheme; @@ -107,7 +107,7 @@ class ignition::common::URI::Implementation ////////////////////////////////////////////////// URIAuthority::URIAuthority() -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { } @@ -362,7 +362,7 @@ bool URIAuthority::Parse(const std::string &_str, bool _emptyHostValid) ///////////////////////////////////////////////// URIPath::URIPath() -: dataPtr(ignition::utils::MakeImpl()) +: dataPtr(gz::utils::MakeImpl()) { } @@ -629,7 +629,7 @@ bool URIPath::Parse(const std::string &_str) ///////////////////////////////////////////////// URIQuery::URIQuery() - : dataPtr(ignition::utils::MakeImpl()) + : dataPtr(gz::utils::MakeImpl()) { } @@ -745,7 +745,7 @@ bool URIQuery::Parse(const std::string &_str) ///////////////////////////////////////////////// URIFragment::URIFragment() - : dataPtr(ignition::utils::MakeImpl()) + : dataPtr(gz::utils::MakeImpl()) { } @@ -843,7 +843,7 @@ bool URIFragment::Parse(const std::string &_str) ///////////////////////////////////////////////// URI::URI() - : dataPtr(ignition::utils::MakeImpl()) + : dataPtr(gz::utils::MakeImpl()) { } diff --git a/src/URI_TEST.cc b/src/URI_TEST.cc index 5aa00d915..717ee356f 100644 --- a/src/URI_TEST.cc +++ b/src/URI_TEST.cc @@ -866,7 +866,7 @@ TEST(URITEST, File) TEST(URITEST, WinPath) { // Windows path requires authority - const auto uri = ignition::common::URI("file://D:/my/test/dir/world.sdf", + const auto uri = gz::common::URI("file://D:/my/test/dir/world.sdf", true); ASSERT_TRUE(uri.Authority()); EXPECT_EQ("file", uri.Scheme()); diff --git a/src/Util.cc b/src/Util.cc index b713b20a6..e5eac82ca 100644 --- a/src/Util.cc +++ b/src/Util.cc @@ -62,10 +62,10 @@ /// /// This uses the NeverDestroyed pattern to prevent static initialization and /// destruction order fiasco issues. -ignition::common::SystemPaths& GetSystemPaths() +gz::common::SystemPaths& GetSystemPaths() { static - ignition::utils::NeverDestroyed paths; + gz::utils::NeverDestroyed paths; return paths.Access(); } @@ -249,13 +249,13 @@ bool Sha1::Digest(void const *_buffer, std::size_t _byteCount, } ///////////////////////////////////////////////// -std::string ignition::common::systemTimeISO() +std::string gz::common::systemTimeISO() { return timeToIso(IGN_SYSTEM_TIME()); } ///////////////////////////////////////////////// -std::string ignition::common::systemTimeIso() +std::string gz::common::systemTimeIso() { return timeToIso(IGN_SYSTEM_TIME()); } @@ -277,7 +277,7 @@ static bool PortableLocaltime(time_t seconds, struct tm* out) { } ///////////////////////////////////////////////// -std::string ignition::common::timeToIso( +std::string gz::common::timeToIso( const std::chrono::time_point &_time) { char isoStr[25]; @@ -295,32 +295,32 @@ std::string ignition::common::timeToIso( } ///////////////////////////////////////////////// -std::string ignition::common::logPath() +std::string gz::common::logPath() { return GetSystemPaths().LogPath(); } ///////////////////////////////////////////////// -void ignition::common::addSearchPathSuffix(const std::string &_suffix) +void gz::common::addSearchPathSuffix(const std::string &_suffix) { GetSystemPaths().AddSearchPathSuffix(_suffix); } ///////////////////////////////////////////////// -std::string ignition::common::findFile(const std::string &_file) +std::string gz::common::findFile(const std::string &_file) { return GetSystemPaths().FindFile(_file, true); } ///////////////////////////////////////////////// -std::string ignition::common::findFile(const std::string &_file, +std::string gz::common::findFile(const std::string &_file, const bool _searchLocalPath) { return GetSystemPaths().FindFile(_file, _searchLocalPath); } ///////////////////////////////////////////////// -std::string ignition::common::findFilePath(const std::string &_file) +std::string gz::common::findFilePath(const std::string &_file) { std::string filepath = findFile(_file); @@ -336,26 +336,26 @@ std::string ignition::common::findFilePath(const std::string &_file) } ///////////////////////////////////////////////// -void ignition::common::addFindFileURICallback( - std::function _cb) +void gz::common::addFindFileURICallback( + std::function _cb) { GetSystemPaths().AddFindFileURICallback(_cb); } ///////////////////////////////////////////////// -ignition::common::SystemPaths *ignition::common::systemPaths() +gz::common::SystemPaths *gz::common::systemPaths() { return &GetSystemPaths(); } ///////////////////////////////////////////////// -bool ignition::common::env(const std::string &_name, std::string &_value) +bool gz::common::env(const std::string &_name, std::string &_value) { return env(_name, _value, false); } ///////////////////////////////////////////////// -bool ignition::common::env(const std::string &_name, +bool gz::common::env(const std::string &_name, std::string &_value, bool _allowEmpty) { @@ -402,7 +402,7 @@ bool ignition::common::env(const std::string &_name, } ///////////////////////////////////////////////// -bool ignition::common::setenv(const std::string &_name, +bool gz::common::setenv(const std::string &_name, const std::string &_value) { #ifdef _WIN32 @@ -425,7 +425,7 @@ bool ignition::common::setenv(const std::string &_name, return true; } ///////////////////////////////////////////////// -bool ignition::common::unsetenv(const std::string &_name) +bool gz::common::unsetenv(const std::string &_name) { #ifdef _WIN32 if (0 != _putenv_s(_name.c_str(), "")) @@ -448,7 +448,7 @@ bool ignition::common::unsetenv(const std::string &_name) } ///////////////////////////////////////////////// -std::string ignition::common::sha1(void const *_buffer, std::size_t _byteCount) +std::string gz::common::sha1(void const *_buffer, std::size_t _byteCount) { Sha1 sha1; std::stringstream stream; @@ -464,14 +464,14 @@ std::string ignition::common::sha1(void const *_buffer, std::size_t _byteCount) } ///////////////////////////////////////////////// -std::string ignition::common::uuid() +std::string gz::common::uuid() { - ignition::common::Uuid uuid; + gz::common::Uuid uuid; return uuid.String(); } ///////////////////////////////////////////////// -std::vector ignition::common::split(const std::string &_str, +std::vector gz::common::split(const std::string &_str, const std::string &_delim) { std::vector tokens; @@ -491,14 +491,14 @@ std::vector ignition::common::split(const std::string &_str, } ///////////////////////////////////////////////// -void ignition::common::ltrim(std::string &_s) +void gz::common::ltrim(std::string &_s) { _s.erase(_s.begin(), std::find_if(_s.begin(), _s.end(), [](int c) {return !std::isspace(c);})); } ///////////////////////////////////////////////// -void ignition::common::rtrim(std::string &_s) +void gz::common::rtrim(std::string &_s) { _s.erase(std::find_if(_s.rbegin(), _s.rend(), [](int c) {return !std::isspace(c);}).base(), @@ -506,35 +506,35 @@ void ignition::common::rtrim(std::string &_s) } ///////////////////////////////////////////////// -void ignition::common::trim(std::string &_s) +void gz::common::trim(std::string &_s) { - ignition::common::ltrim(_s); - ignition::common::rtrim(_s); + gz::common::ltrim(_s); + gz::common::rtrim(_s); } ///////////////////////////////////////////////// -std::string ignition::common::ltrimmed(std::string _s) +std::string gz::common::ltrimmed(std::string _s) { - ignition::common::ltrim(_s); + gz::common::ltrim(_s); return _s; } ///////////////////////////////////////////////// -std::string ignition::common::rtrimmed(std::string _s) +std::string gz::common::rtrimmed(std::string _s) { - ignition::common::rtrim(_s); + gz::common::rtrim(_s); return _s; } ///////////////////////////////////////////////// -std::string ignition::common::trimmed(std::string _s) +std::string gz::common::trimmed(std::string _s) { - ignition::common::trim(_s); + gz::common::trim(_s); return _s; } ///////////////////////////////////////////////// -std::string ignition::common::lowercase(const std::string &_in) +std::string gz::common::lowercase(const std::string &_in) { std::string out = _in; for (size_t i = 0; i < out.size(); ++i) @@ -543,14 +543,14 @@ std::string ignition::common::lowercase(const std::string &_in) } ///////////////////////////////////////////////// -std::string ignition::common::lowercase(const char *_in) +std::string gz::common::lowercase(const char *_in) { std::string ins = _in; return lowercase(ins); } ///////////////////////////////////////////////// -void ignition::common::replaceAll(std::string &_result, +void gz::common::replaceAll(std::string &_result, const std::string &_orig, const std::string &_key, const std::string &_replacement) @@ -565,7 +565,7 @@ void ignition::common::replaceAll(std::string &_result, } ///////////////////////////////////////////////// -std::string ignition::common::replaceAll(const std::string &_orig, +std::string gz::common::replaceAll(const std::string &_orig, const std::string &_key, const std::string &_replacement) { diff --git a/src/Util_TEST.cc b/src/Util_TEST.cc index 5171893c7..853bb276e 100644 --- a/src/Util_TEST.cc +++ b/src/Util_TEST.cc @@ -278,13 +278,13 @@ TEST(Util_TEST, envSetEmpty) ///////////////////////////////////////////////// TEST(Util_TEST, findFile) { - EXPECT_EQ("", ignition::common::findFile("no_such_file")); + EXPECT_EQ("", gz::common::findFile("no_such_file")); // Create file to find - auto dir1 = ignition::common::absPath("test_dir1"); - ignition::common::createDirectories(dir1); - auto file1 = ignition::common::absPath( - ignition::common::joinPaths(dir1, "test_f1")); + auto dir1 = gz::common::absPath("test_dir1"); + gz::common::createDirectories(dir1); + auto file1 = gz::common::absPath( + gz::common::joinPaths(dir1, "test_f1")); std::ofstream fout; fout.open(file1, std::ofstream::out); @@ -292,13 +292,13 @@ TEST(Util_TEST, findFile) fout.close(); // Relative path - auto systemPaths = ignition::common::systemPaths(); + auto systemPaths = gz::common::systemPaths(); ASSERT_NE(nullptr, systemPaths); EXPECT_EQ(file1, systemPaths->FindFile(common::joinPaths("test_dir1", "test_f1"), true)); // Relative prefixed by file: - EXPECT_EQ(file1, ignition::common::findFile("file:test_dir1/test_f1")); + EXPECT_EQ(file1, gz::common::findFile("file:test_dir1/test_f1")); // Custom callback #ifndef _WIN32 @@ -306,11 +306,11 @@ TEST(Util_TEST, findFile) #else const auto tmpDir = "C:\\Windows"; #endif - auto fileCb = [&tmpDir](const ignition::common::URI &) + auto fileCb = [&tmpDir](const gz::common::URI &) { return tmpDir; }; - ignition::common::addFindFileURICallback(fileCb); - EXPECT_EQ(tmpDir, ignition::common::findFile("model://banana")); + gz::common::addFindFileURICallback(fileCb); + EXPECT_EQ(tmpDir, gz::common::findFile("model://banana")); } diff --git a/src/WorkerPool.cc b/src/WorkerPool.cc index 2e1f4ec07..26c51df1e 100644 --- a/src/WorkerPool.cc +++ b/src/WorkerPool.cc @@ -23,7 +23,7 @@ #include "ignition/common/WorkerPool.hh" -namespace igncmn = ignition::common; +namespace igncmn = gz::common; using namespace igncmn; namespace gz @@ -124,7 +124,7 @@ void WorkerPool::Implementation::Worker() ////////////////////////////////////////////////// WorkerPool::WorkerPool(const unsigned int _minThreadCount) - : dataPtr(ignition::utils::MakeUniqueImpl()) + : dataPtr(gz::utils::MakeUniqueImpl()) { unsigned int numWorkers = std::max(std::thread::hardware_concurrency(), std::max(_minThreadCount, 1u)); diff --git a/src/WorkerPool_TEST.cc b/src/WorkerPool_TEST.cc index 7d2f8252a..5a7a0ed24 100644 --- a/src/WorkerPool_TEST.cc +++ b/src/WorkerPool_TEST.cc @@ -23,7 +23,7 @@ #include "ignition/common/WorkerPool.hh" #include "ignition/utils/ExtraTestMacros.hh" -namespace igncmn = ignition::common; +namespace igncmn = gz::common; using namespace igncmn; ////////////////////////////////////////////////// diff --git a/test/integration/console.cc b/test/integration/console.cc index e3f7c2313..2f920beb5 100644 --- a/test/integration/console.cc +++ b/test/integration/console.cc @@ -24,23 +24,23 @@ TEST(Console_TEST, LogInitAfterConsoleOut) { std::string logFilename = "uri.log"; - auto tempDir = ignition::common::testing::MakeTestTempDirectory(); + auto tempDir = gz::common::testing::MakeTestTempDirectory(); ASSERT_TRUE(tempDir->Valid()); - ignition::common::setenv(IGN_HOMEDIR, tempDir->Path()); + gz::common::setenv(IGN_HOMEDIR, tempDir->Path()); std::string home; - ASSERT_TRUE(ignition::common::env(IGN_HOMEDIR, home)); + ASSERT_TRUE(gz::common::env(IGN_HOMEDIR, home)); auto logDir = tempDir->Path(); - std::string logFile = ignition::common::joinPaths(logDir, logFilename); + std::string logFile = gz::common::joinPaths(logDir, logFilename); - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); // Before console is initialized, logs go to default file location ignerr << "Error before logging initialized" << std::endl; { - auto defaultPath = ignition::common::joinPaths(home, + auto defaultPath = gz::common::joinPaths(home, ".ignition", "auto_default.log"); std::ifstream t(defaultPath); diff --git a/test/integration/mesh.cc b/test/integration/mesh.cc index a0f2f7118..84e2e8fa3 100644 --- a/test/integration/mesh.cc +++ b/test/integration/mesh.cc @@ -151,11 +151,11 @@ TEST_F(MeshTest, Access) EXPECT_EQ(24u, mesh->TexCoordCount()); EXPECT_EQ(0u, mesh->MaterialCount()); - ignition::math::Vector3d center, min, max; + gz::math::Vector3d center, min, max; mesh->AABB(center, min, max); - EXPECT_TRUE(center == ignition::math::Vector3d(0, 0, 0)); - EXPECT_TRUE(min == ignition::math::Vector3d(-.5, -.5, -.5)); - EXPECT_TRUE(max == ignition::math::Vector3d(.5, .5, .5)); + EXPECT_TRUE(center == gz::math::Vector3d(0, 0, 0)); + EXPECT_TRUE(min == gz::math::Vector3d(-.5, -.5, -.5)); + EXPECT_TRUE(max == gz::math::Vector3d(.5, .5, .5)); double *vertArray = nullptr; int *indArray = nullptr; @@ -224,9 +224,9 @@ TEST_F(MeshTest, RoundtripStl) math::Vector3d center, min, max; mesh->AABB(center, min, max); - EXPECT_TRUE(center == ignition::math::Vector3d(0.5, 0.5, 0.5)); - EXPECT_TRUE(min == ignition::math::Vector3d(0, 0, 0)); - EXPECT_TRUE(max == ignition::math::Vector3d(1, 1, 1)); + EXPECT_TRUE(center == gz::math::Vector3d(0.5, 0.5, 0.5)); + EXPECT_TRUE(min == gz::math::Vector3d(0, 0, 0)); + EXPECT_TRUE(max == gz::math::Vector3d(1, 1, 1)); } ///////////////////////////////////////////////// diff --git a/test/integration/plugin.cc b/test/integration/plugin.cc index a8ee39e5d..230eef525 100644 --- a/test/integration/plugin.cc +++ b/test/integration/plugin.cc @@ -39,9 +39,9 @@ TEST(PluginLoader, LoadBadPlugins) { std::string dummyPath = - ignition::common::copyFromUnixPath(IGN_DUMMY_PLUGIN_PATH); + gz::common::copyFromUnixPath(IGN_DUMMY_PLUGIN_PATH); - ignition::common::SystemPaths sp; + gz::common::SystemPaths sp; sp.AddPluginPaths(dummyPath); std::vector libraryNames = { @@ -54,10 +54,10 @@ TEST(PluginLoader, LoadBadPlugins) std::string path = sp.FindSharedLibrary(libraryName); ASSERT_FALSE(path.empty()); - ignition::common::PluginLoader pl; + gz::common::PluginLoader pl; // Make sure the expected plugins were loaded. - ignition::common::Console::SetVerbosity(2); + gz::common::Console::SetVerbosity(2); std::unordered_set pluginNames = pl.LoadLibrary(path); EXPECT_TRUE(pluginNames.empty()); } @@ -67,15 +67,15 @@ TEST(PluginLoader, LoadBadPlugins) TEST(PluginLoader, LoadExistingLibrary) { std::string dummyPath = - ignition::common::copyFromUnixPath(IGN_DUMMY_PLUGIN_PATH); + gz::common::copyFromUnixPath(IGN_DUMMY_PLUGIN_PATH); - ignition::common::SystemPaths sp; + gz::common::SystemPaths sp; sp.AddPluginPaths(dummyPath); std::string path = sp.FindSharedLibrary("IGNDummyPlugins"); ASSERT_FALSE(path.empty()); - ignition::common::PluginLoader pl; + gz::common::PluginLoader pl; // Make sure the expected plugins were loaded. std::unordered_set pluginNames = pl.LoadLibrary(path); @@ -92,7 +92,7 @@ TEST(PluginLoader, LoadExistingLibrary) EXPECT_EQ(1u, pl.PluginsImplementing("::test::util::DummyDoubleBase").size()); - ignition::common::PluginPtr firstPlugin = + gz::common::PluginPtr firstPlugin = pl.Instantiate("test::util::DummySinglePlugin"); EXPECT_FALSE(firstPlugin.IsEmpty()); EXPECT_TRUE(firstPlugin->HasInterface("test::util::DummyNameBase")); @@ -100,7 +100,7 @@ TEST(PluginLoader, LoadExistingLibrary) EXPECT_FALSE(firstPlugin->HasInterface("test::util::DummyIntBase")); EXPECT_FALSE(firstPlugin->HasInterface("test::util::DummySetterBase")); - ignition::common::PluginPtr secondPlugin = + gz::common::PluginPtr secondPlugin = pl.Instantiate("test::util::DummyMultiPlugin"); EXPECT_FALSE(secondPlugin.IsEmpty()); EXPECT_TRUE(secondPlugin->HasInterface("test::util::DummyNameBase")); @@ -155,19 +155,19 @@ class SomeInterface }; using SomeSpecializedPluginPtr = - ignition::common::SpecializedPluginPtr< + gz::common::SpecializedPluginPtr< SomeInterface, test::util::DummyIntBase, test::util::DummySetterBase>; TEST(SpecializedPluginPtr, Construction) { - ignition::common::SystemPaths sp; + gz::common::SystemPaths sp; sp.AddPluginPaths(IGN_DUMMY_PLUGIN_PATH); std::string path = sp.FindSharedLibrary("IGNDummyPlugins"); ASSERT_FALSE(path.empty()); - ignition::common::PluginLoader pl; + gz::common::PluginLoader pl; pl.LoadLibrary(path); SomeSpecializedPluginPtr plugin( @@ -222,8 +222,8 @@ TEST(SpecializedPluginPtr, Construction) template void TestSetAndMapUsage( - const ignition::common::PluginLoader &loader, - const ignition::common::PluginPtr &plugin) + const gz::common::PluginLoader &loader, + const gz::common::PluginPtr &plugin) { PluginPtrType1 plugin1 = plugin; PluginPtrType2 plugin2 = plugin1; @@ -236,22 +236,22 @@ void TestSetAndMapUsage( EXPECT_TRUE(plugin2 == plugin1); EXPECT_FALSE(plugin2 != plugin1); - std::set orderedSet; + std::set orderedSet; EXPECT_TRUE(orderedSet.insert(plugin1).second); EXPECT_FALSE(orderedSet.insert(plugin1).second); EXPECT_FALSE(orderedSet.insert(plugin2).second); - std::unordered_set unorderedSet; + std::unordered_set unorderedSet; EXPECT_TRUE(unorderedSet.insert(plugin1).second); EXPECT_FALSE(unorderedSet.insert(plugin1).second); EXPECT_FALSE(unorderedSet.insert(plugin2).second); - std::map orderedMap; + std::map orderedMap; EXPECT_TRUE(orderedMap.insert(std::make_pair(plugin1, "some string")).second); EXPECT_FALSE(orderedMap.insert(std::make_pair(plugin1, "a string")).second); EXPECT_FALSE(orderedMap.insert(std::make_pair(plugin2, "chars")).second); - std::unordered_map unorderedMap; + std::unordered_map unorderedMap; EXPECT_TRUE(unorderedMap.insert(std::make_pair(plugin1, "strings")).second); EXPECT_FALSE(unorderedMap.insert(std::make_pair(plugin1, "letters")).second); EXPECT_FALSE(unorderedMap.insert(std::make_pair(plugin2, "")).second); @@ -277,30 +277,30 @@ void TestSetAndMapUsage( } using SingleSpecializedPluginPtr = - ignition::common::SpecializedPluginPtr; + gz::common::SpecializedPluginPtr; using AnotherSpecializedPluginPtr = - ignition::common::SpecializedPluginPtr< + gz::common::SpecializedPluginPtr< SomeInterface, test::util::DummyIntBase>; TEST(PluginPtr, CopyMoveSemantics) { - ignition::common::PluginPtr plugin; + gz::common::PluginPtr plugin; EXPECT_TRUE(plugin.IsEmpty()); - ignition::common::SystemPaths sp; + gz::common::SystemPaths sp; sp.AddPluginPaths(IGN_DUMMY_PLUGIN_PATH); std::string path = sp.FindSharedLibrary("IGNDummyPlugins"); ASSERT_FALSE(path.empty()); - ignition::common::PluginLoader pl; + gz::common::PluginLoader pl; pl.LoadLibrary(path); plugin = pl.Instantiate("test::util::DummySinglePlugin"); EXPECT_FALSE(plugin.IsEmpty()); - ignition::common::PluginPtr otherPlugin = + gz::common::PluginPtr otherPlugin = pl.Instantiate("test::util::DummySinglePlugin"); EXPECT_FALSE(otherPlugin.IsEmpty()); @@ -313,14 +313,14 @@ TEST(PluginPtr, CopyMoveSemantics) igndbg << "Testing sets and maps with PluginPtr and PluginPtr\n"; TestSetAndMapUsage< - ignition::common::PluginPtr, - ignition::common::PluginPtr>( + gz::common::PluginPtr, + gz::common::PluginPtr>( pl, plugin); igndbg << "Testing sets and maps with PluginPtr and " << "SomeSpecializedPluginPtr\n"; TestSetAndMapUsage< - ignition::common::PluginPtr, + gz::common::PluginPtr, SomeSpecializedPluginPtr>( pl, plugin); @@ -338,7 +338,7 @@ TEST(PluginPtr, CopyMoveSemantics) SingleSpecializedPluginPtr>( pl, plugin); - ignition::common::ConstPluginPtr c_plugin(plugin); + gz::common::ConstPluginPtr c_plugin(plugin); EXPECT_FALSE(c_plugin.IsEmpty()); EXPECT_TRUE(c_plugin == plugin); @@ -369,17 +369,17 @@ void CheckSomeValues( TEST(PluginPtr, QueryInterfaceSharedPtr) { - ignition::common::SystemPaths sp; + gz::common::SystemPaths sp; sp.AddPluginPaths(IGN_DUMMY_PLUGIN_PATH); std::string path = sp.FindSharedLibrary("IGNDummyPlugins"); ASSERT_FALSE(path.empty()); - ignition::common::PluginLoader pl; + gz::common::PluginLoader pl; pl.LoadLibrary(path); // as_shared_pointer without specialization { - ignition::common::PluginPtr plugin = + gz::common::PluginPtr plugin = pl.Instantiate("test::util::DummyMultiPlugin"); std::shared_ptr int_ptr = diff --git a/test/performance/plugin_specialization.cc b/test/performance/plugin_specialization.cc index 9e33a7b87..94e79ec04 100644 --- a/test/performance/plugin_specialization.cc +++ b/test/performance/plugin_specialization.cc @@ -54,26 +54,26 @@ IGN_CREATE_SPEC_INTERFACE(Interface19) // Specialize for only 1 type using Specialize1Type = - ignition::common::SpecializedPluginPtr; + gz::common::SpecializedPluginPtr; // Specialize for 3 different types, and put the type we care about first in // the list. using Specialize3Types_Leading = - ignition::common::SpecializedPluginPtr< + gz::common::SpecializedPluginPtr< test::util::DummySetterBase, Interface1, Interface2>; // Specialize for 3 different types, and put the type we care about last in // the list. using Specialize3Types_Trailing = - ignition::common::SpecializedPluginPtr< + gz::common::SpecializedPluginPtr< Interface1, Interface2, test::util::DummySetterBase>; // Specialize for 10 different types, and put the type we care about first in // the list. using Specialize10Types_Leading = - ignition::common::SpecializedPluginPtr< + gz::common::SpecializedPluginPtr< test::util::DummySetterBase, Interface1, Interface2, Interface3, Interface4, Interface5, Interface6, Interface7, Interface8, Interface9>; @@ -81,7 +81,7 @@ using Specialize10Types_Leading = // Specialize for 10 different types, and put the type we care about last in // the list. using Specialize10Types_Trailing = - ignition::common::SpecializedPluginPtr< + gz::common::SpecializedPluginPtr< Interface1, Interface2, Interface3, Interface4, Interface5, Interface6, Interface7, Interface8, Interface9, test::util::DummySetterBase>; @@ -89,7 +89,7 @@ using Specialize10Types_Trailing = // Specialize for 20 different types, and put the type we care about first in // the list. using Specialize20Types_Leading = - ignition::common::SpecializedPluginPtr< + gz::common::SpecializedPluginPtr< test::util::DummySetterBase, Interface1, Interface2, Interface3, Interface4, Interface5, Interface6, Interface7, Interface8, Interface9, Interface10, @@ -99,7 +99,7 @@ using Specialize20Types_Leading = // Specialize for 20 different types, and put the type we care about last in // the list. using Specialize20Types_Trailing = - ignition::common::SpecializedPluginPtr< + gz::common::SpecializedPluginPtr< Interface1, Interface2, Interface3, Interface4, Interface5, Interface6, Interface7, Interface8, Interface9, Interface10, Interface11, Interface12, Interface13, Interface14, Interface15, @@ -129,16 +129,16 @@ double RunPerformanceTest(const PluginType &plugin) ///////////////////////////////////////////////// TEST(PluginSpecialization, AccessTime) { - ignition::common::SystemPaths sp; + gz::common::SystemPaths sp; sp.AddPluginPaths(IGN_DUMMY_PLUGIN_PATH); std::string path = sp.FindSharedLibrary("IGNDummyPlugins"); ASSERT_FALSE(path.empty()); - ignition::common::PluginLoader pl; + gz::common::PluginLoader pl; pl.LoadLibrary(path); // Load up the generic plugin - ignition::common::PluginPtr plugin = + gz::common::PluginPtr plugin = pl.Instantiate("::test::util::DummyMultiPlugin"); // Create specialized versions diff --git a/test/plugins/BadPluginAPIVersionNew.cc b/test/plugins/BadPluginAPIVersionNew.cc index 681feca0e..5a59422ed 100644 --- a/test/plugins/BadPluginAPIVersionNew.cc +++ b/test/plugins/BadPluginAPIVersionNew.cc @@ -20,10 +20,10 @@ extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = - sizeof(ignition::common::PluginInfo); + sizeof(gz::common::PluginInfo); std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoAlignment = - alignof(ignition::common::PluginInfo); + alignof(gz::common::PluginInfo); int DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginAPIVersion = std::numeric_limits::max(); diff --git a/test/plugins/BadPluginAPIVersionOld.cc b/test/plugins/BadPluginAPIVersionOld.cc index 342286789..687d72c8c 100644 --- a/test/plugins/BadPluginAPIVersionOld.cc +++ b/test/plugins/BadPluginAPIVersionOld.cc @@ -19,10 +19,10 @@ extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = - sizeof(ignition::common::PluginInfo); + sizeof(gz::common::PluginInfo); std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoAlignment = - alignof(ignition::common::PluginInfo); + alignof(gz::common::PluginInfo); int DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginAPIVersion = -1; } diff --git a/test/plugins/BadPluginAlign.cc b/test/plugins/BadPluginAlign.cc index 2d3607158..033c96ae5 100644 --- a/test/plugins/BadPluginAlign.cc +++ b/test/plugins/BadPluginAlign.cc @@ -19,13 +19,13 @@ extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = - sizeof(ignition::common::PluginInfo); + sizeof(gz::common::PluginInfo); std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoAlignment = - 1 + alignof(ignition::common::PluginInfo); + 1 + alignof(gz::common::PluginInfo); int DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginAPIVersion = - ignition::common::PLUGIN_API_VERSION; + gz::common::PLUGIN_API_VERSION; } extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( diff --git a/test/plugins/BadPluginSize.cc b/test/plugins/BadPluginSize.cc index 82e5deb54..d70fbc8a5 100644 --- a/test/plugins/BadPluginSize.cc +++ b/test/plugins/BadPluginSize.cc @@ -19,13 +19,13 @@ extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = - 1 + sizeof(ignition::common::PluginInfo); + 1 + sizeof(gz::common::PluginInfo); std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoAlignment = - alignof(ignition::common::PluginInfo); + alignof(gz::common::PluginInfo); int DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginAPIVersion = - ignition::common::PLUGIN_API_VERSION; + gz::common::PLUGIN_API_VERSION; } extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( diff --git a/test/static_assertions/plugin_bad_const_assignment.cc b/test/static_assertions/plugin_bad_const_assignment.cc index ddab315db..e9408178a 100644 --- a/test/static_assertions/plugin_bad_const_assignment.cc +++ b/test/static_assertions/plugin_bad_const_assignment.cc @@ -19,7 +19,7 @@ int main() { - ignition::common::ConstPluginPtr const_ptr; - ignition::common::PluginPtr ptr; + gz::common::ConstPluginPtr const_ptr; + gz::common::PluginPtr ptr; ptr = const_ptr; } diff --git a/test/static_assertions/plugin_bad_const_construct.cc b/test/static_assertions/plugin_bad_const_construct.cc index 2d7375234..0e89f926d 100644 --- a/test/static_assertions/plugin_bad_const_construct.cc +++ b/test/static_assertions/plugin_bad_const_construct.cc @@ -19,5 +19,5 @@ int main() { - ignition::common::PluginPtr ptr{ignition::common::ConstPluginPtr()}; + gz::common::PluginPtr ptr{gz::common::ConstPluginPtr()}; } diff --git a/testing/include/gz/common/testing/TestPaths.hh b/testing/include/gz/common/testing/TestPaths.hh index 5a4bd77fe..10d643fbe 100644 --- a/testing/include/gz/common/testing/TestPaths.hh +++ b/testing/include/gz/common/testing/TestPaths.hh @@ -98,7 +98,7 @@ class TestPaths /// \param[in] _cleanup True to indicate that the filesystem should /// be cleaned as part of the destructor /// \return Shared pointer to TempDirectory -std::shared_ptr +std::shared_ptr IGNITION_COMMON_TESTING_VISIBLE MakeTestTempDirectoryImpl(const std::string &_projectSourcePath, const std::string &_prefix = "test", @@ -117,7 +117,7 @@ MakeTestTempDirectoryImpl(const std::string &_projectSourcePath, /// \param[in] _cleanup True to indicate that the filesystem should /// be cleaned as part of the destructor /// \return Shared pointer to TempDirectory -inline std::shared_ptr +inline std::shared_ptr MakeTestTempDirectory(const std::string &_prefix = "test", const std::string &_subDir = "ignition", bool _cleanup = true) diff --git a/testing/include/gz/common/testing/detail/AutoLogFixture.hh b/testing/include/gz/common/testing/detail/AutoLogFixture.hh index 9e9a9ce0b..7bf22b73f 100644 --- a/testing/include/gz/common/testing/detail/AutoLogFixture.hh +++ b/testing/include/gz/common/testing/detail/AutoLogFixture.hh @@ -49,7 +49,7 @@ class AutoLogFixture::Implementation ////////////////////////////////////////////////// AutoLogFixture::AutoLogFixture(): - dataPtr(ignition::utils::MakeUniqueImpl()) + dataPtr(gz::utils::MakeUniqueImpl()) { } @@ -57,7 +57,7 @@ AutoLogFixture::AutoLogFixture(): AutoLogFixture::~AutoLogFixture() { ignLogClose(); - EXPECT_TRUE(ignition::common::unsetenv(IGN_HOMEDIR)); + EXPECT_TRUE(gz::common::unsetenv(IGN_HOMEDIR)); } ////////////////////////////////////////////////// @@ -90,15 +90,15 @@ void AutoLogFixture::SetUp() // Read the full path to the log directory. this->dataPtr->logDirectory = ignLogDirectory(); ASSERT_FALSE(this->dataPtr->logDirectory.empty()); - ASSERT_TRUE(ignition::common::exists(this->dataPtr->logDirectory)); + ASSERT_TRUE(gz::common::exists(this->dataPtr->logDirectory)); - ignition::common::Console::SetVerbosity(4); + gz::common::Console::SetVerbosity(4); } ////////////////////////////////////////////////// std::string AutoLogFixture::FullLogPath() const { - return ignition::common::joinPaths( + return gz::common::joinPaths( this->dataPtr->logDirectory, this->dataPtr->logFilename); } diff --git a/testing/src/BazelTestPaths.cc b/testing/src/BazelTestPaths.cc index e2fa85115..07d23dea7 100644 --- a/testing/src/BazelTestPaths.cc +++ b/testing/src/BazelTestPaths.cc @@ -34,7 +34,7 @@ bool BazelTestPaths::ProjectSourcePath(std::string &_sourceDir) if (common::env("TEST_SRCDIR", test_srcdir) && common::env("IGN_BAZEL_PATH", bazel_path)) { - _sourceDir = ignition::common::joinPaths(test_srcdir, + _sourceDir = gz::common::joinPaths(test_srcdir, "ignition", bazel_path); return true; diff --git a/testing/src/BazelTestPaths_TEST.cc b/testing/src/BazelTestPaths_TEST.cc index 7474b0286..a4b1c6e03 100644 --- a/testing/src/BazelTestPaths_TEST.cc +++ b/testing/src/BazelTestPaths_TEST.cc @@ -25,7 +25,7 @@ using namespace gz::common; ///////////////////////////////////////////////// TEST(BazelTestPaths, ProjectSourcePath) { - ignition::common::testing::BazelTestPaths testPaths; + gz::common::testing::BazelTestPaths testPaths; std::string sourceDir; ASSERT_TRUE(testPaths.ProjectSourcePath(sourceDir)); @@ -45,7 +45,7 @@ TEST(BazelTestPaths, ProjectSourcePath) ///////////////////////////////////////////////// TEST(BazelTestPaths, TestTmpPath) { - ignition::common::testing::BazelTestPaths testPaths; + gz::common::testing::BazelTestPaths testPaths; std::string tmpDir; ASSERT_TRUE(testPaths.TestTmpPath(tmpDir)); @@ -57,13 +57,13 @@ TEST(BazelTestPaths, TestTmpPath) ///////////////////////////////////////////////// TEST(BazelTestPaths, TestBuildType) { - using BuildType = ignition::common::testing::BuildType; - ASSERT_EQ(BuildType::kBazel, ignition::common::testing::TestBuildType()); + using BuildType = gz::common::testing::BuildType; + ASSERT_EQ(BuildType::kBazel, gz::common::testing::TestBuildType()); } ///////////////////////////////////////////////// TEST(BazelTestPaths, TestPathFactory) { - auto testPaths = ignition::common::testing::TestPathFactory(); + auto testPaths = gz::common::testing::TestPathFactory(); ASSERT_NE(nullptr, testPaths); } diff --git a/testing/src/CMakeTestPaths.cc b/testing/src/CMakeTestPaths.cc index c15956858..06ec1e50d 100644 --- a/testing/src/CMakeTestPaths.cc +++ b/testing/src/CMakeTestPaths.cc @@ -39,7 +39,7 @@ bool CMakeTestPaths::ProjectSourcePath(std::string &_sourceDir) ////////////////////////////////////////////////// bool CMakeTestPaths::TestTmpPath(std::string &_tmpDir) { - _tmpDir = ignition::common::tempDirectoryPath(); + _tmpDir = gz::common::tempDirectoryPath(); return true; } diff --git a/testing/src/CMakeTestPaths_TEST.cc b/testing/src/CMakeTestPaths_TEST.cc index c478a02d3..d523b005c 100644 --- a/testing/src/CMakeTestPaths_TEST.cc +++ b/testing/src/CMakeTestPaths_TEST.cc @@ -40,13 +40,13 @@ TEST(TestPaths, ProjectSourcePathUnset) ///////////////////////////////////////////////// TEST(CMakeTestPaths, TestingProjectSourceDir) { - ASSERT_NE(0u, strlen(ignition::common::testing::kTestingProjectSourceDir)); + ASSERT_NE(0u, strlen(gz::common::testing::kTestingProjectSourceDir)); } ///////////////////////////////////////////////// TEST(CMakeTestPaths, ProjectSourcePathUnset) { - ignition::common::testing::CMakeTestPaths testPaths(kFakeTestPaths); + gz::common::testing::CMakeTestPaths testPaths(kFakeTestPaths); std::string sourceDir; EXPECT_FALSE(testPaths.ProjectSourcePath(sourceDir)); EXPECT_TRUE(sourceDir.empty()); @@ -55,13 +55,13 @@ TEST(CMakeTestPaths, ProjectSourcePathUnset) ///////////////////////////////////////////////// TEST(CMakeTestPaths, TestBuildType) { - ASSERT_EQ(BuildType::kCMake, ignition::common::testing::TestBuildType()); + ASSERT_EQ(BuildType::kCMake, gz::common::testing::TestBuildType()); } ///////////////////////////////////////////////// TEST(CMakeTestPaths, ProjectSourcePath) { - ignition::common::testing::CMakeTestPaths testPaths; + gz::common::testing::CMakeTestPaths testPaths; std::string sourceDir; ASSERT_TRUE(testPaths.ProjectSourcePath(sourceDir)); @@ -81,7 +81,7 @@ TEST(CMakeTestPaths, ProjectSourcePath) ///////////////////////////////////////////////// TEST(CMakeTestPaths, TestTmpPath) { - ignition::common::testing::CMakeTestPaths testPaths; + gz::common::testing::CMakeTestPaths testPaths; std::string tmpDir; ASSERT_TRUE(testPaths.TestTmpPath(tmpDir)); diff --git a/testing/src/TestPaths.cc b/testing/src/TestPaths.cc index b9f4dec74..1c3c9ea4a 100644 --- a/testing/src/TestPaths.cc +++ b/testing/src/TestPaths.cc @@ -77,7 +77,7 @@ TestPathFactory(const std::string &_projectSourcePath) } ////////////////////////////////////////////////// -std::shared_ptr +std::shared_ptr MakeTestTempDirectoryImpl(const std::string &_projectSourcePath, const std::string &_prefix, const std::string &_subDir, @@ -94,7 +94,7 @@ MakeTestTempDirectoryImpl(const std::string &_projectSourcePath, if (dataDir.empty()) return nullptr; - return std::make_shared( + return std::make_shared( dataDir, _prefix, _subDir, _cleanup); } diff --git a/tutorials/hw-encoding.md b/tutorials/hw-encoding.md index adc2ee1e4..0440e4955 100644 --- a/tutorials/hw-encoding.md +++ b/tutorials/hw-encoding.md @@ -1,6 +1,6 @@ \page hw-encoding Hardware-accelerated Video Encoding -When recording video using the `ignition::common::VideoEncoder` class, you can +When recording video using the `gz::common::VideoEncoder` class, you can opt-in to use hardware (HW) acceleration for the encoding process. By default, only software encoders are used. This tutorial will show how to configure the encoder for HW acceleration and will present ready-made commandlines for some typical use-cases. @@ -191,7 +191,7 @@ no effect then). This would be useful if you want to e.g. implement a GUI choose for the acceleration. The `FlagSet` captures a set of allowed encoders. Its value may be -e.g. `ignition::Common::HWEncoderType::QSV | ignition::common::HWEncoderType::NVENC`. +e.g. `gz::Common::HWEncoderType::QSV | gz::common::HWEncoderType::NVENC`. ## How do I know it's working diff --git a/tutorials/profiler.md b/tutorials/profiler.md index 231b9f8f1..804566e2c 100644 --- a/tutorials/profiler.md +++ b/tutorials/profiler.md @@ -7,7 +7,7 @@ Next Tutorial: \ref hw-encoding This tutorial describes how to get started using the Ignition Common profiler to measure and visualize run-time performance of your software. -The `ignition::common::Profiler` provides a common interface that can allow for +The `gz::common::Profiler` provides a common interface that can allow for multiple underlying profiler implementations. Currently, the only available implementation is [Remotery](https://github.com/Celtoys/Remotery). From 9823e4da2711ebe58f634f30ec88dfedcd7b8ecb Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 17 May 2022 22:18:08 -0700 Subject: [PATCH 3/9] Add migration line Signed-off-by: methylDragon --- Migration.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Migration.md b/Migration.md index 8b121ade8..229bb28d2 100644 --- a/Migration.md +++ b/Migration.md @@ -12,6 +12,7 @@ release will remove the deprecated code. 1. `Submesh::MaterialIndex` is deprecated. `SubMesh::GetMaterialIndex` should be used instead, which properly handles submeshes having no material index applied to them. +2. The `ignition` namespace is deprecated and will be removed in future versions. Use `gz` instead. ### Additions From e742eaa27c943b08f7bd77ce3a737d1a977fb7a4 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 17 May 2022 22:21:15 -0700 Subject: [PATCH 4/9] Add deprecation test Signed-off-by: methylDragon --- test/integration/deprecated_TEST.cc | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/integration/deprecated_TEST.cc diff --git a/test/integration/deprecated_TEST.cc b/test/integration/deprecated_TEST.cc new file mode 100644 index 000000000..8b8ae2003 --- /dev/null +++ b/test/integration/deprecated_TEST.cc @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ + +#include + +#include +#include + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION + +///////////////////////////////////////////////// +// Make sure the ignition namespace still works +TEST(Deprecated, IgnitionNamespace) +{ + ignition::common::Battery battery; +} + +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION From 6ecc2f8dfcccf15011b0dbdc061829636dea754b Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 17 May 2022 22:22:17 -0700 Subject: [PATCH 5/9] Use pragma deprecation message in config.hh Signed-off-by: methylDragon --- include/ignition/common/config.hh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/ignition/common/config.hh b/include/ignition/common/config.hh index 390857008..03e128022 100644 --- a/include/ignition/common/config.hh +++ b/include/ignition/common/config.hh @@ -15,4 +15,21 @@ * */ +#ifndef IGNITION_COMMON__CONFIG_HH_ +#define IGNITION_COMMON__CONFIG_HH_ + #include + +namespace gz +{ +} + +namespace ignition +{ + #ifndef SUPPRESS_IGNITION_HEADER_DEPRECATION + #pragma message("ignition namespace is deprecated! Use gz instead!") + #endif + using namespace gz; +} + +#endif From 24f5364cb8c2a15b33387db9e981cf68bc6bb122 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Thu, 19 May 2022 17:54:27 -0700 Subject: [PATCH 6/9] Mention gz headers in migration guide Signed-off-by: methylDragon --- Migration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Migration.md b/Migration.md index 229bb28d2..4f21d10bb 100644 --- a/Migration.md +++ b/Migration.md @@ -13,6 +13,8 @@ release will remove the deprecated code. be used instead, which properly handles submeshes having no material index applied to them. 2. The `ignition` namespace is deprecated and will be removed in future versions. Use `gz` instead. +3. Header files under `ignition/...` are deprecated and will be removed in future versions. + Use `gz/...` instead. ### Additions @@ -98,4 +100,3 @@ release will remove the deprecated code. 1. **ignition-cmake** + Ignition-math now has a build dependency on ignition-cmake, which allows cmake scripts to be shared across all the ignition packages. - From 22d14c1bfadf4a4850fdad3285dba2ac1b807ca5 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 17 May 2022 22:22:35 -0700 Subject: [PATCH 7/9] Include config.hh Signed-off-by: methylDragon --- include/ignition/common/Base64.hh | 1 + include/ignition/common/Battery.hh | 1 + include/ignition/common/Console.hh | 1 + include/ignition/common/EnumIface.hh | 1 + include/ignition/common/Export.hh | 1 + include/ignition/common/Filesystem.hh | 1 + include/ignition/common/FlagSet.hh | 1 + include/ignition/common/MaterialDensity.hh | 1 + include/ignition/common/MovingWindowFilter.hh | 1 + include/ignition/common/Plugin.hh | 1 + include/ignition/common/PluginInfo.hh | 1 + include/ignition/common/PluginLoader.hh | 1 + include/ignition/common/PluginMacros.hh | 1 + include/ignition/common/PluginPtr.hh | 1 + include/ignition/common/SignalHandler.hh | 1 + include/ignition/common/SingletonT.hh | 1 + include/ignition/common/SpecializedPlugin.hh | 1 + include/ignition/common/SpecializedPluginPtr.hh | 1 + include/ignition/common/StringUtils.hh | 1 + include/ignition/common/SuppressWarning.hh | 1 + include/ignition/common/SystemPaths.hh | 1 + include/ignition/common/TempDirectory.hh | 1 + include/ignition/common/TemplateHelpers.hh | 1 + include/ignition/common/Timer.hh | 1 + include/ignition/common/URI.hh | 1 + include/ignition/common/Util.hh | 1 + include/ignition/common/Uuid.hh | 1 + include/ignition/common/WorkerPool.hh | 1 + include/ignition/common/detail/Export.hh | 1 + include/ignition/common/detail/Plugin.hh | 1 + include/ignition/common/detail/PluginLoader.hh | 1 + include/ignition/common/detail/PluginMacros.hh | 1 + include/ignition/common/detail/PluginPtr.hh | 1 + include/ignition/common/detail/SpecializedPlugin.hh | 1 + include/ignition/common/detail/TemplateHelpers.hh | 1 + 35 files changed, 35 insertions(+) diff --git a/include/ignition/common/Base64.hh b/include/ignition/common/Base64.hh index c0eab4705..965123959 100644 --- a/include/ignition/common/Base64.hh +++ b/include/ignition/common/Base64.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/Battery.hh b/include/ignition/common/Battery.hh index cf0552653..ba553f190 100644 --- a/include/ignition/common/Battery.hh +++ b/include/ignition/common/Battery.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/Console.hh b/include/ignition/common/Console.hh index 572323350..51a4ae3bc 100644 --- a/include/ignition/common/Console.hh +++ b/include/ignition/common/Console.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/EnumIface.hh b/include/ignition/common/EnumIface.hh index 0a7a09313..69a3d3ba7 100644 --- a/include/ignition/common/EnumIface.hh +++ b/include/ignition/common/EnumIface.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/Export.hh b/include/ignition/common/Export.hh index a85faac65..bd4b88b6a 100644 --- a/include/ignition/common/Export.hh +++ b/include/ignition/common/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/Filesystem.hh b/include/ignition/common/Filesystem.hh index ac4537f7f..97561a9b8 100644 --- a/include/ignition/common/Filesystem.hh +++ b/include/ignition/common/Filesystem.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/FlagSet.hh b/include/ignition/common/FlagSet.hh index db2f5e830..09c5c7b45 100644 --- a/include/ignition/common/FlagSet.hh +++ b/include/ignition/common/FlagSet.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/MaterialDensity.hh b/include/ignition/common/MaterialDensity.hh index d0461ff1d..6e68aedcc 100644 --- a/include/ignition/common/MaterialDensity.hh +++ b/include/ignition/common/MaterialDensity.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/MovingWindowFilter.hh b/include/ignition/common/MovingWindowFilter.hh index 462654c47..6f4414567 100644 --- a/include/ignition/common/MovingWindowFilter.hh +++ b/include/ignition/common/MovingWindowFilter.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/Plugin.hh b/include/ignition/common/Plugin.hh index 6a463e61e..be43e3df5 100644 --- a/include/ignition/common/Plugin.hh +++ b/include/ignition/common/Plugin.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/PluginInfo.hh b/include/ignition/common/PluginInfo.hh index 3496c90fd..5614dcc3f 100644 --- a/include/ignition/common/PluginInfo.hh +++ b/include/ignition/common/PluginInfo.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/PluginLoader.hh b/include/ignition/common/PluginLoader.hh index 3b4922e41..7122e3fd7 100644 --- a/include/ignition/common/PluginLoader.hh +++ b/include/ignition/common/PluginLoader.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/PluginMacros.hh b/include/ignition/common/PluginMacros.hh index ca9da7675..46a037480 100644 --- a/include/ignition/common/PluginMacros.hh +++ b/include/ignition/common/PluginMacros.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/PluginPtr.hh b/include/ignition/common/PluginPtr.hh index c308952d0..85184dc9b 100644 --- a/include/ignition/common/PluginPtr.hh +++ b/include/ignition/common/PluginPtr.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/SignalHandler.hh b/include/ignition/common/SignalHandler.hh index bb6c160bc..8c9fdcdb6 100644 --- a/include/ignition/common/SignalHandler.hh +++ b/include/ignition/common/SignalHandler.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/SingletonT.hh b/include/ignition/common/SingletonT.hh index efea6e58f..4b5207ff0 100644 --- a/include/ignition/common/SingletonT.hh +++ b/include/ignition/common/SingletonT.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/SpecializedPlugin.hh b/include/ignition/common/SpecializedPlugin.hh index 95373b8f6..95efb3ded 100644 --- a/include/ignition/common/SpecializedPlugin.hh +++ b/include/ignition/common/SpecializedPlugin.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/SpecializedPluginPtr.hh b/include/ignition/common/SpecializedPluginPtr.hh index 948becf66..e2a9d073b 100644 --- a/include/ignition/common/SpecializedPluginPtr.hh +++ b/include/ignition/common/SpecializedPluginPtr.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/StringUtils.hh b/include/ignition/common/StringUtils.hh index 3c13cc94d..150263bca 100644 --- a/include/ignition/common/StringUtils.hh +++ b/include/ignition/common/StringUtils.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/SuppressWarning.hh b/include/ignition/common/SuppressWarning.hh index 84f6b7eec..c330c5f3c 100644 --- a/include/ignition/common/SuppressWarning.hh +++ b/include/ignition/common/SuppressWarning.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/SystemPaths.hh b/include/ignition/common/SystemPaths.hh index 9d138a40b..fd9a284c8 100644 --- a/include/ignition/common/SystemPaths.hh +++ b/include/ignition/common/SystemPaths.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/TempDirectory.hh b/include/ignition/common/TempDirectory.hh index 17ea86f8e..33927ca6a 100644 --- a/include/ignition/common/TempDirectory.hh +++ b/include/ignition/common/TempDirectory.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/TemplateHelpers.hh b/include/ignition/common/TemplateHelpers.hh index 5f2d84082..d0ec4c2c3 100644 --- a/include/ignition/common/TemplateHelpers.hh +++ b/include/ignition/common/TemplateHelpers.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/Timer.hh b/include/ignition/common/Timer.hh index 7f3eb7149..60b28dba0 100644 --- a/include/ignition/common/Timer.hh +++ b/include/ignition/common/Timer.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/URI.hh b/include/ignition/common/URI.hh index eddddf732..1c1544e4a 100644 --- a/include/ignition/common/URI.hh +++ b/include/ignition/common/URI.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/Util.hh b/include/ignition/common/Util.hh index 28627d411..760930934 100644 --- a/include/ignition/common/Util.hh +++ b/include/ignition/common/Util.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/Uuid.hh b/include/ignition/common/Uuid.hh index 7a9db5b0e..b894b105b 100644 --- a/include/ignition/common/Uuid.hh +++ b/include/ignition/common/Uuid.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/WorkerPool.hh b/include/ignition/common/WorkerPool.hh index bd48b0b39..d77a01a41 100644 --- a/include/ignition/common/WorkerPool.hh +++ b/include/ignition/common/WorkerPool.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/detail/Export.hh b/include/ignition/common/detail/Export.hh index 2628774af..2a820a978 100644 --- a/include/ignition/common/detail/Export.hh +++ b/include/ignition/common/detail/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/detail/Plugin.hh b/include/ignition/common/detail/Plugin.hh index 1d56b8c97..c555a48e6 100644 --- a/include/ignition/common/detail/Plugin.hh +++ b/include/ignition/common/detail/Plugin.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/detail/PluginLoader.hh b/include/ignition/common/detail/PluginLoader.hh index f3a4f3221..beb5d3fe1 100644 --- a/include/ignition/common/detail/PluginLoader.hh +++ b/include/ignition/common/detail/PluginLoader.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/detail/PluginMacros.hh b/include/ignition/common/detail/PluginMacros.hh index b9f2717be..f64f9180c 100644 --- a/include/ignition/common/detail/PluginMacros.hh +++ b/include/ignition/common/detail/PluginMacros.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/detail/PluginPtr.hh b/include/ignition/common/detail/PluginPtr.hh index 915c6b72d..5a2ae29cc 100644 --- a/include/ignition/common/detail/PluginPtr.hh +++ b/include/ignition/common/detail/PluginPtr.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/detail/SpecializedPlugin.hh b/include/ignition/common/detail/SpecializedPlugin.hh index fc799a441..5377d2dc4 100644 --- a/include/ignition/common/detail/SpecializedPlugin.hh +++ b/include/ignition/common/detail/SpecializedPlugin.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common/detail/TemplateHelpers.hh b/include/ignition/common/detail/TemplateHelpers.hh index 5b8927205..e00285988 100644 --- a/include/ignition/common/detail/TemplateHelpers.hh +++ b/include/ignition/common/detail/TemplateHelpers.hh @@ -16,3 +16,4 @@ */ #include +#include From 4cab2b5efdbf6c6bf5407808298413591fcb4f27 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Sun, 22 May 2022 15:20:43 -0700 Subject: [PATCH 8/9] Include config.hh in recursive directories and .hh Signed-off-by: methylDragon --- av/include/ignition/common/AudioDecoder.hh | 1 + av/include/ignition/common/HWEncoder.hh | 1 + av/include/ignition/common/HWVideo.hh | 1 + av/include/ignition/common/Video.hh | 1 + av/include/ignition/common/VideoEncoder.hh | 1 + av/include/ignition/common/av.hh | 1 + av/include/ignition/common/av/Export.hh | 1 + av/include/ignition/common/av/Util.hh | 1 + av/include/ignition/common/av/detail/Export.hh | 1 + av/include/ignition/common/ffmpeg_inc.hh | 1 + events/include/ignition/common/Event.hh | 1 + events/include/ignition/common/KeyEvent.hh | 1 + events/include/ignition/common/MouseEvent.hh | 1 + events/include/ignition/common/events.hh | 1 + events/include/ignition/common/events/Export.hh | 1 + events/include/ignition/common/events/Types.hh | 1 + events/include/ignition/common/events/detail/Export.hh | 1 + geospatial/include/ignition/common/geospatial.hh | 1 + geospatial/include/ignition/common/geospatial/Dem.hh | 1 + geospatial/include/ignition/common/geospatial/Export.hh | 1 + geospatial/include/ignition/common/geospatial/HeightmapData.hh | 1 + geospatial/include/ignition/common/geospatial/ImageHeightmap.hh | 1 + geospatial/include/ignition/common/geospatial/detail/Export.hh | 1 + graphics/include/ignition/common/Animation.hh | 1 + graphics/include/ignition/common/BVHLoader.hh | 1 + graphics/include/ignition/common/ColladaExporter.hh | 1 + graphics/include/ignition/common/ColladaLoader.hh | 1 + graphics/include/ignition/common/GTSMeshUtils.hh | 1 + graphics/include/ignition/common/Image.hh | 1 + graphics/include/ignition/common/KeyFrame.hh | 1 + graphics/include/ignition/common/Material.hh | 1 + graphics/include/ignition/common/Mesh.hh | 1 + graphics/include/ignition/common/MeshCSG.hh | 1 + graphics/include/ignition/common/MeshExporter.hh | 1 + graphics/include/ignition/common/MeshLoader.hh | 1 + graphics/include/ignition/common/MeshManager.hh | 1 + graphics/include/ignition/common/NodeAnimation.hh | 1 + graphics/include/ignition/common/NodeTransform.hh | 1 + graphics/include/ignition/common/OBJLoader.hh | 1 + graphics/include/ignition/common/Pbr.hh | 1 + graphics/include/ignition/common/STLLoader.hh | 1 + graphics/include/ignition/common/SVGLoader.hh | 1 + graphics/include/ignition/common/Skeleton.hh | 1 + graphics/include/ignition/common/SkeletonAnimation.hh | 1 + graphics/include/ignition/common/SkeletonNode.hh | 1 + graphics/include/ignition/common/SubMesh.hh | 1 + graphics/include/ignition/common/graphics.hh | 1 + graphics/include/ignition/common/graphics/Export.hh | 1 + graphics/include/ignition/common/graphics/Types.hh | 1 + graphics/include/ignition/common/graphics/detail/Export.hh | 1 + include/ignition/common.hh | 1 + profiler/include/ignition/common/Profiler.hh | 1 + profiler/include/ignition/common/profiler/Export.hh | 1 + profiler/include/ignition/common/profiler/detail/Export.hh | 1 + testing/include/ignition/common/testing.hh | 1 + testing/include/ignition/common/testing/AutoLogFixture.hh | 1 + testing/include/ignition/common/testing/BazelTestPaths.hh | 1 + testing/include/ignition/common/testing/CMakeTestPaths.hh | 1 + testing/include/ignition/common/testing/Export.hh | 1 + testing/include/ignition/common/testing/TestPaths.hh | 1 + testing/include/ignition/common/testing/Utils.hh | 1 + testing/include/ignition/common/testing/detail/AutoLogFixture.hh | 1 + testing/include/ignition/common/testing/detail/Export.hh | 1 + 63 files changed, 63 insertions(+) diff --git a/av/include/ignition/common/AudioDecoder.hh b/av/include/ignition/common/AudioDecoder.hh index 4fe88b03d..485ab0970 100644 --- a/av/include/ignition/common/AudioDecoder.hh +++ b/av/include/ignition/common/AudioDecoder.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/HWEncoder.hh b/av/include/ignition/common/HWEncoder.hh index 265e0bfc4..10cd0246c 100644 --- a/av/include/ignition/common/HWEncoder.hh +++ b/av/include/ignition/common/HWEncoder.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/HWVideo.hh b/av/include/ignition/common/HWVideo.hh index 0aab109ad..ef59102b5 100644 --- a/av/include/ignition/common/HWVideo.hh +++ b/av/include/ignition/common/HWVideo.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/Video.hh b/av/include/ignition/common/Video.hh index 32d257a22..db062d2d0 100644 --- a/av/include/ignition/common/Video.hh +++ b/av/include/ignition/common/Video.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/VideoEncoder.hh b/av/include/ignition/common/VideoEncoder.hh index b7ab032bd..409858e7e 100644 --- a/av/include/ignition/common/VideoEncoder.hh +++ b/av/include/ignition/common/VideoEncoder.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/av.hh b/av/include/ignition/common/av.hh index 6c4c5ac5c..e31d7dc42 100644 --- a/av/include/ignition/common/av.hh +++ b/av/include/ignition/common/av.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/av/Export.hh b/av/include/ignition/common/av/Export.hh index bc7a8fe13..c51d279e4 100644 --- a/av/include/ignition/common/av/Export.hh +++ b/av/include/ignition/common/av/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/av/Util.hh b/av/include/ignition/common/av/Util.hh index cb6c2d914..2bedd213f 100644 --- a/av/include/ignition/common/av/Util.hh +++ b/av/include/ignition/common/av/Util.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/av/detail/Export.hh b/av/include/ignition/common/av/detail/Export.hh index 10c594289..d1d5bac60 100644 --- a/av/include/ignition/common/av/detail/Export.hh +++ b/av/include/ignition/common/av/detail/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/av/include/ignition/common/ffmpeg_inc.hh b/av/include/ignition/common/ffmpeg_inc.hh index 9b94f9eba..811e466d1 100644 --- a/av/include/ignition/common/ffmpeg_inc.hh +++ b/av/include/ignition/common/ffmpeg_inc.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/events/include/ignition/common/Event.hh b/events/include/ignition/common/Event.hh index 7824cb7bd..8340f2eed 100644 --- a/events/include/ignition/common/Event.hh +++ b/events/include/ignition/common/Event.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/events/include/ignition/common/KeyEvent.hh b/events/include/ignition/common/KeyEvent.hh index 0f4b956e9..4fd2d79b7 100644 --- a/events/include/ignition/common/KeyEvent.hh +++ b/events/include/ignition/common/KeyEvent.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/events/include/ignition/common/MouseEvent.hh b/events/include/ignition/common/MouseEvent.hh index 3eb0b4a70..ed1a11748 100644 --- a/events/include/ignition/common/MouseEvent.hh +++ b/events/include/ignition/common/MouseEvent.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/events/include/ignition/common/events.hh b/events/include/ignition/common/events.hh index 7301375ec..cecf803e1 100644 --- a/events/include/ignition/common/events.hh +++ b/events/include/ignition/common/events.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/events/include/ignition/common/events/Export.hh b/events/include/ignition/common/events/Export.hh index ad7ef3813..b2711adf6 100644 --- a/events/include/ignition/common/events/Export.hh +++ b/events/include/ignition/common/events/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/events/include/ignition/common/events/Types.hh b/events/include/ignition/common/events/Types.hh index 665871374..158129e35 100644 --- a/events/include/ignition/common/events/Types.hh +++ b/events/include/ignition/common/events/Types.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/events/include/ignition/common/events/detail/Export.hh b/events/include/ignition/common/events/detail/Export.hh index 02551dd85..1e8e23733 100644 --- a/events/include/ignition/common/events/detail/Export.hh +++ b/events/include/ignition/common/events/detail/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/geospatial/include/ignition/common/geospatial.hh b/geospatial/include/ignition/common/geospatial.hh index 226fdda11..c085a207b 100644 --- a/geospatial/include/ignition/common/geospatial.hh +++ b/geospatial/include/ignition/common/geospatial.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/geospatial/include/ignition/common/geospatial/Dem.hh b/geospatial/include/ignition/common/geospatial/Dem.hh index 100ac6190..c1ea4c986 100644 --- a/geospatial/include/ignition/common/geospatial/Dem.hh +++ b/geospatial/include/ignition/common/geospatial/Dem.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/geospatial/include/ignition/common/geospatial/Export.hh b/geospatial/include/ignition/common/geospatial/Export.hh index e6553162e..c37df6602 100644 --- a/geospatial/include/ignition/common/geospatial/Export.hh +++ b/geospatial/include/ignition/common/geospatial/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/geospatial/include/ignition/common/geospatial/HeightmapData.hh b/geospatial/include/ignition/common/geospatial/HeightmapData.hh index db7742b6c..22b5a3a44 100644 --- a/geospatial/include/ignition/common/geospatial/HeightmapData.hh +++ b/geospatial/include/ignition/common/geospatial/HeightmapData.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/geospatial/include/ignition/common/geospatial/ImageHeightmap.hh b/geospatial/include/ignition/common/geospatial/ImageHeightmap.hh index 59a228565..05b819c39 100644 --- a/geospatial/include/ignition/common/geospatial/ImageHeightmap.hh +++ b/geospatial/include/ignition/common/geospatial/ImageHeightmap.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/geospatial/include/ignition/common/geospatial/detail/Export.hh b/geospatial/include/ignition/common/geospatial/detail/Export.hh index c04a752e2..38c2e359c 100644 --- a/geospatial/include/ignition/common/geospatial/detail/Export.hh +++ b/geospatial/include/ignition/common/geospatial/detail/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/Animation.hh b/graphics/include/ignition/common/Animation.hh index 82b4aa259..91e4aff18 100644 --- a/graphics/include/ignition/common/Animation.hh +++ b/graphics/include/ignition/common/Animation.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/BVHLoader.hh b/graphics/include/ignition/common/BVHLoader.hh index 522738cc6..657ded317 100644 --- a/graphics/include/ignition/common/BVHLoader.hh +++ b/graphics/include/ignition/common/BVHLoader.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/ColladaExporter.hh b/graphics/include/ignition/common/ColladaExporter.hh index 42a3ff4be..fa11be10f 100644 --- a/graphics/include/ignition/common/ColladaExporter.hh +++ b/graphics/include/ignition/common/ColladaExporter.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/ColladaLoader.hh b/graphics/include/ignition/common/ColladaLoader.hh index d805bc8bf..c4cce2db1 100644 --- a/graphics/include/ignition/common/ColladaLoader.hh +++ b/graphics/include/ignition/common/ColladaLoader.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/GTSMeshUtils.hh b/graphics/include/ignition/common/GTSMeshUtils.hh index 8c8948ec9..b25552dcd 100644 --- a/graphics/include/ignition/common/GTSMeshUtils.hh +++ b/graphics/include/ignition/common/GTSMeshUtils.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/Image.hh b/graphics/include/ignition/common/Image.hh index 14c34b496..7d4b606ba 100644 --- a/graphics/include/ignition/common/Image.hh +++ b/graphics/include/ignition/common/Image.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/KeyFrame.hh b/graphics/include/ignition/common/KeyFrame.hh index 5616b7192..8cfbdc68d 100644 --- a/graphics/include/ignition/common/KeyFrame.hh +++ b/graphics/include/ignition/common/KeyFrame.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/Material.hh b/graphics/include/ignition/common/Material.hh index 262b2f102..dbaf08dcd 100644 --- a/graphics/include/ignition/common/Material.hh +++ b/graphics/include/ignition/common/Material.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/Mesh.hh b/graphics/include/ignition/common/Mesh.hh index 081b63507..85b836090 100644 --- a/graphics/include/ignition/common/Mesh.hh +++ b/graphics/include/ignition/common/Mesh.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/MeshCSG.hh b/graphics/include/ignition/common/MeshCSG.hh index 761d209e0..85d922b7a 100644 --- a/graphics/include/ignition/common/MeshCSG.hh +++ b/graphics/include/ignition/common/MeshCSG.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/MeshExporter.hh b/graphics/include/ignition/common/MeshExporter.hh index ef31676c1..8103cf091 100644 --- a/graphics/include/ignition/common/MeshExporter.hh +++ b/graphics/include/ignition/common/MeshExporter.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/MeshLoader.hh b/graphics/include/ignition/common/MeshLoader.hh index e513e2a3e..ff28f1724 100644 --- a/graphics/include/ignition/common/MeshLoader.hh +++ b/graphics/include/ignition/common/MeshLoader.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/MeshManager.hh b/graphics/include/ignition/common/MeshManager.hh index c3b371692..15e47d109 100644 --- a/graphics/include/ignition/common/MeshManager.hh +++ b/graphics/include/ignition/common/MeshManager.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/NodeAnimation.hh b/graphics/include/ignition/common/NodeAnimation.hh index e4c0efdab..c49a9cd1c 100644 --- a/graphics/include/ignition/common/NodeAnimation.hh +++ b/graphics/include/ignition/common/NodeAnimation.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/NodeTransform.hh b/graphics/include/ignition/common/NodeTransform.hh index 48e5d3ced..aeb8bc62c 100644 --- a/graphics/include/ignition/common/NodeTransform.hh +++ b/graphics/include/ignition/common/NodeTransform.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/OBJLoader.hh b/graphics/include/ignition/common/OBJLoader.hh index 0859dd13a..f7f617771 100644 --- a/graphics/include/ignition/common/OBJLoader.hh +++ b/graphics/include/ignition/common/OBJLoader.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/Pbr.hh b/graphics/include/ignition/common/Pbr.hh index e614ccba4..c9eb85c48 100644 --- a/graphics/include/ignition/common/Pbr.hh +++ b/graphics/include/ignition/common/Pbr.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/STLLoader.hh b/graphics/include/ignition/common/STLLoader.hh index cf66d1aaa..73c411622 100644 --- a/graphics/include/ignition/common/STLLoader.hh +++ b/graphics/include/ignition/common/STLLoader.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/SVGLoader.hh b/graphics/include/ignition/common/SVGLoader.hh index 6cd8bcf29..28641a546 100644 --- a/graphics/include/ignition/common/SVGLoader.hh +++ b/graphics/include/ignition/common/SVGLoader.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/Skeleton.hh b/graphics/include/ignition/common/Skeleton.hh index b626a984f..96b0e850e 100644 --- a/graphics/include/ignition/common/Skeleton.hh +++ b/graphics/include/ignition/common/Skeleton.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/SkeletonAnimation.hh b/graphics/include/ignition/common/SkeletonAnimation.hh index 15b11e8e8..10fbadc72 100644 --- a/graphics/include/ignition/common/SkeletonAnimation.hh +++ b/graphics/include/ignition/common/SkeletonAnimation.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/SkeletonNode.hh b/graphics/include/ignition/common/SkeletonNode.hh index 028ebb04a..dbc19fe9b 100644 --- a/graphics/include/ignition/common/SkeletonNode.hh +++ b/graphics/include/ignition/common/SkeletonNode.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/SubMesh.hh b/graphics/include/ignition/common/SubMesh.hh index 99627f022..893ccf9cc 100644 --- a/graphics/include/ignition/common/SubMesh.hh +++ b/graphics/include/ignition/common/SubMesh.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/graphics.hh b/graphics/include/ignition/common/graphics.hh index 479012f22..f8ef1afa3 100644 --- a/graphics/include/ignition/common/graphics.hh +++ b/graphics/include/ignition/common/graphics.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/graphics/Export.hh b/graphics/include/ignition/common/graphics/Export.hh index 11fb43152..92aec884e 100644 --- a/graphics/include/ignition/common/graphics/Export.hh +++ b/graphics/include/ignition/common/graphics/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/graphics/Types.hh b/graphics/include/ignition/common/graphics/Types.hh index b241035a6..d768670be 100644 --- a/graphics/include/ignition/common/graphics/Types.hh +++ b/graphics/include/ignition/common/graphics/Types.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/graphics/include/ignition/common/graphics/detail/Export.hh b/graphics/include/ignition/common/graphics/detail/Export.hh index d613f0bc1..ea783ec12 100644 --- a/graphics/include/ignition/common/graphics/detail/Export.hh +++ b/graphics/include/ignition/common/graphics/detail/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/include/ignition/common.hh b/include/ignition/common.hh index 1c258c592..c97c90296 100644 --- a/include/ignition/common.hh +++ b/include/ignition/common.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/profiler/include/ignition/common/Profiler.hh b/profiler/include/ignition/common/Profiler.hh index 4205134f9..6b35d68c5 100644 --- a/profiler/include/ignition/common/Profiler.hh +++ b/profiler/include/ignition/common/Profiler.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/profiler/include/ignition/common/profiler/Export.hh b/profiler/include/ignition/common/profiler/Export.hh index 5f69bb544..a807b235c 100644 --- a/profiler/include/ignition/common/profiler/Export.hh +++ b/profiler/include/ignition/common/profiler/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/profiler/include/ignition/common/profiler/detail/Export.hh b/profiler/include/ignition/common/profiler/detail/Export.hh index 911e1c844..d9c731ec8 100644 --- a/profiler/include/ignition/common/profiler/detail/Export.hh +++ b/profiler/include/ignition/common/profiler/detail/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing.hh b/testing/include/ignition/common/testing.hh index d12f9f1d4..2f091ead7 100644 --- a/testing/include/ignition/common/testing.hh +++ b/testing/include/ignition/common/testing.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing/AutoLogFixture.hh b/testing/include/ignition/common/testing/AutoLogFixture.hh index d1373f729..5de1ec8b3 100644 --- a/testing/include/ignition/common/testing/AutoLogFixture.hh +++ b/testing/include/ignition/common/testing/AutoLogFixture.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing/BazelTestPaths.hh b/testing/include/ignition/common/testing/BazelTestPaths.hh index 1501e7e84..a0baace32 100644 --- a/testing/include/ignition/common/testing/BazelTestPaths.hh +++ b/testing/include/ignition/common/testing/BazelTestPaths.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing/CMakeTestPaths.hh b/testing/include/ignition/common/testing/CMakeTestPaths.hh index 0c69d6259..ba2b1287a 100644 --- a/testing/include/ignition/common/testing/CMakeTestPaths.hh +++ b/testing/include/ignition/common/testing/CMakeTestPaths.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing/Export.hh b/testing/include/ignition/common/testing/Export.hh index 342716546..9a2a67386 100644 --- a/testing/include/ignition/common/testing/Export.hh +++ b/testing/include/ignition/common/testing/Export.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing/TestPaths.hh b/testing/include/ignition/common/testing/TestPaths.hh index 194364e33..27dc2a9fe 100644 --- a/testing/include/ignition/common/testing/TestPaths.hh +++ b/testing/include/ignition/common/testing/TestPaths.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing/Utils.hh b/testing/include/ignition/common/testing/Utils.hh index 7101accd4..292c845f7 100644 --- a/testing/include/ignition/common/testing/Utils.hh +++ b/testing/include/ignition/common/testing/Utils.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing/detail/AutoLogFixture.hh b/testing/include/ignition/common/testing/detail/AutoLogFixture.hh index 93d35731a..87aa0e91f 100644 --- a/testing/include/ignition/common/testing/detail/AutoLogFixture.hh +++ b/testing/include/ignition/common/testing/detail/AutoLogFixture.hh @@ -16,3 +16,4 @@ */ #include +#include diff --git a/testing/include/ignition/common/testing/detail/Export.hh b/testing/include/ignition/common/testing/detail/Export.hh index 660f38422..6baae3605 100644 --- a/testing/include/ignition/common/testing/detail/Export.hh +++ b/testing/include/ignition/common/testing/detail/Export.hh @@ -16,3 +16,4 @@ */ #include +#include From 6b196a5ad70b23d0e8d150a31c48c2856b4ff576 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 24 May 2022 00:28:19 -0700 Subject: [PATCH 9/9] Update test/integration/deprecated_TEST.cc Signed-off-by: Steve Peters Co-authored-by: methylDragon --- test/integration/deprecated_TEST.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/deprecated_TEST.cc b/test/integration/deprecated_TEST.cc index 8b8ae2003..2e93a4e8d 100644 --- a/test/integration/deprecated_TEST.cc +++ b/test/integration/deprecated_TEST.cc @@ -17,11 +17,11 @@ #include +#define SUPPRESS_IGNITION_HEADER_DEPRECATION + #include #include -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION - ///////////////////////////////////////////////// // Make sure the ignition namespace still works TEST(Deprecated, IgnitionNamespace) @@ -29,4 +29,4 @@ TEST(Deprecated, IgnitionNamespace) ignition::common::Battery battery; } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +#undef SUPPRESS_IGNITION_HEADER_DEPRECATION