source: trunk/source/materials/src/G4OpticalSurface.cc@ 826

Last change on this file since 826 was 822, checked in by garnier, 17 years ago

import all except CVS

File size: 4.5 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: G4OpticalSurface.cc,v 1.10 2006/06/29 19:13:08 gunter Exp $
28// GEANT4 tag $Name: $
29//
30//
31////////////////////////////////////////////////////////////////////////
32// Optical Surface Class Implementation
33////////////////////////////////////////////////////////////////////////
34//
35// File: G4OpticalSurface.cc
36// Description: An optical surface class for use in G4OpBoundaryProcess
37// Version: 2.0
38// Created: 1997-06-26
39// Author: Peter Gumplinger
40// mail: gum@triumf.ca
41//
42////////////////////////////////////////////////////////////////////////
43
44#include "G4ios.hh"
45#include "globals.hh"
46#include "G4OpticalSurface.hh"
47
48/////////////////////////
49// Class Implementation
50/////////////////////////
51
52 //////////////
53 // Operators
54 //////////////
55
56const G4OpticalSurface&
57 G4OpticalSurface::operator=(const G4OpticalSurface& right)
58{
59 if (this != &right)
60 {
61 theName = right.GetName();
62 theModel = right.theModel;
63 theFinish = right.theFinish;
64 theType = right.GetType();
65 sigma_alpha = right.sigma_alpha;
66 polish = right.polish;
67 theMaterialPropertiesTable = right.theMaterialPropertiesTable;
68 }
69 return *this;
70}
71
72 /////////////////
73 // Constructors
74 /////////////////
75
76G4OpticalSurface::G4OpticalSurface(const G4String& name,
77 G4OpticalSurfaceModel model,
78 G4OpticalSurfaceFinish finish,
79 G4SurfaceType type,
80 G4double value)
81 : G4SurfaceProperty(name,type),
82 theModel(model),
83 theFinish(finish),
84 theMaterialPropertiesTable(0)
85{
86 if (model == glisur ){
87 polish = value;
88 sigma_alpha = 0.0;
89 }
90 else if ( model == unified ) {
91 sigma_alpha = value;
92 polish = 0.0;
93 }
94 else {
95 G4Exception("G4OpticalSurface::G4OpticalSurface ==> "
96 "Constructor called with INVALID model.");
97 }
98}
99
100G4OpticalSurface::G4OpticalSurface(const G4OpticalSurface &right)
101 : G4SurfaceProperty(right.GetName())
102{
103 *this = right;
104}
105
106G4OpticalSurface::~G4OpticalSurface(){}
107
108G4int G4OpticalSurface::operator==(const G4OpticalSurface &right) const
109{
110 return (this == (G4OpticalSurface *) &right);
111}
112
113G4int G4OpticalSurface::operator!=(const G4OpticalSurface &right) const
114{
115 return (this != (G4OpticalSurface *) &right);
116}
117 ////////////
118 // Methods
119 ////////////
120
121void G4OpticalSurface::DumpInfo() const
122{
123
124 // Dump info for surface
125
126 G4cout <<
127 " Surface type = " << G4int(theType) << G4endl <<
128 " Surface finish = " << G4int(theFinish) << G4endl <<
129 " Surface model = " << G4int(theModel) << G4endl;
130
131 G4cout << G4endl;
132
133 G4cout << " Surface parameter " << G4endl;
134 G4cout << " ----------------- " << G4endl;
135 if (theModel == glisur ){
136 G4cout << polish << G4endl;
137 }
138 else {
139 G4cout << sigma_alpha << G4endl;
140 }
141 G4cout << G4endl;
142}
Note: See TracBrowser for help on using the repository browser.