0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / TopOpeBRepDS / TopOpeBRepDS_Marker.cxx
1 // Created on: 1997-10-22
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <TopOpeBRepDS_Marker.ixx>
18 #include <TopOpeBRepDS_define.hxx>
19 //#include <TopExp.hxx>
20 //#include <TopTools_IndexedMapOfShape.hxx>
21
22 TopOpeBRepDS_Marker::TopOpeBRepDS_Marker()
23 {
24   Reset();
25 }
26
27 void TopOpeBRepDS_Marker::Reset()
28 {
29   myhe.Nullify();
30   myne = 0;
31 }
32
33 void TopOpeBRepDS_Marker::Set(const Standard_Integer ie, const Standard_Boolean b)
34 {
35   Allocate(ie);
36   if (!(ie>=1 && ie<=myne)) return;
37   myhe->SetValue(ie,b); 
38 }
39
40 void TopOpeBRepDS_Marker::Set(const Standard_Boolean b, const Standard_Integer na, const Standard_Address aa)
41 {
42   char ** a = (char**)aa;
43 //  Standard_Integer ia,ie;
44   Standard_Integer ia;
45   if (!na) myhe->Init(b);
46   else for (ia=0; ia<na; ia++) Set(atoi(a[ia]),b);
47 }
48
49 Standard_Boolean TopOpeBRepDS_Marker::GetI(const Standard_Integer ie) const
50 {
51   if (myhe.IsNull()) return Standard_False;
52   if (!(ie>=1 && ie<=myne)) return Standard_False;
53   return myhe->Value(ie);
54 }
55
56 void TopOpeBRepDS_Marker::Allocate(const Standard_Integer n)
57 {
58   Standard_Boolean all = (n > myne);
59   Standard_Integer nall = n;
60   if (all) {
61     if (myne == 0) nall = 1000;
62     myhe = new TColStd_HArray1OfBoolean(0,nall);
63     myhe->Init(Standard_False);
64   }
65   if (nall) myne = nall;
66 }