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 bfuzzyvalue (Draw_Interpretor&, Standard_Integer, const char**);
26 static Standard_Integer bparallelmode(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" , __FILE__, boptions, g);
41 theCommands.Add("brunparallel", "use brunparallel [0/1]" , __FILE__, brunparallel, g);
42 theCommands.Add("bfuzzyvalue", "use bfuzzyvalue value" , __FILE__, bfuzzyvalue, g);
43 theCommands.Add("bparallelmode",
44 "bparallelmode [1/0] : show / set parallel mode for boolean operations",
45 __FILE__, bparallelmode, g);
48 //=======================================================================
51 //=======================================================================
52 Standard_Integer boptions(Draw_Interpretor& di,
57 di << " use boptions\n";
62 Standard_Boolean bRunParallel;
63 Standard_Real aFuzzyValue;
65 bRunParallel=BOPTest_Objects::RunParallel();
66 aFuzzyValue=BOPTest_Objects::FuzzyValue();
68 Sprintf(buf, " RunParallel: %d\n", bRunParallel);
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=(Standard_Boolean)(iX);
123 BOPTest_Objects::SetRunParallel(bRunParallel);
127 //=======================================================================
128 //function : bparallelmode
130 //=======================================================================
131 Standard_Integer bparallelmode(Draw_Interpretor& di,
135 Standard_Boolean bRunParallel;
138 bRunParallel=(Standard_Boolean)Draw::Atoi(a[1]);
139 BOPTest_Objects::SetRunParallel(bRunParallel);
141 di << "Parallel mode for boolean operations has been enabled";
144 di << "Parallel mode for boolean operations has been disabled";
148 bRunParallel=BOPTest_Objects::RunParallel();
149 di << "Parallel mode state for boolean operations: "
150 << (bRunParallel? "enabled" : "disabled");