1 // Created on: 2002-05-22
2 // Created by: QA Admin
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
23 #include <Draw_Interpretor.hxx>
25 #include <DrawTrSurf.hxx>
26 #include <AIS_InteractiveContext.hxx>
27 #include <ViewerTest.hxx>
28 #include <AIS_Shape.hxx>
29 #include <TopoDS_Shape.hxx>
31 #include <V3d_Viewer.hxx>
32 #include <V3d_View.hxx>
33 #include <Graphic3d_AspectMarker3d.hxx>
35 static Standard_Integer OCC281bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
37 Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
40 cerr << "use 'vinit' command before " << argv[0] << "\n";
44 di << "Usage : " << argv[0] << " x y TypeOfMarker(0-12)" << "\n";
48 Standard_Integer x,y,TypeOfMarker;
49 x = Draw::Atoi(argv[1]);
50 y = Draw::Atoi(argv[2]);
51 TypeOfMarker = Draw::Atoi(argv[3]);
53 di << "Bad value x=" << x << "\n";
57 di << "Bad value y=" << y << "\n";
60 if( TypeOfMarker < 0 || TypeOfMarker > 12) {
61 di << "Bad value TypeOfMarker=" << TypeOfMarker << "\n";
64 Aspect_TypeOfMarker AspectTypeOfMarker( (Aspect_TypeOfMarker) TypeOfMarker);
66 enumeration TypeOfMarker is TOM_POINT,
81 ---Purpose: Definition of types of markers
88 -- TOM_O_POINT a point in a circle
89 -- TOM_O_PLUS a plus in a circle
90 -- TOM_O_STAR a star in a circle
91 -- TOM_O_X a cross in a circle
92 -- TOM_BALL a ball with 1 color and different saturations
93 -- TOM_RING1 a large ring
94 -- TOM_RING2 a medium ring
95 -- TOM_RING3 a small ring
96 -- TOM_USERDEFINED defined by Users
98 ---Category: Enumerations
101 Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
102 Handle(V3d_View) aView = ViewerTest::CurrentView();
104 aViewer->ActivateGrid(Aspect_GT_Rectangular, Aspect_GDM_Lines);
105 Handle(Graphic3d_AspectMarker3d) GridAsp = new Graphic3d_AspectMarker3d(AspectTypeOfMarker, Quantity_NOC_BLUE1, 10.);
106 aViewer->SetGridEcho(GridAsp);
108 if (aViewer->IsActive()) {
109 if (aViewer->GridEcho()) {
110 V3d_Coordinate X,Y,Z;
111 aView->ConvertToGrid(x,y,X,Y,Z);
113 di << "NOT aViewer->GridEcho()" << "\n";
117 di << "NOT aViewer->IsActive()" << "\n";
123 void QABugs::Commands_6(Draw_Interpretor& theCommands) {
124 const char *group = "QABugs";
126 theCommands.Add ("OCC281", "OCC281 x y TypeOfMarker(0-12)", __FILE__, OCC281bug, group);