56 G4int lineSegmentsPerCircle)
58 fType =
"G4ArrowModel";
60 fGlobalDescription = fType +
": " + description;
75 const G4double shaftLength = std::sqrt
76 (std::pow(x2-x1,2)+std::pow(y2-y1,2)+std::pow(z2-z1,2));
79 if (shaftRadius > shaftLength/100.) shaftRadius = shaftLength/100.;
80 const G4double halfShaftLength = shaftLength/2.;
81 const G4double halfReduction = 4.*shaftRadius;
82 const G4double halfLength = halfShaftLength-halfReduction;
83 G4Tubs shaft(
"shaft",0.,shaftRadius,halfLength,0.,
twopi);
89 const G4int numRZ = 3;
92 for (
G4int i = 0; i < numRZ; i++) {
93 r[i] *= 2.*shaftRadius;
94 z[i] = halfShaftLength + z[i] * 2.*shaftRadius;
103 const G4Point3D arrowCentre(0.5*(x1+x2),0.5*(y1+y2),0.5*(z1+z2));
106 fpShaftPolyhedron->Transform(tr);
107 fpHeadPolyhedron->Transform(tr);
112 fpShaftPolyhedron->SetVisAttributes(va);
113 fpHeadPolyhedron->SetVisAttributes(va);
T max(const T t1, const T t2)
brief Return the largest of the two arguments
Float_t y1[n_points_granero]
Float_t x1[n_points_granero]
BasicVector3D< T > unit() const
virtual void EndPrimitives()=0
G4Polyhedron * fpHeadPolyhedron
static void SetNumberOfRotationSteps(G4int n)
G4Polyhedron * CreatePolyhedron() const
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())=0
Float_t y2[n_points_geant4]
HepPolyhedron & Transform(const G4Transform3D &t)
static constexpr double twopi
G4Polyhedron * fpShaftPolyhedron
virtual void DescribeYourselfTo(G4VGraphicsScene &)
G4ArrowModel(G4double x1, G4double y1, G4double z1, G4double x2, G4double y2, G4double z2, G4double width, const G4Colour &colour, const G4String &description="", G4int lineSegmentsPerCircle=6)
virtual void AddPrimitive(const G4Polyline &)=0
HepGeom::Vector3D< G4double > G4Vector3D
static G4int GetNumberOfRotationSteps()
void SetForceSolid(G4bool=true)
G4Polyhedron * CreatePolyhedron() const
void SetColour(const G4Colour &)
Float_t x2[n_points_geant4]
T min(const T t1, const T t2)
brief Return the smallest of the two arguments