source: trunk/source/geometry/solids/specific/include/G4EllipticalCone.icc @ 836

Last change on this file since 836 was 831, checked in by garnier, 16 years ago

import all except CVS

File size: 3.3 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.icc,v 1.6 2006/10/20 13:45:20 gcosmo Exp $
28// GEANT4 tag $Name:  $
29//
30//
31// --------------------------------------------------------------------
32// GEANT 4 inline definitions file
33//
34// G4EllipticalCone.icc
35//
36// Implementation of inline methods of G4EllipticalCone
37// --------------------------------------------------------------------
38// Author: Dionysios Anninos
39// --------------------------------------------------------------------
40
41inline
42G4double G4EllipticalCone::GetSemiAxisMax () const
43{
44  return ySemiAxis > xSemiAxis ? ySemiAxis : xSemiAxis;
45}
46
47inline
48G4double G4EllipticalCone::GetZTopCut() const
49{
50  return zTopCut;
51}
52
53inline
54void G4EllipticalCone::SetSemiAxis (G4double newxSemiAxis,
55                                    G4double newySemiAxis,
56                                    G4double newzMax)
57{
58  xSemiAxis = newxSemiAxis;
59  ySemiAxis = newySemiAxis;
60  zheight   = newzMax;
61  semiAxisMax = xSemiAxis > ySemiAxis ? xSemiAxis : ySemiAxis;
62  if (zTopCut > +zheight) { zTopCut = +zheight; }
63}
64
65inline
66void G4EllipticalCone::SetZCut (G4double newzTopCut)
67{
68  if (newzTopCut > +zheight)
69    { zTopCut = +zheight; }
70  else
71    { zTopCut = newzTopCut; }
72}
73
74inline
75G4double G4EllipticalCone::GetCubicVolume()
76{
77  if(fCubicVolume != 0 ) {;}
78  else
79  {
80    if (zTopCut > +zheight )
81    {
82      fCubicVolume = (8./3.)*pi*xSemiAxis*ySemiAxis*zheight*zheight*zheight;
83    }
84    else
85    {   
86      fCubicVolume = pi*xSemiAxis*ySemiAxis*
87                    (2./3.*std::pow(zTopCut,3.)+2.*sqr(zheight)*zTopCut);
88    }
89  }
90  return fCubicVolume;
91}
92
93inline
94G4double G4EllipticalCone::GetSurfaceArea()
95{
96  if(fSurfaceArea != 0.) {;}
97  else   { fSurfaceArea = G4VSolid::GetSurfaceArea(); }
98  return fSurfaceArea;
99}
Note: See TracBrowser for help on using the repository browser.