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();
+}
//=============================================================================
/*!
GHS3DPlugin_Hypothesis::GHS3DPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen)
: SMESH_Hypothesis(hypId, studyId, gen),
- myToMeshHoles(DefaultMeshHoles()),
- myToMakeGroupsOfDomains(DefaultToMakeGroupsOfDomains()),
- myMaximumMemory(-1),
- myInitialMemory(-1),
- myOptimizationLevel(DefaultOptimizationLevel()),
- myKeepFiles(DefaultKeepFiles()),
- myWorkingDirectory(DefaultWorkingDirectory()),
- myVerboseLevel(DefaultVerboseLevel()),
- myToCreateNewNodes(DefaultToCreateNewNodes()),
- myToUseBoundaryRecoveryVersion(DefaultToUseBoundaryRecoveryVersion()),
- myToUseFemCorrection(DefaultToUseFEMCorrection()),
- myToRemoveCentralPoint(DefaultToRemoveCentralPoint()),
- myLogInStandardOutput(DefaultStandardOutputLog()),
- myGradation(DefaultGradation()),
- _enfVertexList(DefaultGHS3DEnforcedVertexList()),
- _enfVertexCoordsSizeList(DefaultGHS3DEnforcedVertexCoordsValues()),
- _enfVertexEntrySizeList(DefaultGHS3DEnforcedVertexEntryValues()),
- _coordsEnfVertexMap(DefaultCoordsGHS3DEnforcedVertexMap()),
- _geomEntryEnfVertexMap(DefaultGeomEntryGHS3DEnforcedVertexMap()),
- _enfMeshList(DefaultGHS3DEnforcedMeshList()),
- _entryEnfMeshMap(DefaultEntryGHS3DEnforcedMeshListMap()),
- _enfNodes(TIDSortedNodeGroupMap()),
- _enfEdges(TIDSortedElemGroupMap()),
- _enfTriangles(TIDSortedElemGroupMap()),
- _nodeIDToSizeMap(DefaultID2SizeMap()),
- _groupsToRemove(DefaultGroupsToRemove())
+ myToMeshHoles(DefaultMeshHoles()),
+ myToMakeGroupsOfDomains(DefaultToMakeGroupsOfDomains()),
+ myMaximumMemory(-1),
+ myInitialMemory(-1),
+ myOptimizationLevel(DefaultOptimizationLevel()),
+ myKeepFiles(DefaultKeepFiles()),
+ myWorkingDirectory(DefaultWorkingDirectory()),
+ myVerboseLevel(DefaultVerboseLevel()),
+ myToCreateNewNodes(DefaultToCreateNewNodes()),
+ myToUseBoundaryRecoveryVersion(DefaultToUseBoundaryRecoveryVersion()),
+ myToUseFemCorrection(DefaultToUseFEMCorrection()),
+ myToRemoveCentralPoint(DefaultToRemoveCentralPoint()),
+ myLogInStandardOutput(DefaultStandardOutputLog()),
+ myRemoveLogOnSuccess(DefaultRemoveLogOnSuccess()),
+ myGradation(DefaultGradation()),
+ _enfVertexList(DefaultGHS3DEnforcedVertexList()),
+ _enfVertexCoordsSizeList(DefaultGHS3DEnforcedVertexCoordsValues()),
+ _enfVertexEntrySizeList(DefaultGHS3DEnforcedVertexEntryValues()),
+ _coordsEnfVertexMap(DefaultCoordsGHS3DEnforcedVertexMap()),
+ _geomEntryEnfVertexMap(DefaultGeomEntryGHS3DEnforcedVertexMap()),
+ _enfMeshList(DefaultGHS3DEnforcedMeshList()),
+ _entryEnfMeshMap(DefaultEntryGHS3DEnforcedMeshListMap()),
+ _enfNodes(TIDSortedNodeGroupMap()),
+ _enfEdges(TIDSortedElemGroupMap()),
+ _enfTriangles(TIDSortedElemGroupMap()),
+ _nodeIDToSizeMap(DefaultID2SizeMap()),
+ _groupsToRemove(DefaultGroupsToRemove())
{
_name = GetHypType();
_param_algo_dim = 3;
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: