ATLAS Offline Software
Loading...
Searching...
No Matches
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>
17class SoMaterial;
18
20public:
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
46private:
47
48 class Imp;
50
51};
52
53#endif
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
VP1SoMaterialMixer(IVP1System *sys=0)
SoMaterial * getMixedMaterial(const std::set< SoMaterial * > &)