From 78f38b89ade9d4a8c69c933f4263666feb231e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 29 Sep 2020 18:39:48 +0200 Subject: [PATCH] Trade: doc++ Huh, so much copypaste bullshit. --- src/Magnum/Trade/AbstractImageConverter.cpp | 4 +-- src/Magnum/Trade/AbstractImageConverter.h | 35 +++++++++++---------- src/Magnum/Trade/AbstractImporter.h | 4 +-- src/Magnum/Trade/AbstractSceneConverter.cpp | 1 - src/Magnum/Trade/AbstractSceneConverter.h | 24 +++++++------- src/Magnum/Trade/MaterialData.h | 8 ++--- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index 20be105e7..2a5df3984 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -152,9 +152,9 @@ bool AbstractImageConverter::doExportToFile(const ImageView2D& image, const std: CORRADE_ASSERT(features() >= ImageConverterFeature::ConvertData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false); const auto data = doExportToData(image); + /* No deleter checks as it doesn't matter here */ if(!data) return false; - /* Open file */ if(!Utility::Directory::write(filename, data)) { Error() << "Trade::AbstractImageConverter::exportToFile(): cannot write to file" << filename; return false; @@ -174,9 +174,9 @@ bool AbstractImageConverter::doExportToFile(const CompressedImageView2D& image, CORRADE_ASSERT(features() >= ImageConverterFeature::ConvertCompressedData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false); const auto data = doExportToData(image); + /* No deleter checks as it doesn't matter here */ if(!data) return false; - /* Open file */ if(!Utility::Directory::write(filename, data)) { Error() << "Trade::AbstractImageConverter::exportToFile(): cannot write to file" << filename; return false; diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 9f33d6b92..82ef8ae12 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -107,9 +107,9 @@ MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, ImageConverterFeatures value */ enum class ImageConverterFlag: UnsignedByte { /** - * Print verbose diagnostic during import. By default the importer only - * prints messages on error or when some operation might cause unexpected - * data modification or loss. + * Print verbose diagnostic during conversion. By default the converter + * only prints messages on error or when some operation might cause + * unexpected data modification or loss. */ Verbose = 1 << 0 @@ -120,7 +120,7 @@ enum class ImageConverterFlag: UnsignedByte { @brief Image converter flags @m_since{2020,06} -@see @ref AbstractImporter::setFlags() +@see @ref AbstractImageConverter::setFlags() */ typedef Containers::EnumSet ImageConverterFlags; @@ -148,13 +148,14 @@ classes in @ref Trade namespace for available image converter plugins. @section Trade-AbstractImageConverter-data-dependency Data dependency The instances returned from various functions *by design* have no dependency on -the importer instance and neither on the dynamic plugin module. In other words, -you don't need to keep the importer instance (or the plugin manager instance) -around in order to have the `*Data` instances valid. Moreover, all +the converter instance and neither on the dynamic plugin module. In other +words, you don't need to keep the converter instance (or the plugin manager +instance) around in order to have the `*Data` instances valid. Moreover, all @ref Corrade::Containers::Array instances returned through @ref Image, -@ref CompressedImage and others are only allowed to have default deleters --- -this is to avoid potential dangling function pointer calls when destructing -such instances after the plugin module has been unloaded. +@ref CompressedImage, @ref MeshData, @ref MaterialData, @ref AnimationData and +others are only allowed to have default deleters --- this is to avoid potential +dangling function pointer calls when destructing such instances after the +plugin module has been unloaded. @section Trade-AbstractImageConverter-subclassing Subclassing @@ -338,7 +339,7 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract bool exportToFile(const ImageData2D& image, const std::string& filename); private: - /** @brief Implementation of @ref features() */ + /** @brief Implementation for @ref features() */ virtual ImageConverterFeatures doFeatures() const = 0; /** @@ -356,20 +357,20 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract */ virtual void doSetFlags(ImageConverterFlags flags); - /** @brief Implementation of @ref exportToImage() */ + /** @brief Implementation for @ref exportToImage() */ virtual Containers::Optional doExportToImage(const ImageView2D& image); - /** @brief Implementation of @ref exportToCompressedImage() */ + /** @brief Implementation for @ref exportToCompressedImage() */ virtual Containers::Optional doExportToCompressedImage(const ImageView2D& image); - /** @brief Implementation of @ref exportToData(const ImageView2D&) */ + /** @brief Implementation for @ref exportToData(const ImageView2D&) */ virtual Containers::Array doExportToData(const ImageView2D& image); - /** @brief Implementation of @ref exportToData(const CompressedImageView2D&) */ + /** @brief Implementation for @ref exportToData(const CompressedImageView2D&) */ virtual Containers::Array doExportToData(const CompressedImageView2D& image); /** - * @brief Implementation of @ref exportToFile(const ImageView2D&, const std::string&) + * @brief Implementation for @ref exportToFile(const ImageView2D&, const std::string&) * * If @ref ImageConverterFeature::ConvertData is supported, default * implementation calls @ref doExportToData(const ImageView2D&) and @@ -378,7 +379,7 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract virtual bool doExportToFile(const ImageView2D& image, const std::string& filename); /** - * @brief Implementation of @ref exportToFile(const CompressedImageView2D&, const std::string&) + * @brief Implementation for @ref exportToFile(const CompressedImageView2D&, const std::string&) * * If @ref ImageConverterFeature::ConvertCompressedData is supported, * default implementation calls @ref doExportToData(const CompressedImageView2D&) diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index aa2d9501f..36515d9f0 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -58,7 +58,7 @@ enum class ImporterFeature: UnsignedByte { /** * Specifying callbacks for loading additional files referenced * from the main file using @ref AbstractImporter::setFileCallback(). If - * the importer * doesn't expose this feature, the format is either + * the importer doesn't expose this feature, the format is either * single-file or loading via callbacks is not supported. * * See @ref Trade-AbstractImporter-usage-callbacks and particular importer @@ -162,7 +162,7 @@ See @ref plugins for more information about general plugin usage and Besides loading data directly from the filesystem using @ref openFile() like shown above, it's possible to use @ref openData() to import data from memory. -Note that the particular importer implementation must support +Note that the particular importer implementation has to support @ref ImporterFeature::OpenData for this method to work. Complex scene files often reference other files such as images and in that case diff --git a/src/Magnum/Trade/AbstractSceneConverter.cpp b/src/Magnum/Trade/AbstractSceneConverter.cpp index ae2c7ddf0..1ef1bfa2f 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.cpp +++ b/src/Magnum/Trade/AbstractSceneConverter.cpp @@ -145,7 +145,6 @@ bool AbstractSceneConverter::doConvertToFile(const std::string& filename, const /* No deleter checks as it doesn't matter here */ if(!data) return false; - /* Open file */ if(!Utility::Directory::write(filename, data)) { Error() << "Trade::AbstractSceneConverter::convertToFile(): cannot write to file" << filename; return false; diff --git a/src/Magnum/Trade/AbstractSceneConverter.h b/src/Magnum/Trade/AbstractSceneConverter.h index 2195db3aa..4d912fe6a 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.h +++ b/src/Magnum/Trade/AbstractSceneConverter.h @@ -95,9 +95,9 @@ MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, SceneConverterFeatures value */ enum class SceneConverterFlag: UnsignedByte { /** - * Print verbose diagnostic during import. By default the importer only - * prints messages on error or when some operation might cause unexpected - * data modification or loss. + * Print verbose diagnostic during conversion. By default the converter + * only prints messages on error or when some operation might cause + * unexpected data modification or loss. */ Verbose = 1 << 0 @@ -108,7 +108,7 @@ enum class SceneConverterFlag: UnsignedByte { @brief Scene converter flags @m_since{2020,06} -@see @ref AbstractImporter::setFlags() +@see @ref AbstractSceneConverter::setFlags() */ typedef Containers::EnumSet SceneConverterFlags; @@ -138,9 +138,9 @@ various formats or performing optimizations and other operations on them. See @section Trade-AbstractSceneConverter-data-dependency Data dependency The instances returned from various functions *by design* have no dependency on -the importer instance and neither on the dynamic plugin module. In other words, -you don't need to keep the importer instance (or the plugin manager instance) -around in order to have the `*Data` instances valid. Moreover, all +the converter instance and neither on the dynamic plugin module. In other +words, you don't need to keep the converter instance (or the plugin manager +instance) around in order to have the `*Data` instances valid. Moreover, all @ref Corrade::Containers::Array instances returned through @ref MeshData and others are only allowed to have default deleters --- this is to avoid potential dangling function pointer calls when destructing such instances after the @@ -274,7 +274,7 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract private: /** - * @brief Implementation of @ref features() + * @brief Implementation for @ref features() * * The implementation is expected to support at least one feature. */ @@ -295,17 +295,17 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract */ virtual void doSetFlags(SceneConverterFlags flags); - /** @brief Implementation of @ref convert(const MeshData&) */ + /** @brief Implementation for @ref convert(const MeshData&) */ virtual Containers::Optional doConvert(const MeshData& mesh); - /** @brief Implementation of @ref convertInPlace(MeshData&) */ + /** @brief Implementation for @ref convertInPlace(MeshData&) */ virtual bool doConvertInPlace(MeshData& mesh); - /** @brief Implementation of @ref convertToData(const MeshData&) */ + /** @brief Implementation for @ref convertToData(const MeshData&) */ virtual Containers::Array doConvertToData(const MeshData& mesh); /** - * @brief Implementation of @ref convertToFile(const std::string&, const MeshData&) + * @brief Implementation for @ref convertToFile(const std::string&, const MeshData&) * * If @ref SceneConverterFeature::ConvertMeshToData is supported, * default implementation calls @ref doConvertToData(const MeshData&) diff --git a/src/Magnum/Trade/MaterialData.h b/src/Magnum/Trade/MaterialData.h index 6f94c8d9e..13f4eed3d 100644 --- a/src/Magnum/Trade/MaterialData.h +++ b/src/Magnum/Trade/MaterialData.h @@ -1487,10 +1487,10 @@ APIs, see the documentation of of a particular enum value for more information. @subsection Trade-MaterialData-usage-texture-complexity Texture packing, coordinate transformation and coordinate sets -The material APIs allow for a lot of flexibility regarding --- texture maps may -be arbitrarily packed together to efficiently use all four channels, each -texture can use a different set of texture coordinates and there can be a -different coordinate transformation for each texture. +The material APIs allow for a lot of flexibility --- texture maps may be +arbitrarily packed together to efficiently use all four channels, each texture +can use a different set of texture coordinates and there can be a different +coordinate transformation for each texture. In most cases, however, real-world textures fit into a few well-known packing schemes and usually have a common transformation and coordinate sets for all.