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
PAL6938
[modules/smesh.git]
/
src
/
SMDS
/
SMDS_MeshNode.cxx
diff --git
a/src/SMDS/SMDS_MeshNode.cxx
b/src/SMDS/SMDS_MeshNode.cxx
index cba7920fa32232349423fd2ca7d7ddcb6643e0ce..06ab12173d871505c7ab482c4937e6796ea01b2c 100644
(file)
--- a/
src/SMDS/SMDS_MeshNode.cxx
+++ b/
src/SMDS/SMDS_MeshNode.cxx
@@
-19,11
+19,16
@@
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+#ifdef _MSC_VER
+#pragma warning(disable:4786)
+#endif
#include "SMDS_MeshNode.hxx"
#include "SMDS_SpacePosition.hxx"
#include "SMDS_IteratorOfElements.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_SpacePosition.hxx"
#include "SMDS_IteratorOfElements.hxx"
+using namespace std;
+
//=======================================================================
//function : SMDS_MeshNode
//purpose :
//=======================================================================
//function : SMDS_MeshNode
//purpose :
@@
-42,7
+47,14
@@
SMDS_MeshNode::SMDS_MeshNode(double x, double y, double z):
void SMDS_MeshNode::RemoveInverseElement(const SMDS_MeshElement * parent)
{
void SMDS_MeshNode::RemoveInverseElement(const SMDS_MeshElement * parent)
{
- myInverseElements.erase(parent);
+ NCollection_List<const SMDS_MeshElement*>::Iterator it(myInverseElements);
+ while (it.More()) {
+ const SMDS_MeshElement* elem = it.Value();
+ if (elem == parent)
+ myInverseElements.Remove(it);
+ else
+ it.Next();
+ }
}
//=======================================================================
}
//=======================================================================
@@
-78,25
+90,22
@@
const SMDS_PositionPtr& SMDS_MeshNode::GetPosition() const
class SMDS_MeshNode_MyInvIterator:public SMDS_ElemIterator
{
class SMDS_MeshNode_MyInvIterator:public SMDS_ElemIterator
{
- const set<const SMDS_MeshElement*>& mySet;
- set<const SMDS_MeshElement*>::iterator myIterator;
+ NCollection_List<const SMDS_MeshElement*>::Iterator myIterator;
public:
public:
- SMDS_MeshNode_MyInvIterator(const set<const SMDS_MeshElement*>& s):
- mySet(s)
- {
- myIterator=mySet.begin();
- }
+ SMDS_MeshNode_MyInvIterator(const NCollection_List<const SMDS_MeshElement*>& s):
+ myIterator(s)
+ {}
bool more()
{
bool more()
{
- return myIterator
!=mySet.end()
;
+ return myIterator
.More() != Standard_False
;
}
const SMDS_MeshElement* next()
{
}
const SMDS_MeshElement* next()
{
- const SMDS_MeshElement* current=
*myIterator
;
- myIterator
++
;
- return current;
+ const SMDS_MeshElement* current=
myIterator.Value()
;
+ myIterator
.Next()
;
+ return current;
}
};
}
};
@@
-110,39
+119,38
@@
SMDS_ElemIteratorPtr SMDS_MeshNode::
// wanted type elements.
class SMDS_MeshNode_MyIterator:public SMDS_ElemIterator
{
// wanted type elements.
class SMDS_MeshNode_MyIterator:public SMDS_ElemIterator
{
-
se
t<const SMDS_MeshElement*> mySet;
-
set<const SMDS_MeshElement*>::i
terator myIterator;
+
NCollection_Lis
t<const SMDS_MeshElement*> mySet;
+
NCollection_List<const SMDS_MeshElement*>::I
terator myIterator;
public:
SMDS_MeshNode_MyIterator(SMDSAbs_ElementType type,
public:
SMDS_MeshNode_MyIterator(SMDSAbs_ElementType type,
- const
se
t<const SMDS_MeshElement*>& s)
+ const
NCollection_Lis
t<const SMDS_MeshElement*>& s)
{
const SMDS_MeshElement * e;
bool toInsert;
{
const SMDS_MeshElement * e;
bool toInsert;
-
set<const SMDS_MeshElement*>::iterator it=s.begin(
);
-
while(it!=s.end
())
+
NCollection_List<const SMDS_MeshElement*>::Iterator it(s
);
+
for(; it.More(); it.Next
())
{
{
- e=
*it
;
+ e=
it.Value()
;
switch(type)
{
case SMDSAbs_Edge: toInsert=true; break;
case SMDSAbs_Face: toInsert=(e->GetType()!=SMDSAbs_Edge); break;
case SMDSAbs_Volume: toInsert=(e->GetType()==SMDSAbs_Volume); break;
}
switch(type)
{
case SMDSAbs_Edge: toInsert=true; break;
case SMDSAbs_Face: toInsert=(e->GetType()!=SMDSAbs_Edge); break;
case SMDSAbs_Volume: toInsert=(e->GetType()==SMDSAbs_Volume); break;
}
- if(toInsert) mySet.insert(e);
- it++;
+ if(toInsert) mySet.Append(e);
}
}
- myIterator
=mySet.begin(
);
+ myIterator
.Init(mySet
);
}
bool more()
{
}
bool more()
{
- return myIterator
!=mySet.end()
;
+ return myIterator
.More() != Standard_False
;
}
const SMDS_MeshElement* next()
{
}
const SMDS_MeshElement* next()
{
- const SMDS_MeshElement* current=
*myIterator
;
- myIterator
++
;
+ const SMDS_MeshElement* current=
myIterator.Value()
;
+ myIterator
.Next()
;
return current;
}
};
return current;
}
};
@@
-197,7
+205,13
@@
SMDSAbs_ElementType SMDS_MeshNode::GetType() const
//=======================================================================
void SMDS_MeshNode::AddInverseElement(const SMDS_MeshElement* ME)
{
//=======================================================================
void SMDS_MeshNode::AddInverseElement(const SMDS_MeshElement* ME)
{
- myInverseElements.insert(ME);
+ NCollection_List<const SMDS_MeshElement*>::Iterator it(myInverseElements);
+ for (; it.More(); it.Next()) {
+ const SMDS_MeshElement* elem = it.Value();
+ if (elem == ME)
+ return;
+ }
+ myInverseElements.Append(ME);
}
//=======================================================================
}
//=======================================================================
@@
-206,12
+220,12
@@
void SMDS_MeshNode::AddInverseElement(const SMDS_MeshElement* ME)
//=======================================================================
void SMDS_MeshNode::ClearInverseElements()
{
//=======================================================================
void SMDS_MeshNode::ClearInverseElements()
{
-
myInverseElements.c
lear();
+
myInverseElements.C
lear();
}
bool SMDS_MeshNode::emptyInverseElements()
{
}
bool SMDS_MeshNode::emptyInverseElements()
{
-
return myInverseElements.empty()
;
+
return myInverseElements.IsEmpty() != Standard_False
;
}
///////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////