while ( nIt->more() )
{
const SMDS_MeshNode* node = smdsNode( nIt->next() );
- if (node->getshapeId() <0) {
+ if (node->getshapeId() <1) {
return false;
}
}
vector<int>& theQuantity)
{
bool makePoly = false;
-// cout << "FROM FACE NODES: " <<endl;
-// for ( int i = 0; i < theNbBndNodes; ++i )
-// cout << theBndNodes[ i ];
- set< const SMDS_MeshNode* > bndNodeSet;
- for ( int i = 0; i < theNbBndNodes; ++i )
- bndNodeSet.insert( theBndNodes[ i ]);
+ set< const SMDS_MeshNode* > bndNodeSet( theBndNodes, theBndNodes + theNbBndNodes);
map< TNodeSet, list< list< int > > >::iterator nn_IdList;
if ( !myIs2D ) { // for 2D, merge only edges
nn_IdList = myIdsOnBoundary.find( bndNodeSet );
if ( nn_IdList != myIdsOnBoundary.end() ) {
- makePoly = true;
list< int > & faceIds = nn_IdList->second.front();
- ids.insert( faceIds.begin(), faceIds.end() );
+ if ( !faceIds.empty() ) {
+ makePoly = true;
+ ids.insert( faceIds.begin(), faceIds.end() );
+ }
}
}
- //bool hasIdsInFace = !ids.empty();
// add ids on links and bnd nodes
int lastFreeId = Max( myXYZIdToNodeMap.rbegin()->first, theNodes.size() );
bndId = nn_IdList->second.front().front();
ids.insert( bndId );
}
- else
+ else {
myXYZIdToNodeMap.insert( make_pair( bndId, theBndNodes[ iN ] ));
+ }
faceDef.push_back( bndId );
// add ids on a link
TNodeSet linkNodes;
linkNodes.insert( theBndNodes[ iN ]);
- linkNodes.insert( theBndNodes[ iN + 1 == theNbBndNodes ? 0 : iN + 1 ]);
+ linkNodes.insert( theBndNodes[ (iN + 1) % theNbBndNodes] );
nn_IdList = myIdsOnBoundary.find( linkNodes );
if ( nn_IdList != myIdsOnBoundary.end() ) {
- makePoly = true;
list< int > & linkIds = nn_IdList->second.front();
- ids.insert( linkIds.begin(), linkIds.end() );
- if ( isReversed( theBndNodes[ iN ], linkIds ))
- faceDef.insert( faceDef.end(), linkIds.begin(), linkIds.end() );
- else
- faceDef.insert( faceDef.end(), linkIds.rbegin(), linkIds.rend() );
+ if ( !linkIds.empty() )
+ {
+ makePoly = true;
+ ids.insert( linkIds.begin(), linkIds.end() );
+ if ( isReversed( theBndNodes[ iN ], linkIds ))
+ faceDef.insert( faceDef.end(), linkIds.begin(), linkIds.end() );
+ else
+ faceDef.insert( faceDef.end(), linkIds.rbegin(), linkIds.rend() );
+ }
}
}
{
if ( !checkedVolDefs.insert( *pIdList ).second )
continue; // skip already checked volume definition
- vector< int > idVec;
- idVec.reserve( (*pIdList)->size() );
- idVec.insert( idVec.begin(), (*pIdList)->begin(), (*pIdList)->end() );
+ vector< int > idVec( (*pIdList)->begin(), (*pIdList)->end() );
// loop on face defs of a volume
SMDS_VolumeTool::VolumeType volType = vol.GetType( idVec.size() );
if ( volType == SMDS_VolumeTool::UNKNOWN )
}
if ( !defsAdded ) {
theQuantity.push_back( faceDef.size() );
- theFaceDefs.splice( theFaceDefs.end(), faceDef, faceDef.begin(), faceDef.end() );
+ theFaceDefs.splice( theFaceDefs.end(), faceDef );
}
return makePoly;
createElements( theMesh, nodesVector, myElemPointIDs, myElements );
}
+ aMeshDS->compactMesh();
+
// const map<int,SMESHDS_SubMesh*>& sm = aMeshDS->SubMeshes();
// map<int,SMESHDS_SubMesh*>::const_iterator i_sm = sm.begin();
// for ( ; i_sm != sm.end(); i_sm++ )
myShapeIDMap.Clear();
myShape.Nullify();
myNbKeyPntInBoundary.clear();
+
+ myXYZ.clear();
+ myElemXYZIDs.clear();
+ myXYZIdToNodeMap.clear();
+ myElements.clear();
+ myOrderedNodes.clear();
+ myPolyElems.clear();
+ myPolyElemXYZIDs.clear();
+ myPolyhedronQuantities.clear();
+ myIdsOnBoundary.clear();
+ myReverseConnectivity.clear();
}
//=======================================================================