Skip to content

Commit 65ba15d

Browse files
authored
Major formatting & doxygen pass (asmaloney#179)
- go over all comments and make them consistent in their use of doxygen tags - remove some useless comments - clarify some doxygen docs - fix some incorrect doxygen markup - change line length to 100 (from 120) in clang-format - reformat all code
1 parent 0c8cbd5 commit 65ba15d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+7322
-6084
lines changed

.clang-format

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ BreakBeforeTernaryOperators: true
4949
BreakConstructorInitializersBeforeComma: false
5050
BreakConstructorInitializers: AfterColon
5151
BreakStringLiterals: true
52-
ColumnLimit: 120
53-
CommentPragmas: '^ IWYU pragma:'
52+
ColumnLimit: 100
53+
CommentPragmas: '@copydetails '
5454
CompactNamespaces: false
5555
ConstructorInitializerAllOnOneLineOrOnePerLine: false
5656
ConstructorInitializerIndentWidth: 3

include/E57Exception.h

+185-122
Large diffs are not rendered by default.

include/E57Format.h

+169-177
Large diffs are not rendered by default.

include/E57SimpleData.h

+497-276
Large diffs are not rendered by default.

include/E57SimpleReader.h

+117-107
Original file line numberDiff line numberDiff line change
@@ -30,172 +30,182 @@
3030

3131
#pragma once
3232

33-
//! @file
34-
//! @brief E57 Simple API for reading E57.
35-
//! @details This includes support for the [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt)
36-
//! extension.
33+
/// @file
34+
/// @brief E57 Simple API for reading E57.
35+
/// @details This includes support for the
36+
/// [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension.
3737

3838
#include "E57SimpleData.h"
3939

4040
namespace e57
4141
{
42-
//! Options to the Reader constructor
42+
/// Options to the Reader constructor
4343
struct E57_DLL ReaderOptions
4444
{
45-
//! Set how frequently to verify the checksums (see ReadChecksumPolicy).
45+
/// Set how frequently to verify the checksums (see ReadChecksumPolicy).
4646
ReadChecksumPolicy checksumPolicy = ChecksumAll;
4747
};
4848

49-
//! @brief Used for reading an E57 file using E57 Simple API.
50-
//!
51-
//! The Reader includes support for the [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt)
52-
//! extension.
49+
/// @brief Used for reading an E57 file using E57 Simple API.
50+
///
51+
/// The Reader includes support for the
52+
/// [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension.
5353
class E57_DLL Reader
5454
{
5555
public:
56-
//! @brief Reader constructor
57-
//! @param [in] filePath Path to E57 file
58-
//! @param [in] options Options to be used for the file
56+
/// @brief Reader constructor
57+
/// @param [in] filePath Path to E57 file
58+
/// @param [in] options Options to be used for the file
5959
Reader( const ustring &filePath, const ReaderOptions &options );
6060

61-
//! @brief Reader constructor (deprecated)
62-
//! @param [in] filePath Path to E57 file
63-
//! @deprecated Will be removed in 4.0. Use Reader( const ustring &, const ReaderOptions & ) instead.
64-
[[deprecated(
65-
"Will be removed in 4.0. Use Reader( const ustring, const ReaderOptions & )." )]] // TODO Remove in 4.0
61+
/// @brief Reader constructor (deprecated)
62+
/// @param [in] filePath Path to E57 file
63+
/// @deprecated Will be removed in 4.0. Use Reader( const ustring &, const ReaderOptions & )
64+
/// instead.
65+
[[deprecated( "Will be removed in 4.0. Use Reader( const ustring, const ReaderOptions & "
66+
")." )]] // TODO Remove in 4.0
6667
explicit Reader( const ustring &filePath );
6768

68-
//! @brief Returns true if the file is open
69+
/// @brief Returns true if the file is open
6970
bool IsOpen() const;
7071

71-
//! @brief Closes the file
72+
/// @brief Closes the file
7273
bool Close();
7374

74-
//! @name File information
75-
//!@{
75+
/// @name File information
76+
///@{
7677

77-
//! @brief Returns the file header information
78-
//! @param [out] fileHeader is the main header information
79-
//! @return Returns true if successful
78+
/// @brief Returns the file header information
79+
/// @param [out] fileHeader is the main header information
80+
/// @return Returns true if successful
8081
bool GetE57Root( E57Root &fileHeader ) const;
8182

82-
//!@}
83+
///@}
8384

84-
//! @name Image2D
85-
//!@{
85+
/// @name Image2D
86+
///@{
8687

87-
//! @brief Returns the total number of Picture Blocks
88-
//! @return Returns the number of Image2D blocks
88+
/// @brief Returns the total number of Picture Blocks
89+
/// @return Returns the number of Image2D blocks
8990
int64_t GetImage2DCount() const;
9091

91-
//! @brief Returns the image2D header and positions the cursor
92-
//! @param [in] imageIndex This in the index into the image2D vector
93-
//! @param [out] image2DHeader pointer to the Image2D structure to receive the picture information
94-
//! @return Returns true if successful
92+
/// @brief Returns the image2D header and positions the cursor
93+
/// @param [in] imageIndex This in the index into the image2D vector
94+
/// @param [out] image2DHeader pointer to the Image2D structure to receive the picture
95+
/// information
96+
/// @return Returns true if successful
9597
bool ReadImage2D( int64_t imageIndex, Image2D &image2DHeader ) const;
9698

97-
//! @brief Returns the size of the image data
98-
//! @param [in] imageIndex This in the index into the image2D vector
99-
//! @param [out] imageProjection identifies the projection in the image2D.
100-
//! @param [out] imageType identifies the image format of the projection.
101-
//! @param [out] imageWidth The image width (in pixels).
102-
//! @param [out] imageHeight The image height (in pixels).
103-
//! @param [out] imageSize This is the total number of bytes for the image blob.
104-
//! @param [out] imageMaskType This is E57_PNG_IMAGE_MASK if "imageMask" is defined in the projection
105-
//! @param [out] imageVisualType This is image type of the VisualReferenceRepresentation if given.
106-
//! @return Returns true if successful
107-
bool GetImage2DSizes( int64_t imageIndex, Image2DProjection &imageProjection, Image2DType &imageType,
108-
int64_t &imageWidth, int64_t &imageHeight, int64_t &imageSize, Image2DType &imageMaskType,
99+
/// @brief Returns the size of the image data
100+
/// @param [in] imageIndex This in the index into the image2D vector
101+
/// @param [out] imageProjection identifies the projection in the image2D.
102+
/// @param [out] imageType identifies the image format of the projection.
103+
/// @param [out] imageWidth The image width (in pixels).
104+
/// @param [out] imageHeight The image height (in pixels).
105+
/// @param [out] imageSize This is the total number of bytes for the image blob.
106+
/// @param [out] imageMaskType This is E57_PNG_IMAGE_MASK if "imageMask" is defined in the
107+
/// projection
108+
/// @param [out] imageVisualType This is image type of the VisualReferenceRepresentation if
109+
/// given.
110+
/// @return Returns true if successful
111+
bool GetImage2DSizes( int64_t imageIndex, Image2DProjection &imageProjection,
112+
Image2DType &imageType, int64_t &imageWidth, int64_t &imageHeight,
113+
int64_t &imageSize, Image2DType &imageMaskType,
109114
Image2DType &imageVisualType ) const;
110115

111-
//! @brief Reads an image
112-
//! @param [in] imageIndex index of the image. Must be less than GetImage2DCount()
113-
//! @param [in] imageProjection identifies the projection desired.
114-
//! @param [in] imageType identifies the image format desired.
115-
//! @param [out] buffer pointer the raw image buffer
116-
//! @param [in] start position in the block to start reading
117-
//! @param [in] count size of desired chuck or buffer size
118-
//! @return Returns the number of bytes transferred.
119-
int64_t ReadImage2DData( int64_t imageIndex, Image2DProjection imageProjection, Image2DType imageType,
120-
void *buffer, int64_t start, int64_t count ) const;
121-
122-
//!@}
123-
124-
//! @name Data3D
125-
//!@{
126-
127-
//! @brief Returns the total number of Data3D Blocks
128-
//! @return Returns number of Data3D blocks.
116+
/// @brief Reads an image
117+
/// @param [in] imageIndex index of the image. Must be less than GetImage2DCount()
118+
/// @param [in] imageProjection identifies the projection desired.
119+
/// @param [in] imageType identifies the image format desired.
120+
/// @param [out] buffer pointer the raw image buffer
121+
/// @param [in] start position in the block to start reading
122+
/// @param [in] count size of desired chuck or buffer size
123+
/// @return Returns the number of bytes transferred.
124+
int64_t ReadImage2DData( int64_t imageIndex, Image2DProjection imageProjection,
125+
Image2DType imageType, void *buffer, int64_t start,
126+
int64_t count ) const;
127+
128+
///@}
129+
130+
/// @name Data3D
131+
///@{
132+
133+
/// @brief Returns the total number of Data3D Blocks
134+
/// @return Returns number of Data3D blocks.
129135
int64_t GetData3DCount() const;
130136

131-
//! @brief Returns the Data3D header
132-
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
133-
//! @param [out] data3DHeader Data3D header
134-
//! @return Returns true if successful
137+
/// @brief Returns the Data3D header
138+
/// @param [in] dataIndex This in the index into the images3D vector. Must be less than
139+
/// GetData3DCount().
140+
/// @param [out] data3DHeader Data3D header
141+
/// @return Returns true if successful
135142
bool ReadData3D( int64_t dataIndex, Data3D &data3DHeader ) const;
136143

137-
//! @brief Returns the size of the point data
138-
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
139-
//! @param [out] rowMax This is the maximum row size
140-
//! @param [out] columnMax This is the maximum column size
141-
//! @param [out] pointsSize This is the total number of point records
142-
//! @param [out] groupsSize This is the total number of group records
143-
//! @param [out] countSize This is the maximum point count per group
144-
//! @param [out] columnIndex This indicates that the idElementName is "columnIndex"
145-
//! @return Return true if successful, false otherwise
146-
bool GetData3DSizes( int64_t dataIndex, int64_t &rowMax, int64_t &columnMax, int64_t &pointsSize,
147-
int64_t &groupsSize, int64_t &countSize, bool &columnIndex ) const;
148-
149-
//! @brief Reads the group data into the provided buffers.
150-
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
151-
//! @param [in] groupCount size of each of the buffers given
152-
//! @param [out] idElementValue pointer to the buffer holding indices index for this group
153-
//! @param [out] startPointIndex pointer to the buffer holding Starting index in to the "points" data vector for
154-
//! the groups
155-
//! @param [out] pointCount pointer to the buffer holding size of the groups given
156-
//! @return Return true if successful, false otherwise
144+
/// @brief Returns the size of the point data
145+
/// @param [in] dataIndex This in the index into the images3D vector. Must be less than
146+
/// GetData3DCount().
147+
/// @param [out] rowMax This is the maximum row size
148+
/// @param [out] columnMax This is the maximum column size
149+
/// @param [out] pointsSize This is the total number of point records
150+
/// @param [out] groupsSize This is the total number of group records
151+
/// @param [out] countSize This is the maximum point count per group
152+
/// @param [out] columnIndex This indicates that the idElementName is "columnIndex"
153+
/// @return Return true if successful, false otherwise
154+
bool GetData3DSizes( int64_t dataIndex, int64_t &rowMax, int64_t &columnMax,
155+
int64_t &pointsSize, int64_t &groupsSize, int64_t &countSize,
156+
bool &columnIndex ) const;
157+
158+
/// @brief Reads the group data into the provided buffers.
159+
/// @param [in] dataIndex This in the index into the images3D vector. Must be less than
160+
/// GetData3DCount().
161+
/// @param [in] groupCount size of each of the buffers given
162+
/// @param [out] idElementValue pointer to the buffer holding indices index for this group
163+
/// @param [out] startPointIndex pointer to the buffer holding Starting index in to the
164+
/// "points" data vector for the groups
165+
/// @param [out] pointCount pointer to the buffer holding size of the groups given
166+
/// @return Return true if successful, false otherwise
157167
bool ReadData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue,
158168
int64_t *startPointIndex, int64_t *pointCount ) const;
159169

160-
//! @brief Use this to read the actual 3D data
161-
//! @details All the non-NULL buffers in buffers have number of elements = pointCount.
162-
//! Call the CompressedVectorReader::read() until all data is read.
163-
//! @param [in] dataIndex data block index
164-
//! @param [in] pointCount size of each element buffer.
165-
//! @param [in] buffers pointers to user-provided buffers
166-
//! @return vector reader setup to read the selected data into the provided buffers
170+
/// @brief Use this to read the actual 3D data
171+
/// @details All the non-NULL buffers in buffers have number of elements = pointCount.
172+
/// Call the CompressedVectorReader::read() until all data is read.
173+
/// @param [in] dataIndex data block index
174+
/// @param [in] pointCount size of each element buffer.
175+
/// @param [in] buffers pointers to user-provided buffers
176+
/// @return vector reader setup to read the selected data into the provided buffers
167177
CompressedVectorReader SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
168178
const Data3DPointsData &buffers ) const;
169179

170-
//! @overload
180+
/// @overload
171181
CompressedVectorReader SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
172182
const Data3DPointsData_d &buffers ) const;
173183

174-
//!@}
184+
///@}
175185

176-
//! @name Foundation API file information
177-
//!@{
186+
/// @name File information
187+
///@{
178188

179-
//! @brief Returns the file raw E57Root Structure Node
189+
/// @brief Returns the file raw E57Root Structure Node
180190
StructureNode GetRawE57Root() const;
181191

182-
//! @brief Returns the raw Data3D Vector Node
192+
/// @brief Returns the raw Data3D Vector Node
183193
VectorNode GetRawData3D() const;
184194

185-
//! @brief Returns the raw Image2D Vector Node
195+
/// @brief Returns the raw Image2D Vector Node
186196
VectorNode GetRawImages2D() const;
187197

188-
//! @brief Returns the ram ImageFile Node which is need to add enhancements
198+
/// @brief Returns the ram ImageFile Node which is need to add enhancements
189199
ImageFile GetRawIMF() const;
190200

191-
//!@}
201+
///@}
192202

193-
//! @cond documentNonPublic The following isn't part of the API, and isn't documented.
194203
protected:
204+
/// @cond documentNonPublic The following isn't part of the API, and isn't documented.
195205
friend class ReaderImpl;
196206

197-
E57_OBJECT_IMPLEMENTATION( Reader ) // Internal implementation details, not part of API, must be last in object
198-
//! @endcond
207+
E57_OBJECT_IMPLEMENTATION( Reader ) // must be last in object
208+
/// @endcond
199209
}; // end Reader class
200210

201211
} // end namespace e57

0 commit comments

Comments
 (0)