OCC: Set BC Names/Materials only when available

This commit is contained in:
Matthias Hochsteger 2017-06-02 14:15:31 +02:00
parent e68333ee00
commit 41e62e58a4

View File

@ -417,15 +417,15 @@ namespace netgen
&& (geom.face_colours->GetColor(face,XCAFDoc_ColorSurf,face_colour))) && (geom.face_colours->GetColor(face,XCAFDoc_ColorSurf,face_colour)))
{ {
mesh.GetFaceDescriptor(facenr).SetSurfColour(Vec3d(face_colour.Red(),face_colour.Green(),face_colour.Blue())); mesh.GetFaceDescriptor(facenr).SetSurfColour(Vec3d(face_colour.Red(),face_colour.Green(),face_colour.Blue()));
mesh.GetFaceDescriptor(facenr).SetBCName(&geom.fnames[facenr-1]);
mesh.GetFaceDescriptor(facenr).SetBCProperty(facenr);
} }
else else
{ {
mesh.GetFaceDescriptor(facenr).SetSurfColour(Vec3d(0.0,1.0,0.0)); mesh.GetFaceDescriptor(facenr).SetSurfColour(Vec3d(0.0,1.0,0.0));
mesh.GetFaceDescriptor(facenr).SetBCName(&geom.fnames[facenr-1]);
mesh.GetFaceDescriptor(facenr).SetBCProperty(facenr);
} }
if(geom.fnames.Size()>=facenr)
mesh.GetFaceDescriptor(facenr).SetBCName(&geom.fnames[facenr-1]);
mesh.GetFaceDescriptor(facenr).SetBCProperty(facenr);
// ACHTUNG! STIMMT NICHT ALLGEMEIN (RG) // ACHTUNG! STIMMT NICHT ALLGEMEIN (RG)
@ -1471,7 +1471,8 @@ namespace netgen
(*testout) << mesh->LineSegment(i) << endl; (*testout) << mesh->LineSegment(i) << endl;
for (int i = 0; i < mesh->GetNDomains(); i++) for (int i = 0; i < mesh->GetNDomains(); i++)
mesh->SetMaterial (i+1, geom.snames[i]); if(geom.snames.Size())
mesh->SetMaterial( i+1, geom.snames[i] );
return TCL_OK; return TCL_OK;
} }
} }