Skip to content

Commit e04b543

Browse files
authored
IO group comments reworked in doxygen format (#149)
1 parent fe3f4be commit e04b543

18 files changed

+259
-125
lines changed

source/MRMesh/MRBase64.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@
77
namespace MR
88
{
99

10-
// encodes binary data into textual Base64 format
10+
11+
/// \defgroup IOGroup
12+
/// \{
13+
14+
/// \defgroup Base64Group Base64
15+
/// \{
16+
17+
/// encodes binary data into textual Base64 format
1118
MRMESH_API std::string encode64( const std::uint8_t * data, size_t size );
1219

13-
// decodes Base64 format into binary data
20+
/// decodes Base64 format into binary data
1421
MRMESH_API std::vector<std::uint8_t> decode64( const std::string &val );
1522

16-
} //namespace MR
23+
/// \}
24+
/// \}
25+
26+
} // namespace MR

source/MRMesh/MRDistanceMapLoad.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ namespace MR
1010
namespace DistanceMapLoad
1111
{
1212

13+
/// \defgroup DistanceMapLoadGroup DistanceMap Load
14+
/// \ingroup IOGroup
15+
/// \{
16+
1317
MRMESH_API extern const IOFilters Filters;
1418

1519
/**
@@ -20,6 +24,8 @@ MRMESH_API extern const IOFilters Filters;
2024
*/
2125
MRMESH_API tl::expected<DistanceMap, std::string> loadRaw( const std::filesystem::path& path );
2226

27+
/// \}
28+
2329
} // namespace DistanceMapLoad
2430

2531
} // namespace MR

source/MRMesh/MRDistanceMapSave.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ namespace MR
1010
namespace DistanceMapSave
1111
{
1212

13+
/// \defgroup DistanceMapSaveGroup DistanceMap Save
14+
/// \ingroup IOGroup
15+
/// \{
16+
1317
MRMESH_API extern const IOFilters Filters;
1418

1519
/**
@@ -20,6 +24,8 @@ MRMESH_API extern const IOFilters Filters;
2024
*/
2125
MRMESH_API tl::expected<void, std::string> saveRAW( const std::filesystem::path& path, const DistanceMap& dmapObject );
2226

27+
/// \}
28+
2329
} // namespace DistanceMapSave
2430

2531
} // namespace MR

source/MRMesh/MRIOFilters.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
namespace MR
77
{
8+
9+
/// \defgroup IOFiltersGroup IO Filters
10+
/// \ingroup IOGroup
11+
/// \{
12+
813
struct IOFilter
914
{
1015
IOFilter() = default;
@@ -30,4 +35,6 @@ inline IOFilters operator | ( const IOFilters& a, const IOFilters& b )
3035
return copy;
3136
}
3237

38+
/// \}
39+
3340
}

source/MRMesh/MRIOFormatsRegistry.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ namespace MR
99

1010
namespace MeshLoad
1111
{
12+
13+
/// \defgroup IOFormatsRegistryGroup IO Formats Registry
14+
/// \ingroup IOGroup
15+
/// \{
16+
1217
using MeshLoader = tl::expected<MR::Mesh, std::string>( * )( const std::filesystem::path&, std::vector<Color>* );
1318
using MeshStreamLoader = tl::expected<MR::Mesh, std::string>( * )( std::istream&, std::vector<Color>* );
1419

@@ -19,17 +24,19 @@ struct NamedMeshLoader
1924
MeshStreamLoader streamLoader{ nullptr };
2025
};
2126

22-
// Finds expected loader from registry
27+
/// Finds expected loader from registry
2328
MRMESH_API MeshLoader getMeshLoader( IOFilter filter );
24-
// Finds expected loader from registry
29+
/// Finds expected loader from registry
2530
MRMESH_API MeshStreamLoader getMeshStreamLoader( IOFilter filter );
26-
// Gets all registered filters
31+
/// Gets all registered filters
2732
MRMESH_API IOFilters getFilters();
2833

29-
// Register filter with loader function
30-
// loader function signature: tl::expected<Mesh, std::string> fromFormat( const std::filesystem::path& path, std::vector<Color>* colors );
31-
// example:
32-
// ADD_MESH_LOADER( IOFilter("Name of filter (.ext)","*.ext"), fromFormat)
34+
/**
35+
* \brief Register filter with loader function
36+
* \details loader function signature: tl::expected<Mesh, std::string> fromFormat( const std::filesystem::path& path, std::vector<Color>* colors );
37+
* example:
38+
* ADD_MESH_LOADER( IOFilter("Name of filter (.ext)","*.ext"), fromFormat)
39+
*/
3340
#define MR_ADD_MESH_LOADER( filter, loader ) \
3441
MR::MeshLoad::MeshLoaderAdder __meshLoaderAdder_##loader(MR::MeshLoad::NamedMeshLoader{filter,static_cast<MR::MeshLoad::MeshLoader>(loader),static_cast<MR::MeshLoad::MeshStreamLoader>(loader)});\
3542

