-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
Standard_Real f,l;
BRep_Tool::Range( TopoDS::Edge( shape ), f,l);
if ( paramOnEdge < f || paramOnEdge > l )
- THROW_SALOME_CORBA_EXCEPTION("Invalid paramOnEdge", SALOME::BAD_PARAM);
-
+ {
+ SMESH_Comment txt("Invalid paramOnEdge. It must vary in range [ ");
+ txt << f << ", " << l << " ]";
+ THROW_SALOME_CORBA_EXCEPTION(txt.c_str(), SALOME::BAD_PARAM);
+ }
mesh->SetNodeOnEdge( node, EdgeID, paramOnEdge );
myMesh->SetIsModified( true );
v > surf.LastVParameter() );
if ( isOut ) {
-#ifdef _DEBUG_
- MESSAGE ( "FACE " << FaceID << " (" << u << "," << v << ") out of "
- << " u( " << surf.FirstUParameter()
- << "," << surf.LastUParameter()
- << ") v( " << surf.FirstVParameter()
- << "," << surf.LastVParameter() << ")" );
-#endif
- THROW_SALOME_CORBA_EXCEPTION("Invalid UV", SALOME::BAD_PARAM);
+ SMESH_Comment txt("Invalid UV. U must vary in range [ ");
+ txt << surf.FirstUParameter() << ", " << surf.LastUParameter() << " ], ";
+ txt << "V must vary in range [ ";
+ txt << surf.FirstVParameter() << ", " << surf.LastVParameter() << " ]";
+ THROW_SALOME_CORBA_EXCEPTION(txt.c_str(), SALOME::BAD_PARAM);
}
mesh->SetNodeOnFace( node, FaceID, u, v );
}
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() << ", ";
initData();
const SMDS_MeshElement* elem = getMeshDS()->FindElement(ide);
- if(!elem) return false;
+ if ( !elem ) return false;
int nbn = newIDs.length();
- int i=0;
vector<const SMDS_MeshNode*> aNodes(nbn);
- int nbn1=-1;
- for(; i<nbn; i++) {
- const SMDS_MeshNode* aNode = getMeshDS()->FindNode(newIDs[i]);
- if(aNode) {
- nbn1++;
- aNodes[nbn1] = aNode;
- }
+ for ( int i = 0; i < nbn; i++ ) {
+ const SMDS_MeshNode* aNode = getMeshDS()->FindNode( newIDs[ i ]);
+ if ( !aNode )
+ return false;
+ aNodes[ i ] = aNode;
}
TPythonDump() << "isDone = " << this << ".ChangeElemNodes( "
<< ide << ", " << newIDs << " )";
- bool res = getMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 );
+ bool res = getMeshDS()->ChangeElementNodes( elem, & aNodes[0], aNodes.size() );
declareMeshModified( /*isReComputeSafe=*/ !res );
//================================================================================
/*!
* \brief Create a slot of given width around given 1D elements lying on a triangle mesh.
- * The slot is consrtucted by cutting faces by cylindrical surfaces made
+ * The slot is constructed by cutting faces by cylindrical surfaces made
* around each segment. Segments are expected to be created by MakePolyLine().
* \return Edges located at the slot boundary
*/
SMESHDS_Mesh* meshDS = getMeshDS();
+ // get standalone face groups to be updated
+ std::vector< SMDS_MeshGroup* > faceGroups;
+ const std::set<SMESHDS_GroupBase*>& allGroups = meshDS->GetGroups();
+ std::set<SMESHDS_GroupBase*>::const_iterator grIt = allGroups.begin();
+ for ( ; grIt != allGroups.end(); ++grIt )
+ if ( const SMESHDS_Group* gr = dynamic_cast< const SMESHDS_Group* >( *grIt ))
+ if ( gr->GetType() == SMDSAbs_Face )
+ faceGroups.push_back( & const_cast< SMESHDS_Group* >( gr )->SMDSGroup() );
+
std::vector< SMESH_MeshAlgos::Edge > edges =
SMESH_MeshAlgos::MakeSlot( SMESH_Mesh_i::GetElements( theSegments, SMESH::EDGE ),
- theWidth, meshDS );
+ theWidth, meshDS, faceGroups );
resultEdges->length( edges.size() );
for ( size_t i = 0; i < edges.size(); ++i )