1 // Copyright (C) 2007-2019 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, or (at your option) any later version.
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
19 // Author : Anthony Geay (CEA/DEN)
21 #include "InterpKernelGeo2DAbstractEdge.hxx"
22 #include "InterpKernelGeo2DComposedEdge.hxx"
23 #include "InterpKernelGeo2DElementaryEdge.hxx"
25 using namespace INTERP_KERNEL;
27 IteratorOnComposedEdge::IteratorOnComposedEdge():_list_handle(0)
31 IteratorOnComposedEdge::IteratorOnComposedEdge(ComposedEdge *compEdges):_list_handle(compEdges->getListBehind())
36 void IteratorOnComposedEdge::operator=(const IteratorOnComposedEdge& other)
38 _deep_it=other._deep_it;
39 _list_handle=other._list_handle;
42 void IteratorOnComposedEdge::last()
44 _deep_it=_list_handle->end();
48 void IteratorOnComposedEdge::nextLoop()
51 if(_deep_it==_list_handle->end())
55 void IteratorOnComposedEdge::previousLoop()
57 if(_deep_it!=_list_handle->begin())
63 bool IteratorOnComposedEdge::goToNextInOn(bool direction, int& i, int nbMax)
65 TypeOfEdgeLocInPolygon loc=current()->getLoc();
68 while(loc==FULL_OUT_1 && i<nbMax)
71 loc=current()->getLoc();
79 while(loc==FULL_OUT_1 && i<nbMax)
82 loc=current()->getLoc();
86 while(loc!=FULL_OUT_1 && i<nbMax)
89 loc=current()->getLoc();
96 void IteratorOnComposedEdge::assignMySelfToAllElems(ComposedEdge *elems)
98 std::list<ElementaryEdge *> *myList=elems->getListBehind();
99 for(std::list<ElementaryEdge *>::iterator iter=myList->begin();iter!=myList->end();iter++)
100 (*iter)->getIterator()=(*this);
103 void IteratorOnComposedEdge::insertElemEdges(ComposedEdge *elems, bool changeMySelf)
105 std::list<ElementaryEdge *> *myListToInsert=elems->getListBehind();
106 std::list<ElementaryEdge *>::iterator iter=myListToInsert->begin();
110 int sizeOfMyList=myListToInsert->size();
111 _list_handle->insert(_deep_it,iter,myListToInsert->end());
114 for(int i=0;i<sizeOfMyList;i++)
120 * Erase current element and place iterator onto the PREVIOUS element (eventually looping)
122 void IteratorOnComposedEdge::eraseCurrent()
125 _deep_it = _list_handle->erase(_deep_it);
126 // By default erase place the iterator after the removed element: