Open
Conversation
ed35d46 to
f91f8cc
Compare
f91f8cc to
5a712ad
Compare
Contributor
Cpp-Linter Report
|
Contributor
There was a problem hiding this comment.
Cpp-linter Review
Used clang-format v18.1.3
Only 20 out of 24 clang-format concerns fit within this pull request's diff.
Click here for the full clang-format patch
diff --git a/sysrap/sn.h b/sysrap/sn.h
index 8b74e4a..bcb1b18 100644
--- a/sysrap/sn.h
+++ b/sysrap/sn.h
@@ -453,3 +453,2 @@ struct SYSRAP_API sn
-
- static sn* Trapezoid(double z, double y, double x, double ltx);
- static sn* Cone(double r1, double z1, double r2, double z2);
+ static sn *Trapezoid(double z, double y, double x, double ltx);
+ static sn *Cone(double r1, double z1, double r2, double z2);
@@ -3104,2 +3102,0 @@ inline void sn::CutCylinderZRange(
-
-
@@ -3114 +3111 @@ inline void sn::CutCylinderZRange(
-inline sn* sn::Trapezoid(double z, double y, double x, double ltx)
+inline sn *sn::Trapezoid(double z, double y, double x, double ltx)
@@ -3116,2 +3113,2 @@ inline sn* sn::Trapezoid(double z, double y, double x, double ltx)
- assert( x > 0 && y > 0 && z > 0 && ltx > 0 && ltx < x );
- sn* nd = Create(CSG_TRAPEZOID);
+ assert(x > 0 && y > 0 && z > 0 && ltx > 0 && ltx < x);
+ sn *nd = Create(CSG_TRAPEZOID);
@@ -3119 +3116 @@ inline sn* sn::Trapezoid(double z, double y, double x, double ltx)
- nd->setBB(-0.5*x, -0.5*y, -0.5*z, +0.5*x, +0.5*y, +0.5*z);
+ nd->setBB(-0.5 * x, -0.5 * y, -0.5 * z, +0.5 * x, +0.5 * y, +0.5 * z);
@@ -3123 +3120 @@ inline sn* sn::Trapezoid(double z, double y, double x, double ltx)
-inline sn* sn::Cone(double r1, double z1, double r2, double z2) // static
+inline sn *sn::Cone(double r1, double z1, double r2, double z2) // static
@@ -5230 +5227 @@ inline void sn::setAABB_LeafFrame()
- else if( typecode == CSG_TRAPEZOID )
+ else if (typecode == CSG_TRAPEZOID)
@@ -5234 +5231 @@ inline void sn::setAABB_LeafFrame()
- setBB(-0.5*x, -0.5*y, -0.5*z, +0.5*x, +0.5*y, +0.5*z);
+ setBB(-0.5 * x, -0.5 * y, -0.5 * z, +0.5 * x, +0.5 * y, +0.5 * z);
@@ -5236 +5233 @@ inline void sn::setAABB_LeafFrame()
- else if( typecode == CSG_DISC )
+ else if (typecode == CSG_DISC)
diff --git a/u4/U4Solid.h b/u4/U4Solid.h
index af4873e..0bddbaf 100644
--- a/u4/U4Solid.h
+++ b/u4/U4Solid.h
@@ -40,3 +39,0 @@ npy/NNodeUncoincide npy/NNodeNudger
-#include "G4Orb.hh"
-#include "G4Sphere.hh"
-#include "G4Ellipsoid.hh"
@@ -44,4 +40,0 @@ npy/NNodeUncoincide npy/NNodeNudger
-#include "G4Tubs.hh"
-#include "G4CutTubs.hh"
-#include "G4Trap.hh"
-#include "G4Polycone.hh"
@@ -48,0 +42,2 @@ npy/NNodeUncoincide npy/NNodeNudger
+#include "G4CutTubs.hh"
+#include "G4Ellipsoid.hh"
@@ -49,0 +45 @@ npy/NNodeUncoincide npy/NNodeNudger
+#include "G4IntersectionSolid.hh"
@@ -50,0 +47,4 @@ npy/NNodeUncoincide npy/NNodeNudger
+#include "G4Orb.hh"
+#include "G4Polycone.hh"
+#include "G4Sphere.hh"
+#include "G4SubtractionSolid.hh"
@@ -51,0 +52,2 @@ npy/NNodeUncoincide npy/NNodeNudger
+#include "G4Trap.hh"
+#include "G4Tubs.hh"
@@ -53,2 +54,0 @@ npy/NNodeUncoincide npy/NNodeNudger
-#include "G4IntersectionSolid.hh"
-#include "G4SubtractionSolid.hh"
@@ -92,2 +92,2 @@ struct U4Solid
- static constexpr const char* G4Trap_ = "Trp" ;
- static constexpr const char* G4Polycone_ = "Pol" ;
+ static constexpr const char *G4Trap_ = "Trp";
+ static constexpr const char *G4Polycone_ = "Pol";
@@ -290,2 +290,4 @@ inline int U4Solid::Type(const char* name) // static
- if( strcmp(name, "G4Trap") == 0 ) type = _G4Trap ;
- if( strcmp(name, "G4Polycone") == 0 ) type = _G4Polycone ;
+ if (strcmp(name, "G4Trap") == 0)
+ type = _G4Trap;
+ if (strcmp(name, "G4Polycone") == 0)
+ type = _G4Polycone;
@@ -314,2 +316,6 @@ inline const char* U4Solid::Tag(int type) // static
- case _G4Trap: tag = G4Trap_ ; break ;
- case _G4Polycone: tag = G4Polycone_ ; break ;
+ case _G4Trap:
+ tag = G4Trap_;
+ break;
+ case _G4Polycone:
+ tag = G4Polycone_;
+ break;
@@ -412,2 +418,6 @@ inline void U4Solid::init_Constituents()
- case _G4Trap : init_Trap() ; break ;
- case _G4Polycone : init_Polycone() ; break ;
+ case _G4Trap:
+ init_Trap();
+ break;
+ case _G4Polycone:
+ init_Polycone();
+ break;
@@ -879,3 +888,0 @@ inline void U4Solid::init_CutTubs()
-
-
-
@@ -884 +891 @@ inline void U4Solid::init_Trap()
- const G4Trap* trap = dynamic_cast<const G4Trap*>(solid);
+ const G4Trap *trap = dynamic_cast<const G4Trap *>(solid);
@@ -887,4 +894,4 @@ inline void U4Solid::init_Trap()
- double z = 2*trap->GetZHalfLength()/CLHEP::mm;
- double y = 2*trap->GetYHalfLength1()/CLHEP::mm;
- double x = 2*trap->GetXHalfLength1()/CLHEP::mm;
- double ltx = 2*trap->GetXHalfLength2()/CLHEP::mm;
+ double z = 2 * trap->GetZHalfLength() / CLHEP::mm;
+ double y = 2 * trap->GetYHalfLength1() / CLHEP::mm;
+ double x = 2 * trap->GetXHalfLength1() / CLHEP::mm;
+ double ltx = 2 * trap->GetXHalfLength2() / CLHEP::mm;
@@ -895 +901,0 @@ inline void U4Solid::init_Trap()
-
Have any feedback or feature suggestions? Share it here.
Comment on lines
+453
to
455
|
|
||
| static sn* Trapezoid(double z, double y, double x, double ltx); | ||
| static sn* Cone(double r1, double z1, double r2, double z2); |
Contributor
There was a problem hiding this comment.
clang-format suggestion
Suggested change
| static sn* Trapezoid(double z, double y, double x, double ltx); | |
| static sn* Cone(double r1, double z1, double r2, double z2); | |
| static sn *Trapezoid(double z, double y, double x, double ltx); | |
| static sn *Cone(double r1, double z1, double r2, double z2); |
Comment on lines
3104
to
3105
|
|
||
|
|
Contributor
There was a problem hiding this comment.
clang-format suggestion
Please remove the line(s)
- 3104
- 3105
| * https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Detector/Geometry/geomSolids.html#constructed-solid-geometry-csg-solids | ||
| * https://github.com/Geant4/geant4/blob/master/source/geometry/solids/CSG/include/G4Trap.hh | ||
| */ | ||
| inline sn* sn::Trapezoid(double z, double y, double x, double ltx) |
Contributor
There was a problem hiding this comment.
clang-format suggestion
Suggested change
| inline sn* sn::Trapezoid(double z, double y, double x, double ltx) | |
| inline sn *sn::Trapezoid(double z, double y, double x, double ltx) |
Comment on lines
+3116
to
+3117
| assert( x > 0 && y > 0 && z > 0 && ltx > 0 && ltx < x ); | ||
| sn* nd = Create(CSG_TRAPEZOID); |
Contributor
There was a problem hiding this comment.
clang-format suggestion
Suggested change
| assert( x > 0 && y > 0 && z > 0 && ltx > 0 && ltx < x ); | |
| sn* nd = Create(CSG_TRAPEZOID); | |
| assert(x > 0 && y > 0 && z > 0 && ltx > 0 && ltx < x); | |
| sn *nd = Create(CSG_TRAPEZOID); |
| assert( x > 0 && y > 0 && z > 0 && ltx > 0 && ltx < x ); | ||
| sn* nd = Create(CSG_TRAPEZOID); | ||
| nd->setPA(x, y, z, 0.f, ltx, 0.f); | ||
| nd->setBB(-0.5*x, -0.5*y, -0.5*z, +0.5*x, +0.5*y, +0.5*z); |
Contributor
There was a problem hiding this comment.
clang-format suggestion
Suggested change
| nd->setBB(-0.5*x, -0.5*y, -0.5*z, +0.5*x, +0.5*y, +0.5*z); | |
| nd->setBB(-0.5 * x, -0.5 * y, -0.5 * z, +0.5 * x, +0.5 * y, +0.5 * z); |
Comment on lines
+412
to
413
| case _G4Trap : init_Trap() ; break ; | ||
| case _G4Polycone : init_Polycone() ; break ; |
Contributor
There was a problem hiding this comment.
clang-format suggestion
Suggested change
| case _G4Trap : init_Trap() ; break ; | |
| case _G4Polycone : init_Polycone() ; break ; | |
| case _G4Trap: | |
| init_Trap(); | |
| break; | |
| case _G4Polycone: | |
| init_Polycone(); | |
| break; |
Comment on lines
879
to
881
|
|
||
|
|
||
|
|
Contributor
There was a problem hiding this comment.
clang-format suggestion
Please remove the line(s)
- 879
- 880
- 881
|
|
||
| inline void U4Solid::init_Trap() | ||
| { | ||
| const G4Trap* trap = dynamic_cast<const G4Trap*>(solid); |
Contributor
There was a problem hiding this comment.
clang-format suggestion
Suggested change
| const G4Trap* trap = dynamic_cast<const G4Trap*>(solid); | |
| const G4Trap *trap = dynamic_cast<const G4Trap *>(solid); |
Comment on lines
+887
to
+890
| double z = 2*trap->GetZHalfLength()/CLHEP::mm; | ||
| double y = 2*trap->GetYHalfLength1()/CLHEP::mm; | ||
| double x = 2*trap->GetXHalfLength1()/CLHEP::mm; | ||
| double ltx = 2*trap->GetXHalfLength2()/CLHEP::mm; |
Contributor
There was a problem hiding this comment.
clang-format suggestion
Suggested change
| double z = 2*trap->GetZHalfLength()/CLHEP::mm; | |
| double y = 2*trap->GetYHalfLength1()/CLHEP::mm; | |
| double x = 2*trap->GetXHalfLength1()/CLHEP::mm; | |
| double ltx = 2*trap->GetXHalfLength2()/CLHEP::mm; | |
| double z = 2 * trap->GetZHalfLength() / CLHEP::mm; | |
| double y = 2 * trap->GetYHalfLength1() / CLHEP::mm; | |
| double x = 2 * trap->GetXHalfLength1() / CLHEP::mm; | |
| double ltx = 2 * trap->GetXHalfLength2() / CLHEP::mm; |
| root = sn::Trapezoid(z, y, x, ltx); | ||
| } | ||
|
|
||
|
|
Contributor
There was a problem hiding this comment.
clang-format suggestion
Please remove the line(s)
- 895
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.