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

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

geant4.8.2 beta

File size: 4.6 KB
RevLine 
[822]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//
[850]27// $Id: G4OpticalSurface.cc,v 1.11 2008/07/21 20:55:51 gum Exp $
28// GEANT4 tag $Name: HEAD $
[822]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
[850]106G4OpticalSurface::~G4OpticalSurface()
107{
108 Overwrite();
109}
[822]110
111G4int G4OpticalSurface::operator==(const G4OpticalSurface &right) const
112{
113 return (this == (G4OpticalSurface *) &right);
114}
115
116G4int G4OpticalSurface::operator!=(const G4OpticalSurface &right) const
117{
118 return (this != (G4OpticalSurface *) &right);
119}
120 ////////////
121 // Methods
122 ////////////
123
124void G4OpticalSurface::DumpInfo() const
125{
126
127 // Dump info for surface
128
129 G4cout <<
130 " Surface type = " << G4int(theType) << G4endl <<
131 " Surface finish = " << G4int(theFinish) << G4endl <<
132 " Surface model = " << G4int(theModel) << G4endl;
133
134 G4cout << G4endl;
135
136 G4cout << " Surface parameter " << G4endl;
137 G4cout << " ----------------- " << G4endl;
138 if (theModel == glisur ){
139 G4cout << polish << G4endl;
140 }
141 else {
142 G4cout << sigma_alpha << G4endl;
143 }
144 G4cout << G4endl;
145}
Note: See TracBrowser for help on using the repository browser.