1 // Created by: Peter KURNEV
2 // Copyright (c) 1999-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.
15 #include <BOPTest.ixx>
18 #include <Draw_Interpretor.hxx>
21 #include <TopoDS_Iterator.hxx>
22 #include <TopoDS_Shape.hxx>
24 #include <TopTools_ListOfShape.hxx>
26 #include <BOPTest_Objects.hxx>
28 static Standard_Integer baddobjects (Draw_Interpretor& , Standard_Integer , const char** );
29 static Standard_Integer bclearobjects (Draw_Interpretor& , Standard_Integer , const char** );
30 static Standard_Integer baddtools (Draw_Interpretor& , Standard_Integer , const char** );
31 static Standard_Integer bcleartools (Draw_Interpretor& , Standard_Integer , const char** );
32 static Standard_Integer baddcompound(Draw_Interpretor& , Standard_Integer , const char** );
33 static Standard_Integer baddctools (Draw_Interpretor& , Standard_Integer , const char** );
34 static Standard_Integer bclear (Draw_Interpretor&, Standard_Integer, const char**);
37 //=======================================================================
38 //function :ObjCommands
40 //=======================================================================
41 void BOPTest::ObjCommands(Draw_Interpretor& theCommands)
43 static Standard_Boolean done = Standard_False;
47 const char* g = "BOPTest commands";
49 theCommands.Add("baddobjects" , "use baddobjects s1 s2 ..." , __FILE__, baddobjects, g);
50 theCommands.Add("bclearobjects" , "use bclearobjects" , __FILE__, bclearobjects, g);
51 theCommands.Add("baddtools" , "use baddtools s1 s2 ..." , __FILE__, baddtools, g);
52 theCommands.Add("bcleartools" , "use bcleartools" , __FILE__, bcleartools, g);
53 theCommands.Add("baddcompound" , "use baddcompound c" , __FILE__, baddcompound, g);
54 theCommands.Add("baddctools" , "use baddctools c" , __FILE__, baddctools, g);
55 theCommands.Add("bclear" , "use bclear" , __FILE__, bclear, g);
57 //=======================================================================
58 //function : baddcompound
60 //=======================================================================
61 Standard_Integer baddcompound (Draw_Interpretor& ,
66 printf(" use baddcompound c\n");
75 BOPCol_ListOfShape& aLS=BOPTest_Objects::Shapes();
77 for (; aIt.More(); aIt.Next()) {
78 const TopoDS_Shape& aSx=aIt.Value();
84 //=======================================================================
85 //function : baddctools
87 //=======================================================================
88 Standard_Integer baddctools (Draw_Interpretor& ,
93 printf(" use baddctools c\n");
102 BOPCol_ListOfShape& aLT=BOPTest_Objects::Tools();
104 for (; aIt.More(); aIt.Next()) {
105 const TopoDS_Shape& aSx=aIt.Value();
112 //=======================================================================
113 //function :baddobjects
115 //=======================================================================
116 Standard_Integer baddobjects (Draw_Interpretor& ,
121 printf(" use baddobjects s1 s2 ...\n");
128 BOPCol_ListOfShape& aLS=BOPTest_Objects::Shapes();
129 for (i = 1; i < n; ++i) {
136 //=======================================================================
137 //function : bclearobjects
139 //=======================================================================
140 Standard_Integer bclearobjects (Draw_Interpretor& ,
145 printf(" use bclearobjects\n");
148 BOPCol_ListOfShape& aLS=BOPTest_Objects::Shapes();
153 //=======================================================================
154 //function : baddtools
156 //=======================================================================
157 Standard_Integer baddtools (Draw_Interpretor& ,
162 printf(" use baddtools s1 s2 ...\n");
169 BOPCol_ListOfShape& aLS=BOPTest_Objects::Tools();
170 for (i = 1; i < n; ++i) {
177 //=======================================================================
178 //function : bcleartools
180 //=======================================================================
181 Standard_Integer bcleartools (Draw_Interpretor& ,
186 printf(" use bcleartools\n");
189 BOPCol_ListOfShape& aLS=BOPTest_Objects::Tools();
194 //=======================================================================
197 //=======================================================================
198 Standard_Integer bclear(Draw_Interpretor& di,
203 di << " use bclear\n";
207 BOPTest_Objects::Clear();