49 delete fpHeadPolyhedron;
50 delete fpShaftPolyhedron;
58 G4int lineSegmentsPerCircle,
60: fpShaftPolyhedron(nullptr)
61, fpHeadPolyhedron(nullptr)
62, fTransform(transform)
64 fType =
"G4ArrowModel";
83 G4double totalLength = std::hypot(x2-x1, y2-y1, z2-z1);
84 if (totalLength < tolerance)
85 {totalLength = tolerance;}
88 if (shaftRadius < tolerance)
89 {shaftRadius = tolerance;}
93 G4double arrowLength = std::min(1.5*width, 0.5*totalLength);
95 G4double shaftLength = totalLength - arrowLength;
96 if (shaftLength < 2*tolerance)
97 {shaftLength = 2*tolerance;}
99 const G4Tubs shaft(
"shaft",0.,shaftRadius,0.5*shaftLength,0.,twopi);
102 if (fpShaftPolyhedron)
106 const G4double zHi = 0.5*totalLength;
107 const G4double zLow = zHi - arrowLength;
109 const G4double xExt = std::sqrt(3.)*rExt/2.;
110 const G4Tet head(
"head",
121 const G4Point3D arrowCentre(0.5*(x1+x2),0.5*(y1+y2),0.5*(z1+z2));
124 if (fpShaftPolyhedron) fpShaftPolyhedron->
Transform(tr);
125 if (fpHeadPolyhedron) fpHeadPolyhedron->
Transform(tr);
139 if (fpShaftPolyhedron && fpHeadPolyhedron) {
CLHEP::Hep3Vector G4ThreeVector
HepGeom::Vector3D< G4double > G4Vector3D
G4ArrowModel(G4double x1, G4double y1, G4double z1, G4double x2, G4double y2, G4double z2, G4double width, const G4Colour &colour, const G4String &description="", G4int lineSegmentsPerCircle=6, const G4Transform3D &transform=G4Transform3D())
void DescribeYourselfTo(G4VGraphicsScene &) override
G4double GetRadialTolerance() const
static G4GeometryTolerance * GetInstance()
G4Polyhedron * CreatePolyhedron() const
G4Polyhedron * CreatePolyhedron() const
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual void AddPrimitive(const G4Polyline &)=0
virtual void EndPrimitives()=0
G4String fGlobalDescription
void SetColour(const G4Colour &)
void SetForceSolid(G4bool=true)
void SetVisAttributes(const G4VisAttributes *)
BasicVector3D< T > unit() const
static void SetNumberOfRotationSteps(G4int n)
static G4int GetNumberOfRotationSteps()
HepPolyhedron & Transform(const G4Transform3D &t)