source: trunk/source/geometry/solids/specific/include/G4EllipticalCone.hh@ 900

Last change on this file since 900 was 850, checked in by garnier, 17 years ago

geant4.8.2 beta

File size: 6.2 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id: G4EllipticalCone.hh,v 1.11 2007/08/20 15:21:40 tnikitin Exp $
28// GEANT4 tag $Name: HEAD $
29//
30//
31// --------------------------------------------------------------------
32// GEANT 4 class header file
33//
34// G4EllipticalCone
35//
36// Class description:
37//
38// G4EllipticalCone is a full cone with elliptical base which can be cut in Z.
39//
40// Member Data:
41//
42// xSemiAxis semi-axis, x, without dimentions
43// ySemiAxis semi-axis, y, without dimentions
44// zheight height, z
45// zTopCut upper cut plane level, z
46//
47// The height in Z corresponds to where the elliptical cone hits the
48// Z-axis if it had no Z cut. Also the cone is centered at zero having a
49// base at zTopCut and another at -zTopCut. The semi-major axes at the Z=0
50// plane are given by xSemiAxis*zheight and ySemiAxis*zheight so that the
51// curved surface of our cone satisfies the equation:
52//
53// ***************************************************************************
54// * *
55// * (x/xSemiAxis)^2 + (y/ySemiAxis)^2 = (zheight - z)^2 *
56// * *
57// ***************************************************************************
58//
59// In case you want to construct G4EllipticalCone from :
60// 1. halflength in Z = zTopCut
61// 2. Dx and Dy = halflength of ellipse axis at z = -zTopCut
62// 3. dx and dy = halflength of ellipse axis at z = zTopCut
63// ! Attention : dx/dy=Dx/Dy
64//
65// You need to find xSemiAxis,ySemiAxis and zheight:
66//
67// xSemiAxis = (Dx-dx)/(2*zTopCut)
68// ySemiAxis = (Dy-dy)/(2*zTopCut)
69// zheight = (Dx+dx)/(2*xSemiAxis)
70//
71// Author:
72// Dionysios Anninos, 8.9.2005
73//
74// Revision:
75// Lukas Lindroos, Tatiana Nikitina 20.08.2007
76//
77// --------------------------------------------------------------------
78#ifndef G4EllipticalCone_HH
79#define G4EllipticalCone_HH
80
81#include "G4VSolid.hh"
82
83class G4EllipticalCone : public G4VSolid
84{
85 public: // with description
86
87 G4EllipticalCone(const G4String& pName,
88 G4double pxSemiAxis,
89 G4double pySemiAxis,
90 G4double zMax,
91 G4double pzTopCut);
92
93 virtual ~G4EllipticalCone();
94
95 // Access functions
96 //
97 inline G4double GetSemiAxisMax () const;
98 inline G4double GetZTopCut() const;
99 inline void SetSemiAxis (G4double x, G4double y, G4double z);
100 inline void SetZCut (G4double newzTopCut);
101
102 inline G4double GetCubicVolume();
103 inline G4double GetSurfaceArea();
104
105 // Solid standard methods
106 //
107 G4bool CalculateExtent(const EAxis pAxis,
108 const G4VoxelLimits& pVoxelLimit,
109 const G4AffineTransform& pTransform,
110 G4double& pmin, G4double& pmax) const;
111
112 EInside Inside(const G4ThreeVector& p) const;
113
114 G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
115
116 G4double DistanceToIn(const G4ThreeVector& p,
117 const G4ThreeVector& v) const;
118
119 G4double DistanceToIn(const G4ThreeVector& p) const;
120
121 G4double DistanceToOut(const G4ThreeVector& p,
122 const G4ThreeVector& v,
123 const G4bool calcNorm=G4bool(false),
124 G4bool *validNorm=0,
125 G4ThreeVector *n=0) const;
126
127 G4double DistanceToOut(const G4ThreeVector& p) const;
128
129 G4GeometryType GetEntityType() const;
130
131 G4ThreeVector GetPointOnSurface() const;
132
133 std::ostream& StreamInfo(std::ostream& os) const;
134
135 // Visualisation functions
136 //
137 G4Polyhedron* GetPolyhedron () const;
138 void DescribeYourselfTo(G4VGraphicsScene& scene) const;
139 G4VisExtent GetExtent() const;
140 G4Polyhedron* CreatePolyhedron() const;
141 G4NURBS* CreateNURBS() const;
142
143 public: // without description
144
145 G4EllipticalCone(__void__&);
146 // Fake default constructor for usage restricted to direct object
147 // persistency for clients requiring preallocation of memory for
148 // persistifiable objects.
149
150 protected: // without description
151
152 G4ThreeVectorList* CreateRotatedVertices(const G4AffineTransform& pT,
153 G4int& noPV) const;
154
155 mutable G4Polyhedron* fpPolyhedron;
156
157 private:
158
159 G4double kRadTolerance;
160
161 G4double fCubicVolume;
162 G4double fSurfaceArea;
163 G4double xSemiAxis, ySemiAxis, zheight,
164 semiAxisMax, zTopCut;
165};
166
167#include "G4EllipticalCone.icc"
168
169#endif
Note: See TracBrowser for help on using the repository browser.