* \param [in] theValue - offset value
* \param [out] theTgtMesh - a mesh to add offset elements to
* \param [in] theMakeGroups - to generate groups
- * \return PGroupIDs - IDs of created groups
+ * \return PGroupIDs - IDs of created groups. NULL means failure
*/
//================================================================================
PGroupIDs newGroupIDs;
if ( theMakeGroups )
newGroupIDs = generateGroups( srcNodes, srcElems, "offset", theTgtMesh, false );
+ else
+ newGroupIDs.reset( new std::list< int > );
return newGroupIDs;
}
}
else
{
- theGroups = theCopyGroups ? getGroups( groupIds.get() ) : new SMESH::ListOfGroups;
-
if ( *theMeshName && mesh_var->NbFaces() == 0 )
{
// new mesh empty, remove it
builder->RemoveObjectWithChildren( meshSO );
THROW_SALOME_CORBA_EXCEPTION("Offset failed", SALOME::INTERNAL_ERROR);
}
+ if ( !groupIds ) // nothing changed in the current mesh
+ THROW_SALOME_CORBA_EXCEPTION("Offset failed", SALOME::INTERNAL_ERROR);
+
+ theGroups = theCopyGroups ? getGroups( groupIds.get() ) : new SMESH::ListOfGroups;
// result of Offset() is a tuple (mesh, groups)
if ( mesh_var->_is_nil() ) pyDump << myMesh_i->_this() << ", ";