From 3fce3b65917085f8ac34d9bd83149348e4a6f75d Mon Sep 17 00:00:00 2001 From: Mario Luzeiro Date: Sun, 1 Nov 2020 08:10:08 +0000 Subject: [PATCH] 3D-Viewer: fix code style --- .../3d_render_raytracing/shapes2D/citemlayercsg2d.cpp | 8 ++++---- .../3d_render_raytracing/shapes2D/cpolygon2d.cpp | 6 +++--- .../3d_render_raytracing/shapes3D/clayeritem.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/citemlayercsg2d.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/citemlayercsg2d.cpp index cd25870779..7c825c18d8 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/citemlayercsg2d.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/citemlayercsg2d.cpp @@ -116,15 +116,15 @@ bool CITEMLAYERCSG2D::Intersect( const RAYSEG2D &aSegRay, //check against all subbed objects for( unsigned int i = 0; i < m_objectB->size(); ++i ) { - if( ((const COBJECT2D *)(*m_objectB)[i])->IsPointInside( currentRayPos ) ) + if( ( (const COBJECT2D *)( *m_objectB)[i] )->IsPointInside( currentRayPos ) ) { // ray point is inside a subtracted region, so move it to the end of the // subtracted region float hitDist; SFVEC2F tmpNormal; - if( !((const COBJECT2D *)(*m_objectB)[i])->Intersect( currentRay, - &hitDist, - &tmpNormal ) ) + if( !( (const COBJECT2D *)( *m_objectB)[i] )->Intersect( currentRay, + &hitDist, + &tmpNormal ) ) return false; // ray hit main object but did not leave subtracted volume wxASSERT( hitDist <= 1.0f ); diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp index 693ebd7d86..af8fcb5681 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp @@ -541,7 +541,7 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks( SFVEC2UI grid_divisions; - if( aDivFactor < 0.0f) + if( aDivFactor < 0.0f ) { grid_divisions = SFVEC2UI( 1 ); } @@ -551,8 +551,8 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks( aDivFactor = medOfTheSquaresSegmentLength; - grid_divisions.x = (unsigned int)( (bbox.GetExtent().x / aDivFactor) ); - grid_divisions.y = (unsigned int)( (bbox.GetExtent().y / aDivFactor) ); + grid_divisions.x = (unsigned int)( ( bbox.GetExtent().x / aDivFactor ) ); + grid_divisions.y = (unsigned int)( ( bbox.GetExtent().y / aDivFactor ) ); grid_divisions = glm::clamp( grid_divisions , SFVEC2UI( 1, 1 ), diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/clayeritem.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/clayeritem.cpp index ce5033897a..f78f1e0f64 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/clayeritem.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/clayeritem.cpp @@ -64,7 +64,7 @@ bool CLAYERITEM::Intersect( const RAY &aRay, HITINFO &aHitInfo ) const if( tBBoxStart >= aHitInfo.m_tHit ) return false; - if( fabs(tBBoxStart - tBBoxEnd) <= FLT_EPSILON ) + if( fabs( tBBoxStart - tBBoxEnd ) <= FLT_EPSILON ) return false; const bool startedInside = m_bbox.Inside( aRay.m_Origin );