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** );
34 //=======================================================================
35 //function :ObjCommands
37 //=======================================================================
38 void BOPTest::ObjCommands(Draw_Interpretor& theCommands)
40 static Standard_Boolean done = Standard_False;
44 const char* g = "BOP commands";
46 theCommands.Add("baddobjects" , "baddobjects s1 s2 ..." , __FILE__, baddobjects, g);
47 theCommands.Add("bclearobjects" , "bclearobjects" , __FILE__, bclearobjects, g);
48 theCommands.Add("baddtools" , "baddtools s1 s2 ..." , __FILE__, baddtools, g);
49 theCommands.Add("bcleartools" , "bcleartools" , __FILE__, bcleartools, g);
50 theCommands.Add("baddcompound" , "baddcompound c" , __FILE__, baddcompound, g);
52 //=======================================================================
53 //function : baddcompound
55 //=======================================================================
56 Standard_Integer baddcompound (Draw_Interpretor& , Standard_Integer n, const char** a)
59 printf(" Use baddcompound c\n");
68 BOPCol_ListOfShape& aLS=BOPTest_Objects::Shapes();
70 for (; aIt.More(); aIt.Next()) {
71 const TopoDS_Shape& aSx=aIt.Value();
78 //=======================================================================
79 //function :baddobjects
81 //=======================================================================
82 Standard_Integer baddobjects (Draw_Interpretor& , Standard_Integer n, const char** a)
85 printf(" Use baddobjects s1 s2 ...\n");
92 BOPCol_ListOfShape& aLS=BOPTest_Objects::Shapes();
93 for (i = 1; i < n; ++i) {
100 //=======================================================================
101 //function : bclearobjects
103 //=======================================================================
104 Standard_Integer bclearobjects (Draw_Interpretor& , Standard_Integer n, const char** )
107 printf(" Use bclearobjects\n");
110 BOPCol_ListOfShape& aLS=BOPTest_Objects::Shapes();
115 //=======================================================================
116 //function : baddtools
118 //=======================================================================
119 Standard_Integer baddtools (Draw_Interpretor& , Standard_Integer n, const char** a)
122 printf(" Use baddtools s1 s2 ...\n");
129 BOPCol_ListOfShape& aLS=BOPTest_Objects::Tools();
130 for (i = 1; i < n; ++i) {
137 //=======================================================================
138 //function : bcleartools
140 //=======================================================================
141 Standard_Integer bcleartools (Draw_Interpretor& , Standard_Integer n, const char** )
144 printf(" Use bcleartools\n");
147 BOPCol_ListOfShape& aLS=BOPTest_Objects::Tools();