@@ -39,6 +46,8 @@ class MeshLoaderAdder
3946
MRMESH_API MeshLoaderAdder( const NamedMeshLoader& loader );
4047
};
4148

49+
/// \}
50+
4251
}
4352

4453
}

source/MRMesh/MRImageLoad.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@ struct Image;
1313
namespace ImageLoad
1414
{
1515

16+
/// \defgroup ImageLoadGroup Image Load
17+
/// \ingroup IOGroup
18+
/// \{
19+
1620
MRMESH_API extern const IOFilters Filters;
1721

18-
// loads from .png format
22+
/// loads from .png format
1923
MRMESH_API tl::expected<Image, std::string> fromPng( const std::filesystem::path& path );
2024

21-
// detects the format from file extension and loads image from it
25+
/// detects the format from file extension and loads image from it
2226
MRMESH_API tl::expected<Image, std::string> fromAnySupportedFormat( const std::filesystem::path& path );
2327

28+
/// \}
29+
2430
}
31+
2532
}
2633
#endif

source/MRMesh/MRImageSave.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,31 @@ struct Image;
1212
namespace ImageSave
1313
{
1414

15+
/// \defgroup ImageSaveGroup Image Save
16+
/// \ingroup IOGroup
17+
/// \{
18+
1519
MRMESH_API extern const IOFilters Filters;
1620

17-
// saves in .bmp format
21+
/// saves in .bmp format
1822
MRMESH_API tl::expected<void, std::string> toBmp( const Image& image, const std::filesystem::path& path );
1923

2024
#ifndef __EMSCRIPTEN__
21-
// saves in .png format
25+
/// saves in .png format
2226
MRMESH_API tl::expected<void, std::string> toPng( const Image& image, const std::filesystem::path& path );
2327

24-
// saves in .png format
28+
/// saves in .png format
2529
MRMESH_API tl::expected<void, std::string> toPng( const Image& image, std::ostream& os );
2630

27-
// saves in .jpg format
31+
/// saves in .jpg format
2832
MRMESH_API tl::expected<void, std::string> toJpeg( const Image& image, const std::filesystem::path& path );
2933
#endif
3034

31-
// detects the format from file extension and save image to it
35+
/// detects the format from file extension and save image to it
3236
MRMESH_API tl::expected<void, std::string> toAnySupportedFormat( const Image& image, const std::filesystem::path& path );
3337

38+
/// \}
39+
3440
}
41+
3542
}

source/MRMesh/MRLinesLoad.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,23 @@ namespace MR
1313
namespace LinesLoad
1414
{
1515

16+
/// \defgroup LinesLoad Lines Load
17+
/// \ingroup IOGroup
18+
/// \{
19+
1620
MRMESH_API extern const IOFilters Filters;
1721

18-
// loads from .mrlines file
22+
/// loads from .mrlines file
1923
MRMESH_API tl::expected<Polyline3, std::string> fromMrLines( const std::filesystem::path& file );
2024
MRMESH_API tl::expected<Polyline3, std::string> fromMrLines( std::istream& in );
2125

22-
// detects the format from file extension and loads polyline from it
26+
/// detects the format from file extension and loads polyline from it
2327
MRMESH_API tl::expected<Polyline3, std::string> fromAnySupportedFormat( const std::filesystem::path& file );
24-
// extension in `*.ext` format
28+
/// extension in `*.ext` format
2529
MRMESH_API tl::expected<Polyline3, std::string> fromAnySupportedFormat( std::istream& in, const std::string& extension );
2630

27-
} //namespace LinesLoad
31+
/// \}
32+
33+
} // namespace LinesLoad
2834

29-
} //namespace MR
35+
} // namespace MR

source/MRMesh/MRLinesSave.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,21 @@ namespace MR
1313
namespace LinesSave
1414
{
1515

16+
/// \defgroup LinesSaveGroup Lines Save
17+
/// \ingroup IOGroup
18+
/// \{
19+
1620
MRMESH_API extern const IOFilters Filters;
1721

18-
// saves in .mrlines file
22+
/// saves in .mrlines file
1923
MRMESH_API tl::expected<void, std::string> toMrLines( const Polyline3& polyline, const std::filesystem::path& file );
2024
MRMESH_API tl::expected<void, std::string> toMrLines( const Polyline3& polyline, std::ostream& out );
2125

22-
// detects the format from file extension and saves polyline in it
26+
/// detects the format from file extension and saves polyline in it
2327
MRMESH_API tl::expected<void, std::string> toAnySupportedFormat( const Polyline3& polyline, const std::filesystem::path& file );
24-
// extension in `*.ext` format
28+
/// extension in `*.ext` format
2529
MRMESH_API tl::expected<void, std::string> toAnySupportedFormat( const Polyline3& polyline, std::ostream& out, const std::string& extension );
2630

27-
} //namespace LinesSave
31+
} // namespace LinesSave
2832

