bcnames - string as reference

This commit is contained in:
Joachim Schoeberl 2012-11-09 07:27:26 +00:00
parent ce505100a5
commit 81a3f3ff8a
6 changed files with 14 additions and 18 deletions

View File

@ -5588,14 +5588,16 @@ namespace netgen
bcnames[bcnr] = 0;
}
string Mesh ::GetBCName ( int bcnr ) const
const string & Mesh ::GetBCName ( int bcnr ) const
{
static string defaultstring = "default";
if ( !bcnames.Size() )
return "default";
return defaultstring;
if ( bcnames[bcnr] )
return *bcnames[bcnr];
else
return "default";
return defaultstring;
}
void Mesh :: SetUserData(const char * id, Array<int> & data)

View File

@ -585,7 +585,7 @@ namespace netgen
DLL_HEADER void SetBCName ( int bcnr, const string & abcname );
string GetBCName ( int bcnr ) const;
const string & GetBCName ( int bcnr ) const;
string * GetBCNamePtr ( int bcnr )
{ return bcnames[bcnr]; }

View File

@ -44,7 +44,6 @@ namespace netgen
meshopt.ImproveMesh(mesh, mp);
break;
}
case 'c':
{
MeshOptimize2d meshopt;

View File

@ -2311,13 +2311,11 @@ namespace netgen
}
string FaceDescriptor :: GetBCName () const
const string & FaceDescriptor :: GetBCName () const
{
if ( bcname )
return *bcname;
else
return "default";
static string defaultstring = "default";
if (bcname) return *bcname;
return defaultstring;
}
/*

View File

@ -847,12 +847,10 @@ namespace netgen
const string * BCNamePtr () const
{ return bcname; }
string GetBCName () const
const string & GetBCName () const
{
if (! bcname )
{
return "default";
}
static string defaultstring = "default";
if (! bcname ) return defaultstring;
return *bcname;
}
@ -934,7 +932,7 @@ namespace netgen
// Philippose - 06/07/2009
// Get Surface colour
Vec3d SurfColour () const { return surfcolour; }
string GetBCName () const;
const string & GetBCName () const;
// string * BCNamePtr () { return bcname; }
// const string * BCNamePtr () const { return bcname; }
void SetSurfNr (int sn) { surfnr = sn; }

View File

@ -865,7 +865,6 @@ namespace netgen
// (*testout) << "x = " << x << endl;
}
Point3d origp = mesh[pi];
int loci = 1;
double fact = 1;