-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//#include <stdlib.h>
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
aFamily->SetGroupAttributVal(anAttrVal);
}
if(MYDEBUG) MESSAGE(aGroupName);
- aFamily->AddGroupName(aGroupName);
+ if ( strncmp( aGroupName.c_str(), NIG_GROUP_PREFIX, strlen(NIG_GROUP_PREFIX) ) != 0 )
+ aFamily->AddGroupName(aGroupName);
}
aFamily->SetId( aFamId );
myFamilies[aFamId] = aFamily;
//------------------------------------------------------
PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
if (!aNodeInfo) {
- aResult = DRS_FAIL;
+ aResult = addMessage("No nodes", /*isFatal=*/true );
continue;
}
aMeshInfo->myDim=aMeshInfo->mySpaceDim;// ignore meshdim in MEDFile because it can be false
}
#ifndef _DEXCEPT_
} catch(const std::exception& exc) {
- aResult = DRS_FAIL;
+ aResult = addMessage( exc.what(), /*isFatal=*/true );
} catch (...) {
- aResult = DRS_FAIL;
+ aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
if ( !anElement ) {
#ifndef _DEXCEPT_
}catch(const std::exception& exc){
INFOS("Following exception was caught:\n\t"<<exc.what());
- aResult = DRS_FAIL;
+ aResult = addMessage( exc.what(), /*isFatal=*/true );
}catch(...){
INFOS("Unknown exception was caught !!!");
- aResult = DRS_FAIL;
+ aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
if(!anIsValidConnect)
#ifndef _DEXCEPT_
} catch(const std::exception& exc) {
INFOS("The following exception was caught:\n\t"<<exc.what());
- aResult = DRS_FAIL;
+ aResult = addMessage( exc.what(), /*isFatal=*/true );
} catch(...) {
INFOS("Unknown exception was caught !!!");
- aResult = DRS_FAIL;
+ aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
if (!anElement) {
}
if ( DriverMED::checkFamilyID ( aFamily, aFamNum, myFamilies )) {
// Save reference to this element from its family
- myFamilies[aFamNum]->AddElement(anElement);
- myFamilies[aFamNum]->SetType(anElement->GetType());
+ aFamily->AddElement(anElement);
+ aFamily->SetType(anElement->GetType());
}
}
} // loop on aNbElems
catch(const std::exception& exc)
{
INFOS("The following exception was caught:\n\t"<<exc.what());
- aResult = DRS_FAIL;
+ aResult = addMessage( exc.what(), /*isFatal=*/true );
}
catch(...)
{
INFOS("Unknown exception was caught !!!");
- aResult = DRS_FAIL;
+ aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
if (myMesh)
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName))
{
- const set<const SMDS_MeshElement *>& anElements = aFamily->GetElements();
- set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElements.begin();
+ const ElementsSet& anElements = aFamily->GetElements();
+ ElementsSet::const_iterator anElemsIter = anElements.begin();
for (; anElemsIter != anElements.end(); anElemsIter++)
{
const SMDS_MeshElement * element = *anElemsIter;
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
if (aFamily->MemberOf(aName))
{
- const set<const SMDS_MeshElement *>& anElements = aFamily->GetElements();
- set<const SMDS_MeshElement *>::const_iterator anElemsIter = anElements.begin();
+ const ElementsSet& anElements = aFamily->GetElements();
+ ElementsSet::const_iterator anElemsIter = anElements.begin();
if (aFamily->GetType() == SMDSAbs_Node)
{
for (; anElemsIter != anElements.end(); anElemsIter++)
if (aName.substr(0, 7) == string("SubMesh"))
{
int Id = atoi(string(aName).substr(7).c_str());
- set<const SMDS_MeshElement *> anElements = aFamily->GetElements();
- set<const SMDS_MeshElement *>::iterator anElemsIter = anElements.begin();
+ const ElementsSet& anElements = aFamily->GetElements();
+ ElementsSet::const_iterator anElemsIter = anElements.begin();
if (aFamily->GetType() == SMDSAbs_Node)
{
for (; anElemsIter != anElements.end(); anElemsIter++)
{
- SMDS_MeshNode* node = const_cast<SMDS_MeshNode*>
- ( static_cast<const SMDS_MeshNode*>( *anElemsIter ));
+ const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( *anElemsIter );
// find out a shape type
TopoDS_Shape aShape = myMesh->IndexToShape( Id );
int aShapeType = ( aShape.IsNull() ? -1 : aShape.ShapeType() );