29-
} //namespace MR
33+
} // namespace MR

source/MRMesh/MRMeshLoad.h

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,48 @@ namespace MR
1414
namespace MeshLoad
1515
{
1616

17-
// loads from internal file format
17+
/// \defgroup MeshLoadGroup Mesh Load
18+
/// \ingroup IOGroup
19+
/// \{
20+
21+
/// loads from internal file format
1822
MRMESH_API tl::expected<Mesh, std::string> fromMrmesh( const std::filesystem::path& file, std::vector<Color>* colors = nullptr );
1923
MRMESH_API tl::expected<Mesh, std::string> fromMrmesh( std::istream& in, std::vector<Color>* colors = nullptr );
2024

21-
// loads from .off file
25+
/// loads from .off file
2226
MRMESH_API tl::expected<Mesh, std::string> fromOff( const std::filesystem::path& file, std::vector<Color>* colors = nullptr );
2327
MRMESH_API tl::expected<Mesh, std::string> fromOff( std::istream& in, std::vector<Color>* colors = nullptr );
2428

25-
// loads from .obj file
29+
/// loads from .obj file
2630
MRMESH_API tl::expected<Mesh, std::string> fromObj( const std::filesystem::path& file, std::vector<Color>* colors = nullptr );
2731
MRMESH_API tl::expected<Mesh, std::string> fromObj( std::istream& in, std::vector<Color>* colors = nullptr );
28-
// loads from any .stl
32+
/// loads from any .stl
2933
MRMESH_API tl::expected<Mesh, std::string> fromAnyStl( const std::filesystem::path& file, std::vector<Color>* colors = nullptr );
3034
MRMESH_API tl::expected<Mesh, std::string> fromAnyStl( std::istream& in, std::vector<Color>* colors = nullptr );
3135

32-
// loads from binary .stl
36+
/// loads from binary .stl
3337
MRMESH_API tl::expected<Mesh, std::string> fromBinaryStl( const std::filesystem::path & file, std::vector<Color>* colors = nullptr );
3438
MRMESH_API tl::expected<Mesh, std::string> fromBinaryStl( std::istream & in, std::vector<Color>* colors = nullptr );
3539

36-
// loads from ASCII .stl
40+
/// loads from ASCII .stl
3741
MRMESH_API tl::expected<Mesh, std::string> fromASCIIStl( const std::filesystem::path& file, std::vector<Color>* colors = nullptr );
3842
MRMESH_API tl::expected<Mesh, std::string> fromASCIIStl( std::istream& in, std::vector<Color>* colors = nullptr );
3943

40-
// loads from .ply file
44+
/// loads from .ply file
4145
MRMESH_API tl::expected<Mesh, std::string> fromPly( const std::filesystem::path& file, std::vector<Color>* colors = nullptr );
4246
MRMESH_API tl::expected<Mesh, std::string> fromPly( std::istream& in, std::vector<Color>* colors = nullptr );
4347

44-
// loads from .ctm file
48+
/// loads from .ctm file
4549
MRMESH_API tl::expected<Mesh, std::string> fromCtm( const std::filesystem::path & file, std::vector<Color>* colors = nullptr );
4650
MRMESH_API tl::expected<Mesh, std::string> fromCtm( std::istream & in, std::vector<Color>* colors = nullptr );
4751

48-
// detects the format from file extension and loads mesh from it
52+
/// detects the format from file extension and loads mesh from it
4953
MRMESH_API tl::expected<Mesh, std::string> fromAnySupportedFormat( const std::filesystem::path& file, std::vector<Color>* colors = nullptr );
50-
// extension in `*.ext` format
54+
/// extension in `*.ext` format
5155
MRMESH_API tl::expected<Mesh, std::string> fromAnySupportedFormat( std::istream& in, const std::string& extension, std::vector<Color>* colors = nullptr );
5256

53-
} //namespace MeshLoad
57+
/// \}
58+
59+
} // namespace MeshLoad
5460

55-
} //namespace MR
61+
} // namespace MR

0 commit comments

Comments
 (0)