-// Copyright (C) 2007-2019 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
//!< Delete theNodeSearcher
static void Delete()
{
- if ( theNodeSearcher ) delete theNodeSearcher; theNodeSearcher = 0;
- if ( theElementSearcher ) delete theElementSearcher; theElementSearcher = 0;
+ if ( theNodeSearcher ) { delete theNodeSearcher; } theNodeSearcher = 0;
+ if ( theElementSearcher ) { delete theElementSearcher; } theElementSearcher = 0;
}
typedef map < int, SMESH_subMesh * > TDependsOnMap;
//!< The meshod called by submesh: do my main job
//================================================================================
SMESH::MeshPreviewStruct* SMESH_MeshEditor_i::GetPreviewData()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
const bool hasBadElems = ( getEditor().GetError() && getEditor().GetError()->HasBadElems() );
//================================================================================
SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedNodes()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::long_array_var myLastCreatedNodes = new SMESH::long_array();
//================================================================================
SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedElems()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::long_array_var myLastCreatedElems = new SMESH::long_array();
//purpose : Clears sequences of last created elements and nodes
//=======================================================================
-void SMESH_MeshEditor_i::ClearLastCreated() throw (SALOME::SALOME_Exception)
+void SMESH_MeshEditor_i::ClearLastCreated()
{
SMESH_TRY;
getEditor().ClearLastCreated();
//=======================================================================
SMESH::ComputeError* SMESH_MeshEditor_i::GetLastError()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::ComputeError_var errOut = new SMESH::ComputeError;
CORBA::Boolean
SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNodes)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddNode(CORBA::Double x,CORBA::Double y, CORBA::Double z)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Long SMESH_MeshEditor_i::Add0DElement(CORBA::Long IDOfNode,
CORBA::Boolean DuplicateElements)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddBall(CORBA::Long IDOfNode, CORBA::Double diameter)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::long_array & IDsOfNodes)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
if ( ! ( nodes[i] = getMeshDS()->FindNode( IDsOfNodes[i] )))
return 0;
+ if ( NbNodes == 0 )
+ {
+ INFOS("Polygon without nodes is forbidden");
+ return 0;
+ }
+
const SMDS_MeshElement* elem = getMeshDS()->AddPolygonalFace(nodes);
// Update Python script
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddQuadPolygonalFace (const SMESH::long_array & IDsOfNodes)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
for (int i = 0; i < NbNodes; i++)
nodes[i] = getMeshDS()->FindNode(IDsOfNodes[i]);
+ if ( NbNodes == 0 )
+ {
+ INFOS("Polygon without nodes is forbidden");
+ return 0;
+ }
+
const SMDS_MeshElement* elem = getMeshDS()->AddQuadPolygonalFace(nodes);
// Update Python script
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::long_array & IDsOfNodes,
const SMESH::long_array & Quantities)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces (const SMESH::long_array & IdsOfFaces)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
SMESH_MeshEditor_i::Create0DElementsOnAllNodes(SMESH::SMESH_IDSource_ptr theObject,
const char* theGroupName,
CORBA::Boolean theDuplicateElements)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
void SMESH_MeshEditor_i::SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
void SMESH_MeshEditor_i::SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
CORBA::Double paramOnEdge)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
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 );
void SMESH_MeshEditor_i::SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
CORBA::Double u, CORBA::Double v)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESHDS_Mesh * mesh = getMeshDS();
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 );
//=============================================================================
void SMESH_MeshEditor_i::SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESHDS_Mesh * mesh = getMeshDS();
void SMESH_MeshEditor_i::SetMeshElementOnShape(CORBA::Long ElementID,
CORBA::Long ShapeID)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESHDS_Mesh * mesh = getMeshDS();
CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(CORBA::Long NodeID1,
CORBA::Long NodeID2)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1,
CORBA::Long NodeID2)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfElements)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
CORBA::Boolean SMESH_MeshEditor_i::ReorientObject(SMESH::SMESH_IDSource_ptr theObject)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const SMESH::DirStruct& theDirection,
CORBA::Long theFace,
const SMESH::PointStruct& thePoint)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData(/*deleteSearchers=*/false);
CORBA::Long SMESH_MeshEditor_i::Reorient2DBy3D(const SMESH::ListOfIDSources& faceGroups,
SMESH::SMESH_IDSource_ptr volumeGroup,
CORBA::Boolean outsideNormal)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfElements,
SMESH::NumericalFunctor_ptr Criterion,
CORBA::Double MaxAngle)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
SMESH::NumericalFunctor_ptr Criterion,
CORBA::Double MaxAngle)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::long_array & IDsOfElements,
SMESH::NumericalFunctor_ptr Criterion)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
SMESH::NumericalFunctor_ptr Criterion)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//================================================================================
void SMESH_MeshEditor_i::QuadTo4Tri (SMESH::SMESH_IDSource_ptr theObject)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
getEditor().QuadTo4Tri( faces );
TPythonDump() << this << ".QuadTo4Tri( " << theObject << " )";
+ declareMeshModified( /*isReComputeSafe=*/false );
+
SMESH_CATCH( SMESH::throwCorbaException );
}
CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::long_array & IDsOfElements,
CORBA::Boolean Diag13)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
CORBA::Boolean Diag13)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Long SMESH_MeshEditor_i::BestSplit (CORBA::Long IDOfQuad,
SMESH::NumericalFunctor_ptr Criterion)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
void SMESH_MeshEditor_i::SplitVolumesIntoTetra (SMESH::SMESH_IDSource_ptr elems,
CORBA::Short methodFlags)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const SMESH::DirStruct& facetToSplitNormal,
CORBA::Short methodFlags,
CORBA::Boolean allDomains)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//================================================================================
void SMESH_MeshEditor_i::SplitBiQuadraticIntoLinear(const SMESH::ListOfIDSources& theElems)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method)
- throw (SALOME::SALOME_Exception)
{
return smooth( IDsOfElements, IDsOfFixedNodes, MaxNbOfIterations,
MaxAspectRatio, Method, false );
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method)
- throw (SALOME::SALOME_Exception)
{
return smooth( IDsOfElements, IDsOfFixedNodes, MaxNbOfIterations,
MaxAspectRatio, Method, true );
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method)
- throw (SALOME::SALOME_Exception)
{
return smoothObject (theObject, IDsOfFixedNodes, MaxNbOfIterations,
MaxAspectRatio, Method, false);
CORBA::Long MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method)
- throw (SALOME::SALOME_Exception)
{
return smoothObject (theObject, IDsOfFixedNodes, MaxNbOfIterations,
MaxAspectRatio, Method, true);
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method,
bool IsParametric)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method,
bool IsParametric)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=============================================================================
void SMESH_MeshEditor_i::RenumberNodes()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
// Update Python script
//=============================================================================
void SMESH_MeshEditor_i::RenumberElements()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
// Update Python script
//=======================================================================
SMESH::ListOfGroups* SMESH_MeshEditor_i::getGroups(const std::list<int>* groupIDs)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
if ( !groupIDs )
CORBA::Long theNbOfSteps,
CORBA::Double theTolerance,
const bool theMakeGroups)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const SMESH::double_array & theBasePoint,
const SMESH::double_array & theAngles,
CORBA::Boolean theAnglesVariation)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean useInputElemsOnly,
CORBA::Boolean makeGroups,
CORBA::Short dim)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Long theExtrFlags,
CORBA::Double theSewTolerance,
CORBA::Boolean theMakeGroups)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const SMESH::double_array & theScaleFactors,
CORBA::Boolean theScalesVariation,
SMESH::SMESH_MeshEditor::Extrusion_Error& theError)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean theCopy,
bool theMakeGroups,
::SMESH_Mesh* theTargetMesh)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const SMESH::AxisStruct & theAxis,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
CORBA::Boolean theCopy)
- throw (SALOME::SALOME_Exception)
{
if ( !myIsPreviewMode ) {
TPythonDump() << this << ".Mirror( "
const SMESH::AxisStruct & theAxis,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
CORBA::Boolean theCopy)
- throw (SALOME::SALOME_Exception)
{
if ( !myIsPreviewMode ) {
TPythonDump() << this << ".MirrorObject( "
SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::long_array& theIDsOfElements,
const SMESH::AxisStruct& theMirror,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
- throw (SALOME::SALOME_Exception)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
SMESH_MeshEditor_i::MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::AxisStruct& theMirror,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
- throw (SALOME::SALOME_Exception)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
CORBA::Boolean theCopyGroups,
const char* theMeshName)
- throw (SALOME::SALOME_Exception)
{
SMESH_Mesh_i* mesh_i;
SMESH::SMESH_Mesh_var mesh;
SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
CORBA::Boolean theCopyGroups,
const char* theMeshName)
- throw (SALOME::SALOME_Exception)
{
SMESH_Mesh_i* mesh_i;
SMESH::SMESH_Mesh_var mesh;
CORBA::Boolean theCopy,
bool theMakeGroups,
::SMESH_Mesh* theTargetMesh)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements,
const SMESH::DirStruct & theVector,
CORBA::Boolean theCopy)
- throw (SALOME::SALOME_Exception)
{
if (!myIsPreviewMode) {
TPythonDump() << this << ".Translate( "
void SMESH_MeshEditor_i::TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::DirStruct & theVector,
CORBA::Boolean theCopy)
- throw (SALOME::SALOME_Exception)
{
if (!myIsPreviewMode) {
TPythonDump() << this << ".TranslateObject( "
SMESH::ListOfGroups*
SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElements,
const SMESH::DirStruct& theVector)
- throw (SALOME::SALOME_Exception)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
SMESH::ListOfGroups*
SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::DirStruct& theVector)
- throw (SALOME::SALOME_Exception)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
const SMESH::DirStruct& theVector,
CORBA::Boolean theCopyGroups,
const char* theMeshName)
- throw (SALOME::SALOME_Exception)
{
SMESH_Mesh_i* mesh_i;
SMESH::SMESH_Mesh_var mesh;
const SMESH::DirStruct& theVector,
CORBA::Boolean theCopyGroups,
const char* theMeshName)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH_Mesh_i* mesh_i;
CORBA::Boolean theCopy,
bool theMakeGroups,
::SMESH_Mesh* theTargetMesh)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const SMESH::AxisStruct & theAxis,
CORBA::Double theAngle,
CORBA::Boolean theCopy)
- throw (SALOME::SALOME_Exception)
{
if (!myIsPreviewMode) {
TPythonDump() << this << ".Rotate( "
const SMESH::AxisStruct & theAxis,
CORBA::Double theAngle,
CORBA::Boolean theCopy)
- throw (SALOME::SALOME_Exception)
{
if ( !myIsPreviewMode ) {
TPythonDump() << this << ".RotateObject( "
SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::long_array& theIDsOfElements,
const SMESH::AxisStruct& theAxis,
CORBA::Double theAngle)
- throw (SALOME::SALOME_Exception)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
SMESH_MeshEditor_i::RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::AxisStruct& theAxis,
CORBA::Double theAngle)
- throw (SALOME::SALOME_Exception)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
CORBA::Double theAngleInRadians,
CORBA::Boolean theCopyGroups,
const char* theMeshName)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::SMESH_Mesh_var mesh;
CORBA::Double theAngleInRadians,
CORBA::Boolean theCopyGroups,
const char* theMeshName)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::SMESH_Mesh_var mesh;
CORBA::Boolean theCopy,
bool theMakeGroups,
::SMESH_Mesh* theTargetMesh)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const SMESH::PointStruct& thePoint,
const SMESH::double_array& theScaleFact,
CORBA::Boolean theCopy)
- throw (SALOME::SALOME_Exception)
{
if ( !myIsPreviewMode ) {
TPythonDump() << this << ".Scale( "
SMESH_MeshEditor_i::ScaleMakeGroups(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::PointStruct& thePoint,
const SMESH::double_array& theScaleFact)
- throw (SALOME::SALOME_Exception)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
const SMESH::double_array& theScaleFact,
CORBA::Boolean theCopyGroups,
const char* theMeshName)
- throw (SALOME::SALOME_Exception)
{
SMESH_Mesh_i* mesh_i;
SMESH::SMESH_Mesh_var mesh;
CORBA::Boolean theCopyElements,
const char* theMeshName,
SMESH::ListOfGroups_out theGroups)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
}
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() << ", ";
FindCoincidentNodes (CORBA::Double Tolerance,
SMESH::array_of_long_array_out GroupsOfNodes,
CORBA::Boolean SeparateCornersAndMedium)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Double Tolerance,
SMESH::array_of_long_array_out GroupsOfNodes,
CORBA::Boolean SeparateCornersAndMedium)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
SMESH::array_of_long_array_out theGroupsOfNodes,
const SMESH::ListOfIDSources& theExceptSubMeshOrGroups,
CORBA::Boolean theSeparateCornersAndMedium)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes,
const SMESH::ListOfIDSources& NodesToKeep,
CORBA::Boolean AvoidMakingHoles)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
void SMESH_MeshEditor_i::FindEqualElements(const SMESH::ListOfIDSources& theObjects,
const SMESH::ListOfIDSources& theExceptObjects,
SMESH::array_of_long_array_out theGroupsOfElementsID)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& theGroupsOfElementsID,
const SMESH::ListOfIDSources& theElementsToKeep)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=======================================================================
void SMESH_MeshEditor_i::MergeEqualElements()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Double x,
CORBA::Double y,
CORBA::Double z)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData(/*deleteSearchers=*/false);
CORBA::Long SMESH_MeshEditor_i::FindNodeClosestTo(CORBA::Double x,
CORBA::Double y,
CORBA::Double z)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
theSearchersDeleter.Set( myMesh ); // remove theNodeSearcher if mesh is other
CORBA::Double y,
CORBA::Double z,
CORBA::Long theNodeID)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
// We keep theNodeSearcher until any mesh modification:
CORBA::Double y,
CORBA::Double z,
SMESH::ElementType type)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::long_array_var res = new SMESH::long_array;
CORBA::Double y,
CORBA::Double z,
SMESH::ElementType type)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::long_array_var res = new SMESH::long_array;
SMESH::ElementType type,
SMESH::SMESH_IDSource_ptr meshObject,
SMESH::double_array_out projecton)
- throw (SALOME::SALOME_Exception)
{
if ( CORBA::is_nil( meshObject ))
THROW_SALOME_CORBA_EXCEPTION("NULL meshObject", SALOME::BAD_PARAM);
CORBA::Short SMESH_MeshEditor_i::GetPointState(CORBA::Double x,
CORBA::Double y,
CORBA::Double z)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
theSearchersDeleter.Set( myMesh );
//=======================================================================
CORBA::Boolean SMESH_MeshEditor_i::IsManifold()
- throw (SALOME::SALOME_Exception)
{
bool isManifold = true;
//=======================================================================
CORBA::Boolean SMESH_MeshEditor_i::IsCoherentOrientation2D()
- throw (SALOME::SALOME_Exception)
{
bool isGoodOri = true;
SMESH_MeshEditor_i::Get1DBranches( SMESH::SMESH_IDSource_ptr theEdges,
CORBA::Long theStartNode,
SMESH::array_of_long_array_out theNodeGroups )
- throw (SALOME::SALOME_Exception)
{
if ( CORBA::is_nil( theEdges ))
THROW_SALOME_CORBA_EXCEPTION("Get1DBranches(): NULL group given", SALOME::BAD_PARAM);
SMESH::ListOfEdges* SMESH_MeshEditor_i::FindSharpEdges(CORBA::Double theAngle,
CORBA::Boolean theAddExisting)
- throw (SALOME::SALOME_Exception)
{
SMESH::ListOfEdges_var resultEdges = new SMESH::ListOfEdges;
SMESH_TRY;
//=======================================================================
SMESH::ListOfFreeBorders* SMESH_MeshEditor_i::FindFreeBorders(CORBA::Boolean closedOnly)
- throw (SALOME::SALOME_Exception)
{
SMESH::ListOfFreeBorders_var resBorders = new SMESH::ListOfFreeBorders;
SMESH_TRY;
SMESH::SMESH_Group_ptr
SMESH_MeshEditor_i::FillHole(const SMESH::FreeBorder& theHole,
const char* theGroupName)
- throw (SALOME::SALOME_Exception)
{
initData();
SewCoincidentFreeBorders(const SMESH::CoincidentFreeBorders& freeBorders,
CORBA::Boolean createPolygons,
CORBA::Boolean createPolyhedra)
- throw (SALOME::SALOME_Exception)
{
CORBA::Short nbSewed = 0;
CORBA::Long LastNodeID2,
CORBA::Boolean CreatePolygons,
CORBA::Boolean CreatePolyedrs)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Long LastNodeID1,
CORBA::Long FirstNodeID2,
CORBA::Long SecondNodeID2)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Long LastNodeIDOnSide,
CORBA::Boolean CreatePolygons,
CORBA::Boolean CreatePolyedrs)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Long NodeID1OfSide2ToMerge,
CORBA::Long NodeID2OfSide1ToMerge,
CORBA::Long NodeID2OfSide2ToMerge)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide,
const SMESH::long_array& newIDs)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
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 );
void SMESH_MeshEditor_i::convertToQuadratic(CORBA::Boolean theForce3d,
CORBA::Boolean theToBiQuad,
SMESH::SMESH_IDSource_ptr theObject)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=======================================================================
CORBA::Boolean SMESH_MeshEditor_i::ConvertFromQuadratic()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
//=======================================================================
void SMESH_MeshEditor_i::ConvertToQuadratic(CORBA::Boolean theForce3d)
- throw (SALOME::SALOME_Exception)
{
convertToQuadratic( theForce3d, false );
TPythonDump() << this << ".ConvertToQuadratic("<<theForce3d<<")";
void SMESH_MeshEditor_i::ConvertToQuadraticObject(CORBA::Boolean theForce3d,
SMESH::SMESH_IDSource_ptr theObject)
- throw (SALOME::SALOME_Exception)
{
convertToQuadratic( theForce3d, false, theObject );
TPythonDump() << this << ".ConvertToQuadraticObject("<<theForce3d<<", "<<theObject<<")";
void SMESH_MeshEditor_i::ConvertToBiQuadratic(CORBA::Boolean theForce3d,
SMESH::SMESH_IDSource_ptr theObject)
- throw (SALOME::SALOME_Exception)
{
convertToQuadratic( theForce3d, true, theObject );
TPythonDump() << this << ".ConvertToBiQuadratic("<<theForce3d<<", "<<theObject<<")";
//================================================================================
void SMESH_MeshEditor_i::ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
SMESH::SMESH_Group_ptr
SMESH_MeshEditor_i::DoubleElements(SMESH::SMESH_IDSource_ptr theElements,
const char* theGroupName)
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_Group_var newGroup;
CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNodes,
const SMESH::long_array& theModifiedElems )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( CORBA::Long theNodeId,
const SMESH::long_array& theModifiedElems )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::long_array_var aNodes = new SMESH::long_array;
CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroup(SMESH::SMESH_GroupBase_ptr theNodes,
SMESH::SMESH_GroupBase_ptr theModifiedElems )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
if ( CORBA::is_nil( theNodes ) && theNodes->GetType() != SMESH::NODE )
SMESH::SMESH_Group_ptr
SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes,
SMESH::SMESH_GroupBase_ptr theModifiedElems )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::SMESH_Group_var aNewGroup;
CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups(const SMESH::ListOfGroups& theNodes,
const SMESH::ListOfGroups& theModifiedElems )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
SMESH::SMESH_Group_ptr
SMESH_MeshEditor_i::DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes,
const SMESH::ListOfGroups& theModifiedElems )
- throw (SALOME::SALOME_Exception)
{
SMESH::SMESH_Group_var aNewGroup;
CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theElems,
const SMESH::long_array& theNodesNot,
const SMESH::long_array& theAffectedElems )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::long_array& theElems,
const SMESH::long_array& theNodesNot,
GEOM::GEOM_Object_ptr theShape )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
SMESH_MeshEditor_i::DoubleNodeElemGroup(SMESH::SMESH_GroupBase_ptr theElems,
SMESH::SMESH_GroupBase_ptr theNodesNot,
SMESH::SMESH_GroupBase_ptr theAffectedElems)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
if ( CORBA::is_nil( theElems ) && theElems->GetType() == SMESH::NODE )
SMESH_MeshEditor_i::DoubleNodeElemGroupNew(SMESH::SMESH_GroupBase_ptr theElems,
SMESH::SMESH_GroupBase_ptr theNodesNot,
SMESH::SMESH_GroupBase_ptr theAffectedElems)
- throw (SALOME::SALOME_Exception)
{
TPythonDump pyDump;
SMESH::ListOfGroups_var twoGroups = DoubleNodeElemGroup2New( theElems,
SMESH::SMESH_GroupBase_ptr theAffectedElems,
CORBA::Boolean theElemGroupNeeded,
CORBA::Boolean theNodeGroupNeeded)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::SMESH_Group_var aNewElemGroup, aNewNodeGroup;
SMESH_MeshEditor_i::DoubleNodeElemGroupInRegion(SMESH::SMESH_GroupBase_ptr theElems,
SMESH::SMESH_GroupBase_ptr theNodesNot,
GEOM::GEOM_Object_ptr theShape )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
if ( CORBA::is_nil( theElems ) && theElems->GetType() == SMESH::NODE )
SMESH_MeshEditor_i::DoubleNodeElemGroups(const SMESH::ListOfGroups& theElems,
const SMESH::ListOfGroups& theNodesNot,
const SMESH::ListOfGroups& theAffectedElems)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
SMESH_MeshEditor_i::DoubleNodeElemGroupsNew(const SMESH::ListOfGroups& theElems,
const SMESH::ListOfGroups& theNodesNot,
const SMESH::ListOfGroups& theAffectedElems)
- throw (SALOME::SALOME_Exception)
{
TPythonDump pyDump;
SMESH::ListOfGroups_var twoGroups = DoubleNodeElemGroups2New( theElems,
const SMESH::ListOfGroups& theAffectedElems,
CORBA::Boolean theElemGroupNeeded,
CORBA::Boolean theNodeGroupNeeded)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::SMESH_Group_var aNewElemGroup, aNewNodeGroup;
SMESH_MeshEditor_i::DoubleNodeElemGroupsInRegion(const SMESH::ListOfGroups& theElems,
const SMESH::ListOfGroups& theNodesNot,
GEOM::GEOM_Object_ptr theShape )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
SMESH_MeshEditor_i::AffectedElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
const SMESH::ListOfGroups& theNodesNot,
GEOM::GEOM_Object_ptr theShape )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
SMESH::ListOfGroups_var aListOfGroups = new SMESH::ListOfGroups();
//================================================================================
CORBA::Boolean SMESH_MeshEditor_i::Make2DMeshFrom3D()
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
CORBA::Boolean createJointElems,
CORBA::Boolean onAllBoundaries )
- throw (SALOME::SALOME_Exception)
{
bool isOK = false;
CORBA::Boolean
SMESH_MeshEditor_i::CreateFlatElementsOnFacesGroups( const SMESH::ListOfGroups& theGroupsOfFaces )
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const char* groupName,
const SMESH::double_array& theNodesCoords,
SMESH::array_of_long_array_out GroupsOfNodes)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
CORBA::Boolean toCopyElements,
CORBA::Boolean toCopyExistingBondary,
SMESH::SMESH_Group_out group)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
const SMESH::ListOfIDSources& groups,
SMESH::SMESH_Mesh_out mesh,
SMESH::SMESH_Group_out group)
- throw (SALOME::SALOME_Exception)
{
SMESH_TRY;
initData();
void SMESH_MeshEditor_i::MakePolyLine(SMESH::ListOfPolySegments& theSegments,
const char* theGroupName)
- throw (SALOME::SALOME_Exception)
{
if ( theSegments.length() == 0 )
THROW_SALOME_CORBA_EXCEPTION("No segments given", SALOME::BAD_PARAM );
SMESH::ListOfEdges* SMESH_MeshEditor_i::MakeSlot(SMESH::SMESH_GroupBase_ptr theSegments,
CORBA::Double theWidth)
- throw (SALOME::SALOME_Exception)
{
if ( CORBA::is_nil( theSegments ) ||
theSegments->GetType() != SMESH::EDGE )