35#ifndef G4VTWISTEDFACETED_HH
36#define G4VTWISTEDFACETED_HH
87 const G4bool calcnorm =
false,
88 G4bool* validnorm =
nullptr,
107 std::ostream &
StreamInfo(std::ostream& os)
const override;
157 void CreateSurfaces();
200 p.
set(kInfinity,kInfinity,kInfinity); inside =
kOutside;
202 ~LastState()=
default;
203 LastState(
const LastState& r) =
default;
204 LastState& operator=(
const LastState& r)
206 if (
this == &r) {
return *
this; }
207 p = r.p; inside = r.inside;
220 p.
set(kInfinity,kInfinity,kInfinity);
221 vec.
set(kInfinity,kInfinity,kInfinity);
228 LastVector(
const LastVector& r) : p(r.p), vec(r.vec)
231 surface[0] = r.surface[0];
233 LastVector& operator=(
const LastVector& r)
235 if (&r ==
this) {
return *
this; }
236 p = r.p; vec = r.vec;
238 surface[0] = r.surface[0];
252 p.
set(kInfinity,kInfinity,kInfinity);
255 ~LastValue()=
default;
256 LastValue(
const LastValue& r) =
default;
257 LastValue& operator=(
const LastValue& r)
259 if (
this == &r) {
return *
this; }
260 p = r.p; value = r.value;
268 class LastValueWithDoubleVector
271 LastValueWithDoubleVector()
273 p.
set(kInfinity,kInfinity,kInfinity);
274 vec.
set(kInfinity,kInfinity,kInfinity);
277 ~LastValueWithDoubleVector()=
default;
278 LastValueWithDoubleVector(
const LastValueWithDoubleVector& r) =
default;
279 LastValueWithDoubleVector& operator=(
const LastValueWithDoubleVector& r)
281 if (
this == &r) {
return *
this; }
282 p = r.p; vec = r.vec; value = r.value;
291 LastState fLastInside;
292 LastVector fLastNormal;
293 LastValue fLastDistanceToIn;
294 LastValue fLastDistanceToOut;
295 LastValueWithDoubleVector fLastDistanceToInWithV;
296 LastValueWithDoubleVector fLastDistanceToOutWithV;
304 return ( fDx4 + fDx2 + ( fDx4 - fDx2 ) * ( 2 * phi ) / fPhiTwist ) ;
310 return ( fDx3 + fDx1 + ( fDx3 - fDx1 ) * ( 2 * phi ) / fPhiTwist ) ;
316 return ( fDy2 + fDy1 + ( fDy2 - fDy1 ) * ( 2 * phi ) / fPhiTwist ) ;
void set(double x, double y, double z)
G4double GetValueD(G4double phi) const
G4Polyhedron * GetPolyhedron() const override
G4double GetValueA(G4double phi) const
void DescribeYourselfTo(G4VGraphicsScene &scene) const override
G4ThreeVector GetPointOnSurface() const override
G4double GetTheta() const
G4VTwistedFaceted & operator=(const G4VTwistedFaceted &rhs)
G4Polyhedron * fpPolyhedron
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const override
G4double GetTwistAngle() const
G4double GetCubicVolume() override
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const override
G4bool fRebuildPolyhedron
G4ThreeVector GetPointInSolid(G4double z) const
EInside Inside(const G4ThreeVector &p) const override
G4double GetAlpha() const
void ComputeDimensions(G4VPVParameterisation *, const G4int, const G4VPhysicalVolume *) override
G4Polyhedron * CreatePolyhedron() const override
std::ostream & StreamInfo(std::ostream &os) const override
virtual ~G4VTwistedFaceted()
G4GeometryType GetEntityType() const override
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcnorm=false, G4bool *validnorm=nullptr, G4ThreeVector *n=nullptr) const override
G4VTwistedFaceted(const G4String &pname, G4double PhiTwist, G4double pDz, G4double pTheta, G4double pPhi, G4double pDy1, G4double pDx1, G4double pDx2, G4double pDy2, G4double pDx3, G4double pDx4, G4double pAlph)
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const override
G4VisExtent GetExtent() const override
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const override
G4double GetValueB(G4double phi) const
G4double Xcoef(G4double u, G4double phi, G4double ftg) const
G4double GetSurfaceArea() override