0031431: Visualization, PrsMgr_PresentableObject - simplify HLR computing interface
[occt.git] / src / QABugs / QABugs_15.cxx
1 // Created on: 2002-04-09
2 // Created by: QA Admin
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <QABugs.hxx>
17
18 #include <Draw.hxx>
19 #include <Draw_Interpretor.hxx>
20 #include <DBRep.hxx>
21 #include <DrawTrSurf.hxx>
22 #include <AIS_InteractiveContext.hxx>
23 #include <ViewerTest.hxx>
24 #include <AIS_Shape.hxx>
25 #include <TopoDS_Shape.hxx>
26
27 #include <QABugs_PresentableObject.hxx>
28
29 Handle(QABugs_PresentableObject) theObject1=NULL;
30 Handle(QABugs_PresentableObject) theObject2=NULL;
31
32 static Standard_Integer BUC60720 (Draw_Interpretor& di,Standard_Integer argc,const char ** argv )
33 {
34   Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
35   if(myAISContext.IsNull()) { 
36     di << "use 'vinit' command before " << argv[0] << "\n";
37     return -1;
38   }
39
40   if(argc != 2) {
41     di << "Usage : " << argv[0] << " 0/1\n";
42   }
43
44   if(Draw::Atoi(argv[1]) == 0) {
45     if ( theObject1.IsNull() )
46       {
47         theObject1 = new QABugs_PresentableObject();
48         theObject1->SetDisplayMode(0);
49         myAISContext->Display (theObject1, Standard_True);
50       }
51   } else if(Draw::Atoi(argv[1]) == 1) {
52     if ( theObject2.IsNull() )
53       {
54         theObject2 = new QABugs_PresentableObject();
55         theObject2->SetDisplayMode(1);
56         myAISContext->Display (theObject2, Standard_True);
57       }
58   } else {
59     di << "Usage : " << argv[0] << " 0/1\n";
60     return -1;
61   }
62   return 0;
63 }
64
65 void QABugs::Commands_15(Draw_Interpretor& theCommands)
66 {
67   const char *group = "QABugs";
68   theCommands.Add("BUC60720","BUC60720 0/1",__FILE__,BUC60720,group);
69 }