57 fType =
"G4ArrowModel";
59 fGlobalDescription = fType +
": " + description;
70 const G4double shaftLength = std::sqrt
71 (std::pow(x2-x1,2)+std::pow(y2-y1,2)+std::pow(z2-z1,2));
74 if (shaftRadius > shaftLength/100.) shaftRadius = shaftLength/100.;
75 const G4double halfShaftLength = shaftLength/2.;
76 const G4double halfReduction = 4.*shaftRadius;
77 const G4double halfLength = halfShaftLength-halfReduction;
78 G4Tubs shaft(
"shaft",0.,shaftRadius,halfLength,0.,twopi);
81 fpShaftPolyhedron->Transform(
G4Translate3D(0,0,-halfReduction));
84 const G4int numRZ = 3;
87 for (
G4int i = 0; i < numRZ; i++) {
88 r[i] *= 2.*shaftRadius;
89 z[i] = halfShaftLength + z[i] * 2.*shaftRadius;
96 const G4double theta = arrowDirection.theta();
97 const G4double phi = arrowDirection.phi();
98 const G4Point3D arrowCentre(0.5*(x1+x2),0.5*(y1+y2),0.5*(z1+z2));
101 fpShaftPolyhedron->Transform(tr);
102 fpHeadPolyhedron->Transform(tr);
107 fpShaftPolyhedron->SetVisAttributes(va);
108 fpHeadPolyhedron->SetVisAttributes(va);
void SetColour(const G4Colour &)
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())=0
HepGeom::Point3D< G4double > G4Point3D
HepGeom::Vector3D< G4double > G4Vector3D
void SetForceSolid(G4bool)
virtual void AddPrimitive(const G4Polyline &)=0
G4Polyhedron * CreatePolyhedron() const
G4Polyhedron * CreatePolyhedron() const
G4Polyhedron * fpShaftPolyhedron
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ArrowModel(G4double x1, G4double y1, G4double z1, G4double x2, G4double y2, G4double z2, G4double width, const G4Colour &colour, const G4String &description="")
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
virtual void EndPrimitives()=0
virtual void DescribeYourselfTo(G4VGraphicsScene &)
G4Polyhedron * fpHeadPolyhedron