1 // Created on: 2002-05-22
2 // Created by: QA Admin
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
19 #include <Draw_Interpretor.hxx>
21 #include <DrawTrSurf.hxx>
22 #include <AIS_InteractiveContext.hxx>
23 #include <ViewerTest.hxx>
24 #include <AIS_Shape.hxx>
25 #include <TopoDS_Shape.hxx>
27 #include <V3d_Viewer.hxx>
28 #include <V3d_View.hxx>
29 #include <Graphic3d_AspectMarker3d.hxx>
31 static Standard_Integer OCC281bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
33 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
36 cerr << "use 'vinit' command before " << argv[0] << "\n";
40 di << "Usage : " << argv[0] << " x y TypeOfMarker(0-12)\n";
44 Standard_Integer x,y,TypeOfMarker;
45 x = Draw::Atoi(argv[1]);
46 y = Draw::Atoi(argv[2]);
47 TypeOfMarker = Draw::Atoi(argv[3]);
49 di << "Bad value x=" << x << "\n";
53 di << "Bad value y=" << y << "\n";
56 if( TypeOfMarker < 0 || TypeOfMarker > 12) {
57 di << "Bad value TypeOfMarker=" << TypeOfMarker << "\n";
60 Aspect_TypeOfMarker AspectTypeOfMarker( (Aspect_TypeOfMarker) TypeOfMarker);
62 enumeration TypeOfMarker is TOM_POINT,
77 ---Purpose: Definition of types of markers
84 -- TOM_O_POINT a point in a circle
85 -- TOM_O_PLUS a plus in a circle
86 -- TOM_O_STAR a star in a circle
87 -- TOM_O_X a cross in a circle
88 -- TOM_BALL a ball with 1 color and different saturations
89 -- TOM_RING1 a large ring
90 -- TOM_RING2 a medium ring
91 -- TOM_RING3 a small ring
92 -- TOM_USERDEFINED defined by Users
94 ---Category: Enumerations
97 Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
98 Handle(V3d_View) aView = ViewerTest::CurrentView();
100 aViewer->ActivateGrid(Aspect_GT_Rectangular, Aspect_GDM_Lines);
101 Handle(Graphic3d_AspectMarker3d) GridAsp = new Graphic3d_AspectMarker3d(AspectTypeOfMarker, Quantity_NOC_BLUE1, 10.);
102 aViewer->SetGridEcho(GridAsp);
104 if (aViewer->IsActive()) {
105 if (aViewer->GridEcho()) {
107 aView->ConvertToGrid(x,y,X,Y,Z);
109 di << "NOT aViewer->GridEcho()\n";
113 di << "NOT aViewer->IsActive()\n";
119 void QABugs::Commands_6(Draw_Interpretor& theCommands) {
120 const char *group = "QABugs";
122 theCommands.Add ("OCC281", "OCC281 x y TypeOfMarker(0-12)", __FILE__, OCC281bug, group);