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
small optimization
[modules/smesh.git]
/
src
/
SMESHUtils
/
SMESH_OctreeNode.cxx
diff --git
a/src/SMESHUtils/SMESH_OctreeNode.cxx
b/src/SMESHUtils/SMESH_OctreeNode.cxx
index db85eb05a8ed181f76b771d0f3b80dc7e2822604..95353575fe7d32ada94f2ec4f87b366d2d8de72e 100644
(file)
--- a/
src/SMESHUtils/SMESH_OctreeNode.cxx
+++ b/
src/SMESHUtils/SMESH_OctreeNode.cxx
@@
-327,29
+327,27
@@
void SMESH_OctreeNode::FindCoincidentNodes ( TIDSortedNodeSet* theSetOfNodes,
* \param precision - Precision used
*/
//======================================================================================
* \param precision - Precision used
*/
//======================================================================================
-void SMESH_OctreeNode::FindCoincidentNodes (const SMDS_MeshNode * Node,
- TIDSortedNodeSet* SetOfNodes,
+void SMESH_OctreeNode::FindCoincidentNodes (const SMDS_MeshNode *
Node,
+ TIDSortedNodeSet*
SetOfNodes,
list<const SMDS_MeshNode*>* Result,
list<const SMDS_MeshNode*>* Result,
- const double precision)
+ const double
precision)
{
{
- gp_
XYZ p
(Node->X(), Node->Y(), Node->Z());
- bool isInsideBool = isInside(
p, precision
);
+ gp_
Pnt p1
(Node->X(), Node->Y(), Node->Z());
+ bool isInsideBool = isInside(
p1.XYZ(), precision
);
if (isInsideBool)
{
// I'm only looking in the leaves, since all the nodes are stored there.
if (isLeaf())
{
if (isInsideBool)
{
// I'm only looking in the leaves, since all the nodes are stored there.
if (isLeaf())
{
- gp_Pnt p1 (Node->X(), Node->Y(), Node->Z());
-
- TIDSortedNodeSet myNodesCopy = myNodes;
- TIDSortedNodeSet::iterator it = myNodesCopy.begin();
- double tol2 = precision * precision;
+ TIDSortedNodeSet::iterator it = myNodes.begin();
+ const double tol2 = precision * precision;
bool squareBool;
bool squareBool;
- while (it != myNodes
Copy
.end())
+ while (it != myNodes.end())
{
const SMDS_MeshNode* n2 = *it;
{
const SMDS_MeshNode* n2 = *it;
+ squareBool = false;
// We're only looking at nodes with a superior Id.
// JFA: Why?
//if (Node->GetID() < n2->GetID())
// We're only looking at nodes with a superior Id.
// JFA: Why?
//if (Node->GetID() < n2->GetID())
@@
-364,14
+362,13
@@
void SMESH_OctreeNode::FindCoincidentNodes (const SMDS_MeshNode * Node,
{
Result->insert(Result->begin(), n2);
SetOfNodes->erase( n2 );
{
Result->insert(Result->begin(), n2);
SetOfNodes->erase( n2 );
- myNodes.erase(
n2 );
+ myNodes.erase(
*it++ ); // it++ goes forward and returns it's previous position
}
}
}
}
- //myNodesCopy.erase( it );
- //it = myNodesCopy.begin();
- it++;
+ if ( !squareBool )
+ it++;
}
}
- if (
Result->size() > 0
)
+ if (
!Result->empty()
)
myNodes.erase(Node); // JFA: for bug 0020185
}
else
myNodes.erase(Node); // JFA: for bug 0020185
}
else