1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "InterpKernelGeo2DAbstractEdge.hxx"
21 #include "InterpKernelGeo2DComposedEdge.hxx"
22 #include "InterpKernelGeo2DElementaryEdge.hxx"
24 using namespace INTERP_KERNEL;
26 IteratorOnComposedEdge::IteratorOnComposedEdge():_list_handle(0)
30 IteratorOnComposedEdge::IteratorOnComposedEdge(ComposedEdge *compEdges):_list_handle(compEdges->getListBehind())
35 void IteratorOnComposedEdge::operator=(const IteratorOnComposedEdge& other)
37 _deep_it=other._deep_it;
38 _list_handle=other._list_handle;
41 void IteratorOnComposedEdge::last()
43 _deep_it=_list_handle->end();
47 void IteratorOnComposedEdge::nextLoop()
50 if(_deep_it==_list_handle->end())
54 void IteratorOnComposedEdge::previousLoop()
56 if(_deep_it!=_list_handle->begin())
62 bool IteratorOnComposedEdge::goToNextInOn(bool direction, int& i, int nbMax)
64 TypeOfEdgeLocInPolygon loc=current()->getLoc();
67 while(loc==FULL_OUT_1 && i<nbMax)
70 loc=current()->getLoc();
78 while(loc==FULL_OUT_1 && i<nbMax)
81 loc=current()->getLoc();
85 while(loc!=FULL_OUT_1 && i<nbMax)
88 loc=current()->getLoc();
95 void IteratorOnComposedEdge::assignMySelfToAllElems(ComposedEdge *elems)
97 std::list<ElementaryEdge *> *myList=elems->getListBehind();
98 for(std::list<ElementaryEdge *>::iterator iter=myList->begin();iter!=myList->end();iter++)
99 (*iter)->getIterator()=(*this);
102 void IteratorOnComposedEdge::insertElemEdges(ComposedEdge *elems, bool changeMySelf)
104 std::list<ElementaryEdge *> *myListToInsert=elems->getListBehind();
105 std::list<ElementaryEdge *>::iterator iter=myListToInsert->begin();
109 int sizeOfMyList=myListToInsert->size();
110 _list_handle->insert(_deep_it,iter,myListToInsert->end());
113 for(int i=0;i<sizeOfMyList;i++)