G4SurfaceProperty.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4SurfaceProperty.cc 67044 2013-01-30 08:50:06Z gcosmo $
00028 //
00029 // 
00031 // G4SurfaceProperty Implementation
00033 //
00034 // Class Description:
00035 //
00036 // A base class describing a surface property.
00037 // Derived classes are G4Opticalsurface, G4Firovsurface, etc.      
00038 //
00039 // File:        G4SurfaceProperty.cc
00040 // Version:     1.0
00041 // Created:     16-11-2006
00042 // Author:      Peter Gumplinger
00043 //
00045 
00046 #include "globals.hh"
00047 
00048 #include "G4SurfaceProperty.hh"
00049 
00050 G4SurfacePropertyTable G4SurfaceProperty::theSurfacePropertyTable;
00051 
00052 //
00053 // Constructor and destructor
00054 //
00055 G4SurfaceProperty::G4SurfaceProperty( const G4String& name,
00056                                             G4SurfaceType type )
00057   : theName(name), theType(type)
00058 {
00059   theSurfacePropertyTable.push_back(this);
00060 }
00061 
00062 //
00063 // Dummy constructor
00064 //
00065 G4SurfaceProperty::G4SurfaceProperty()
00066   : theName("Dielectric"), theType(dielectric_metal)
00067 {
00068   theSurfacePropertyTable.push_back(this);
00069 }
00070 
00071 G4SurfaceProperty::~G4SurfaceProperty()
00072 {
00073 }
00074 
00075 //
00076 // Methods
00077 //
00078 
00079 const G4SurfacePropertyTable* G4SurfaceProperty::GetSurfacePropertyTable()
00080 {
00081   return &theSurfacePropertyTable;
00082 }
00083 
00084 size_t G4SurfaceProperty::GetNumberOfSurfaceProperties()
00085 {
00086   return theSurfacePropertyTable.size();
00087 }
00088 
00089 // Dump info for known surface properties
00090 //
00091 void G4SurfaceProperty::DumpTableInfo()
00092 {
00093   G4cout << "***** Surface Property Table : Nb of Surface Properties = "
00094          << GetNumberOfSurfaceProperties() << " *****" << G4endl;
00095 
00096   for (size_t i=0; i<theSurfacePropertyTable.size(); i++)
00097   {
00098     G4SurfaceProperty* pSurfaceProperty = theSurfacePropertyTable[i];
00099     G4cout << pSurfaceProperty->GetName() << " : " << G4endl
00100            << "  Surface Property type   = " 
00101            << pSurfaceProperty->GetType()
00102            << G4endl;
00103   }
00104   G4cout << G4endl;
00105 }
00106 
00107 void G4SurfaceProperty::CleanSurfacePropertyTable()
00108 {
00109   DumpTableInfo();
00110   G4SurfacePropertyTable::iterator pos;
00111   for(pos=theSurfacePropertyTable.begin();
00112       pos!=theSurfacePropertyTable.end(); pos++)
00113   {
00114     if (*pos) delete *pos;
00115   }
00116   theSurfacePropertyTable.clear();
00117   DumpTableInfo();
00118 }

Generated on Mon May 27 17:49:56 2013 for Geant4 by  doxygen 1.4.7