source: trunk/source/materials/src/G4SurfaceProperty.cc @ 850

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

geant4.8.2 beta

File size: 3.7 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: G4SurfaceProperty.cc,v 1.4 2008/07/21 20:55:34 gum Exp $
28// GEANT4 tag $Name: HEAD $
29//
30//
31////////////////////////////////////////////////////////////////////////
32// G4SurfaceProperty Implementation
33////////////////////////////////////////////////////////////////////////
34//
35// Class Description:
36//
37// A base class describing a surface property.
38// Derived classes are G4Opticalsurface, G4Firovsurface, etc.     
39//
40// File:        G4SurfaceProperty.cc
41// Version:     1.0
42// Created:     16-11-2006
43// Author:      Peter Gumplinger
44//
45////////////////////////////////////////////////////////////////////////
46
47#include "globals.hh"
48
49#include "G4SurfaceProperty.hh"
50
51G4SurfacePropertyTable G4SurfaceProperty::theSurfacePropertyTable;
52
53//
54// Constructor and destructor
55//
56G4SurfaceProperty::G4SurfaceProperty( const G4String& name,
57                                            G4SurfaceType type )
58  : theName(name), theType(type)
59{
60  theSurfacePropertyTable.push_back(this);
61}
62
63G4SurfaceProperty::~G4SurfaceProperty()
64{
65  Overwrite();
66}
67
68//
69// Methods
70//
71
72const G4SurfacePropertyTable* G4SurfaceProperty::GetSurfacePropertyTable()
73{
74  return &theSurfacePropertyTable;
75}
76
77size_t G4SurfaceProperty::GetNumberOfSurfaceProperties()
78{
79  return theSurfacePropertyTable.size();
80}
81
82// Dump info for known surface properties
83//
84void G4SurfaceProperty::DumpTableInfo()
85{
86  G4cout << "***** Surface Property Table : Nb of Surface Properties = "
87         << GetNumberOfSurfaceProperties() << " *****" << G4endl;
88
89  for (size_t i=0; i<theSurfacePropertyTable.size(); i++)
90  {
91    G4SurfaceProperty* pSurfaceProperty = theSurfacePropertyTable[i];
92    G4cout << pSurfaceProperty->GetName() << " : " << G4endl
93           << "  Surface Property type   = " 
94           << pSurfaceProperty->GetType()
95           << G4endl;
96  }
97  G4cout << G4endl;
98}
99
100void G4SurfaceProperty::CleanSurfacePropertyTable()
101{
102  DumpTableInfo();
103  G4SurfacePropertyTable::iterator pos;
104  for(pos=theSurfacePropertyTable.begin();
105      pos!=theSurfacePropertyTable.end(); pos++)
106  {
107    if (*pos) delete *pos;
108  }
109  theSurfacePropertyTable.clear();
110  DumpTableInfo();
111}
Note: See TracBrowser for help on using the repository browser.