const _Ghs2smdsConvertor & toSmdsConvertor,
const bool isOk/* = false*/ )
{
- SMESH_ComputeErrorPtr err = SMESH_ComputeError::New( COMPERR_ALGO_FAILED );
+ SMESH_BadInputElements* badElemsErr =
+ new SMESH_BadInputElements( toSmdsConvertor.getMesh(), COMPERR_ALGO_FAILED );
+ SMESH_ComputeErrorPtr err( badElemsErr );
char* ptr = const_cast<char*>( log.c_str() );
char* buf = ptr, * bufEnd = ptr + log.size();
if ( strncmp( ptr, "ERR ", 4 ) != 0 )
continue;
- list<const SMDS_MeshElement*>& badElems = err->myBadElements;
+ list<const SMDS_MeshElement*>& badElems = badElemsErr->myBadElements;
vector<int> nodeIds;
ptr += 4;
err->myComment = errDescription;
- if ( err->myComment.empty() && err->myBadElements.empty() )
+ if ( err->myComment.empty() && !err->HasBadElems() )
err = SMESH_ComputeError::New(); // OK
return err;
return 0;
}
+//================================================================================
+/*!
+ * \brief Return a mesh
+ */
+//================================================================================
+
+const SMDS_Mesh* _Ghs2smdsConvertor::getMesh() const
+{
+ return _mesh->GetMeshDS();
+}
//=============================================================================
/*!
SMESH_ProxyMesh::Ptr mesh);
const SMDS_MeshElement* getElement(const std::vector<int>& ghsNodes) const;
+ const SMDS_Mesh* getMesh() const;
};
#endif
nodeRet = _enfNodes.insert(make_pair(node,groupName));
added = added && nodeRet.second;
}
-// added = true;s
}
break;
case SMESH::EDGE:
added = added && elemRet.second;
}
else if (elem->GetType() > SMDSAbs_Edge) {
- SMDS_ElemIteratorPtr it = elem->edgesIterator();
- for (;it->more();) {
- const SMDS_MeshElement* anEdge = it->next();
- elemRet = _enfEdges.insert(make_pair(anEdge,groupName));
- added = added && elemRet.second;
- }
+ // SMDS_ElemIteratorPtr it = elem->edgesIterator();
+ // for (;it->more();) {
+ // const SMDS_MeshElement* anEdge = it->next();
+ // elemRet = _enfEdges.insert(make_pair(anEdge,groupName));
+ // added = added && elemRet.second;
+ // }
}
break;
case SMESH::FACE:
}
}
else if (elem->GetType() > SMDSAbs_Face) { // Group of faces
- SMDS_ElemIteratorPtr it = elem->facesIterator();
- for (;it->more();) {
- const SMDS_MeshElement* aFace = it->next();
- if (aFace->NbCornerNodes() == 3) {
- elemRet = _enfTriangles.insert(make_pair(aFace,groupName));
- added = added && elemRet.second;
- }
- }
+ // SMDS_ElemIteratorPtr it = elem->facesIterator();
+ // for (;it->more();) {
+ // const SMDS_MeshElement* aFace = it->next();
+ // if (aFace->NbCornerNodes() == 3) {
+ // elemRet = _enfTriangles.insert(make_pair(aFace,groupName));
+ // added = added && elemRet.second;
+ // }
+ // }
}
break;
default:
struct TIDMeshIDCompare {
bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const
- { return e1->getMeshId() == e2->getMeshId() ? e1->GetID() < e2->GetID() : e1->getMeshId() < e2->getMeshId() ; }
+ { return e1->GetMesh() == e2->GetMesh() ? e1->GetID() < e2->GetID() : e1->GetMesh() < e2->GetMesh() ; }
};
typedef std::map<const SMDS_MeshElement*, std::string, TIDMeshIDCompare > TIDSortedElemGroupMap;
SMESHDS_Mesh* meshDS = theHelper->GetMeshDS();
if ( meshDS->NbNodes() != meshDS->MaxNodeID() )
- meshDS->compactMesh();
+ meshDS->CompactMesh();
theMGInput->GmfSetKwd( mfile, GmfVertices, meshDS->NbNodes() );
int TypTab[] = { GmfSca };