2626#include < celutil/logger.h>
2727#include " 3dsmodel.h"
2828
29- namespace celutil = celestia::util;
30- using celestia:: util::GetLogger;
29+ namespace util = celestia::util;
30+ using util::GetLogger;
3131
3232namespace
3333{
@@ -105,7 +105,7 @@ namespace
105105bool readChunkType (std::istream& in, M3DChunkType& chunkType)
106106{
107107 std::uint16_t value;
108- if (!celutil ::readLE<std::uint16_t >(in, value)) { return false ; }
108+ if (!util ::readLE<std::uint16_t >(in, value)) { return false ; }
109109 chunkType = static_cast <M3DChunkType>(value);
110110 return true ;
111111}
@@ -185,7 +185,7 @@ bool readChunks(std::istream& in, std::int32_t contentSize, T& obj, ProcessFunc
185185 GetLogger ()->debug (" Found chunk type {}\n " , chunkType);
186186
187187 std::int32_t chunkSize;
188- if (!celutil ::readLE<std::int32_t >(in, chunkSize))
188+ if (!util ::readLE<std::int32_t >(in, chunkSize))
189189 {
190190 GetLogger ()->error (" Failed to read chunk size\n " , chunkType);
191191 return false ;
@@ -224,7 +224,7 @@ bool readPointArray(std::istream& in, std::int32_t contentSize, M3DTriangleMesh&
224224 }
225225
226226 std::uint16_t nPoints;
227- if (!celutil ::readLE<std::uint16_t >(in, nPoints))
227+ if (!util ::readLE<std::uint16_t >(in, nPoints))
228228 {
229229 GetLogger ()->error (" Failed to read point array count\n " );
230230 return false ;
@@ -241,9 +241,9 @@ bool readPointArray(std::istream& in, std::int32_t contentSize, M3DTriangleMesh&
241241 for (std::int32_t i = 0 ; i < pointsCount; ++i)
242242 {
243243 Eigen::Vector3f vertex;
244- if (!celutil ::readLE<float >(in, vertex.x ())
245- || !celutil ::readLE<float >(in, vertex.y ())
246- || !celutil ::readLE<float >(in, vertex.z ()))
244+ if (!util ::readLE<float >(in, vertex.x ())
245+ || !util ::readLE<float >(in, vertex.y ())
246+ || !util ::readLE<float >(in, vertex.z ()))
247247 {
248248 GetLogger ()->error (" Failed to read entry {} of point array\n " , i);
249249 return false ;
@@ -266,7 +266,7 @@ bool readTextureCoordArray(std::istream& in, std::int32_t contentSize, M3DTriang
266266 }
267267
268268 std::uint16_t nTexCoords;
269- if (!celutil ::readLE<std::uint16_t >(in, nTexCoords))
269+ if (!util ::readLE<std::uint16_t >(in, nTexCoords))
270270 {
271271 GetLogger ()->error (" Failed to read texture coord array count\n " );
272272 return false ;
@@ -283,8 +283,8 @@ bool readTextureCoordArray(std::istream& in, std::int32_t contentSize, M3DTriang
283283 for (std::int32_t i = 0 ; i < texCoordsCount; ++i)
284284 {
285285 Eigen::Vector2f texCoord;
286- if (!celutil ::readLE<float >(in, texCoord.x ())
287- || !celutil ::readLE<float >(in, texCoord.y ()))
286+ if (!util ::readLE<float >(in, texCoord.x ())
287+ || !util ::readLE<float >(in, texCoord.y ()))
288288 {
289289 GetLogger ()->error (" Failed to read entry {} of texture coord array\n " , i);
290290 return false ;
@@ -310,7 +310,7 @@ bool readMeshMaterialGroup(std::istream& in, std::int32_t contentSize, M3DTriang
310310 }
311311
312312 std::uint16_t nFaces;
313- if (!celutil ::readLE<std::uint16_t >(in, nFaces))
313+ if (!util ::readLE<std::uint16_t >(in, nFaces))
314314 {
315315 GetLogger ()->error (" Failed to read material group face array count\n " );
316316 return false ;
@@ -327,7 +327,7 @@ bool readMeshMaterialGroup(std::istream& in, std::int32_t contentSize, M3DTriang
327327 for (std::int32_t i = 0 ; i < faceCount; ++i)
328328 {
329329 std::uint16_t faceIndex;
330- if (!celutil ::readLE (in, faceIndex))
330+ if (!util ::readLE (in, faceIndex))
331331 {
332332 GetLogger ()->error (" Failed to read entry {} of material group face array\n " , i);
333333 return false ;
@@ -354,7 +354,7 @@ bool readMeshSmoothGroup(std::istream& in, std::int32_t contentSize, M3DTriangle
354354 for (std::int32_t i = 0 ; i < faceCount; ++i)
355355 {
356356 std::uint32_t groups;
357- if (!celutil ::readLE<std::uint32_t >(in, groups))
357+ if (!util ::readLE<std::uint32_t >(in, groups))
358358 {
359359 GetLogger ()->error (" Failed to read entry {} of smoothing group array\n " , i);
360360 return false ;
@@ -395,7 +395,7 @@ bool readFaceArray(std::istream& in, std::int32_t contentSize, M3DTriangleMesh&
395395 }
396396
397397 std::uint16_t nFaces;
398- if (!celutil ::readLE<std::uint16_t >(in, nFaces))
398+ if (!util ::readLE<std::uint16_t >(in, nFaces))
399399 {
400400 GetLogger ()->error (" Failed to read face array count\n " );
401401 return false ;
@@ -412,10 +412,10 @@ bool readFaceArray(std::istream& in, std::int32_t contentSize, M3DTriangleMesh&
412412 for (std::int32_t i = 0 ; i < faceCount; ++i)
413413 {
414414 std::uint16_t v0, v1, v2, flags;
415- if (!celutil ::readLE<std::uint16_t >(in, v0)
416- || !celutil ::readLE<std::uint16_t >(in, v1)
417- || !celutil ::readLE<std::uint16_t >(in, v2)
418- || !celutil ::readLE<std::uint16_t >(in, flags))
415+ if (!util ::readLE<std::uint16_t >(in, v0)
416+ || !util ::readLE<std::uint16_t >(in, v1)
417+ || !util ::readLE<std::uint16_t >(in, v2)
418+ || !util ::readLE<std::uint16_t >(in, flags))
419419 {
420420 GetLogger ()->error (" Failed to read entry {} of face array\n " , i);
421421 return false ;
@@ -445,7 +445,7 @@ bool readMeshMatrix(std::istream& in, std::int32_t contentSize, M3DTriangleMesh&
445445 float elements[12 ];
446446 for (std::size_t i = 0 ; i < 12 ; ++i)
447447 {
448- if (!celutil ::readLE<float >(in, elements[i]))
448+ if (!util ::readLE<float >(in, elements[i]))
449449 {
450450 GetLogger ()->error (" Failed to read element {} of mesh matrix\n " , i);
451451 return false ;
@@ -537,9 +537,9 @@ bool readColorFloat(std::istream& in, std::int32_t contentSize, M3DColor& color)
537537 return skipTrailing (in, contentSize);
538538 }
539539
540- if (!celutil ::readLE<float >(in, color.red )
541- || !celutil ::readLE<float >(in, color.green )
542- || !celutil ::readLE<float >(in, color.blue ))
540+ if (!util ::readLE<float >(in, color.red )
541+ || !util ::readLE<float >(in, color.green )
542+ || !util ::readLE<float >(in, color.blue ))
543543 {
544544 GetLogger ()->error (" Error reading ColorFloat RGB values" );
545545 return false ;
@@ -578,7 +578,7 @@ bool readIntPercentage(std::istream& in, std::int32_t contentSize, float& percen
578578 }
579579
580580 std::int16_t value;
581- if (!celutil ::readLE<std::int16_t >(in, value))
581+ if (!util ::readLE<std::int16_t >(in, value))
582582 {
583583 GetLogger ()->error (" Error reading IntPercentage\n " );
584584 return false ;
@@ -598,7 +598,7 @@ bool readFloatPercentage(std::istream& in, std::int32_t contentSize, float& perc
598598 return skipTrailing (in, contentSize);
599599 }
600600
601- if (!celutil ::readLE<float >(in, percentage))
601+ if (!util ::readLE<float >(in, percentage))
602602 {
603603 GetLogger ()->error (" Error reading FloatPercentage\n " );
604604 return false ;
@@ -786,7 +786,7 @@ std::unique_ptr<M3DScene> Read3DSFile(std::istream& in)
786786 }
787787
788788 std::int32_t chunkSize;
789- if (!celutil ::readLE<std::int32_t >(in, chunkSize) || chunkSize < chunkHeaderSize)
789+ if (!util ::readLE<std::int32_t >(in, chunkSize) || chunkSize < chunkHeaderSize)
790790 {
791791 GetLogger ()->error (" Read3DSFile: Error reading 3DS file top level chunk size\n " );
792792 return nullptr ;
0 commit comments