From 059b9c819d1810503ee50e897a6149da1c5d751f Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 28 Aug 2013 11:56:36 +0000 Subject: [PATCH 1/1] small imp --- src/SMESH_I/SMESH_2smeshpy.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index cf4bd90d3..4d4dd0a63 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -887,17 +887,19 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand if ( Type == "SMESH.FT_ElemGeomType" ) { // set SMESH.GeometryType instead of a numerical Threshold - const char* types[SMESH::Geom_BALL+1] = { + const int nbTypes = SMESH::Geom_BALL+1; + const char* types[nbTypes] = { "Geom_POINT", "Geom_EDGE", "Geom_TRIANGLE", "Geom_QUADRANGLE", "Geom_POLYGON", "Geom_TETRA", "Geom_PYRAMID", "Geom_HEXA", "Geom_PENTA", "Geom_HEXAGONAL_PRISM", "Geom_POLYHEDRA", "Geom_BALL" }; - if ( -1 < iGeom && iGeom < SMESH::Geom_POLYHEDRA+1 ) + if ( -1 < iGeom && iGeom < nbTypes ) Threshold = SMESH + types[ iGeom ]; } if (Type == "SMESH.FT_EntityType") { // set SMESH.EntityType instead of a numerical Threshold - const char* types[SMESH::Entity_Ball+1] = { + const int nbTypes = SMESH::Entity_Ball+1; + const char* types[nbTypes] = { "Entity_Node", "Entity_0D", "Entity_Edge", "Entity_Quad_Edge", "Entity_Triangle", "Entity_Quad_Triangle", "Entity_BiQuad_Triangle", "Entity_Quadrangle", "Entity_Quad_Quadrangle", "Entity_BiQuad_Quadrangle", @@ -906,7 +908,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand "Entity_Hexa", "Entity_Quad_Hexa", "Entity_TriQuad_Hexa", "Entity_Penta", "Entity_Quad_Penta", "Entity_Hexagonal_Prism", "Entity_Polyhedra", "Entity_Quad_Polyhedra", "Entity_Ball" }; - if ( -1 < iGeom && iGeom < SMESH::Entity_Quad_Polyhedra+1 ) + if ( -1 < iGeom && iGeom < nbTypes ) Threshold = SMESH + types[ iGeom ]; } } -- 2.30.2