mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-13 22:50:33 +05:00
use static class variable rather then static function variable
This commit is contained in:
parent
76e6aaecb1
commit
feb74d49c2
@ -5768,6 +5768,7 @@ namespace netgen
|
|||||||
materials.Elem(domnr) = new string(mat);
|
materials.Elem(domnr) = new string(mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Mesh :: defaultmat = "default";
|
||||||
const string & Mesh :: GetMaterial (int domnr) const
|
const string & Mesh :: GetMaterial (int domnr) const
|
||||||
{
|
{
|
||||||
if (domnr <= materials.Size())
|
if (domnr <= materials.Size())
|
||||||
|
@ -593,9 +593,9 @@ namespace netgen
|
|||||||
DLL_HEADER void SetMaterial (int domnr, const string & mat);
|
DLL_HEADER void SetMaterial (int domnr, const string & mat);
|
||||||
///
|
///
|
||||||
const string & GetMaterial (int domnr) const;
|
const string & GetMaterial (int domnr) const;
|
||||||
|
static string defaultmat;
|
||||||
const string * GetMaterialPtr (int domnr) const // 1-based
|
const string * GetMaterialPtr (int domnr) const // 1-based
|
||||||
{
|
{
|
||||||
static string defaultmat = "default";
|
|
||||||
return domnr <= materials.Size() ? materials.Get(domnr) : &defaultmat;
|
return domnr <= materials.Size() ? materials.Get(domnr) : &defaultmat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user