0022898: IGES import fails in german environment
[occt.git] / src / TopOpeBRep / TopOpeBRep_traceALWL.cxx
CommitLineData
b311480e 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
5//
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.
10//
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.
13//
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.
20
7fd59977 21
22#ifdef HAVE_CONFIG_H
23# include <config.h>
24#endif
25
26#ifdef HAVE_STRINGS_H
27# include <strings.h>
28#endif
29
30#ifdef DEB
31
32#include <Standard_Type.hxx>
33
34class TopOpeBRep_ALWL {
35
36public:
37 TopOpeBRep_ALWL
38 (const char* name,const Standard_Boolean b = Standard_False);
39 void Set(const Standard_Boolean b)
40 { mydefdef = mypasdef = mynbpdef = myonetrue = b; }
41 void SetDef(const Standard_Real p)
42 { mydeflectionmax = p; mydefdef = Standard_True; }
43 void SetPas(const Standard_Real p)
44 { mypasUVmax = p; mypasdef = Standard_True; }
45 void SetNbp(const Standard_Integer p)
46 { mynbpointsmax = p; mynbpdef = Standard_True; }
47
48 Standard_Boolean GetDef(Standard_Real& p)
49 { p = mydeflectionmax; return mydefdef; }
50 Standard_Boolean GetPas(Standard_Real& p)
51 { p = mypasUVmax; return mypasdef; }
52 Standard_Boolean GetNbp(Standard_Integer& p)
53 { p = mynbpointsmax; return mynbpdef; }
54 Standard_Boolean Get()
55 { return myonetrue; }
56
57 void Set(const Standard_Boolean b, Standard_Integer n, char** a);
58 void Print();
59
60private:
61 Standard_Real mydeflectionmax;
62 Standard_Boolean mydefdef;
63
64 Standard_Real mypasUVmax;
65 Standard_Boolean mypasdef;
66
67 Standard_Integer mynbpointsmax;
68 Standard_Boolean mynbpdef;
69
70 Standard_Boolean myonetrue;
71 char myname[100];
72};
73
74TopOpeBRep_ALWL::TopOpeBRep_ALWL(const char* name, const Standard_Boolean b) :
75 mydeflectionmax(0.01),mydefdef(Standard_False),
76 mypasUVmax(0.05),mypasdef(Standard_False),
77 mynbpointsmax(200),mynbpdef(Standard_False)
78{
79 strcpy(myname,name);
80 Set(b);
81}
82
83void TopOpeBRep_ALWL::Set(const Standard_Boolean b,
84 Standard_Integer n, char** a)
85{
86 if (!n) Set(b);
87 else {
88 Set(Standard_False);
89 for (Standard_Integer i=0; i < n; i++) {
90 const char *p = a[i];
91 if ( !strcasecmp(p,"def") ) {
91322f44 92 if ( ++i < n ) SetDef(Atof(a[i]));
7fd59977 93 }
94 else if ( !strcasecmp(p,"pas") ) {
91322f44 95 if ( ++i < n ) SetPas(Atof(a[i]));
7fd59977 96 }
97 else if ( !strcasecmp(p,"nbp") ) {
98 if ( ++i < n ) SetNbp(atoi(a[i]));
99 }
100 }
101 }
102 myonetrue = mydefdef || mypasdef || mynbpdef;
103 Print();
104}
105
106void TopOpeBRep_ALWL::Print()
107{
108 cout<<myname<<" defined :";
109 Standard_Integer n = 0;
110 if (mydefdef) { cout<<" Def = "<<mydeflectionmax; n++; }
111 if (mypasdef) { cout<<" Pas = "<<mypasUVmax; n++; }
112 if (mynbpdef) { cout<<" Nbp = "<<mynbpointsmax; n++; }
113 if (!n) cout<<" none";
114 cout<<endl;
115}
116
117static TopOpeBRep_ALWL TopOpeBRep_contextALWL
118("LineGeomTool ALWL parameters");
119
120void TopOpeBRep_SetcontextALWL
121 (const Standard_Boolean b, Standard_Integer narg, char** a)
122{ TopOpeBRep_contextALWL.Set(b,narg,a); }
123
124Standard_Boolean TopOpeBRep_GetcontextALWLNBP(Standard_Integer& n)
125{ Standard_Boolean b = TopOpeBRep_contextALWL.GetNbp(n);
126 return b;
127}
128
129// #ifdef DEB
130#endif