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
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.
23 #include <Standard_Type.hxx>
25 class TopOpeBRep_ALWL {
29 (const char* name,const Standard_Boolean b = Standard_False);
30 void Set(const Standard_Boolean b)
31 { mydefdef = mypasdef = mynbpdef = myonetrue = b; }
32 void SetDef(const Standard_Real p)
33 { mydeflectionmax = p; mydefdef = Standard_True; }
34 void SetPas(const Standard_Real p)
35 { mypasUVmax = p; mypasdef = Standard_True; }
36 void SetNbp(const Standard_Integer p)
37 { mynbpointsmax = p; mynbpdef = Standard_True; }
39 Standard_Boolean GetDef(Standard_Real& p)
40 { p = mydeflectionmax; return mydefdef; }
41 Standard_Boolean GetPas(Standard_Real& p)
42 { p = mypasUVmax; return mypasdef; }
43 Standard_Boolean GetNbp(Standard_Integer& p)
44 { p = mynbpointsmax; return mynbpdef; }
45 Standard_Boolean Get()
48 void Set(const Standard_Boolean b, Standard_Integer n, char** a);
52 Standard_Real mydeflectionmax;
53 Standard_Boolean mydefdef;
55 Standard_Real mypasUVmax;
56 Standard_Boolean mypasdef;
58 Standard_Integer mynbpointsmax;
59 Standard_Boolean mynbpdef;
61 Standard_Boolean myonetrue;
65 TopOpeBRep_ALWL::TopOpeBRep_ALWL(const char* name, const Standard_Boolean b) :
66 mydeflectionmax(0.01),mydefdef(Standard_False),
67 mypasUVmax(0.05),mypasdef(Standard_False),
68 mynbpointsmax(200),mynbpdef(Standard_False)
74 void TopOpeBRep_ALWL::Set(const Standard_Boolean b,
75 Standard_Integer n, char** a)
80 for (Standard_Integer i=0; i < n; i++) {
82 if ( !strcasecmp(p,"def") ) {
83 if ( ++i < n ) SetDef(Atof(a[i]));
85 else if ( !strcasecmp(p,"pas") ) {
86 if ( ++i < n ) SetPas(Atof(a[i]));
88 else if ( !strcasecmp(p,"nbp") ) {
89 if ( ++i < n ) SetNbp(atoi(a[i]));
93 myonetrue = mydefdef || mypasdef || mynbpdef;
97 void TopOpeBRep_ALWL::Print()
99 cout<<myname<<" defined :";
100 Standard_Integer n = 0;
101 if (mydefdef) { cout<<" Def = "<<mydeflectionmax; n++; }
102 if (mypasdef) { cout<<" Pas = "<<mypasUVmax; n++; }
103 if (mynbpdef) { cout<<" Nbp = "<<mynbpointsmax; n++; }
104 if (!n) cout<<" none";
108 static TopOpeBRep_ALWL TopOpeBRep_contextALWL
109 ("LineGeomTool ALWL parameters");
111 void TopOpeBRep_SetcontextALWL
112 (const Standard_Boolean b, Standard_Integer narg, char** a)
113 { TopOpeBRep_contextALWL.Set(b,narg,a); }
115 Standard_Boolean TopOpeBRep_GetcontextALWLNBP(Standard_Integer& n)
116 { Standard_Boolean b = TopOpeBRep_contextALWL.GetNbp(n);