2 // File: SMDSControl_BoundaryEdges.cxx
3 // Created: Wed Feb 20 19:28:42 2002
4 // Author: Jean-Michel BOULCOURT
5 // <jmb@localhost.localdomain>
8 #include "SMDSControl_BoundaryEdges.ixx"
9 #include "SMDSControl.hxx"
11 #include "SMDS_MeshFacesIterator.hxx"
12 #include "SMDS_MeshElement.hxx"
13 #include "SMDS_MeshEdge.hxx"
14 #include "SMDS_MapIteratorOfExtendedMap.hxx"
16 //=======================================================================
17 //function : SMDSControl_BoundaryEdges
19 //=======================================================================
21 SMDSControl_BoundaryEdges::SMDSControl_BoundaryEdges(const Handle(SMDS_Mesh)& M)
22 :SMDSControl_MeshBoundary(M)
26 //=======================================================================
29 //=======================================================================
31 void SMDSControl_BoundaryEdges::Compute()
33 Standard_Integer idnode1;
34 Standard_Integer idnode2;
35 Standard_Integer nbedg;
37 myBoundaryMesh = myMesh->AddSubMesh();
38 SMDS_MeshFacesIterator itface(myMesh);
40 for (;itface.More();itface.Next()) {
41 Handle(SMDS_MeshElement) ME = itface.Value();
43 nbedg = ME->NbEdges();
45 for (Standard_Integer iedge=1; iedge<=nbedg; ++iedge) {
46 ME->GetEdgeDefinedByNodes(iedge,idnode1,idnode2);
47 Handle(SMDS_MeshElement) edge = new SMDS_MeshEdge(0,idnode1,idnode2);
48 if (!myBoundaryEdges.Add(edge))
49 myBoundaryEdges.Remove(edge);
53 SMDS_MapIteratorOfExtendedMap itbound(myBoundaryEdges);
55 for (;itbound.More();itbound.Next()) {
56 const Handle(SMDS_MeshElement)& edge = itbound.Key();
57 myBoundaryMesh->AddEdge(edge->GetConnection(1),edge->GetConnection(2));