0022312: Translation of french commentaries in OCCT files
[occt.git] / src / DrawResources / TestDraw.cxx
1
2
3 // model of main program Draw
4
5 #include <Draw.hxx>
6 #include <Draw_Appli.hxx>
7
8 // main passes main to Draw
9
10 main(int argc, char** argv)
11 {
12   Draw_Appli(argc,argv);
13 }
14
15 //*******************************
16 //
17 // Remove unused includes
18 // to avoid overloading the link
19 //
20 //********************************
21
22 #include <GeometryTest.hxx>
23
24 // only is one makes the topology
25 #include <BRepTest.hxx>
26
27 // for the commands using topology
28 #include <DBRep.hxx>
29
30
31 // example of user command
32
33 static Standard_Integer macommande (Draw_Interpretor& di,
34                                     Standard_Integer n, char** a)
35 {
36   if (n < 2) return 1;   // error if not enough arguments
37
38   TopoDS_Shape S = DBRep::Get(a[1]);
39   if (S.IsNull()) {
40     cout << a[1] << " is not a shape" << endl;
41     return 1;
42   }
43
44   // .... do what you like with S .....
45
46   //... to return a chain to TCL, place it in di
47
48   di << a[1];
49
50   return 0;
51 }
52
53
54 // definition of commands
55
56 void Draw_InitAppli(Draw_Interpretor& theCommands)
57 {
58   Draw::Commands(theCommands);
59
60   // geometry
61   GeometryTest::AllCommands(theCommands);   // see GeometryTest.cdl for details
62
63   // for the topology
64   BRepTest::AllCommands(theCommands);       // see BRepTest.cdl for details
65
66
67   // user commands
68
69   theCommands.Add("macommande","macommande and its help",macommande);
70 }