00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 #ifndef G4Para_HH
00072 #define G4Para_HH
00073
00074 #include "G4CSGSolid.hh"
00075
00076 class G4Para : public G4CSGSolid
00077 {
00078 public:
00079
00080 G4Para(const G4String& pName,
00081 G4double pDx, G4double pDy, G4double pDz,
00082 G4double pAlpha, G4double pTheta, G4double pPhi);
00083
00084 G4Para(const G4String& pName,
00085 const G4ThreeVector pt[8]);
00086
00087 virtual ~G4Para();
00088
00089
00090
00091 inline G4double GetZHalfLength() const;
00092 inline G4ThreeVector GetSymAxis() const;
00093 inline G4double GetYHalfLength() const;
00094 inline G4double GetXHalfLength() const;
00095 inline G4double GetTanAlpha() const;
00096
00097
00098
00099 inline void SetXHalfLength(G4double val);
00100 inline void SetYHalfLength(G4double val);
00101 inline void SetZHalfLength(G4double val);
00102 inline void SetAlpha(G4double alpha);
00103 inline void SetTanAlpha(G4double val);
00104 inline void SetThetaAndPhi(double pTheta, double pPhi);
00105
00106 void SetAllParameters(G4double pDx, G4double pDy, G4double pDz,
00107 G4double pAlpha, G4double pTheta, G4double pPhi);
00108
00109
00110
00111 inline G4double GetCubicVolume();
00112 inline G4double GetSurfaceArea();
00113
00114 void ComputeDimensions(G4VPVParameterisation* p,
00115 const G4int n,
00116 const G4VPhysicalVolume* pRep);
00117
00118 G4bool CalculateExtent(const EAxis pAxis,
00119 const G4VoxelLimits& pVoxelLimit,
00120 const G4AffineTransform& pTransform,
00121 G4double& pMin, G4double& pMax) const;
00122
00123 EInside Inside(const G4ThreeVector& p) const;
00124
00125 G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
00126
00127 G4double DistanceToIn(const G4ThreeVector& p,
00128 const G4ThreeVector& v) const;
00129 G4double DistanceToIn(const G4ThreeVector& p) const;
00130
00131 G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v,
00132 const G4bool calcNorm=G4bool(false),
00133 G4bool *validNorm=0, G4ThreeVector *n=0) const;
00134 G4double DistanceToOut(const G4ThreeVector& p) const;
00135
00136 G4GeometryType GetEntityType() const;
00137
00138 G4ThreeVector GetPointOnSurface() const;
00139
00140 G4VSolid* Clone() const;
00141
00142 std::ostream& StreamInfo(std::ostream& os) const;
00143
00144
00145
00146 void DescribeYourselfTo (G4VGraphicsScene& scene) const;
00147 G4Polyhedron* CreatePolyhedron () const;
00148 G4NURBS* CreateNURBS () const;
00149
00150 public:
00151
00152 G4Para(__void__&);
00153
00154
00155
00156
00157 G4Para(const G4Para& rhs);
00158 G4Para& operator=(const G4Para& rhs);
00159
00160
00161 protected:
00162
00163 G4ThreeVectorList*
00164 CreateRotatedVertices(const G4AffineTransform& pTransform) const;
00165
00166 private:
00167
00168 G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p) const;
00169
00170
00171
00172 G4ThreeVector GetPointOnPlane(G4ThreeVector p0, G4ThreeVector p1,
00173 G4ThreeVector p2, G4ThreeVector p3,
00174 G4double& area) const;
00175
00176
00177 private:
00178
00179 G4double fDx,fDy,fDz;
00180 G4double fTalpha,fTthetaCphi,fTthetaSphi;
00181 };
00182
00183 #include "G4Para.icc"
00184
00185 #endif