// Author : Paul RASCLE, EDF
// Module : SMESH
+#include <BRepPrimAPI_MakeBox.hxx>
+#include <BRepPrimAPI_MakeCylinder.hxx>
+#include <BRepPrimAPI_MakeSphere.hxx>
+#include <BRep_Tool.hxx>
+#include <OSD.hxx>
+#include <TColStd_MapOfAsciiString.hxx>
+#include <TCollection_AsciiString.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
#include <TopoDS.hxx>
-#include <TopoDS_Iterator.hxx>
-#include <TopoDS_Compound.hxx>
#include <TopoDS_CompSolid.hxx>
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Shell.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Wire.hxx>
+#include <TopoDS_Compound.hxx>
#include <TopoDS_Edge.hxx>
-#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopoDS_Shell.hxx>
+#include <TopoDS_Solid.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Wire.hxx>
#include <gp_Pnt.hxx>
-#include <BRep_Tool.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <OSD.hxx>
-#include <BRepPrimAPI_MakeSphere.hxx>
-#include <BRepPrimAPI_MakeCylinder.hxx>
-#include <BRepPrimAPI_MakeBox.hxx>
#ifdef WIN32
throw (SALOME::SALOME_Exception)
{
std::string aPlatformLibName;
- /* It's Need to tranlate lib name for WIN32 or X platform */
+ /* It's Need to translate lib name for WIN32 or X platform */
if ( theLibName && theLibName[0] != '\0' )
{
int libNameLen = strlen(theLibName);
//================================================================================
/*!
- * \brief Returns errors of hypotheses definintion
+ * \brief Returns errors of hypotheses definition
* \param theMesh - the mesh
* \param theSubObject - the main or sub- shape
* \retval SMESH::algo_error_array* - sequence of errors
if ( aTopGroup->ExistInternalObject( name_group ) ) {
aGroup = new HDFgroup( name_group, aTopGroup );
aGroup->OpenOnDisk();
- // get number of groups
- int aNbSubObjects = aGroup->nInternalObjects();
- for ( int j = 0; j < aNbSubObjects; j++ ) {
- char name_dataset[ HDF_NAME_MAX_LEN+1 ];
- aGroup->InternalObjectIndentify( j, name_dataset );
- // check if it is an group
- if ( string( name_dataset ).substr( 0, 5 ) == string( "Group" ) ) {
+ // PAL23514: get all names from the HDFgroup to avoid iteration on its contents
+ // within aGroup->ExistInternalObject( name )
+ std::vector< std::string > subNames;
+ TColStd_MapOfAsciiString mapOfNames;
+ aGroup->GetAllObjects( subNames );
+ for ( size_t iN = 0; iN < subNames.size(); ++iN )
+ mapOfNames.Add( subNames[ iN ].c_str() );
+ // loop on groups
+ for ( size_t j = 0; j < subNames.size(); j++ ) {
+ const std::string& name_dataset = subNames[ j ];
+ // check if it is a group
+ if ( name_dataset.substr( 0, 5 ) == "Group" ) {
// --> get group id
- int subid = atoi( string( name_dataset ).substr( 5 ).c_str() );
+ int subid = atoi( name_dataset.substr( 5 ).c_str() );
if ( subid <= 0 )
continue;
- aDataset = new HDFdataset( name_dataset, aGroup );
+ aDataset = new HDFdataset( name_dataset.c_str(), aGroup );
aDataset->OpenOnDisk();
// Retrieve actual group name
TopoDS_Shape aShape;
char aRefName[ 30 ];
sprintf( aRefName, "Ref on shape %d", subid);
- if ( aGroup->ExistInternalObject( aRefName ) ) {
+ if ( mapOfNames.Contains( aRefName ))
+ {
// load mesh "Ref on shape" - it's an entry to SObject
aDataset = new HDFdataset( aRefName, aGroup );
aDataset->OpenOnDisk();
// Try to read a filter of SMESH_GroupOnFilter
SMESH::Filter_var filter;
SMESH_PredicatePtr predicate;
- std::string hdfGrpName = "Filter " + SMESH_Comment(subid);
- if ( aGroup->ExistInternalObject( hdfGrpName.c_str() ))
+ std::string hdfGrpName = ( SMESH_Comment( "Filter ") << subid );
+ if ( mapOfNames.Contains( hdfGrpName.c_str() ))
{
aDataset = new HDFdataset( hdfGrpName.c_str(), aGroup );
aDataset->OpenOnDisk();
if ( !aGroupBaseDS )
continue;
- aGroupBaseDS->SetStoreName( name_dataset );
+ aGroupBaseDS->SetStoreName( name_dataset.c_str() );
// ouv : NPAL12872
// Read color of the group
char aGroupColorName[ 30 ];
sprintf( aGroupColorName, "ColorGroup %d", subid);
- if ( aGroup->ExistInternalObject( aGroupColorName ) )
+ if ( mapOfNames.Contains( aGroupColorName ))
{
aDataset = new HDFdataset( aGroupColorName, aGroup );
aDataset->OpenOnDisk();