Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#19887 [CEA] Body fitting missing some faces and generates not-wanted splitted elements
[modules/smesh.git]
/
src
/
StdMeshers
/
StdMeshers_Import_1D.cxx
diff --git
a/src/StdMeshers/StdMeshers_Import_1D.cxx
b/src/StdMeshers/StdMeshers_Import_1D.cxx
index b5e9a567ae93de6857d234e8ee58104bcc9737b9..179dd52e4d616167a0a02553902c51f5ead293ff 100644
(file)
--- a/
src/StdMeshers/StdMeshers_Import_1D.cxx
+++ b/
src/StdMeshers/StdMeshers_Import_1D.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
15
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
20
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
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-20,7
+20,7
@@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESH : implementaion of SMESH idl descriptions
+// SMESH SMESH : implementa
t
ion of SMESH idl descriptions
// File : StdMeshers_Import_1D.cxx
// Module : SMESH
//
// File : StdMeshers_Import_1D.cxx
// Module : SMESH
//
@@
-36,6
+36,7
@@
#include "SMESH_Group.hxx"
#include "SMESH_HypoFilter.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_Group.hxx"
#include "SMESH_HypoFilter.hxx"
#include "SMESH_Mesh.hxx"
+#include "SMESH_MeshEditor.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_subMeshEventListener.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_subMeshEventListener.hxx"
@@
-60,10
+61,9
@@
using namespace std;
*/
//=============================================================================
*/
//=============================================================================
-StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId,
int studyId,
SMESH_Gen * gen)
- :SMESH_1D_Algo(hypId,
studyId,
gen), _sourceHyp(0)
+StdMeshers_Import_1D::StdMeshers_Import_1D(int hypId, SMESH_Gen * gen)
+ :SMESH_1D_Algo(hypId, gen), _sourceHyp(0)
{
{
- MESSAGE("StdMeshers_Import_1D::StdMeshers_Import_1D");
_name = "Import_1D";
_shapeType = (1 << TopAbs_EDGE);
_name = "Import_1D";
_shapeType = (1 << TopAbs_EDGE);
@@
-212,7
+212,7
@@
namespace // INTERNAL STUFF
"StdMeshers_Import_1D::_Listener") {}
public:
"StdMeshers_Import_1D::_Listener") {}
public:
- // return poiter to a static listener
+ // return poi
n
ter to a static listener
static _Listener* get() { static _Listener theListener; return &theListener; }
static _ImportData* getImportData(const SMESH_Mesh* srcMesh, SMESH_Mesh* tgtMesh);
static _Listener* get() { static _Listener theListener; return &theListener; }
static _ImportData* getImportData(const SMESH_Mesh* srcMesh, SMESH_Mesh* tgtMesh);
@@
-290,7
+290,7
@@
namespace // INTERNAL STUFF
//--------------------------------------------------------------------------------
/*!
* \brief Remove imported mesh and/or groups if needed
//--------------------------------------------------------------------------------
/*!
* \brief Remove imported mesh and/or groups if needed
- * \param sm - submesh lo
o
sing Import algo
+ * \param sm - submesh losing Import algo
* \param data - data holding imported groups
*/
void _Listener::removeSubmesh( SMESH_subMesh* sm, _ListenerData* data )
* \param data - data holding imported groups
*/
void _Listener::removeSubmesh( SMESH_subMesh* sm, _ListenerData* data )
@@
-312,7
+312,7
@@
namespace // INTERNAL STUFF
//--------------------------------------------------------------------------------
/*!
* \brief Clear _ImportData::_n2n.
//--------------------------------------------------------------------------------
/*!
* \brief Clear _ImportData::_n2n.
- * _n2n is useful
l
within one mesh.Compute() only
+ * _n2n is useful within one mesh.Compute() only
*/
void _Listener::clearN2N( SMESH_Mesh* tgtMesh )
{
*/
void _Listener::clearN2N( SMESH_Mesh* tgtMesh )
{
@@
-685,7
+685,7
@@
bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th
// import edges from groups
TNodeNodeMap* n2n;
TElemElemMap* e2e;
// import edges from groups
TNodeNodeMap* n2n;
TElemElemMap* e2e;
- for (
in
t iG = 0; iG < srcGroups.size(); ++iG )
+ for (
size_
t iG = 0; iG < srcGroups.size(); ++iG )
{
const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
{
const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
@@
-711,7
+711,7
@@
bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th
double mytol = a.Distance(edge->GetNode(edge->NbNodes()-1))/25;
//mytol = max(1.E-5, 10*edgeTol); // too strict and not necessary
//MESSAGE("mytol = " << mytol);
double mytol = a.Distance(edge->GetNode(edge->NbNodes()-1))/25;
//mytol = max(1.E-5, 10*edgeTol); // too strict and not necessary
//MESSAGE("mytol = " << mytol);
- for (
unsigned
i = 0; i < newNodes.size(); ++i, ++node )
+ for (
size_t
i = 0; i < newNodes.size(); ++i, ++node )
{
TNodeNodeMap::iterator n2nIt = n2n->insert( make_pair( *node, (SMDS_MeshNode*)0 )).first;
if ( n2nIt->second )
{
TNodeNodeMap::iterator n2nIt = n2n->insert( make_pair( *node, (SMDS_MeshNode*)0 )).first;
if ( n2nIt->second )
@@
-810,7
+810,7
@@
bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th
// copy meshes
vector<SMESH_Mesh*> srcMeshes = _sourceHyp->GetSourceMeshes();
// copy meshes
vector<SMESH_Mesh*> srcMeshes = _sourceHyp->GetSourceMeshes();
- for (
unsigned
i = 0; i < srcMeshes.size(); ++i )
+ for (
size_t
i = 0; i < srcMeshes.size(); ++i )
importMesh( srcMeshes[i], theMesh, _sourceHyp, theShape );
return true;
importMesh( srcMeshes[i], theMesh, _sourceHyp, theShape );
return true;
@@
-841,6
+841,7
@@
void StdMeshers_Import_1D::importMesh(const SMESH_Mesh* srcMesh,
// 1. Copy mesh
// 1. Copy mesh
+ SMESH_MeshEditor::ElemFeatures elemType;
vector<const SMDS_MeshNode*> newNodes;
const SMESHDS_Mesh* srcMeshDS = srcMesh->GetMeshDS();
SMDS_ElemIteratorPtr eIt = srcMeshDS->elementsIterator();
vector<const SMDS_MeshNode*> newNodes;
const SMESHDS_Mesh* srcMeshDS = srcMesh->GetMeshDS();
SMDS_ElemIteratorPtr eIt = srcMeshDS->elementsIterator();
@@
-865,14
+866,14
@@
void StdMeshers_Import_1D::importMesh(const SMESH_Mesh* srcMesh,
tgtMeshDS->FindElement( newNodes, elem->GetType(), /*noMedium=*/false );
if ( !newElem )
{
tgtMeshDS->FindElement( newNodes, elem->GetType(), /*noMedium=*/false );
if ( !newElem )
{
- newElem = additor.AddElement( newNodes, elem
->GetType(), elem->IsPoly(
));
+ newElem = additor.AddElement( newNodes, elem
Type.Init( elem, /*basicOnly=*/false
));
tgtSubMesh->AddElement( newElem );
}
if ( toCopyGroups )
(*e2eIt).second = newElem;
}
// copy free nodes
tgtSubMesh->AddElement( newElem );
}
if ( toCopyGroups )
(*e2eIt).second = newElem;
}
// copy free nodes
- if ( srcMeshDS->NbNodes() > n2n->size() )
+ if ( srcMeshDS->NbNodes() >
(int)
n2n->size() )
{
SMDS_NodeIteratorPtr nIt = srcMeshDS->nodesIterator();
while( nIt->more() )
{
SMDS_NodeIteratorPtr nIt = srcMeshDS->nodesIterator();
while( nIt->more() )
@@
-911,7
+912,7
@@
void StdMeshers_Import_1D::importMesh(const SMESH_Mesh* srcMesh,
int nb = 1;
while ( !namesByType[ srcGroupDS->GetType() ].insert( name ).second )
name = SMESH_Comment(srcGroup->GetName()) << "_imported_" << nb++;
int nb = 1;
while ( !namesByType[ srcGroupDS->GetType() ].insert( name ).second )
name = SMESH_Comment(srcGroup->GetName()) << "_imported_" << nb++;
- SMESH_Group* newGroup = tgtMesh.AddGroup( srcGroupDS->GetType(), name.c_str()
, nb
);
+ SMESH_Group* newGroup = tgtMesh.AddGroup( srcGroupDS->GetType(), name.c_str() );
SMESHDS_Group* newGroupDS = (SMESHDS_Group*)newGroup->GetGroupDS();
resultGroups.push_back( newGroup );
SMESHDS_Group* newGroupDS = (SMESHDS_Group*)newGroup->GetGroupDS();
resultGroups.push_back( newGroup );
@@
-1027,7
+1028,7
@@
bool StdMeshers_Import_1D::Evaluate(SMESH_Mesh & theMesh,
// count edges imported from groups
int nbEdges = 0, nbQuadEdges = 0;
// count edges imported from groups
int nbEdges = 0, nbQuadEdges = 0;
- for (
in
t iG = 0; iG < srcGroups.size(); ++iG )
+ for (
size_
t iG = 0; iG < srcGroups.size(); ++iG )
{
const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
SMDS_ElemIteratorPtr srcElems = srcGroup->GetElements();
{
const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
SMDS_ElemIteratorPtr srcElems = srcGroup->GetElements();
@@
-1056,7
+1057,7
@@
bool StdMeshers_Import_1D::Evaluate(SMESH_Mesh & theMesh,
}
SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
}
SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
- aResMap.insert(
make_pair(sm,aVec
));
+ aResMap.insert(
make_pair( sm, aVec
));
return true;
}
return true;
}