Skip to content
Snippets Groups Projects
Commit 07b6c89f authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

change default surface representation to "cross", even for OpenCASCADE models;

this is a temporary workaround for a bug in OpenCASCADE, which fails to triangulate quite a few surfaces (it just hangs, which freezes our GUI)
parent 6cdf0295
No related branches found
No related tags found
No related merge requests found
...@@ -913,7 +913,7 @@ StringXNumber GeometryOptions_Number[] = { ...@@ -913,7 +913,7 @@ StringXNumber GeometryOptions_Number[] = {
"Display geometry surfaces?" }, "Display geometry surfaces?" },
{ F|O, "SurfaceNumbers" , opt_geometry_surfaces_num , 0. , { F|O, "SurfaceNumbers" , opt_geometry_surfaces_num , 0. ,
"Display surface numbers?" }, "Display surface numbers?" },
{ F|O, "SurfaceType" , opt_geometry_surface_type , 2. , { F|O, "SurfaceType" , opt_geometry_surface_type , 0. ,
"Surface display type (0=cross, 1=wireframe, 2=solid)" }, "Surface display type (0=cross, 1=wireframe, 2=solid)" },
{ F|O, "Tangents" , opt_geometry_tangents , 0. , { F|O, "Tangents" , opt_geometry_tangents , 0. ,
......
...@@ -56,10 +56,10 @@ static void draw_stl(std::vector<SPoint3> &vertices, std::vector<SVector3> &norm ...@@ -56,10 +56,10 @@ static void draw_stl(std::vector<SPoint3> &vertices, std::vector<SVector3> &norm
{ {
GLint mode[2]; GLint mode[2];
glGetIntegerv(GL_POLYGON_MODE, mode); glGetIntegerv(GL_POLYGON_MODE, mode);
if(CTX::instance()->geom.surfaceType > 1) if(CTX::instance()->geom.surfaceType == 1)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
else
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
glColor4ubv((GLubyte *) & CTX::instance()->color.geom.highlight[0]); glColor4ubv((GLubyte *) & CTX::instance()->color.geom.highlight[0]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment