1 // Created on: 1995-12-08
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <TopOpeBRepDS_DataStructure.hxx>
19 #include <TopOpeBRepDS_Point.hxx>
20 #include <TopOpeBRepDS_PointExplorer.hxx>
22 #define MYDS (*((TopOpeBRepDS_DataStructure*)myDS))
24 //=======================================================================
25 //function : TopOpeBRepDS_PointExplorer
27 //=======================================================================
29 TopOpeBRepDS_PointExplorer::TopOpeBRepDS_PointExplorer()
33 myFound(Standard_False),
34 myFindKeep(Standard_False)
38 //=======================================================================
39 //function : TopOpeBRepDS_PointExplorer
41 //=======================================================================
43 TopOpeBRepDS_PointExplorer::TopOpeBRepDS_PointExplorer
44 (const TopOpeBRepDS_DataStructure& DS,
45 const Standard_Boolean FindKeep)
50 //=======================================================================
53 //=======================================================================
55 void TopOpeBRepDS_PointExplorer::Init
56 (const TopOpeBRepDS_DataStructure& DS,
57 const Standard_Boolean FindKeep)
60 myMax = DS.NbPoints();
61 myDS = (TopOpeBRepDS_DataStructure*)&DS;
62 myFindKeep = FindKeep;
67 //=======================================================================
70 //=======================================================================
72 void TopOpeBRepDS_PointExplorer::Find()
74 myFound = Standard_False;
75 while (myIndex <= myMax) {
77 myFound = IsPointKeep(myIndex);
80 myFound = IsPoint(myIndex);
87 //=======================================================================
90 //=======================================================================
92 Standard_Boolean TopOpeBRepDS_PointExplorer::More() const
97 //=======================================================================
100 //=======================================================================
102 void TopOpeBRepDS_PointExplorer::Next()
108 //=======================================================================
111 //=======================================================================
113 const TopOpeBRepDS_Point& TopOpeBRepDS_PointExplorer::Point()const
116 return MYDS.Point(myIndex);
123 //=======================================================================
126 //=======================================================================
128 Standard_Boolean TopOpeBRepDS_PointExplorer::IsPoint
129 (const Standard_Integer I)const
131 Standard_Boolean b = MYDS.myPoints.IsBound(I);
135 //=======================================================================
136 //function : IsPointKeep
138 //=======================================================================
140 Standard_Boolean TopOpeBRepDS_PointExplorer::IsPointKeep
141 (const Standard_Integer I)const
143 Standard_Boolean b = MYDS.myPoints.IsBound(I);
144 if (b) b = MYDS.Point(I).Keep();
149 //=======================================================================
152 //=======================================================================
154 const TopOpeBRepDS_Point& TopOpeBRepDS_PointExplorer::Point
155 (const Standard_Integer I)const
158 return MYDS.Point(I);
165 //=======================================================================
168 //=======================================================================
170 Standard_Integer TopOpeBRepDS_PointExplorer::NbPoint()
172 myIndex = 1; myMax = MYDS.NbPoints();
174 Standard_Integer n = 0;
175 for (; More(); Next() ) n++;
179 //=======================================================================
182 //=======================================================================
184 Standard_Integer TopOpeBRepDS_PointExplorer::Index()const