if ( const SMDS_MeshNode * n = theMeshDS->FindNode( aElementsId[i] ))
theNodeSet.insert( theNodeSet.end(), n);
}
- else {
+ else if ( SMESH::DownCast<SMESH_Mesh_i*>( theObject ))
+ {
+ SMDS_NodeIteratorPtr nIt = theMeshDS->nodesIterator();
+ while ( nIt->more( ))
+ if( const SMDS_MeshElement * elem = nIt->next() )
+ theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
+ }
+ else
+ {
for(int i = 0; i < aElementsId->length(); i++)
if( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] ))
theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
myMesh->SetIsModified( true );
return isDone;
}
+//================================================================================
+/*!
+ * \brief Makes a part of the mesh quadratic
+ */
+//================================================================================
+
+void SMESH_MeshEditor_i::ConvertToQuadraticObject(CORBA::Boolean theForce3d,
+ SMESH::SMESH_IDSource_ptr theObject)
+ throw (SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ TPythonDump pyDump;
+ TIDSortedElemSet elems;
+ if ( idSourceToSet( theObject, GetMeshDS(), elems, SMDSAbs_All, /*emptyIfIsMesh=*/true ))
+ {
+ if ( elems.empty() )
+ {
+ ConvertToQuadratic( theForce3d );
+ }
+ else if ( (*elems.begin())->GetType() == SMDSAbs_Node )
+ {
+ THROW_SALOME_CORBA_EXCEPTION("Group of nodes is not allowed", SALOME::BAD_PARAM);
+ }
+ else
+ {
+ ::SMESH_MeshEditor anEditor( myMesh );
+ anEditor.ConvertToQuadratic(theForce3d, elems);
+ }
+ }
+ myMesh->GetMeshDS()->Modified();
+ myMesh->SetIsModified( true );
+
+ pyDump << this << ".ConvertToQuadraticObject( "<<theForce3d<<", "<<theObject<<" )";
+}
+
+//================================================================================
+/*!
+ * \brief Makes a part of the mesh linear
+ */
+//================================================================================
+
+void SMESH_MeshEditor_i::ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
+ throw (SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ TPythonDump pyDump;
+ TIDSortedElemSet elems;
+ if ( idSourceToSet( theObject, GetMeshDS(), elems, SMDSAbs_All, /*emptyIfIsMesh=*/true ))
+ {
+ if ( elems.empty() )
+ {
+ ConvertFromQuadratic();
+ }
+ else if ( (*elems.begin())->GetType() == SMDSAbs_Node )
+ {
+ THROW_SALOME_CORBA_EXCEPTION("Group of nodes is not allowed", SALOME::BAD_PARAM);
+ }
+ else
+ {
+ ::SMESH_MeshEditor anEditor( myMesh );
+ anEditor.ConvertFromQuadratic(elems);
+ }
+ }
+ myMesh->GetMeshDS()->Modified();
+ myMesh->SetIsModified( true );
+
+ pyDump << this << ".ConvertFromQuadraticObject( "<<theObject<<" )";
+}
//=======================================================================
//function : makeMesh
* The nodes of the internal faces at the boundaries of the groups are doubled.
* In option, the internal faces are replaced by flat elements.
* Triangles are transformed in prisms, and quadrangles in hexahedrons.
+ * The flat elements are stored in groups of volumes.
* @param theDomains - list of groups of volumes
* @param createJointElems - if TRUE, create the elements
* @return TRUE if operation has been completed successfully, FALSE otherwise
}
bool aResult = aMeshEditor.DoubleNodesOnGroupBoundaries( domains, createJointElems );
+ // TODO publish the groups of flat elements in study
storeResult( aMeshEditor) ;
myMesh->GetMeshDS()->Modified();