if ( aNbNode > 4 )
aNbNode /= 2; // do not take into account additional middle nodes
- SMDS_MeshNode* node1 = (SMDS_MeshNode*)face->GetNode( 1 );
- for ( int nIndx = 1; nIndx <= aNbNode; nIndx++ )
+ SMDS_MeshNode* node1 = (SMDS_MeshNode*)face->GetNode( 0 );
+ for ( int nIndx = 0; nIndx < aNbNode; nIndx++ )
{
- SMDS_MeshNode* node2 = (SMDS_MeshNode*)face->GetNode( nIndx < aNbNode ? nIndx+1 : 1 );
+ SMDS_MeshNode* node2 = (SMDS_MeshNode*)face->GetNode( nIndx+1 < aNbNode ? nIndx+1 : 0 );
if ( setOfEdge.insert( SMESH_TLink ( node1, node2 ) ).second )
{
listOfElemType.push_back( SMDSAbs_Edge );
*/
//=============================================================================
-//CORBA::Boolean
SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject)
// SMESH::long_array& theNbElems)
SALOME::BAD_PARAM );
SMESH::long_array_var nbels = new SMESH::long_array;
+ nbels->length(SMESH::Entity_Last);
+ int i = SMESH::Entity_Node;
+ for (; i < SMESH::Entity_Last; i++)
+ nbels[i] = 0;
// Update Python script
TPythonDump() << "theNbElems = " << this << ".Evaluate( "
// call implementation compute
::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
MapShapeNbElems aResMap;
- CORBA::Boolean ret = myGen.Evaluate( myLocMesh, myLocShape, aResMap);
+ /*CORBA::Boolean ret =*/ myGen.Evaluate( myLocMesh, myLocShape, aResMap);
MapShapeNbElemsItr anIt = aResMap.begin();
- vector<int> aResVec(17);
- int i = 0;
- for(; i<17; i++) aResVec[i] = 0;
for(; anIt!=aResMap.end(); anIt++) {
- // 0 - node, 1 - edge lin, 2 - edge quad,
- // 3 - triangle lin, 4 - triangle quad
- // 5 - quadrangle lin, 6 - quadrangle quad
- // 7 - polygon, 8 - tetra lin, 9 - tetra quad
- // 10 - pyramid lin, 11 - pyramid quad,
- // 12 - penta lin, 13 - penta quad, 14 - hexa lin,
- // 15 - hexa quad, 16 -polyhedra
- vector<int> aVec = (*anIt).second;
- for(i=0; i<17; i++) {
- aResVec[i] += aVec[i];
+ const vector<int>& aVec = (*anIt).second;
+ for(i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) {
+ nbels[i] += aVec[i];
}
}
- nbels->length(17);
- for(i=0; i<17; i++) {
- nbels[i] = aResVec[i];
- }
+#ifdef _DEBUG_
cout<<endl;
+#endif
return nbels._retn();
}
}
// -- Most probably a bad study was saved when there were
// not fixed bugs in SMDS_MeshInfo
if ( elemSet.size() < nbElems ) {
+#ifdef _DEBUG_
cout << "SMESH_Gen_i::Load(), warning: Node position data is invalid" << endl;
+#endif
nbElems = elemSet.size();
}
// add elements to submeshes
int smID = smIDs[ i ];
if ( smID == 0 ) continue;
const SMDS_MeshElement* elem = *iE;
- if( smID >= maxID ) {
+ if( smID > maxID ) {
// corresponding subshape no longer exists: maybe geom group has been edited
if ( myNewMeshImpl->HasShapeToMesh() )
mySMESHDSMesh->RemoveElement( elem );