ATLAS Offline Software
VP1SoMaterialMixer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Class: VP1SoMaterialMixer //
7 // First version: November 2007 //
8 // Author: Thomas.Kittelmann@cern.ch //
10 
11 #ifndef VP1SOMATERIALMIXER_H
12 #define VP1SOMATERIALMIXER_H
13 
15 #include <set>
16 #include <map>
17 class SoMaterial;
18 
20 public:
21 
22  VP1SoMaterialMixer(IVP1System * sys = 0);//sys!=0 for messages in gui
23  virtual ~VP1SoMaterialMixer();
24 
25  //First version - mixes materials with equal weight:
26  SoMaterial * getMixedMaterial(const std::set<SoMaterial*>&);
27 
28  //The second version is similar, but each material has a weight (must be > 0)
29  SoMaterial * getMixedMaterial(const std::map<SoMaterial*,double>&);
30 
31  //Convenience methods for when you are combining 2 materials (dispenses with need to put in a set):
32  SoMaterial * getMixedMaterial( SoMaterial* mat1,SoMaterial* mat2 );
33  SoMaterial * getMixedMaterial( SoMaterial* mat1, const double& weight1,
34  SoMaterial* mat2, const double& weight2 );
35 
36  //NB1: Never modify the returned material directly!!
37  // It is ok to modify the fields of the passed SoMaterials later
38  // - the inventor notification mechanism is used to monitor this
39  // and automatically update the fields of the mixed material node
40  // when that happens.
41  //
42  //NB2: All materials in input list must have exactly 1 value in each
43  // field! (as is usually the case). Methods return a default
44  // material in case of any problems in the input list.
45 
46 private:
47 
48  class Imp;
49  Imp * m_d;
50 
51 };
52 
53 #endif
VP1SoMaterialMixer::VP1SoMaterialMixer
VP1SoMaterialMixer(IVP1System *sys=0)
Definition: VP1SoMaterialMixer.cxx:58
VP1SoMaterialMixer::~VP1SoMaterialMixer
virtual ~VP1SoMaterialMixer()
Definition: VP1SoMaterialMixer.cxx:66
VP1SoMaterialMixer::getMixedMaterial
SoMaterial * getMixedMaterial(const std::set< SoMaterial * > &)
Definition: VP1SoMaterialMixer.cxx:273
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
IVP1System
Definition: IVP1System.h:36
VP1HelperClassBase
Definition: VP1HelperClassBase.h:28
VP1SoMaterialMixer::m_d
Imp * m_d
Definition: VP1SoMaterialMixer.h:48
VP1HelperClassBase.h
VP1SoMaterialMixer::Imp
Definition: VP1SoMaterialMixer.cxx:18
VP1SoMaterialMixer
Definition: VP1SoMaterialMixer.h:19