1 // Copyright (C) 2007-2008 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
19 #include "AbstractEdge.hxx"
20 #include "ComposedEdge.hxx"
21 #include "ElementaryEdge.hxx"
23 using namespace INTERP_KERNEL;
25 IteratorOnComposedEdge::IteratorOnComposedEdge():_list_handle(0)
29 IteratorOnComposedEdge::IteratorOnComposedEdge(ComposedEdge *compEdges):_list_handle(compEdges->getListBehind())
34 void IteratorOnComposedEdge::operator=(const IteratorOnComposedEdge& other)
36 _deep_it=other._deep_it;
37 _list_handle=other._list_handle;
40 void IteratorOnComposedEdge::last()
42 _deep_it=_list_handle->end();
46 void IteratorOnComposedEdge::nextLoop()
49 if(_deep_it==_list_handle->end())
53 void IteratorOnComposedEdge::previousLoop()
55 if(_deep_it!=_list_handle->begin())
61 bool IteratorOnComposedEdge::goToNextInOn(bool direction, int& i, int nbMax)
63 TypeOfEdgeLocInPolygon loc=current()->getLoc();
66 while(loc==FULL_OUT_1 && i<nbMax)
69 loc=current()->getLoc();
77 while(loc==FULL_OUT_1 && i<nbMax)
80 loc=current()->getLoc();
84 while(loc!=FULL_OUT_1 && i<nbMax)
87 loc=current()->getLoc();
94 void IteratorOnComposedEdge::assignMySelfToAllElems(ComposedEdge *elems)
96 std::list<ElementaryEdge *> *myList=elems->getListBehind();
97 for(std::list<ElementaryEdge *>::iterator iter=myList->begin();iter!=myList->end();iter++)
98 (*iter)->getIterator()=(*this);
101 void IteratorOnComposedEdge::insertElemEdges(ComposedEdge *elems, bool changeMySelf)
103 std::list<ElementaryEdge *> *myListToInsert=elems->getListBehind();
104 std::list<ElementaryEdge *>::iterator iter=myListToInsert->begin();
108 int sizeOfMyList=myListToInsert->size();
109 _list_handle->insert(_deep_it,iter,myListToInsert->end());
112 for(int i=0;i<sizeOfMyList;i++)