bool HYBRIDPlugin_Hypothesis::SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SMESH::smIdType_array_var theIDs, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName)
{
TIDSortedElemSet theElemSet;
- if ( theIDs->length() == 0 ){MESSAGE("The source group is empty");}
- for ( SMESH::smIdType i = 0; i < theIDs->length(); i++) {
- SMESH::smIdType ind = theIDs[i];
- if (elementType == SMESH::NODE)
- {
- const SMDS_MeshNode * node = theMeshDS->FindNode(ind);
- if (node)
- theElemSet.insert( node );
- }
- else
- {
- const SMDS_MeshElement * elem = theMeshDS->FindElement(ind);
- if (elem)
- theElemSet.insert( elem );
- }
+ if ( theIDs->length() == 0 ){MESSAGE("The source group is empty");}
+ for ( CORBA::ULong i = 0; i < theIDs->length(); i++)
+ {
+ SMESH::smIdType ind = theIDs[i];
+ if (elementType == SMESH::NODE)
+ {
+ const SMDS_MeshNode * node = theMeshDS->FindNode(ind);
+ if (node)
+ theElemSet.insert( node );
}
+ else
+ {
+ const SMDS_MeshElement * elem = theMeshDS->FindElement(ind);
+ if (elem)
+ theElemSet.insert( elem );
+ }
+ }
-// SMDS_ElemIteratorPtr it = theGroup->GetGroupDS()->GetElements();
-// while ( it->more() )
-// theElemSet.insert( it->next() );
+ // SMDS_ElemIteratorPtr it = theGroup->GetGroupDS()->GetElements();
+ // while ( it->more() )
+ // theElemSet.insert( it->next() );
bool added = SetEnforcedElements( theElemSet, elementType, groupName);
if (added) {
newEnfMesh->entry = entry;
newEnfMesh->elementType = elementType;
newEnfMesh->groupName = groupName;
-
+
THYBRIDEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
if (it == _enfMeshList.end()) {
_entryEnfMeshMap[entry].insert(newEnfMesh);
if ( iMesh == 1 )
{
switch ( what ) {
- case GmfVertices: _nbNodes = nb; break;
- case GmfEdges: _nbEdges = nb; break;
- case GmfTriangles: _nbFaces = nb; break;
+ case GmfVertices: _nbNodes = nb; break;
+ case GmfEdges: _nbEdges = nb; break;
+ case GmfTriangles: _nbFaces += nb; break;
+ case GmfQuadrilaterals: _nbFaces += nb; break;
default:;
}
}