1 // Created by: Peter KURNEV
2 // Copyright (c) 2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
16 #include <BOPTest.hxx>
17 #include <BOPTest_Objects.hxx>
23 static Standard_Integer boptions (Draw_Interpretor&, Standard_Integer, const char**);
24 static Standard_Integer brunparallel (Draw_Interpretor&, Standard_Integer, const char**);
25 static Standard_Integer bnondestructive(Draw_Interpretor&, Standard_Integer, const char**);
26 static Standard_Integer bfuzzyvalue(Draw_Interpretor&, Standard_Integer, const char**);
28 //=======================================================================
29 //function : OptionCommands
31 //=======================================================================
32 void BOPTest::OptionCommands(Draw_Interpretor& theCommands)
34 static Standard_Boolean done = Standard_False;
38 const char* g = "BOPTest commands";
40 theCommands.Add("boptions", "use boptions, shows current value of BOP options" , __FILE__, boptions, g);
41 theCommands.Add("brunparallel", "use brunparallel [0/1]" , __FILE__, brunparallel, g);
42 theCommands.Add("bnondestructive", "use bnondestructive [0/1]", __FILE__, bnondestructive, g);
43 theCommands.Add("bfuzzyvalue", "use bfuzzyvalue value", __FILE__, bfuzzyvalue, g);
45 //=======================================================================
48 //=======================================================================
49 Standard_Integer boptions(Draw_Interpretor& di,
54 di << " use boptions\n";
59 Standard_Boolean bRunParallel, bNonDestructive;
60 Standard_Real aFuzzyValue;
62 bRunParallel=BOPTest_Objects::RunParallel();
63 bNonDestructive = BOPTest_Objects::NonDestructive();
64 aFuzzyValue = BOPTest_Objects::FuzzyValue();
66 Sprintf(buf, " RunParallel: %d\n", bRunParallel);
68 Sprintf(buf, " NonDestructive: %d\n", bNonDestructive);
70 Sprintf(buf, " FuzzyValue : %lf\n", aFuzzyValue);
75 //=======================================================================
76 //function : bfuzzyvalue
78 //=======================================================================
79 Standard_Integer bfuzzyvalue(Draw_Interpretor& di,
84 di << " use bfuzzyvalue value\n";
88 Standard_Real aFuzzyValue;
90 aFuzzyValue=Draw::Atof(a[1]);
92 di << " Wrong value.\n";
96 BOPTest_Objects::SetFuzzyValue(aFuzzyValue);
100 //=======================================================================
101 //function : brunparallel
103 //=======================================================================
104 Standard_Integer brunparallel(Draw_Interpretor& di,
109 di << " use brunparallel [0/1]\n";
114 Standard_Boolean bRunParallel;
118 di << " Wrong value.\n";
122 bRunParallel = (iX != 0);
123 BOPTest_Objects::SetRunParallel(bRunParallel);
127 //=======================================================================
128 //function : bnondestructive
130 //=======================================================================
131 Standard_Integer bnondestructive(Draw_Interpretor& di,
136 di << " use bnondestructive [0/1]\n";
141 Standard_Boolean bNonDestructive;
143 iX = Draw::Atoi(a[1]);
145 di << " Wrong value.\n";
149 bNonDestructive = (iX != 0);
150 BOPTest_Objects::SetNonDestructive(bNonDestructive);