myPolyElems.reserve( myIdsOnBoundary.size() );
// make a set of refined elements
- map<int,const SMDS_MeshElement* > avoidSet, elemSet;
+ TIDSortedElemSet avoidSet, elemSet;
std::vector<const SMDS_MeshElement*>::iterator itv = myElements.begin();
for(; itv!=myElements.end(); itv++) {
const SMDS_MeshElement* el = (*itv);
- avoidSet.insert( make_pair(el->GetID(),el) );
+ avoidSet.insert( el );
}
//avoidSet.insert( myElements.begin(), myElements.end() );
SMESH_MeshEditor::FindFaceInSet( n1, n2, elemSet, avoidSet );
if ( face )
{
- avoidSet.insert ( make_pair(face->GetID(),face) );
+ avoidSet.insert ( face );
myPolyElems.push_back( face );
// some links of <face> are split;
while ( eIt->more() )
{
const SMDS_MeshElement* elem = eIt->next();
- if ( !volTool.Set( elem ) || !avoidSet.insert( make_pair(elem->GetID(),elem) ).second )
+ if ( !volTool.Set( elem ) || !avoidSet.insert( elem ).second )
continue; // skip faces or refined elements
// add polyhedron definition
myPolyhedronQuantities.push_back(vector<int> ());
return isDone;
}
-
-//=======================================================================
-//function : ToMap
-//purpose : auxilary function for conversion long_array to std::map<>
-// which is used in some methods
-//=======================================================================
-static void ToMap(const SMESH::long_array & IDs,
- const SMESHDS_Mesh* aMesh,
- std::map<int,const SMDS_MeshElement*>& aMap,
- const SMDSAbs_ElementType aType = SMDSAbs_All )
-{
- for (int i=0; i<IDs.length(); i++) {
- CORBA::Long ind = IDs[i];
- std::map<int,const SMDS_MeshElement*>::iterator It = aMap.find(ind);
- if(It==aMap.end()) {
+namespace
+{
+ //================================================================================
+ /*!
+ * \brief function for conversion long_array to TIDSortedElemSet
+ * \param IDs - array of IDs
+ * \param aMesh - mesh
+ * \param aMap - collection to fill
+ * \param aType - element type
+ */
+ //================================================================================
+
+ void ToMap(const SMESH::long_array & IDs,
+ const SMESHDS_Mesh* aMesh,
+ TIDSortedElemSet& aMap,
+ const SMDSAbs_ElementType aType = SMDSAbs_All )
+ {
+ for (int i=0; i<IDs.length(); i++) {
+ CORBA::Long ind = IDs[i];
const SMDS_MeshElement * elem = aMesh->FindElement(ind);
if ( elem && ( aType == SMDSAbs_All || elem->GetType() == aType ))
- aMap.insert( make_pair( elem->GetID(), elem ));
+ aMap.insert( elem );
}
}
}
-
//=============================================================================
/*!
*
myLastCreatedNodes = new SMESH::long_array();
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> faces;
+ TIDSortedElemSet faces;
ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face);
SMESH::NumericalFunctor_i* aNumericalFunctor =
myLastCreatedNodes = new SMESH::long_array();
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> faces;
+ TIDSortedElemSet faces;
ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face);
SMESH::NumericalFunctor_i* aNumericalFunctor =
myLastCreatedNodes = new SMESH::long_array();
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> faces;
+ TIDSortedElemSet faces;
ToMap(IDsOfElements, aMesh, faces, SMDSAbs_Face);
// Update Python script
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(IDsOfElements, aMesh, elements, SMDSAbs_Face);
set<const SMDS_MeshNode*> fixedNodes;
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(theIDsOfElements, aMesh, elements);
gp_Ax1 Ax1 (gp_Pnt( theAxis.x, theAxis.y, theAxis.z ),
#endif
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(theIDsOfElements, aMesh, elements);
const SMESH::PointStruct * P = &theStepVector.PS;
SMESH::long_array_var allElementsId = theObject->GetIDs();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(allElementsId, aMesh, elements);
const SMESH::PointStruct * P = &theStepVector.PS;
SMESH::long_array_var allElementsId = theObject->GetIDs();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(allElementsId, aMesh, elements);
const SMESH::PointStruct * P = &theStepVector.PS;
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(theIDsOfElements, aMesh, elements);
const SMESH::PointStruct * P = &theStepVector.PS;
if ( !nodeStart )
return SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE;
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(theIDsOfElements, aMesh, elements);
list<double> angles;
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(theIDsOfElements, aMesh, elements);
gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(theIDsOfElements, aMesh, elements);
gp_Trsf aTrsf;
SMESHDS_Mesh* aMesh = GetMeshDS();
- map<int,const SMDS_MeshElement*> elements;
+ TIDSortedElemSet elements;
ToMap(theIDsOfElements, aMesh, elements);
gp_Pnt P ( theAxis.x, theAxis.y, theAxis.z );
!aSecondNode2ToMerge)
return SMESH::SMESH_MeshEditor::SEW_BAD_SIDE2_NODES;
- map<int,const SMDS_MeshElement*> aSide1Elems, aSide2Elems;
+ TIDSortedElemSet aSide1Elems, aSide2Elems;
ToMap(IDsOfSide1Elements, aMesh, aSide1Elems);
ToMap(IDsOfSide2Elements, aMesh, aSide2Elems);