1 // Created on: 1997-10-22
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
24 #include <Standard_Type.hxx>
25 #include <TCollection_AsciiString.hxx>
26 #include <TColStd_ListOfInteger.hxx>
27 #include <TColStd_ListIteratorOfListOfInteger.hxx>
28 #include <TopOpeBRepTool_define.hxx>
30 #define AS(x) (Standard_PCharacter)TCollection_AsciiString((x)).ToCString();
33 #define OK(x,y) (x)<I&&(y)<J
34 #define T(x,y) myT[(x)][(y)]
35 #define L0(x,y) for((x)=0;(x)<(y);(x)++)
36 #define A(v) (atoi(a[(v)]))
40 Standard_Boolean Get(Standard_Integer n,char**a);
41 Standard_Integer Set(const Standard_Boolean b,Standard_Integer n,char**a);
43 TColStd_ListOfInteger myTL[I];
44 Standard_Boolean myTB[I];
45 Standard_Integer mynl;
48 BOOPNINTL::BOOPNINTL(){Set(Standard_False,0,NULL);}
50 Standard_Integer BOOPNINTL::Set(const Standard_Boolean b,Standard_Integer n,char**a)
53 Standard_Integer i; L0(i,I) { myTB[i] = Standard_False; myTL[i].Clear(); }
57 else if (mynl + 1 < I) {
58 myTB[mynl] = b; Standard_Integer i; L0(i,n) myTL[mynl].Append(atoi(a[i]));
67 Standard_Boolean BOOPNINTL::Get(Standard_Integer n,char**a){
68 if(!n)return Standard_False;
71 const TColStd_ListOfInteger& L = myTL[il];
72 if (L.IsEmpty()) continue;
73 TColStd_ListIteratorOfListOfInteger itL(L);
74 Standard_Integer ia = 0;
75 Standard_Boolean found = Standard_True;
76 for (;itL.More() && (ia < n); itL.Next(),ia++) {
77 Standard_Integer Lval = itL.Value();
78 Standard_Integer aval = atoi(a[ia]);
80 found = Standard_False;
88 return Standard_False;
92 static Standard_Boolean TopOpeBRep_traceEEFF = Standard_False;
93 Standard_EXPORT void TopOpeBRep_SettraceEEFF(const Standard_Boolean b) { TopOpeBRep_traceEEFF = b; }
94 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceEEFF() { return TopOpeBRep_traceEEFF; }
97 Standard_EXPORT Standard_Integer TopOpeBRep_SettraceEEFF(const Standard_Boolean b,Standard_Integer n,char**a)
99 Standard_Integer err = BOOPEEFF.Set(b,n,a); if (n==0) TopOpeBRep_SettraceEEFF(b); return err;
102 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceEEFF(Standard_Integer n,char**a)
103 { Standard_Boolean b = BOOPEEFF.Get(n,a); return b; }
105 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceEEFF(const Standard_Integer i1,const Standard_Integer i2,const Standard_Integer i3,const Standard_Integer i4)
107 char* t[4]; t[0]=AS(i1);t[1]=AS(i2);t[2]=AS(i3);t[3]=AS(i4);
108 Standard_Boolean b = BOOPEEFF.Get(4,t); return b;
112 static Standard_Boolean TopOpeBRep_traceNVP = Standard_False;
113 Standard_EXPORT void TopOpeBRep_SettraceNVP(const Standard_Boolean b) { TopOpeBRep_traceNVP = b; }
114 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceNVP() { return TopOpeBRep_traceNVP; }
117 Standard_EXPORT Standard_Integer TopOpeBRep_SettraceNVP(const Standard_Boolean b,Standard_Integer n,char**a)
119 Standard_Integer err = BOOPNVP.Set(b,n,a); if (n==0) TopOpeBRep_SettraceNVP(b); return err;
122 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceNVP(Standard_Integer n,char**a)
123 { Standard_Integer b = BOOPNVP.Get(n,a); return b; }
125 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceNVP(Standard_Integer i1,Standard_Integer i2,Standard_Integer i3,Standard_Integer i4,Standard_Integer i5)
127 char* t[5]; t[0]=AS(i1);t[1]=AS(i2);t[2]=AS(i3);t[3]=AS(i4);t[4]=AS(i5);
128 Standard_Boolean b = BOOPNVP.Get(5,t);return b;
132 static Standard_Boolean TopOpeBRep_traceSHA = Standard_False;
133 Standard_EXPORT void TopOpeBRep_SettraceSHA(const Standard_Boolean b) { TopOpeBRep_traceSHA = b; }
134 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSHA() { return TopOpeBRep_traceSHA; }
137 Standard_EXPORT Standard_Integer TopOpeBRep_SettraceSHA(const Standard_Boolean b,Standard_Integer n,char**a)
139 Standard_Integer err = BOOPSHA.Set(b,n,a); if (n==0) TopOpeBRep_SettraceSHA(b); return err;
142 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSHA(Standard_Integer n,char**a)
143 { Standard_Integer b = BOOPSHA.Get(n,a); return b; }
145 Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSHA(const Standard_Integer i1)
147 char* t[1]; t[0]=AS(i1);
148 Standard_Boolean b = BOOPSHA.Get(1,t);return b;