diff --git a/src/Draw/Draw_GraphicCommands.cxx b/src/Draw/Draw_GraphicCommands.cxx index c87081c6c4..f36ba2ca47 100755 --- a/src/Draw/Draw_GraphicCommands.cxx +++ b/src/Draw/Draw_GraphicCommands.cxx @@ -136,69 +136,94 @@ static Standard_Integer zoom(Draw_Interpretor& , Standard_Integer n, const char* //purpose : //======================================================================= -static Standard_Integer wzoom(Draw_Interpretor& di, Standard_Integer, const char**) +static Standard_Integer wzoom(Draw_Interpretor& di, Standard_Integer argc, const char** argv) { - Standard_Integer id1,X1,Y1,b; - Standard_Integer X2,Y2; - Standard_Real dX1,dY1,dX2,dY2; - di << "Pick first corner"<<"\n"; - dout.Select(id1,X1,Y1,b); + Standard_Integer id,X,Y,W,H,X1,Y1,X2,Y2,b; + Standard_Real dX1,dY1,dX2,dY2,zx,zy; + if(argc != 1 && argc != 6) + { + di<<"Usage : " << argv[0] << " [view-id X1 Y1 X2 Y2]\n"; + return 1; + } + if(argc == 1) + { + di << "Pick first corner"<<"\n"; + dout.Select(id,X1,Y1,b); - gp_Trsf T; - gp_Pnt P0(0,0,0); - dout.GetTrsf(id1,T); - T.Invert(); - P0.Transform(T); - Standard_Real z = dout.Zoom(id1); + gp_Trsf T; + gp_Pnt P0(0,0,0); + dout.GetTrsf(id,T); + T.Invert(); + P0.Transform(T); + Standard_Real z = dout.Zoom(id); - dX1=X1; dY1=Y1; - dX1-=P0.X(); dY1-=P0.Y(); - dX1/=z; dY1/=z; - - if (b != 1) return 0; - if (id1 < 0) return 0; - Draw_Display d = dout.MakeDisplay(id1); - d.SetColor(Draw_blanc); - d.SetMode(10); - Standard_Real dOX2 = dX1; - Standard_Real dOY2 = dY1; - d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dOY2)); - d.Draw(gp_Pnt2d(dX1,dOY2),gp_Pnt2d(dOX2,dOY2)); - d.Draw(gp_Pnt2d(dOX2,dOY2),gp_Pnt2d(dOX2,dY1)); - d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1)); - d.Flush(); - Standard_Real zx,zy; - Standard_Integer X,Y,W,H; - dout.GetPosSize(id1,X,Y,W,H); - di << "Pick second corner"<<"\n"; - b = 0; - while (b == 0) { - dout.Select(id1,X2,Y2,b,Standard_False); - dX2=X2; dY2=Y2; - dX2-=P0.X(); dY2-=P0.Y(); - dX2/=z; dY2/=z; + dX1=X1; dY1=Y1; + dX1-=P0.X(); dY1-=P0.Y(); + dX1/=z; dY1/=z; + if (b != 1) return 0; + if (id < 0) return 0; + Draw_Display d = dout.MakeDisplay(id); + d.SetColor(Draw_blanc); + d.SetMode(10); + Standard_Real dOX2 = dX1; + Standard_Real dOY2 = dY1; d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dOY2)); d.Draw(gp_Pnt2d(dX1,dOY2),gp_Pnt2d(dOX2,dOY2)); d.Draw(gp_Pnt2d(dOX2,dOY2),gp_Pnt2d(dOX2,dY1)); d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1)); - d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dY2)); - d.Draw(gp_Pnt2d(dX1,dY2),gp_Pnt2d(dX2,dY2)); - d.Draw(gp_Pnt2d(dX2,dY2),gp_Pnt2d(dX2,dY1)); - d.Draw(gp_Pnt2d(dX2,dY1),gp_Pnt2d(dX1,dY1)); d.Flush(); - dOX2 = dX2; - dOY2 = dY2; + dout.GetPosSize(id,X,Y,W,H); + di << "Pick second corner"<<"\n"; + b = 0; + while (b == 0) { + dout.Select(id,X2,Y2,b,Standard_False); + dX2=X2; dY2=Y2; + dX2-=P0.X(); dY2-=P0.Y(); + dX2/=z; dY2/=z; + + d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dOY2)); + d.Draw(gp_Pnt2d(dX1,dOY2),gp_Pnt2d(dOX2,dOY2)); + d.Draw(gp_Pnt2d(dOX2,dOY2),gp_Pnt2d(dOX2,dY1)); + d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1)); + d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dY2)); + d.Draw(gp_Pnt2d(dX1,dY2),gp_Pnt2d(dX2,dY2)); + d.Draw(gp_Pnt2d(dX2,dY2),gp_Pnt2d(dX2,dY1)); + d.Draw(gp_Pnt2d(dX2,dY1),gp_Pnt2d(dX1,dY1)); + d.Flush(); + dOX2 = dX2; + dOY2 = dY2; + } + d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dOY2)); + d.Draw(gp_Pnt2d(dX1,dOY2),gp_Pnt2d(dOX2,dOY2)); + d.Draw(gp_Pnt2d(dOX2,dOY2),gp_Pnt2d(dOX2,dY1)); + d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1)); + d.Flush(); + if (b != 1) return 0; + d.SetMode(0); + } + else + { + id = atoi(argv[1]); + if ((id < 0) || (id >= MAXVIEW)) + { + cout << "Incorrect view-id, must be in 0.."< zx) zx = zy; @@ -207,11 +232,10 @@ static Standard_Integer wzoom(Draw_Interpretor& di, Standard_Integer, const char if (Y2 > Y1) Y1 = Y2; X1 = (Standard_Integer ) (X1*zx); Y1 = (Standard_Integer ) (Y1*zx); - d.SetMode(0); - dout.SetZoom(id1,zx*dout.Zoom(id1)); - dout.SetPan(id1,-X1,-Y1); - dout.RepaintView(id1); - SetTitle(id1); + dout.SetZoom(id,zx*dout.Zoom(id)); + dout.SetPan(id,-X1,-Y1); + dout.RepaintView(id); + SetTitle(id); return 0; } @@ -947,8 +971,11 @@ void Draw::GraphicCommands(Draw_Interpretor& theCommands) __FILE__,zoom,g); theCommands.Add("2dzoom","2dzoom [view-id] z, or zoom2d z for all 2d views", __FILE__,zoom,g); - theCommands.Add("wzoom","zoom on a window", - __FILE__,wzoom,g); + theCommands.Add("wzoom","wzoom [view-id X1 Y1 X2 Y2]\n" + "- fits the contents of a given rectangle into a view window.\n" + "- The view window and rectangle corners are specified through the arguments\n" + "- or selected interactively by the user if no arguments are given", + __FILE__,wzoom,g); theCommands.Add("view","view view-id type X(0) Y(0) W(500) H(500)", __FILE__,view,g); theCommands.Add("delete","delete [view-id]", diff --git a/src/QADraw/QADraw.cxx b/src/QADraw/QADraw.cxx index 9a8b6a27e6..8d27f07c3a 100755 --- a/src/QADraw/QADraw.cxx +++ b/src/QADraw/QADraw.cxx @@ -306,126 +306,6 @@ static Standard_Integer QARebuild (Draw_Interpretor& di, Standard_Integer /*n*/, return 0; } -static Standard_Integer QAUpdateLights(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) -{ - if(argc != 1) { - di << "Usage : " << argv[0] << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); - if(myAIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - ViewerTest::CurrentView()->UpdateLights(); - ViewerTest::CurrentView()->Update(); - return 0; -} - -static Standard_Integer QAxwd_3d(Draw_Interpretor& di, Standard_Integer argc, const char** argv ) -{ - if(argc != 2) { - di << "Usage : " << argv[0] << " filename" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); - if(myAIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - Handle(V3d_View) myV3dView = ViewerTest::CurrentView(); - //cout << myV3dView->Dump(argv[1]) << endl; - myV3dView->Dump(argv[1]); - return 0; -} - - -static Standard_Integer QAMoveTo(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) -{ - if(argc != 3) { - di << "Usage : " << argv[0] << " x y" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); - if(myAIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - ViewerTest::CurrentEventManager()->MoveTo(atoi(argv[1]),atoi(argv[2])); - return 0; -} - -static Standard_Integer QASelect(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) -{ - if(argc != 3) { - di << "Usage : " << argv[0] << " x y" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); - if(myAIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - ViewerTest::CurrentEventManager()->MoveTo(atoi(argv[1]),atoi(argv[2])); - ViewerTest::CurrentEventManager()->Select(); - return 0; -} - -static Standard_Integer QAShiftSelect(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) -{ - if(argc != 3) { - di << "Usage : " << argv[0] << " x y" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); - if(myAIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - ViewerTest::CurrentEventManager()->MoveTo(atoi(argv[1]),atoi(argv[2])); - ViewerTest::CurrentEventManager()->ShiftSelect(); - return 0; -} - -static Standard_Integer QASetAntialiasing(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) -{ - if(argc > 2) { - di << "Usage : " << argv[0] << " [1/0]" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); - if(myAIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - - Handle(V3d_View) myV3dView = ViewerTest::CurrentView(); - - if((argc == 2) && (atof(argv[1]) == 0)) - myV3dView->SetAntialiasingOff(); - else - myV3dView->SetAntialiasingOn(); - myV3dView->Update(); - return 0; -} - -static Standard_Integer QAvzfit(Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv ) -{ - Handle(V3d_View) V = ViewerTest::CurrentView(); - if ( V.IsNull() ) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - V->ZFitAll(); - return 0; -} - Handle(TColStd_HSequenceOfReal) GetColorOfPixel (const Image_PixMap& theImage, const Standard_Integer theCoordinateX, const Standard_Integer theCoordinateY, @@ -468,165 +348,78 @@ static Standard_Integer QAAISGetPixelColor (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const char** theArgs) { - if (theArgsNb != 3 && theArgsNb != 6) - { - theDi << "Usage : " << theArgs[0] << " coordinate_X coordinate_Y [color_R color_G color_B]" << "\n"; - return 1; // TCL_ERROR - } + if (theArgsNb != 3 && theArgsNb != 6) + { + theDi << "Usage : " << theArgs[0] << " coordinate_X coordinate_Y [color_R color_G color_B]" << "\n"; + return 1; // TCL_ERROR + } - Handle(V3d_View) aView3d = ViewerTest::CurrentView(); - if (aView3d.IsNull()) - { - theDi << "You must initialize AISViewer before this command.\n"; - return 1; // TCL_ERROR - } + Handle(V3d_View) aView3d = ViewerTest::CurrentView(); + if (aView3d.IsNull()) + { + theDi << "You must initialize AISViewer before this command.\n"; + return 1; // TCL_ERROR + } - const Handle(Aspect_Window) anAISWindow = aView3d->Window(); - Standard_Integer aWindowSizeX = 0; - Standard_Integer aWindowSizeY = 0; - anAISWindow->Size (aWindowSizeX, aWindowSizeY); + const Handle(Aspect_Window) anAISWindow = aView3d->Window(); + Standard_Integer aWindowSizeX = 0; + Standard_Integer aWindowSizeY = 0; + anAISWindow->Size (aWindowSizeX, aWindowSizeY); - Standard_Integer anArgIter = 1; - const Standard_Integer aPickCoordX = atoi (theArgs[anArgIter++]); - const Standard_Integer aPickCoordY = atoi (theArgs[anArgIter++]); - const Standard_Integer aRadius = (theArgsNb == 3) ? 0 : 1; + Standard_Integer anArgIter = 1; + const Standard_Integer aPickCoordX = atoi (theArgs[anArgIter++]); + const Standard_Integer aPickCoordY = atoi (theArgs[anArgIter++]); + const Standard_Integer aRadius = (theArgsNb == 3) ? 0 : 1; - Image_ColorRGBF aColorInput = {{ 0.0f, 0.0f, 0.0f }}; - if (theArgsNb == 6) - { - aColorInput.r() = (Standard_ShortReal )atof (theArgs[anArgIter++]); - aColorInput.g() = (Standard_ShortReal )atof (theArgs[anArgIter++]); - aColorInput.b() = (Standard_ShortReal )atof (theArgs[anArgIter++]); - } + Image_ColorRGBF aColorInput = {{ 0.0f, 0.0f, 0.0f }}; + if (theArgsNb == 6) + { + aColorInput.r() = (Standard_ShortReal )atof (theArgs[anArgIter++]); + aColorInput.g() = (Standard_ShortReal )atof (theArgs[anArgIter++]); + aColorInput.b() = (Standard_ShortReal )atof (theArgs[anArgIter++]); + } - Image_PixMap anImage; - aView3d->ToPixMap (anImage, aWindowSizeX, aWindowSizeY); - const Handle(TColStd_HSequenceOfReal) aSeq = GetColorOfPixel (anImage, aPickCoordX, aPickCoordY, aRadius); - cout << "Length = " << aSeq->Length() << endl; + Image_PixMap anImage; + aView3d->ToPixMap (anImage, aWindowSizeX, aWindowSizeY); + const Handle(TColStd_HSequenceOfReal) aSeq = GetColorOfPixel (anImage, aPickCoordX, aPickCoordY, aRadius); + cout << "Length = " << aSeq->Length() << endl; - Image_ColorRGBF aColorPicked = {{ 0.0f, 0.0f, 0.0f }}; - Standard_Boolean isNotEqual = Standard_True; - for (Standard_Integer i = 1; i <= aSeq->Length(); i += 3) - { - aColorPicked.r() = (Standard_ShortReal )aSeq->Value (i + 0); - aColorPicked.g() = (Standard_ShortReal )aSeq->Value (i + 1); - aColorPicked.b() = (Standard_ShortReal )aSeq->Value (i + 2); + Image_ColorRGBF aColorPicked = {{ 0.0f, 0.0f, 0.0f }}; + Standard_Boolean isNotEqual = Standard_True; + for (Standard_Integer i = 1; i <= aSeq->Length(); i += 3) + { + aColorPicked.r() = (Standard_ShortReal )aSeq->Value (i + 0); + aColorPicked.g() = (Standard_ShortReal )aSeq->Value (i + 1); + aColorPicked.b() = (Standard_ShortReal )aSeq->Value (i + 2); - if (theArgsNb == 3 || - ((Abs (aColorPicked.r() - aColorInput.r()) <= Precision::Confusion()) - && (Abs (aColorPicked.g() - aColorInput.g()) <= Precision::Confusion()) - && (Abs (aColorPicked.b() - aColorInput.b()) <= Precision::Confusion()))) - { - isNotEqual = Standard_False; - break; - } - } + if (theArgsNb == 3 || + ((Abs (aColorPicked.r() - aColorInput.r()) <= Precision::Confusion()) + && (Abs (aColorPicked.g() - aColorInput.g()) <= Precision::Confusion()) + && (Abs (aColorPicked.b() - aColorInput.b()) <= Precision::Confusion()))) + { + isNotEqual = Standard_False; + break; + } + } - theDi << "RED : " << aColorPicked.r() << " " - << "GREEN : " << aColorPicked.g() << " " - << "BLUE : " << aColorPicked.b() << "\n"; + theDi << "RED : " << aColorPicked.r() << " " + << "GREEN : " << aColorPicked.g() << " " + << "BLUE : " << aColorPicked.b() << "\n"; - if (theArgsNb == 6) - { - theDi << "User color: \n" - << "RED : " << aColorInput.r() << " " - << "GREEN : " << aColorInput.g() << " " - << "BLUE : " << aColorInput.b() << "\n"; - } + if (theArgsNb == 6) + { + theDi << "User color: \n" + << "RED : " << aColorInput.r() << " " + << "GREEN : " << aColorInput.g() << " " + << "BLUE : " << aColorInput.b() << "\n"; + } - if (isNotEqual) - { - theDi << "Faulty : colors are not equal.\n"; - return 1; // TCL_ERROR - } - return 0; -} - -static Standard_Boolean IsSelectionModeCurrentlyON (Standard_Integer theMode) { - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); - if(!aContext->HasOpenedContext()) { - return Standard_False ; - } - const TColStd_ListOfInteger& List = aContext->ActivatedStandardModes(); - TColStd_ListIteratorOfListOfInteger it; - Standard_Boolean Found=Standard_False; - for (it.Initialize(List); it.More()&&!Found; it.Next() ) { - if (it.Value()==theMode ) Found=Standard_True; - } - return Found; -} - -static Standard_Integer QAAISSetChoiceMode (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if ( argc != 3 ) { - di << "Usage : " << argv[0] << " mode switch" << "\n"; - di << " mode: " << "\n"; - // cout << " SHAPE " << endl; - di << " VERTEX " << "\n"; - di << " EDGE " << "\n"; - di << " WIRE " << "\n"; - di << " FACE " << "\n"; - di << " SHELL " << "\n"; - di << " SOLID " << "\n"; - di << " COMPOUND " << "\n"; - di << " switch: " << "\n"; - di << " ON " << "\n"; - di << " OFF " << "\n"; - return 1; - } - Handle (V3d_View) QAAISView = ViewerTest::CurrentView (); - if ( QAAISView.IsNull () ) { - di << "You must initialize AISViewer before this command." << "\n"; - return 1; - } - Standard_Integer QAChoosingMode = -1; - // if ( strcmp (sc [1], "SHAPE") == 0 ) { - // QAChoosingMode = 0; - // } - if ( strcmp (argv [1], "VERTEX") == 0 ) { - QAChoosingMode = 1; - } - if ( strcmp (argv [1], "EDGE") == 0 ) { - QAChoosingMode = 2; - } - if ( strcmp (argv [1], "WIRE") == 0 ) { - QAChoosingMode = 3; - } - if ( strcmp (argv [1], "FACE") == 0 ) { - QAChoosingMode = 4; - } - if ( strcmp (argv [1], "SHELL") == 0 ) { - QAChoosingMode = 5; - } - if ( strcmp (argv [1], "SOLID") == 0 ) { - QAChoosingMode = 6; - } - if ( strcmp (argv [1], "COMPOUND") == 0 ) { - QAChoosingMode = 7; - } - if ( QAChoosingMode == -1 ) { - di << "Use - QAAISSetChoiceMode mode switch" << "\n"; - return 1; - } - - if ( strcmp (argv [2], "ON") == 0 ) { - if ( IsSelectionModeCurrentlyON (QAChoosingMode)) { - di << "Mode already ON." << "\n"; - return 1; - } - ViewerTest::StandardModeActivation (QAChoosingMode); - return 0; - } - if ( strcmp (argv [2], "OFF") == 0 ) { - if (!IsSelectionModeCurrentlyON (QAChoosingMode)) { - di << "Mode already OFF." << "\n"; - return 1; - } - ViewerTest::StandardModeActivation (QAChoosingMode); - return 0; - } - di << "Usage : " << argv[0] << " mode switch" << "\n"; - return 1; + if (isNotEqual) + { + theDi << "Faulty : colors are not equal.\n"; + return 1; // TCL_ERROR + } + return 0; } #if ! defined(WNT) @@ -642,93 +435,26 @@ Standard_EXPORT int ViewerMainLoop2d (Standard_Integer argc, const char ** argv) static Standard_Integer QAAISGetMousePoint (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { - if ( argc != 1 ) { - di << "Usage : " << argv[0] << "\n"; - return 1; - } - Handle (V3d_View) QAAISView = ViewerTest::CurrentView (); - if ( QAAISView.IsNull () ) { - di << "You must initialize AISViewer before this command." << "\n"; - return 1; - } - Standard_Integer QAAISMouseCoordinateX = 0; - Standard_Integer QAAISMouseCoordinateY = 0; - Standard_Integer argccc = 5; - const char *bufff[] = { "A", "B", "C", "D", "E" }; - const char **argvvv = (const char **) bufff; - while ( ViewerMainLoop (argccc, argvvv) ) { - ViewerTest::GetMousePosition (QAAISMouseCoordinateX, QAAISMouseCoordinateY); - } - ViewerTest::GetMousePosition (QAAISMouseCoordinateX, QAAISMouseCoordinateY); - di << "X-coordinate: " << QAAISMouseCoordinateX << "; Y-coordinate: " << QAAISMouseCoordinateY << "\n"; - return 0; -} - -static Standard_Integer QAAISGetViewCharac (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if ( argc != 1 ) { - di << "Usage : " << argv[0] << "\n"; - return 1; - } - Handle (V3d_View) QAAISView = ViewerTest::CurrentView (); - if ( QAAISView.IsNull () ) { - di << "You must initialize AISViewer before this command." << "\n"; - return 1; - } - Quantity_Factor QAAISViewScale = QAAISView -> V3d_View::Scale (); - Standard_Real QAAISViewCenterCoordinateX = 0.0; - Standard_Real QAAISViewCenterCoordinateY = 0.0; - QAAISView -> V3d_View::Center (QAAISViewCenterCoordinateX, QAAISViewCenterCoordinateY); - Standard_Real QAAISViewProjX = 0.0; - Standard_Real QAAISViewProjY = 0.0; - Standard_Real QAAISViewProjZ = 0.0; - QAAISView -> V3d_View::Proj (QAAISViewProjX, QAAISViewProjY, QAAISViewProjZ); - Standard_Real QAAISViewUpX = 0.0; - Standard_Real QAAISViewUpY = 0.0; - Standard_Real QAAISViewUpZ = 0.0; - QAAISView -> V3d_View::Up (QAAISViewUpX, QAAISViewUpY, QAAISViewUpZ); - Standard_Real QAAISViewAtX = 0.0; - Standard_Real QAAISViewAtY = 0.0; - Standard_Real QAAISViewAtZ = 0.0; - QAAISView -> V3d_View::At (QAAISViewAtX, QAAISViewAtY, QAAISViewAtZ); - di << "Scale of current view: " << QAAISViewScale << "\n"; - di << "Center on X : "<< QAAISViewCenterCoordinateX << "; on Y: " << QAAISViewCenterCoordinateY << "\n"; - di << "Proj on X : " << QAAISViewProjX << "; on Y: " << QAAISViewProjY << "; on Z: " << QAAISViewProjZ << "\n"; - di << "Up on X : " << QAAISViewUpX << "; on Y: " << QAAISViewUpY << "; on Z: " << QAAISViewUpZ << "\n"; - di << "At on X : " << QAAISViewAtX << "; on Y: " << QAAISViewAtY << "; on Z: " << QAAISViewAtZ << "\n"; - return 0; -} - -static Standard_Integer QAAISSetViewCharac (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if ( argc != 13 ) { - di << "Usage : " << argv[0] << " scale center_X center_Y proj_X proj_Y proj_Z up_X up_Y up_Z at_X at_Y at_Z" << "\n"; - return 1; - } - Handle (V3d_View) QAAISView = ViewerTest::CurrentView (); - if ( QAAISView.IsNull () ) { - di << "You must initialize AISViewer before this command." << "\n"; - return 1; - } - Quantity_Factor QAAISViewScale = atof (argv [1]); - Standard_Real QAAISViewCenterCoordinateX = atof (argv [2]); - Standard_Real QAAISViewCenterCoordinateY = atof (argv [3]); - Standard_Real QAAISViewProjX = atof (argv [4]); - Standard_Real QAAISViewProjY = atof (argv [5]); - Standard_Real QAAISViewProjZ = atof (argv [6]); - Standard_Real QAAISViewUpX = atof (argv [7]); - Standard_Real QAAISViewUpY = atof (argv [8]); - Standard_Real QAAISViewUpZ = atof (argv [9]); - Standard_Real QAAISViewAtX = atof (argv [10]); - Standard_Real QAAISViewAtY = atof (argv [11]); - Standard_Real QAAISViewAtZ = atof (argv [12]); - QAAISView -> V3d_View::SetScale (QAAISViewScale); - QAAISView -> V3d_View::SetCenter (QAAISViewCenterCoordinateX, QAAISViewCenterCoordinateY); - QAAISView -> V3d_View::SetAt (QAAISViewAtX, QAAISViewAtY, QAAISViewAtZ); - QAAISView -> V3d_View::SetProj (QAAISViewProjX, QAAISViewProjY, QAAISViewProjZ); - QAAISView -> V3d_View::SetUp (QAAISViewUpX, QAAISViewUpY, QAAISViewUpZ); - QAAISView -> V3d_View::SetProj (QAAISViewProjX, QAAISViewProjY, QAAISViewProjZ); - return 0; + if ( argc != 1 ) { + di << "Usage : " << argv[0] << "\n"; + return 1; + } + Handle (V3d_View) QAAISView = ViewerTest::CurrentView (); + if ( QAAISView.IsNull () ) { + di << "You must initialize AISViewer before this command." << "\n"; + return 1; + } + Standard_Integer QAAISMouseCoordinateX = 0; + Standard_Integer QAAISMouseCoordinateY = 0; + Standard_Integer argccc = 5; + const char *bufff[] = { "A", "B", "C", "D", "E" }; + const char **argvvv = (const char **) bufff; + while ( ViewerMainLoop (argccc, argvvv) ) { + ViewerTest::GetMousePosition (QAAISMouseCoordinateX, QAAISMouseCoordinateY); + } + ViewerTest::GetMousePosition (QAAISMouseCoordinateX, QAAISMouseCoordinateY); + di << "X-coordinate: " << QAAISMouseCoordinateX << "; Y-coordinate: " << QAAISMouseCoordinateY << "\n"; + return 0; } static Standard_Integer QAAISGetColorCoord (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) @@ -1175,61 +901,12 @@ static int QAxwd_2d (Draw_Interpretor& di, int argc, const char ** argv) #ifndef WNT extern Draw_Viewer dout; -extern XW_STATUS Xw_save_image_adv (Display *aDisplay,Window aWindow,XWindowAttributes aWinAttr,XImage *aPximage,Colormap aColormap,int aNcolors,char *filename); extern Display* Draw_WindowDisplay; extern Colormap Draw_WindowColorMap; #else Standard_IMPORT Draw_Viewer dout; -int __WNT_API SaveWindowToFile (Handle( WNT_GraphicDevice )& gDev, - HWND hWnd, char* fName, int x, int y, int w, int h); #endif -//======================================================================= -//function : QAxwd -//purpose : -//======================================================================= -static int QAxwd (Draw_Interpretor& di, int argc, const char ** argv) -{ - if (argc < 2) - { - di << "Usage : " << argv[0] << " [id=1] filename" << "\n"; - return -1; - } - - // enforce repaint if necessary - Standard_Integer id = 1; - const char* file = argv[1]; - if (argc > 2) { - id = atoi(argv[1]); - file = argv[2]; - } - - after(id); - - dout.Flush(); - if(dout.HasView(id)) { -#if defined (WNT) - Handle(WNT_GraphicDevice) aGd = new WNT_GraphicDevice(Standard_False); - RECT rc; - GetClientRect((HWND)dout.GetWindow(id), &rc); - SaveWindowToFile(aGd,(HWND)dout.GetWindow(id),(char*)file,rc.left, rc.top,rc.right-rc.left, rc.bottom-rc.top); -#else - XSync(Draw_WindowDisplay,True); - - XWindowAttributes winAttr; - XGetWindowAttributes (Draw_WindowDisplay, dout.GetWindow(id), &winAttr); - - XImage *pximage = XGetImage(Draw_WindowDisplay,dout.GetWindow(id), - 0,0,winAttr.width,winAttr.height, - AllPlanes,ZPixmap); - - Xw_save_image_adv(Draw_WindowDisplay,dout.GetWindow(id),winAttr,pximage,Draw_WindowColorMap,256,(char*)file); -#endif - } - - return 0; -} - //======================================================================= //function : QA2dGetIndexes //purpose : @@ -1329,138 +1006,6 @@ static int VTrihedronOrigins(Draw_Interpretor& di, return 0; } -//======================================================================= -//function : QAAddOrRemoveSelected -//purpose : -//======================================================================= -static Standard_Integer QAAddOrRemoveSelected (Draw_Interpretor& di, Standard_Integer n, const char ** a) -{ - if( n != 2) - { - di<<"Usage : QAAddOrRemoveSelected shape \n"; - return 1; - } - //get AIS_Shape: - Handle(AIS_InteractiveContext) anAISCtx = ViewerTest::GetAISContext(); - - //ViewerTest_DoubleMapOfInteractiveAndName& aMap = - // ViewerTest::GetDataMapOfAIS (); - ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS(); - - TCollection_AsciiString aName(a[1]); - Handle(AIS_InteractiveObject) AISObj; - - if(aMap.IsBound2(aName)){ - AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName)); - if(AISObj.IsNull()){ - di<<"No interactive object \n"; - return 1; - } - - if(anAISCtx->HasOpenedContext()){ - anAISCtx->InitSelected(); - anAISCtx->AddOrRemoveSelected(AISObj); - } - else { - anAISCtx->InitCurrent(); - anAISCtx->AddOrRemoveCurrentObject(AISObj); - } - return 0; - } - //select this shape: - else { - di<<"Use 'vdisplay' before"; - return 1; - } -} - -//======================================================================= -//function : QASetZClippingMode -//purpose : -//======================================================================= -static Standard_Integer QASetZClippingMode (Draw_Interpretor& di, int argc, const char ** argv) -{ - if (argc != 2) { - di << "Usage : " << argv[0] << " mode(OFF/BACK/FRONT/SLICE)" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - - Standard_Integer aStatus = 0; - V3d_TypeOfZclipping ZClippingMode; - if ( strcmp (argv [1], "OFF") == 0 ) { - aStatus = 1; - ZClippingMode = V3d_OFF; - } - if ( strcmp (argv [1], "BACK") == 0 ) { - aStatus = 1; - ZClippingMode = V3d_BACK; - } - if ( strcmp (argv [1], "FRONT") == 0 ) { - aStatus = 1; - ZClippingMode = V3d_FRONT; - } - if ( strcmp (argv [1], "SLICE") == 0 ) { - aStatus = 1; - ZClippingMode = V3d_SLICE; - } - if (aStatus != 1) - { - di << "Bad mode; Usage : " << argv[0] << " mode(OFF/BACK/FRONT/SLICE)" << "\n"; - return -1; - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - aView->SetZClippingType(ZClippingMode); - aView->Redraw(); - - return 0; -} - -//======================================================================= -//function : QAGetZClippingMode -//purpose : -//======================================================================= -static Standard_Integer QAGetZClippingMode (Draw_Interpretor& di, int /*argc*/, const char ** argv) -{ - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - TCollection_AsciiString ZClippingModeString; - Quantity_Length Depth, Width; - V3d_TypeOfZclipping ZClippingMode = aView->ZClipping(Depth, Width); - switch (ZClippingMode) - { - case V3d_OFF: - ZClippingModeString.Copy("OFF"); - break; - case V3d_BACK: - ZClippingModeString.Copy("BACK"); - break; - case V3d_FRONT: - ZClippingModeString.Copy("FRONT"); - break; - case V3d_SLICE: - ZClippingModeString.Copy("SLICE"); - break; - default: - ZClippingModeString.Copy(TCollection_AsciiString(ZClippingMode)); - break; - } - di << "ZClippingMode = " << ZClippingModeString.ToCString() << "\n"; - - return 0; -} - #include #include #include @@ -1539,144 +1084,8 @@ static Standard_Integer ViewId(const Standard_CString a) return id; } -//======================================================================= -//function : QAwzoom -//purpose : -//======================================================================= - -static Standard_Integer QAwzoom(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { - if(argc < 6){ - di<<"Usage : " << argv[0] << " view-id X1 Y1 X2 Y2\n"; - return -1; - } - - Standard_Integer id = ViewId(argv [1]); - if (id < 0) { - return -1; - } - - Standard_Integer X1 = atoi (argv [2]); - Standard_Integer Y1 = atoi (argv [3]); - Standard_Integer X2 = atoi (argv [4]); - Standard_Integer Y2 = atoi (argv [5]); - - Standard_Real zx,zy; - - Standard_Integer X,Y,W,H; - dout.GetPosSize(id,X,Y,W,H); - - if ((X1 == X2) || (Y1 == Y2)) return 0; - - zx = (Standard_Real) Abs(X2-X1) / (Standard_Real) W; - zy = (Standard_Real) Abs(Y2-Y1) / (Standard_Real) H; - if (zy > zx) zx = zy; - zx = 1/zx; - if (X2 < X1) X1 = X2; - if (Y2 > Y1) Y1 = Y2; - X1 = (Standard_Integer ) (X1*zx); - Y1 = (Standard_Integer ) (Y1*zx); - dout.SetZoom(id,zx*dout.Zoom(id)); - dout.SetPan(id,-X1,-Y1); - dout.RepaintView(id); - if (dout.HasView(id)) { - char title[255]; - sprintf(title,"%d : %s - Zoom %f",id,dout.GetType(id),dout.Zoom(id)); - dout.SetTitle(id,title); - } - return 0; -} - #include -//======================================================================= -//function : QAGetCoordinatesWzoom -//purpose : -//======================================================================= - -static Standard_Integer QAGetCoordinatesWzoom(Draw_Interpretor& di, Standard_Integer, const char **) -{ - Standard_Integer id1,X1,Y1,b; - Standard_Integer X2,Y2; - Standard_Real dX1,dY1,dX2,dY2; - di << "Pick first corner"<<"\n"; - dout.Select(id1,X1,Y1,b); - - gp_Trsf T; - gp_Pnt P0(0,0,0); - dout.GetTrsf(id1,T); - T.Invert(); - P0.Transform(T); - Standard_Real z = dout.Zoom(id1); - - dX1=X1; dY1=Y1; - dX1-=P0.X(); dY1-=P0.Y(); - dX1/=z; dY1/=z; - - if (b != 1) return 0; - if (id1 < 0) return 0; - Draw_Display d = dout.MakeDisplay(id1); - d.SetColor(Draw_blanc); - d.SetMode(10); - Standard_Real dOX2 = dX1; - Standard_Real dOY2 = dY1; - d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dOY2)); - d.Draw(gp_Pnt2d(dX1,dOY2),gp_Pnt2d(dOX2,dOY2)); - d.Draw(gp_Pnt2d(dOX2,dOY2),gp_Pnt2d(dOX2,dY1)); - d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1)); - d.Flush(); - Standard_Real zx,zy; - Standard_Integer X,Y,W,H; - dout.GetPosSize(id1,X,Y,W,H); - di << "Pick second corner"<<"\n"; - b = 0; - while (b == 0) { - dout.Select(id1,X2,Y2,b,Standard_False); - dX2=X2; dY2=Y2; - dX2-=P0.X(); dY2-=P0.Y(); - dX2/=z; dY2/=z; - - d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dOY2)); - d.Draw(gp_Pnt2d(dX1,dOY2),gp_Pnt2d(dOX2,dOY2)); - d.Draw(gp_Pnt2d(dOX2,dOY2),gp_Pnt2d(dOX2,dY1)); - d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1)); - d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dY2)); - d.Draw(gp_Pnt2d(dX1,dY2),gp_Pnt2d(dX2,dY2)); - d.Draw(gp_Pnt2d(dX2,dY2),gp_Pnt2d(dX2,dY1)); - d.Draw(gp_Pnt2d(dX2,dY1),gp_Pnt2d(dX1,dY1)); - d.Flush(); - dOX2 = dX2; - dOY2 = dY2; - } - d.Draw(gp_Pnt2d(dX1,dY1),gp_Pnt2d(dX1,dOY2)); - d.Draw(gp_Pnt2d(dX1,dOY2),gp_Pnt2d(dOX2,dOY2)); - d.Draw(gp_Pnt2d(dOX2,dOY2),gp_Pnt2d(dOX2,dY1)); - d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1)); - d.Flush(); - if (b != 1) return 0; - - if ((X1 == X2) || (Y1 == Y2)) return 0; - - di << "X1=" << X1 << " Y1=" << Y1 <<"\n"; - di << "X2=" << X2 << " Y2=" << Y2 <<"\n"; - - zx = (Standard_Real) Abs(X2-X1) / (Standard_Real) W; - zy = (Standard_Real) Abs(Y2-Y1) / (Standard_Real) H; - if (zy > zx) zx = zy; - zx = 1/zx; - if (X2 < X1) X1 = X2; - if (Y2 > Y1) Y1 = Y2; - X1 = (Standard_Integer ) (X1*zx); - Y1 = (Standard_Integer ) (Y1*zx); - dout.SetZoom(id1,zx*dout.Zoom(id1)); - dout.SetPan(id1,-X1,-Y1); - dout.RepaintView(id1); - //SetTitle(id1); - char title[255]; - sprintf(title,"%d : %s - Zoom %f",id1,dout.GetType(id1),dout.Zoom(id1)); - dout.SetTitle(id1,title); - return 0; -} - //======================================================================= // QArename //======================================================================= @@ -1703,21 +1112,6 @@ static Standard_Integer QArename(Draw_Interpretor& di, Standard_Integer n, const return 0; } -static Standard_Integer QANbSelected (Draw_Interpretor& di, Standard_Integer argc, const char** argv) -{ - if(argc != 1) { - di << "Usage : " << argv[0] << "\n"; - return 1; - } - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); - if(aContext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return 1; - } - di << aContext->NbSelected() << "\n"; - return 0; -} - //#if defined(V2D) //#include //static Standard_Integer QANbSelected2d (Draw_Interpretor& /*di*/, Standard_Integer argc, char** argv) @@ -1736,189 +1130,6 @@ static Standard_Integer QANbSelected (Draw_Interpretor& di, Standard_Integer arg //} //#endif -static Standard_Integer QAPurgeDisplay (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if (argc > 2) { - di << "Usage : " << argv[0] << " [CollectorToo=0/1]" << "\n"; - return 1; - } - Standard_Boolean CollectorTooBoolean = Standard_False; - if (argc == 2) { - Standard_Integer CollectorTooInteger = atoi (argv [1]); - if (CollectorTooInteger != 0) - CollectorTooBoolean = Standard_True; - } - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); - if (aContext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return 1; - } - aContext->CloseAllContexts(Standard_False); - di << aContext->PurgeDisplay(CollectorTooBoolean) << "\n"; - return 0; -} - -static Standard_Integer QACloseLocalContext (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if (argc > 3) { - di << "Usage : " << argv[0] << " [Index [updateviewer=1/0]]" << "\n"; - return 1; - } - Standard_Integer Index = -1; - if (argc > 1) { - Index = atoi (argv [1]); - } - //cout << "Index = " << Index << endl; - Standard_Boolean updateviewerBoolean = Standard_True; - if (argc == 3) { - Standard_Integer updateviewerInteger = atoi (argv [2]); - if (updateviewerInteger == 0) - updateviewerBoolean = Standard_False; - } - //if (updateviewerBoolean) - // cout << "updateviewer = Standard_True" << endl; - //else - // cout << "updateviewer = Standard_False" << endl; - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); - if (aContext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return 1; - } - aContext->CloseLocalContext(Index, updateviewerBoolean); - return 0; -} - -static Standard_Integer QACloseAllContexts (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if (argc > 2) { - di << "Usage : " << argv[0] << " [updateviewer=1/0]" << "\n"; - return 1; - } - Standard_Boolean updateviewerBoolean = Standard_True; - if (argc == 2) { - Standard_Integer updateviewerInteger = atoi (argv [1]); - if (updateviewerInteger == 0) - updateviewerBoolean = Standard_False; - } - //if (updateviewerBoolean) - // cout << "updateviewer = Standard_True" << endl; - //else - // cout << "updateviewer = Standard_False" << endl; - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); - if (aContext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return 1; - } - aContext->CloseAllContexts(updateviewerBoolean); - return 0; -} - -static Standard_Integer QAIndexOfCurrentLocal (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if (argc > 1) { - di << "Usage : " << argv[0] << "\n"; - return 1; - } - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); - if (aContext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return 1; - } - di << aContext->IndexOfCurrentLocal() << "\n"; - return 0; -} - -#include -static Standard_Integer QADisplayedObjects (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if (argc > 2) { - di << "Usage : " << argv[0] << " [OnlyFromNeutral=0/1]" << "\n"; - return 1; - } - - Standard_Boolean OnlyFromNeutralBoolean = Standard_False; - if (argc == 2) { - Standard_Integer OnlyFromNeutralInteger = atoi (argv [1]); - if (OnlyFromNeutralInteger != 0) - OnlyFromNeutralBoolean = Standard_True; - } - //if (OnlyFromNeutralBoolean) - // cout << "OnlyFromNeutral = Standard_True" << endl; - //else - // cout << "OnlyFromNeutral = Standard_False" << endl; - - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); - if (aContext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return 1; - } - Standard_Integer ListOfInteractiveExtent = 0; - if(!aContext->HasOpenedContext()) { - ListOfInteractiveExtent = 0; - } else { - AIS_ListOfInteractive ListOfInteractive; - aContext->DisplayedObjects(ListOfInteractive, OnlyFromNeutralBoolean); - ListOfInteractiveExtent = ListOfInteractive.Extent(); - } - di << ListOfInteractiveExtent << "\n"; - return 0; -} - -static Standard_Integer QASelectRectangle(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) -{ - if(argc != 5) { - di << "Usage : " << argv[0] << " x1 y1 x2 y2" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); - if(myAIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - - Standard_Integer x1 = atoi(argv[1]); - Standard_Integer y1 = atoi(argv[2]); - Standard_Integer x2 = atoi(argv[3]); - Standard_Integer y2 = atoi(argv[4]); - - Handle(ViewerTest_EventManager) aCurrentEventManager = ViewerTest::CurrentEventManager(); -// Handle(V3d_View) aCurrentView = ViewerTest::CurrentView(); - - aCurrentEventManager->MoveTo(x1,y1); - aCurrentEventManager->Select(x1,y1,x2,y2); - aCurrentEventManager->MoveTo(x2,y2); - - return 0; -} - -static Standard_Integer QAShiftSelectRectangle(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) -{ - if(argc != 5) { - di << "Usage : " << argv[0] << " x1 y1 x2 y2" << "\n"; - return -1; - } - - Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); - if(myAIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - Standard_Integer x1 = atoi(argv[1]); - Standard_Integer y1 = atoi(argv[2]); - Standard_Integer x2 = atoi(argv[3]); - Standard_Integer y2 = atoi(argv[4]); - - Handle(ViewerTest_EventManager) aCurrentEventManager = ViewerTest::CurrentEventManager(); -// Handle(V3d_View) aCurrentView = ViewerTest::CurrentView(); - - aCurrentEventManager->MoveTo(x1,y1); - aCurrentEventManager->ShiftSelect(x1,y1,x2,y2); - aCurrentEventManager->MoveTo(x2,y2); - - return 0; -} - static int QASelect2dRectangle (Draw_Interpretor& di, int argc, const char ** argv) { if (argc != 5) @@ -1979,239 +1190,6 @@ static int QAShiftSelect2dRectangle (Draw_Interpretor& di, int argc, const char return 0; } -//======================================================================= -//function : QARotateV3dView -//purpose : -//======================================================================= -static Standard_Integer QARotateV3dView (Draw_Interpretor& di, int argc, const char ** argv) -{ - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc < 4 || argc > 5){ - di<<"Usage : " << argv[0] << " Ax Ay Az [Start(1/0)]\n"; - return -1; - } - Standard_Real Ax = atof(argv[1]); - Standard_Real Ay = atof(argv[2]); - Standard_Real Az = atof(argv[3]); - Standard_Boolean Start = Standard_True; - if (argc == 5) { - Standard_Integer StartInteger = atoi(argv[4]); - if (StartInteger > 0) { - Start = Standard_True; - } else { - Start = Standard_False; - } - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - aView->Rotate(Ax,Ay,Az,Start); - return 0; -} - -//======================================================================= -//function : QAMoveV3dView -//purpose : -//======================================================================= -static Standard_Integer QAMoveV3dView (Draw_Interpretor& di, int argc, const char ** argv) -{ - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc < 4 || argc > 5){ - di<<"Usage : " << argv[0] << " Dx Dy Dz [Start(1/0)]\n"; - return -1; - } - Standard_Real Dx = atof(argv[1]); - Standard_Real Dy = atof(argv[2]); - Standard_Real Dz = atof(argv[3]); - Standard_Boolean Start = Standard_True; - if (argc == 5) { - Standard_Integer StartInteger = atoi(argv[4]); - if (StartInteger > 0) { - Start = Standard_True; - } else { - Start = Standard_False; - } - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - aView->Move(Dx,Dy,Dz,Start); - return 0; -} - -//======================================================================= -//function : QATranslateV3dView -//purpose : -//======================================================================= -static Standard_Integer QATranslateV3dView (Draw_Interpretor& di, int argc, const char ** argv) -{ - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc < 4 || argc > 5){ - di<<"Usage : " << argv[0] << " Dx Dy Dz [Start(1/0)]\n"; - return -1; - } - Standard_Real Dx = atof(argv[1]); - Standard_Real Dy = atof(argv[2]); - Standard_Real Dz = atof(argv[3]); - Standard_Boolean Start = Standard_True; - if (argc == 5) { - Standard_Integer StartInteger = atoi(argv[4]); - if (StartInteger > 0) { - Start = Standard_True; - } else { - Start = Standard_False; - } - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - aView->Translate(Dx,Dy,Dz,Start); - return 0; -} - -//======================================================================= -//function : QATurnV3dView -//purpose : -//======================================================================= -static Standard_Integer QATurnV3dView (Draw_Interpretor& di, int argc, const char ** argv) -{ - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc < 4 || argc > 5){ - di<<"Usage : " << argv[0] << " Ax Ay Az [Start(1/0)]\n"; - return -1; - } - Standard_Real Ax = atof(argv[1]); - Standard_Real Ay = atof(argv[2]); - Standard_Real Az = atof(argv[3]); - Standard_Boolean Start = Standard_True; - if (argc == 5) { - Standard_Integer StartInteger = atoi(argv[4]); - if (StartInteger > 0) { - Start = Standard_True; - } else { - Start = Standard_False; - } - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - aView->Turn(Ax,Ay,Az,Start); - return 0; -} - -//======================================================================= -//function : QAPanningV3dView -//purpose : -//======================================================================= -static Standard_Integer QAPanningV3dView (Draw_Interpretor& di, int argc, const char ** argv) -{ - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc < 3 || argc > 5){ - di<<"Usage : " << argv[0] << " Dx Dy [Zoom [Start(1/0)]]\n"; - return -1; - } - Standard_Real Dx = atof(argv[1]); - Standard_Real Dy = atof(argv[2]); - Standard_Real Zoom = 1.; - if (argc > 3) { - Zoom = atof(argv[3]); - if (Zoom <= 0.) { - di<<"Bad Zoom value : " << Zoom << "\n"; - return -1; - } - } - Standard_Boolean Start = Standard_True; - if (argc == 5) { - Standard_Integer StartInteger = atoi(argv[4]); - if (StartInteger > 0) { - Start = Standard_True; - } else { - Start = Standard_False; - } - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - aView->Panning(Dx,Dy,Zoom,Start); - return 0; -} - -//======================================================================= -//function : QASetZoomV3dView -//purpose : -//======================================================================= -static Standard_Integer QASetZoomV3dView (Draw_Interpretor& di, int argc, const char ** argv) -{ - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc < 2 || argc > 3){ - di<<"Usage : " << argv[0] << " Zoom [Start(1/0)]\n"; - return -1; - } - Standard_Real Zoom = atof(argv[1]); - if (Zoom <= 0.) { - di<<"Bad Zoom value : " << Zoom << "\n"; - return -1; - } - Standard_Boolean Start = Standard_True; - if (argc == 3) { - Standard_Integer StartInteger = atoi(argv[2]); - if (StartInteger > 0) { - Start = Standard_True; - } else { - Start = Standard_False; - } - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - aView->SetZoom(Zoom,Start); - return 0; -} - -//======================================================================= -//function : QASetSizeV3dView -//purpose : -//======================================================================= -static Standard_Integer QASetSizeV3dView (Draw_Interpretor& di, int argc, const char ** argv) -{ - Handle(AIS_InteractiveContext) AIScontext = ViewerTest::GetAISContext(); - if(AIScontext.IsNull()) { - di << "use 'vinit' command before " << argv[0] << "\n"; - return -1; - } - if(argc != 2){ - di<<"Usage : " << argv[0] << " Size\n"; - return -1; - } - Standard_Real Size = atof(argv[1]); - if (Size <= 0.) { - di<<"Bad Size value : " << Size << "\n"; - return -1; - } - - Handle(V3d_View) aView = ViewerTest::CurrentView(); - aView->SetSize(Size); - return 0; -} - void QADraw::CommonCommands(Draw_Interpretor& theCommands) { ios::sync_with_stdio(); @@ -2227,18 +1205,8 @@ void QADraw::CommonCommands(Draw_Interpretor& theCommands) const char* group = "QA_Commands"; theCommands.Add("QARebuild","QARebuild command_name",__FILE__,QARebuild,group); - theCommands.Add("QAxwd_3d","QAxwd_3d filename",__FILE__,QAxwd_3d,group); - theCommands.Add("QAMoveTo","QAMoveTo x y",__FILE__,QAMoveTo,group); - theCommands.Add("QASelect","QASelect x y",__FILE__,QASelect,group); - theCommands.Add("QAShiftSelect","QAShiftSelect x y",__FILE__,QAShiftSelect,group); - theCommands.Add("QAUpdateLights","QAUpdateLights",__FILE__,QAUpdateLights,group); - theCommands.Add("QASetAntialiasing","QASetAntialiasing [1/0]",__FILE__,QASetAntialiasing,group); - theCommands.Add("QAvzfit","QAvzfit",__FILE__,QAvzfit,group); theCommands.Add("QAGetPixelColor", "QAGetPixelColor coordinate_X coordinate_Y [color_R color_G color_B]", __FILE__,QAAISGetPixelColor, group); - theCommands.Add("QASetChoiceMode", "QASetChoiceMode mode switch ; Use without params to see a help ", __FILE__,QAAISSetChoiceMode, group); theCommands.Add("QAGetMousePoint", "QAGetMousePoint", __FILE__,QAAISGetMousePoint, group); - theCommands.Add("QAGetViewCharac", "QAGetViewCharac", __FILE__,QAAISGetViewCharac, group); - theCommands.Add("QASetViewCharac", "QASetViewCharac scale center_X center_Y proj_X proj_Y proj_Z up_X up_Y up_Z at_X at_Y at_Z", __FILE__,QAAISSetViewCharac, group); theCommands.Add("QAGetColorCoord", "QAGetColorCoord [3d|2d]", __FILE__,QAAISGetColorCoord, group); //#ifndef WNT theCommands.Add("QAAISGetPixelColor2d", @@ -2269,57 +1237,23 @@ void QADraw::CommonCommands(Draw_Interpretor& theCommands) theCommands.Add("QAMoveTo2d", "QAMoveTo2d x y", __FILE__, QAMoveTo2d, group); theCommands.Add("QASelect2d", "QASelect2d x y", __FILE__, QASelect2d, group); theCommands.Add("QAShiftSelect2d", "QAShiftSelect2d x y", __FILE__, QAShiftSelect2d, group); - theCommands.Add("QAv2dSetHighlightMode", "QAv2dSetHighlightMode mode", __FILE__, V2dSetHighlightMode, group); - theCommands.Add("QAxwd_2d", "QAxwd_2d filename", __FILE__, QAxwd_2d, group); - - theCommands.Add("QAxwd", "QAxwd [id=1] filename", __FILE__, QAxwd, group); - theCommands.Add("QA2dGetIndexes", "QA2dGetIndexes", __FILE__, QA2dGetIndexes, group); theCommands.Add("vtri_orig", "vtri_orig : vtri_orig trihedron_name - draws axis origin lines", __FILE__,VTrihedronOrigins,group); - - theCommands.Add("QAAddOrRemoveSelected", - "QAAddOrRemoveSelected shape : selects the shape by AddOrRemoveSelected method", - __FILE__, QAAddOrRemoveSelected, group); - - theCommands.Add("QASetZClippingMode","QASetZClippingMode mode(OFF/BACK/FRONT/SLICE)",__FILE__,QASetZClippingMode,group); - theCommands.Add("QAGetZClippingMode","QAGetZClippingMode",__FILE__,QAGetZClippingMode,group); theCommands.Add("QAv2dcircle", "QAv2dcircle CircleName X Y Radius Alpha Beta [Color_index]", __FILE__, QAv2dcircle, group); - theCommands.Add("QAwzoom","QAwzoom view-id X1 Y1 X2 Y2; zoom on a window",__FILE__,QAwzoom,group); - theCommands.Add("QAGetCoordinatesWzoom","QAGetCoordinatesWzoom ; Get coordinates for zoom on a window",__FILE__,QAGetCoordinatesWzoom,group); - // adding commands "rename" leads to the fact that QA commands doesn't work properly OCC23410, use function "renamevar" // theCommands.Add("rename","rename name1 toname1 name2 toname2 ...",__FILE__,QArename,group); - - theCommands.Add ("QANbSelected", "QANbSelected", __FILE__, QANbSelected, group); //#if defined(V2D) // theCommands.Add ("QANbSelected2d", "QANbSelected2d", __FILE__, QANbSelected2d, group); //#endif - - theCommands.Add ("QAPurgeDisplay", "QAPurgeDisplay [CollectorToo=0/1]", __FILE__, QAPurgeDisplay, group); - theCommands.Add ("QACloseLocalContext", "QACloseLocalContext [Index [updateviewer=1/0]]", __FILE__, QACloseLocalContext, group); - theCommands.Add ("QACloseAllContexts", "QACloseAllContexts [updateviewer=1/0]", __FILE__, QACloseAllContexts, group); - theCommands.Add ("QAIndexOfCurrentLocal", "QAIndexOfCurrentLocal", __FILE__, QAIndexOfCurrentLocal, group); - theCommands.Add ("QADisplayedObjects", "QADisplayedObjects [OnlyFromNeutral=0/1]", __FILE__, QADisplayedObjects, group); - - theCommands.Add("QASelectRectangle","QASelectRectangle x1 y1 x2 y2",__FILE__,QASelectRectangle,group); - theCommands.Add("QAShiftSelectRectangle","QAShiftSelectRectangle x1 y1 x2 y2",__FILE__,QAShiftSelectRectangle,group); theCommands.Add("QASelect2dRectangle","QASelect2dRectangle x1 y1 x2 y2",__FILE__,QASelect2dRectangle,group); theCommands.Add("QAShiftSelect2dRectangle","QAShiftSelect2dRectangle x1 y1 x2 y2",__FILE__,QAShiftSelect2dRectangle,group); - - theCommands.Add("QARotateV3dView","QARotateV3dView Ax Ay Az [Start(1/0)]",__FILE__,QARotateV3dView,group); - theCommands.Add("QAMoveV3dView","QAMoveV3dView Dx Dy Dz [Start(1/0)]",__FILE__,QAMoveV3dView,group); - theCommands.Add("QATranslateV3dView","QATranslateV3dView Dx Dy Dz [Start(1/0)]",__FILE__,QATranslateV3dView,group); - theCommands.Add("QATurnV3dView","QATurnV3dView Ax Ay Az [Start(1/0)]",__FILE__,QATurnV3dView,group); - theCommands.Add("QAPanningV3dView","QAPanningV3dView Dx Dy [Zoom [Start(1/0)]]",__FILE__,QAPanningV3dView,group); - theCommands.Add("QASetZoomV3dView","QASetZoomV3dView Zoom [Start(1/0)]",__FILE__,QASetZoomV3dView,group); - theCommands.Add("QASetSizeV3dView","QASetSizeV3dView Size",__FILE__,QASetSizeV3dView,group); } /* extern "C" int Tkqadraw_Init(Tcl_Interp *); diff --git a/src/ViewerTest/ViewerTest.cdl b/src/ViewerTest/ViewerTest.cdl index e254c54dd1..234c67a99c 100755 --- a/src/ViewerTest/ViewerTest.cdl +++ b/src/ViewerTest/ViewerTest.cdl @@ -29,6 +29,7 @@ uses Draw, TCollection, TColStd, + TColgp, TopAbs, TopTools, TopoDS, diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index 0efa670d68..c560ff72b6 100755 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -560,7 +560,8 @@ void ViewerTest::StandardModeActivation(const Standard_Integer mode ) case 4: cmode = "Face"; break; case 5: cmode = "Shell"; break; case 6: cmode = "Solid"; break; - case 7: cmode = "Compound"; break; + case 7: cmode = "Compsolid"; break; + case 8: cmode = "Compound"; break; } if(theactivatedmodes.Contains(mode)) @@ -578,128 +579,6 @@ void ViewerTest::StandardModeActivation(const Standard_Integer mode ) } } -//============================================================================== -//function : SelectFromContext -//purpose : pick / select an object from the last MoveTo() on a -// ButtonPress event -//============================================================================== - -Handle(AIS_InteractiveObject) Select(Standard_Integer argc, - const char** argv, - Standard_Boolean shift, - Standard_Boolean pick ) -{ - Handle(AIS_InteractiveObject) ret; - Handle (ViewerTest_EventManager) EM = ViewerTest::CurrentEventManager(); - if ( shift ) { - EM->ShiftSelect(); - } - else { - EM->Select(); - } - const Handle(AIS_InteractiveContext) aContext = EM->Context(); - - if ( !aContext->HasOpenedContext() ) { - aContext->InitCurrent(); - while ( aContext->MoreCurrent() ) { - Handle(AIS_InteractiveObject) aisPickedShape = - Handle(AIS_InteractiveObject)::DownCast(aContext->Current()); - -//JR/Hp - const char *name = (GetMapOfAIS().IsBound1(aisPickedShape))? -// const char *name = (GetMapOfAIS().IsBound1(aisPickedShape))? - GetMapOfAIS().Find1(aisPickedShape).ToCString() : - "????"; - Handle(AIS_Shape) TheRealSh = Handle(AIS_Shape)::DownCast(aisPickedShape); - if(!TheRealSh.IsNull()){ - cout << "Current is " << name - << " (" << GetTypeNameFromShape(TheRealSh->Shape()) - << ")" << endl; - } - ret = aisPickedShape; - if(!TheRealSh.IsNull()){ - if ( pick && argc > 4 ) { - DBRep::Set(argv[4], TheRealSh->Shape()); - } - } - aContext->NextCurrent(); - } - } - else { - // A LocalContext is opened, the use xxxxSelected() - // to select an object and its SubShape - aContext->InitSelected(); - while ( aContext->MoreSelected() ) { - if ( !aContext->HasSelectedShape() ) { - } - else { - TopoDS_Shape PickedShape = aContext->SelectedShape(); - if ( pick && argc > 5 ) { - DBRep::Set(argv[5], PickedShape); - } - } - - if ( aContext->Interactive().IsNull() ) { - cout << "??? (No InteractiveObject selected)" << endl; - } - else { - Handle(AIS_InteractiveObject) aisPicked = - Handle(AIS_InteractiveObject)::DownCast(aContext->Interactive()); - ret = aisPicked; - Handle(AIS_Shape) aisPickedShape = Handle(AIS_Shape)::DownCast(aisPicked); - - // Get back its name -//JR/Hp - const char *name = ( GetMapOfAIS().IsBound1(aisPicked) )? -// const char *name = ( GetMapOfAIS().IsBound1(aisPicked) )? - GetMapOfAIS().Find1(aisPicked).ToCString() : - "????"; - - if(!aisPickedShape.IsNull()){ - if ( pick && argc > 4 ) { - // Create a draw variable to store the wohole shape - // for vpick command - DBRep::Set(argv[4], aisPickedShape->Shape()); - } - - cout << name << " (" << GetTypeNameFromShape(aisPickedShape->Shape()) - << ")" << endl ; - } - } - // Goto the next selected object - aContext->NextSelected(); - } - } - return ret; -} - -//============================================================================== -//function : DetectedFromContext -//purpose : hilight dynamicaly an object from the last MoveTo() on a -// MouseMove event -//============================================================================== -Handle(AIS_InteractiveObject) DetectedFromContext( - Handle(AIS_InteractiveContext) aContext ) -{ - Handle(AIS_InteractiveObject) ret; - if ( aContext->HasDetected() ) { - if ( !aContext->HasDetectedShape() ) { - //No SubShape selected - } - else { - // Get the detected SubShape - TopoDS_Shape PickedShape = aContext->DetectedShape(); - } - if ( !aContext->DetectedInteractive().IsNull() ) { - Handle(AIS_InteractiveObject) aisPickedShape = - Handle(AIS_InteractiveObject)::DownCast(aContext->DetectedInteractive()); - ret = aisPickedShape; - } - } - return ret; -} - - //============================================================================== //function : VDispAreas,VDispSensitive,... //purpose : Redraw the view diff --git a/src/ViewerTest/ViewerTest_EventManager.cdl b/src/ViewerTest/ViewerTest_EventManager.cdl index 5fc9a3439e..1b4395805f 100755 --- a/src/ViewerTest/ViewerTest_EventManager.cdl +++ b/src/ViewerTest/ViewerTest_EventManager.cdl @@ -26,8 +26,8 @@ class EventManager from ViewerTest inherits TShared from MMgt uses View from V3d, - InteractiveContext from AIS - + InteractiveContext from AIS, + Array1OfPnt2d from TColgp is Create (aView: View from V3d; @@ -44,6 +44,10 @@ is Select(me:mutable;xmin,ymin,xmax,ymax:Integer) is virtual; ShiftSelect(me:mutable;xmin,ymin,xmax,ymax:Integer) is virtual; + + Select(me:mutable;thePolyline:Array1OfPnt2d from TColgp) is virtual; + + ShiftSelect(me:mutable;thePolyline:Array1OfPnt2d from TColgp) is virtual; Context(me) returns InteractiveContext from AIS; ---C++: inline diff --git a/src/ViewerTest/ViewerTest_EventManager.cxx b/src/ViewerTest/ViewerTest_EventManager.cxx index 7cffdaf919..fd6c570011 100755 --- a/src/ViewerTest/ViewerTest_EventManager.cxx +++ b/src/ViewerTest/ViewerTest_EventManager.cxx @@ -118,3 +118,47 @@ void ViewerTest_EventManager::ShiftSelect() if (!aView.IsNull()) aView->Select(myX, myY, Standard_True); } + +//======================================================================= +//function : Select +//purpose : Selection with polyline +//======================================================================= + +void ViewerTest_EventManager::Select(const TColgp_Array1OfPnt2d& thePolyline) +{ + if(!myCtx.IsNull() && !myView.IsNull()) + myCtx->Select(thePolyline,myView); + const Handle(NIS_View) aView = Handle(NIS_View)::DownCast(myView); + if (!aView.IsNull()) + { + NCollection_List aPolylist; + for(Standard_Integer anIter = thePolyline.Lower();anIter <= thePolyline.Upper();++anIter) + { + aPolylist.Append(gp_XY(thePolyline.Value(anIter).X(), + thePolyline.Value(anIter).Y())); + } + aView->Select(aPolylist); + } +} + +//======================================================================= +//function : ShiftSelect +//purpose : Selection with polyline without erasing of current selection +//======================================================================= + +void ViewerTest_EventManager::ShiftSelect(const TColgp_Array1OfPnt2d& thePolyline) +{ + if(!myCtx.IsNull() && !myView.IsNull()) + myCtx->ShiftSelect(thePolyline,myView); + const Handle(NIS_View) aView = Handle(NIS_View)::DownCast(myView); + if (!aView.IsNull()) + { + NCollection_List aPolylist; + for(Standard_Integer anIter = thePolyline.Lower();anIter <= thePolyline.Upper();++anIter) + { + aPolylist.Append(gp_XY(thePolyline.Value(anIter).X(), + thePolyline.Value(anIter).Y())); + } + aView->Select(aPolylist, Standard_True); + } +} diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index cb4a9dcc01..ededd567c4 100755 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,8 @@ #include #include #include +#include +#include #include #include #include @@ -94,6 +97,7 @@ Standard_IMPORT Standard_Boolean Draw_VirtualWindows; Standard_EXPORT int ViewerMainLoop(Standard_Integer , const char** argv); extern const Handle(NIS_InteractiveContext)& TheNISContext(); +extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS(); #if defined(_WIN32) || defined(__WIN32__) static Handle(Graphic3d_WNTGraphicDevice)& GetG3dDevice(){ @@ -3097,6 +3101,526 @@ static int VDiffImage (Draw_Interpretor& theDI, Standard_Integer theArgNb, const return 0; } +//======================================================================= +//function : VSelect +//purpose : Emulates different types of selection by mouse: +// 1) single click selection +// 2) selection with rectangle having corners at pixel positions (x1,y1) and (x2,y2) +// 3) selection with polygon having corners at +// pixel positions (x1,y1),...,(xn,yn) +// 4) any of these selections with shift button pressed +//======================================================================= +static Standard_Integer VSelect (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + if(argc < 3) + { + di << "Usage : " << argv[0] << " x1 y1 [x2 y2 [... xn yn]] [shift_selection = 1|0]" << "\n"; + return 1; + } + + Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext(); + if(myAIScontext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + const Standard_Boolean isShiftSelection = (argc>3 && !(argc%2) && (atoi(argv[argc-1])==1)); + Handle(ViewerTest_EventManager) aCurrentEventManager = ViewerTest::CurrentEventManager(); + aCurrentEventManager->MoveTo(atoi(argv[1]),atoi(argv[2])); + if(argc <= 4) + { + if(isShiftSelection) + aCurrentEventManager->ShiftSelect(); + else + aCurrentEventManager->Select(); + } + else if(argc <= 6) + { + if(isShiftSelection) + aCurrentEventManager->ShiftSelect(atoi(argv[1]),atoi(argv[2]),atoi(argv[3]),atoi(argv[4])); + else + aCurrentEventManager->Select(atoi(argv[1]),atoi(argv[2]),atoi(argv[3]),atoi(argv[4])); + } + else + { + Standard_Integer anUpper = 0; + + if(isShiftSelection) + anUpper = (argc-1)/2; + else + anUpper = argc/2; + TColgp_Array1OfPnt2d aPolyline(1,anUpper); + + for(Standard_Integer i=1;i<=anUpper;++i) + aPolyline.SetValue(i,gp_Pnt2d(atoi(argv[2*i-1]),atoi(argv[2*i]))); + + if(isShiftSelection) + aCurrentEventManager->ShiftSelect(aPolyline); + else + aCurrentEventManager->Select(aPolyline); + } + return 0; +} + +//======================================================================= +//function : VMoveTo +//purpose : Emulates cursor movement to defined pixel position +//======================================================================= +static Standard_Integer VMoveTo (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + if(argc != 3) + { + di << "Usage : " << argv[0] << " x y" << "\n"; + return 1; + } + + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + ViewerTest::CurrentEventManager()->MoveTo(atoi(argv[1]),atoi(argv[2])); + return 0; +} + +//======================================================================= +//function : VViewParams +//purpose : Gets or sets AIS View characteristics +//======================================================================= +static Standard_Integer VViewParams (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + if ( argc != 1 && argc != 13) + { + di << "Usage : " << argv[0] << "\n"; + return 1; + } + Handle (V3d_View) anAISView = ViewerTest::CurrentView (); + if ( anAISView.IsNull () ) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + if(argc==1){ + Quantity_Factor anAISViewScale = anAISView -> V3d_View::Scale (); + Standard_Real anAISViewCenterCoordinateX = 0.0; + Standard_Real anAISViewCenterCoordinateY = 0.0; + anAISView -> V3d_View::Center (anAISViewCenterCoordinateX, anAISViewCenterCoordinateY); + Standard_Real anAISViewProjX = 0.0; + Standard_Real anAISViewProjY = 0.0; + Standard_Real anAISViewProjZ = 0.0; + anAISView -> V3d_View::Proj (anAISViewProjX, anAISViewProjY, anAISViewProjZ); + Standard_Real anAISViewUpX = 0.0; + Standard_Real anAISViewUpY = 0.0; + Standard_Real anAISViewUpZ = 0.0; + anAISView -> V3d_View::Up (anAISViewUpX, anAISViewUpY, anAISViewUpZ); + Standard_Real anAISViewAtX = 0.0; + Standard_Real anAISViewAtY = 0.0; + Standard_Real anAISViewAtZ = 0.0; + anAISView -> V3d_View::At (anAISViewAtX, anAISViewAtY, anAISViewAtZ); + di << "Scale of current view: " << anAISViewScale << "\n"; + di << "Center on X : "<< anAISViewCenterCoordinateX << "; on Y: " << anAISViewCenterCoordinateY << "\n"; + di << "Proj on X : " << anAISViewProjX << "; on Y: " << anAISViewProjY << "; on Z: " << anAISViewProjZ << "\n"; + di << "Up on X : " << anAISViewUpX << "; on Y: " << anAISViewUpY << "; on Z: " << anAISViewUpZ << "\n"; + di << "At on X : " << anAISViewAtX << "; on Y: " << anAISViewAtY << "; on Z: " << anAISViewAtZ << "\n"; + } + else + { + Quantity_Factor anAISViewScale = atof (argv [1]); + Standard_Real anAISViewCenterCoordinateX = atof (argv [2]); + Standard_Real anAISViewCenterCoordinateY = atof (argv [3]); + Standard_Real anAISViewProjX = atof (argv [4]); + Standard_Real anAISViewProjY = atof (argv [5]); + Standard_Real anAISViewProjZ = atof (argv [6]); + Standard_Real anAISViewUpX = atof (argv [7]); + Standard_Real anAISViewUpY = atof (argv [8]); + Standard_Real anAISViewUpZ = atof (argv [9]); + Standard_Real anAISViewAtX = atof (argv [10]); + Standard_Real anAISViewAtY = atof (argv [11]); + Standard_Real anAISViewAtZ = atof (argv [12]); + anAISView -> V3d_View::SetScale (anAISViewScale); + anAISView -> V3d_View::SetCenter (anAISViewCenterCoordinateX, anAISViewCenterCoordinateY); + anAISView -> V3d_View::SetAt (anAISViewAtX, anAISViewAtY, anAISViewAtZ); + anAISView -> V3d_View::SetProj (anAISViewProjX, anAISViewProjY, anAISViewProjZ); + anAISView -> V3d_View::SetUp (anAISViewUpX, anAISViewUpY, anAISViewUpZ); + } + return 0; +} + +//======================================================================= +//function : VChangeSelected +//purpose : Adds the shape to selection or remove one from it +//======================================================================= +static Standard_Integer VChangeSelected (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + if(argc != 2) + { + di<<"Usage : " << argv[0] << " shape \n"; + return 1; + } + //get AIS_Shape: + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS(); + TCollection_AsciiString aName(argv[1]); + Handle(AIS_InteractiveObject) anAISObject; + + if(!aMap.IsBound2(aName)) + { + di<<"Use 'vdisplay' before"; + return 1; + } + else + { + anAISObject = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName)); + if(anAISObject.IsNull()){ + di<<"No interactive object \n"; + return 1; + } + + if(aContext->HasOpenedContext()) + { + aContext->AddOrRemoveSelected(anAISObject); + } + else + { + aContext->AddOrRemoveCurrentObject(anAISObject); + } + } + return 0; +} + +//======================================================================= +//function : VZClipping +//purpose : Gets or sets ZClipping mode, width and depth +//======================================================================= +static Standard_Integer VZClipping (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + if(argc>4) + { + di << "Usage : " << argv[0] << " [mode] [depth width]" << "\n" + <<"mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]" << "\n"; + return -1; + } + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + Handle(V3d_View) aView = ViewerTest::CurrentView(); + V3d_TypeOfZclipping aZClippingMode; + if(argc==1) + { + TCollection_AsciiString aZClippingModeString; + Quantity_Length aDepth, aWidth; + aZClippingMode = aView->ZClipping(aDepth, aWidth); + switch (aZClippingMode) + { + case V3d_OFF: + aZClippingModeString.Copy("OFF"); + break; + case V3d_BACK: + aZClippingModeString.Copy("BACK"); + break; + case V3d_FRONT: + aZClippingModeString.Copy("FRONT"); + break; + case V3d_SLICE: + aZClippingModeString.Copy("SLICE"); + break; + default: + aZClippingModeString.Copy(TCollection_AsciiString(aZClippingMode)); + break; + } + di << "ZClippingMode = " << aZClippingModeString.ToCString() << "\n" + << "ZClipping depth = " << aDepth << "\n" + << "ZClipping width = " << aWidth << "\n"; + } + else + { + if(argc !=3) + { + Standard_Integer aStatus = 0; + if ( strcmp (argv [1], "OFF") == 0 ) { + aStatus = 1; + aZClippingMode = V3d_OFF; + } + if ( strcmp (argv [1], "BACK") == 0 ) { + aStatus = 1; + aZClippingMode = V3d_BACK; + } + if ( strcmp (argv [1], "FRONT") == 0 ) { + aStatus = 1; + aZClippingMode = V3d_FRONT; + } + if ( strcmp (argv [1], "SLICE") == 0 ) { + aStatus = 1; + aZClippingMode = V3d_SLICE; + } + if (aStatus != 1) + { + di << "Bad mode; Usage : " << argv[0] << " [mode] [depth width]" << "\n" + << "mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]" << "\n"; + return 1; + } + aView->SetZClippingType(aZClippingMode); + } + if(argc >2) + { + Quantity_Length aDepth = 0., aWidth = 1.; + if(argc == 3) + { + aDepth = atof(argv[1]); + aWidth = atof(argv[2]); + } + else if(argc == 4) + { + aDepth = atof(argv[2]); + aWidth = atof(argv[3]); + } + + if(aDepth<0. || aDepth>1.) + { + di << "Bad depth; Usage : " << argv[0] << " [mode] [depth width]" << "\n" + << "mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]" << "\n"; + return 1; + } + if(aWidth<0. || aWidth>1.) + { + di << "Bad width; Usage : " << argv[0] << " [mode] [depth width]" << "\n" + << "mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]" << "\n"; + return 1; + } + + aView->SetZClippingDepth(aDepth); + aView->SetZClippingWidth(aWidth); + } + aView->Redraw(); + } + return 0; +} + +//======================================================================= +//function : VNbSelected +//purpose : Returns number of selected objects +//======================================================================= +static Standard_Integer VNbSelected (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + if(argc != 1) + { + di << "Usage : " << argv[0] << "\n"; + return 1; + } + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + di << aContext->NbSelected() << "\n"; + return 0; +} + +//======================================================================= +//function : VAntialiasing +//purpose : Switches altialiasing on or off +//======================================================================= +static Standard_Integer VAntialiasing (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + if(argc > 2) + { + di << "Usage : " << argv[0] << " [1|0]" << "\n"; + return 1; + } + + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + + Handle(V3d_View) aView = ViewerTest::CurrentView(); + + if((argc == 2) && (atof(argv[1]) == 0)) + aView->SetAntialiasingOff(); + else + aView->SetAntialiasingOn(); + aView->Update(); + return 0; +} + +//======================================================================= +//function : VPurgeDisplay +//purpose : Switches altialiasing on or off +//======================================================================= +static Standard_Integer VPurgeDisplay (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + if (argc > 2) + { + di << "Usage : " << argv[0] << " [CollectorToo = 0|1]" << "\n"; + return 1; + } + Standard_Boolean isCollectorToo = Standard_False; + if (argc == 2) + { + isCollectorToo = (atoi(argv [1]) != 0); + } + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if (aContext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + aContext->CloseAllContexts(Standard_False); + di << aContext->PurgeDisplay(isCollectorToo) << "\n"; + return 0; +} + +//======================================================================= +//function : VSetViewSize +//purpose : +//======================================================================= +static Standard_Integer VSetViewSize (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + if(argc != 2) + { + di<<"Usage : " << argv[0] << " Size\n"; + return 1; + } + Standard_Real aSize = atof(argv[1]); + if (aSize <= 0.) + { + di<<"Bad Size value : " << aSize << "\n"; + return 1; + } + + Handle(V3d_View) aView = ViewerTest::CurrentView(); + aView->SetSize(aSize); + return 0; +} + +//======================================================================= +//function : VMoveView +//purpose : +//======================================================================= +static Standard_Integer VMoveView (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + if(argc < 4 || argc > 5) + { + di<<"Usage : " << argv[0] << " Dx Dy Dz [Start = 1|0]\n"; + return 1; + } + Standard_Real Dx = atof(argv[1]); + Standard_Real Dy = atof(argv[2]); + Standard_Real Dz = atof(argv[3]); + Standard_Boolean aStart = Standard_True; + if (argc == 5) + { + aStart = (atoi(argv[4]) > 0); + } + + Handle(V3d_View) aView = ViewerTest::CurrentView(); + aView->Move(Dx,Dy,Dz,aStart); + return 0; +} + +//======================================================================= +//function : VTranslateView +//purpose : +//======================================================================= +static Standard_Integer VTranslateView (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) + { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + if(argc < 4 || argc > 5) + { + di<<"Usage : " << argv[0] << " Dx Dy Dz [Start = 1|0]\n"; + return 1; + } + Standard_Real Dx = atof(argv[1]); + Standard_Real Dy = atof(argv[2]); + Standard_Real Dz = atof(argv[3]); + Standard_Boolean aStart = Standard_True; + if (argc == 5) + { + aStart = (atoi(argv[4]) > 0); + } + + Handle(V3d_View) aView = ViewerTest::CurrentView(); + aView->Translate(Dx,Dy,Dz,aStart); + return 0; +} + +//======================================================================= +//function : VTurnView +//purpose : +//======================================================================= +static Standard_Integer VTurnView (Draw_Interpretor& di, + Standard_Integer argc, + const char ** argv) +{ + Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); + if(aContext.IsNull()) { + di << "use 'vinit' command before " << argv[0] << "\n"; + return 1; + } + if(argc < 4 || argc > 5){ + di<<"Usage : " << argv[0] << " Ax Ay Az [Start = 1|0]\n"; + return 1; + } + Standard_Real Ax = atof(argv[1]); + Standard_Real Ay = atof(argv[2]); + Standard_Real Az = atof(argv[3]); + Standard_Boolean aStart = Standard_True; + if (argc == 5) + { + aStart = (atoi(argv[4]) > 0); + } + + Handle(V3d_View) aView = ViewerTest::CurrentView(); + aView->Turn(Ax,Ay,Az,aStart); + return 0; +} + //======================================================================= //function : ViewerCommands //purpose : @@ -3230,4 +3754,50 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands) theCommands.Add("diffimage", "diffimage : diffimage imageFile1 imageFile2 toleranceOfColor(0..1) blackWhite(1|0) borderFilter(1|0) [diffImageFile]", __FILE__, VDiffImage, group); + theCommands.Add ("vselect", + "vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [shift_selection = 0|1]\n" + "- emulates different types of selection:\n" + "- 1) single click selection\n" + "- 2) selection with rectangle having corners at pixel positions (x1,y1) and (x2,y2)\n" + "- 3) selection with polygon having corners in pixel positions (x1,y1), (x2,y2),...,(xn,yn)\n" + "- 4) any of these selections with shift button pressed", + __FILE__, VSelect, group); + theCommands.Add ("vmoveto", + "vmoveto x y" + "- emulates cursor movement to pixel postion (x,y)", + __FILE__, VMoveTo, group); + theCommands.Add("vviewparams", + "vviewparams [scale center_X center_Y proj_X proj_Y proj_Z up_X up_Y up_Z at_X at_Y at_Z]" + "- gets or sets current view characteristics", + __FILE__,VViewParams, group); + theCommands.Add("vchangeselected", + "vchangeselected shape" + "- adds to shape to selection or remove one from it", + __FILE__, VChangeSelected, group); + theCommands.Add("vzclipping", + "vzclipping [mode] [depth width]\n" + "- mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]\n" + "- gets or sets ZClipping mode, width and depth", + __FILE__,VZClipping,group); + theCommands.Add ("vnbselected", + "vnbselected", __FILE__, VNbSelected, group); + theCommands.Add("vantialiasing", + "vantialiasing 1|0", + __FILE__,VAntialiasing,group); + theCommands.Add ("vpurgedisplay", + "vpurgedisplay [CollectorToo = 0|1]" + "- removes structures which don't belong to objects displayed in neutral point", + __FILE__, VPurgeDisplay, group); + theCommands.Add("vsetviewsize", + "vsetviewsize size", + __FILE__,VSetViewSize,group); + theCommands.Add("vmoveview", + "vmoveview Dx Dy Dz [Start = 1|0]", + __FILE__,VMoveView,group); + theCommands.Add("vtranslateview", + "vtranslateview Dx Dy Dz [Start = 1|0)]", + __FILE__,VTranslateView,group); + theCommands.Add("vturnview", + "vturnview Ax Ay Az [Start = 1|0]", + __FILE__,VTurnView,group); } diff --git a/tests/bugs/modalg/bug397 b/tests/bugs/modalg/bug397 index 005092f46d..63aed4de49 100755 --- a/tests/bugs/modalg/bug397 +++ b/tests/bugs/modalg/bug397 @@ -25,8 +25,7 @@ if { ${stat} != 1 } { puts "Error : Shading is missing in 3D Viewer" } -QASelect 220 170 -QASelect 220 170 +vselect 220 170 set square 92.9029 set only_screen 1 diff --git a/tests/bugs/modalg/bug625 b/tests/bugs/modalg/bug625 index 49f765c456..ddb3607f67 100755 --- a/tests/bugs/modalg/bug625 +++ b/tests/bugs/modalg/bug625 @@ -24,8 +24,6 @@ vdisplay result vfit vsetdispmode result 1 -QAUpdateLights - set x_coord 116 set y_coord 252 diff --git a/tests/bugs/modalg/bug794 b/tests/bugs/modalg/bug794 index dcbbebcb76..b840b8e330 100755 --- a/tests/bugs/modalg/bug794 +++ b/tests/bugs/modalg/bug794 @@ -20,7 +20,6 @@ vinit vdisplay result vsetdispmode 1 vfit -QAUpdateLights checkcolor $x_coord $y_coord 0.77 0.54 0.09 diff --git a/tests/bugs/modalg/bug895 b/tests/bugs/modalg/bug895 index a015c8f192..2d2edccf50 100755 --- a/tests/bugs/modalg/bug895 +++ b/tests/bugs/modalg/bug895 @@ -40,13 +40,11 @@ if { ${status} == 0} { vsetdispmode 1 vdisplay result - QASetViewCharac ${scale} ${center_X} ${center_Y} \ + vviewparams ${scale} ${center_X} ${center_Y} \ ${proj_X} ${proj_Y} ${proj_Z} \ ${up_X} ${up_Y} ${up_Z} \ ${at_X} ${at_Y} ${at_Z} - QAUpdateLights - checkcolor $x_coord $y_coord 0.98 0.72 0.13 if { ${stat} != 1 } { diff --git a/tests/bugs/moddata/bug20 b/tests/bugs/moddata/bug20 index 2552e98f0c..b9f4dc0911 100755 --- a/tests/bugs/moddata/bug20 +++ b/tests/bugs/moddata/bug20 @@ -18,7 +18,7 @@ vinit vdisplay result vsetdispmode result 1 -QASetViewCharac 5.1346924 95.358439 -4.910448 0.23495967 -0.302 0.923899 -0.7304302 0.5722587 0.372815 9.550874 -7.55706 -28.83166 +vviewparams 5.1346924 95.358439 -4.910448 0.23495967 -0.302 0.923899 -0.7304302 0.5722587 0.372815 9.550874 -7.55706 -28.83166 isos result 0 triangles result diff --git a/tests/bugs/moddata/bug332 b/tests/bugs/moddata/bug332 index f6e31f60fd..82893296a6 100755 --- a/tests/bugs/moddata/bug332 +++ b/tests/bugs/moddata/bug332 @@ -20,7 +20,7 @@ checkshape gasSolid_ vinit vdisplay wallSolid_ vdisplay gasSolid_ -QAvzfit +vzfit explode wallSolid_ w diff --git a/tests/bugs/vis/buc60547 b/tests/bugs/vis/buc60547 index 5e7081530f..f74f2a670a 100755 --- a/tests/bugs/vis/buc60547 +++ b/tests/bugs/vis/buc60547 @@ -12,7 +12,6 @@ puts "=========================" vinit BUC60547 f vfit -QAUpdateLights set x_coord 290 set y_coord 33 diff --git a/tests/bugs/vis/buc60574 b/tests/bugs/vis/buc60574 index fdecb787df..936491c57a 100755 --- a/tests/bugs/vis/buc60574 +++ b/tests/bugs/vis/buc60574 @@ -17,9 +17,7 @@ puts "==================================" vinit BUC60574 -QASelect 220 210 -QASelect 220 210 -QAUpdateLights +vselect 220 210 puts "" set x_coord 205 diff --git a/tests/bugs/vis/buc60587 b/tests/bugs/vis/buc60587 index d5f3479a62..4da6b73ab8 100755 --- a/tests/bugs/vis/buc60587 +++ b/tests/bugs/vis/buc60587 @@ -14,8 +14,7 @@ vinit vdisplay result vfit vsetdispmode 1 -QASelect 180 180 -QASelect 180 180 +vselect 180 180 vsetcolor result CYAN3 set x_coord 120 diff --git a/tests/bugs/vis/buc60614 b/tests/bugs/vis/buc60614 index a469365c4d..c92bed3a5a 100755 --- a/tests/bugs/vis/buc60614 +++ b/tests/bugs/vis/buc60614 @@ -9,8 +9,7 @@ box b 10 30 50 compound b c vinit BUC60614 c -QAMoveTo 200 200 -QAMoveTo 200 200 +vmoveto 200 200 vfit set only_screen 1 diff --git a/tests/bugs/vis/buc60632_1 b/tests/bugs/vis/buc60632_1 index a24fa58c63..de769e641d 100755 --- a/tests/bugs/vis/buc60632_1 +++ b/tests/bugs/vis/buc60632_1 @@ -14,8 +14,7 @@ puts "================" vinit BUC60632 0 100 vfit -QAMoveTo 313 254 -QAMoveTo 313 254 +vmoveto 313 254 puts "Highlighting by 'Move To' command in wireframe mode" set x_coord 315 diff --git a/tests/bugs/vis/buc60632_2 b/tests/bugs/vis/buc60632_2 index f4831a7ad7..dddbbae524 100755 --- a/tests/bugs/vis/buc60632_2 +++ b/tests/bugs/vis/buc60632_2 @@ -14,8 +14,7 @@ puts "================" vinit BUC60632 1 100 vfit -QAMoveTo 313 254 -QAMoveTo 313 254 +vmoveto 313 254 puts "Highlighting by 'Move To' command in shading mode" set x_coord 315 diff --git a/tests/bugs/vis/buc60688 b/tests/bugs/vis/buc60688 index cfb683a24d..03afec74c5 100755 --- a/tests/bugs/vis/buc60688 +++ b/tests/bugs/vis/buc60688 @@ -18,9 +18,7 @@ wire w_1 e_1 e_2 e_3 e_4 mkplane r w_1 vdisplay r vfit -QASelect 120 21 -QASelect 120 21 -QAUpdateLights +vselect 120 21 puts "WARNING : The rectangular MUST be highlighted !" puts "" diff --git a/tests/bugs/vis/buc60738 b/tests/bugs/vis/buc60738 index 0c2d154952..37cc8ef1a4 100755 --- a/tests/bugs/vis/buc60738 +++ b/tests/bugs/vis/buc60738 @@ -21,7 +21,6 @@ BUC60738 vfit vsetdispmode 1 -QAUpdateLights set x_coord 261 set y_coord 314 diff --git a/tests/bugs/vis/buc60740 b/tests/bugs/vis/buc60740 index e79c9d4e93..b47ffca91d 100755 --- a/tests/bugs/vis/buc60740 +++ b/tests/bugs/vis/buc60740 @@ -18,7 +18,6 @@ vsettransparency c 0.5 set x_coord 154 set y_coord 257 -QAUpdateLights checkcolor $x_coord $y_coord 0.6 0.4 0.07 diff --git a/tests/bugs/vis/buc60814 b/tests/bugs/vis/buc60814 index 730c549040..41b9067ac3 100755 --- a/tests/bugs/vis/buc60814 +++ b/tests/bugs/vis/buc60814 @@ -6,7 +6,6 @@ puts "" vinit BUC60814 vfit -QAUpdateLights set x_coord 131 set y_coord 352 diff --git a/tests/bugs/vis/buc60876 b/tests/bugs/vis/buc60876 index 4fb521670c..d0d737087a 100755 --- a/tests/bugs/vis/buc60876 +++ b/tests/bugs/vis/buc60876 @@ -7,10 +7,7 @@ pcylinder c 100 300 vinit BUC60876 c vfit -QAMoveTo 200 200 -QAMoveTo 200 200 - -QAUpdateLights +vmoveto 200 200 set x_coord 200 set y_coord 200 diff --git a/tests/bugs/vis/buc60920 b/tests/bugs/vis/buc60920 index 03ddc39b5f..f64bc774ad 100755 --- a/tests/bugs/vis/buc60920 +++ b/tests/bugs/vis/buc60920 @@ -12,7 +12,6 @@ vinit BUC60920 vfit -QAUpdateLights set x_coord 315 set y_coord 210 diff --git a/tests/bugs/vis/bug10702 b/tests/bugs/vis/bug10702 index 93f7f0e0fa..0d2023ff0a 100755 --- a/tests/bugs/vis/bug10702 +++ b/tests/bugs/vis/bug10702 @@ -22,25 +22,22 @@ set y_coord 260 meshdispmode m 2 puts "\nMesh displayed in shading mode" -QAUpdateLights checkcolor $x_coord $y_coord 0 0 0.36 meshselmode m 8 puts "\nSelection of elements is activated" -QAShiftSelect $x_coord $y_coord -###QAShiftSelect $x_coord $y_coord +vselect $x_coord $y_coord 1 +###vselect $x_coord $y_coord 1 meshhidesel m puts "\nSelected elemement is hidden" -QAUpdateLights checkcolor $x_coord $y_coord 0 0 0.36 nodalcolor_id m puts "\nDisplay nodal color presentation" -QAUpdateLights checkcolor $x_coord $y_coord 0.46 0.12 0.37 set only_screen 1 diff --git a/tests/bugs/vis/bug10781 b/tests/bugs/vis/bug10781 index 6a50f63413..730f237316 100755 --- a/tests/bugs/vis/bug10781 +++ b/tests/bugs/vis/bug10781 @@ -15,15 +15,12 @@ meshfromstl m [locate_data_file OMF6391_box.stl] set x_coord 210 set y_coord 280 -QAMoveTo $x_coord $y_coord -QAMoveTo $x_coord $y_coord -QAUpdateLights +vmoveto $x_coord $y_coord checkcolor $x_coord $y_coord 0 0 0 mesh_edge_width m 20 puts "\nSet big mesh edge width" -QAUpdateLights checkcolor $x_coord $y_coord 1 1 1 diff --git a/tests/bugs/vis/bug11095 b/tests/bugs/vis/bug11095 index 5cb9a65d9a..1914bbf9ef 100755 --- a/tests/bugs/vis/bug11095 +++ b/tests/bugs/vis/bug11095 @@ -19,8 +19,7 @@ set RED_R1 0 set GREEN_R1 0 set BLUE_R1 0 -QAMoveTo $x_coord $y_coord -QAMoveTo $x_coord $y_coord +vmoveto $x_coord $y_coord meshdispmode m 3 puts "\nSet shrinked display mode\n" diff --git a/tests/bugs/vis/bug112 b/tests/bugs/vis/bug112 index 6ac758cd70..e675636469 100755 --- a/tests/bugs/vis/bug112 +++ b/tests/bugs/vis/bug112 @@ -17,7 +17,6 @@ vinit vdisplay result vfit vsetdispmode result 1 -QAUpdateLights checkcolor $x_coord $y_coord 0.77 0.54 0.9 diff --git a/tests/bugs/vis/bug113 b/tests/bugs/vis/bug113 old mode 100644 new mode 100755 index 18902499bd..8985c0cab3 --- a/tests/bugs/vis/bug113 +++ b/tests/bugs/vis/bug113 @@ -32,38 +32,31 @@ vdisplay b_1 vdisplay b_2 vfit -QAUpdateLights - # Check face color checkcolor ${X_01} ${Y_01} 0 1 0 checkcolor ${X_02} ${Y_02} 0 1 0 # Select faces -QAAddOrRemoveSelected b_1 -QAAddOrRemoveSelected b_2 +vchangeselected b_1 +vchangeselected b_2 # Check face color -QAUpdateLights checkcolor ${X_01} ${Y_01} 0.8 0.8 0.8 -QAUpdateLights checkcolor ${X_02} ${Y_02} 0.8 0.8 0.8 # Hilight face -QAMoveTo ${X_01} ${Y_01} -QAMoveTo ${X_01} ${Y_01} +vmoveto ${X_01} ${Y_01} # Check face color -QAUpdateLights -QASelect 10 10 -QAMoveTo ${X_01} ${Y_01} +vselect 10 10 +vmoveto ${X_01} ${Y_01} checkcolor ${X_01} ${Y_01} 0 1 1 -QAUpdateLights -QAMoveTo ${X_02} ${Y_02} +vmoveto ${X_02} ${Y_02} checkcolor ${X_02} ${Y_02} 0 1 1 # Rotation -QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} +vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} set only_screen 1 diff --git a/tests/bugs/vis/bug11615 b/tests/bugs/vis/bug11615 index 97d7561467..c13f0d135c 100755 --- a/tests/bugs/vis/bug11615 +++ b/tests/bugs/vis/bug11615 @@ -13,12 +13,10 @@ vinit vdisplay b vfit vscale 1 1 1 -QAUpdateLights set x1 [list 165 340 70] set y1 [list 384 283 79] -QAUpdateLights puts "" for {set i 0} {$i < 3} {incr i} { set x_coord [lindex ${x1} $i] @@ -29,12 +27,10 @@ for {set i 0} {$i < 3} {incr i} { vscale 0.5 1.5 0.7 vfit -QAUpdateLights set x2 [list 80 390 25] set y2 [list 390 218 167] -QAUpdateLights puts "" for {set i 0} {$i < 3} {incr i} { set x_coord [lindex ${x2} $i] diff --git a/tests/bugs/vis/bug1174 b/tests/bugs/vis/bug1174 old mode 100644 new mode 100755 index fdfe97da34..4afae8ebaa --- a/tests/bugs/vis/bug1174 +++ b/tests/bugs/vis/bug1174 @@ -32,7 +32,7 @@ set at_X -27.258 set at_Y 30.2321 set at_Z -9.0201 -QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} +vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} set x_GREEN 300 set y_GREEN 180 @@ -40,8 +40,6 @@ set y_GREEN 180 set x_BLUE 180 set y_BLUE 250 -QAUpdateLights - set ColorList1 [QAGetPixelColor ${x_GREEN} ${y_GREEN}] regexp {RED +: +([-0-9.+eE]+)} $ColorList1 full RED_1 regexp {GREEN +: +([-0-9.+eE]+)} $ColorList1 full GREEN_1 @@ -71,4 +69,3 @@ if {${IsGreen} == 1 && ${IsBlue} == 1} { } set only_screen 1 - diff --git a/tests/bugs/vis/bug1188 b/tests/bugs/vis/bug1188 old mode 100644 new mode 100755 index c2d2e47a95..2944929983 --- a/tests/bugs/vis/bug1188 +++ b/tests/bugs/vis/bug1188 @@ -11,7 +11,6 @@ vinit OCC1188 [locate_data_file OCC1188.gif] -QAUpdateLights checkcolor $x $y 0.99 0.99 0.99 if { ${stat} != 1} { puts "OCC1188: Error" diff --git a/tests/bugs/vis/bug128 b/tests/bugs/vis/bug128 index 801c7a716b..e058174a67 100755 --- a/tests/bugs/vis/bug128 +++ b/tests/bugs/vis/bug128 @@ -10,8 +10,7 @@ set y_coord 171 vinit OCC128 -QASetViewCharac 4.9487928 89.23589 4.1505 0.7329295 0.59461397 0.33052679 -0.536849 0.2071041 0.81786 71.971878 -17.250309 33.509651 -QAUpdateLights +vviewparams 4.9487928 89.23589 4.1505 0.7329295 0.59461397 0.33052679 -0.536849 0.2071041 0.81786 71.971878 -17.250309 33.509651 checkcolor $x_coord $y_coord 0.43 0.48 0.54 diff --git a/tests/bugs/vis/bug137_1 b/tests/bugs/vis/bug137_1 index 9075400a8c..49d8dabfc2 100755 --- a/tests/bugs/vis/bug137_1 +++ b/tests/bugs/vis/bug137_1 @@ -33,10 +33,7 @@ OCC137 1 set x_coord 105 set y_coord 100 -QAMoveTo $x_coord $y_coord -QAMoveTo $x_coord $y_coord - -QAUpdateLights +vmoveto $x_coord $y_coord checkcolor $x_coord $y_coord 0 1 1 diff --git a/tests/bugs/vis/bug137_10 b/tests/bugs/vis/bug137_10 old mode 100644 new mode 100755 index a7aeff62f3..2318e9cc0e --- a/tests/bugs/vis/bug137_10 +++ b/tests/bugs/vis/bug137_10 @@ -25,10 +25,9 @@ vdisplay a vfit vsetdispmode 1 -QASetChoiceMode FACE ON +vselmode FACE ON set x 170 set y 80 -QASelect $x $y -QASelect $x $y +vselect $x $y set only_screen 1 diff --git a/tests/bugs/vis/bug137_11 b/tests/bugs/vis/bug137_11 old mode 100644 new mode 100755 index 909962ecd5..d03de52b8b --- a/tests/bugs/vis/bug137_11 +++ b/tests/bugs/vis/bug137_11 @@ -25,10 +25,9 @@ vdisplay a vfit vsetdispmode 1 -QASetChoiceMode FACE ON +vselmode FACE ON set x 170 set y 80 -QASelect $x $y -QASelect $x $y +vselect $x $y set only_screen 1 diff --git a/tests/bugs/vis/bug137_2 b/tests/bugs/vis/bug137_2 index 0e9c488e75..dc9ef02f3a 100755 --- a/tests/bugs/vis/bug137_2 +++ b/tests/bugs/vis/bug137_2 @@ -37,10 +37,7 @@ OCC137 1 set x_coord 105 set y_coord 100 -QAMoveTo $x_coord $y_coord -QAMoveTo $x_coord $y_coord - -QAUpdateLights +vmoveto $x_coord $y_coord checkcolor $x_coord $y_coord 0 1 1 diff --git a/tests/bugs/vis/bug137_3 b/tests/bugs/vis/bug137_3 index 2f565a8a1e..bb25275125 100755 --- a/tests/bugs/vis/bug137_3 +++ b/tests/bugs/vis/bug137_3 @@ -37,9 +37,7 @@ vselmode 4 1 set x_coord 105 set y_coord 100 -QAMoveTo $x_coord $y_coord -QAMoveTo $x_coord $y_coord -QAUpdateLights +vmoveto $x_coord $y_coord checkcolor $x_coord $y_coord 0 1 1 diff --git a/tests/bugs/vis/bug137_4 b/tests/bugs/vis/bug137_4 index 48fe476ce7..07d9359725 100755 --- a/tests/bugs/vis/bug137_4 +++ b/tests/bugs/vis/bug137_4 @@ -38,9 +38,7 @@ OCC137_z set x_coord 105 set y_coord 350 -QAMoveTo $x_coord $y_coord -QAMoveTo $x_coord $y_coord -QAUpdateLights +vmoveto $x_coord $y_coord set x_coord 105 set y_coord 340 @@ -49,7 +47,7 @@ checkcolor $x_coord $y_coord 0 1 1 set x_coord 105 set y_coord 340 -QASetViewCharac 60.6309 7.07107 4.08248 0.592163 -0.60038 -0.537482 0.369921 -0.390032 0.843228 -3.28175 3.38875 3.0464 +vviewparams 60.6309 7.07107 4.08248 0.592163 -0.60038 -0.537482 0.369921 -0.390032 0.843228 -3.28175 3.38875 3.0464 checkcolor $x_coord $y_coord 0.78 0.54 0.09 diff --git a/tests/bugs/vis/bug137_5 b/tests/bugs/vis/bug137_5 index 74139b32a9..ac953126bf 100755 --- a/tests/bugs/vis/bug137_5 +++ b/tests/bugs/vis/bug137_5 @@ -38,16 +38,14 @@ vselmode 4 1 set x_coord 105 set y_coord 350 -QAMoveTo $x_coord $y_coord -QAMoveTo $x_coord $y_coord -QAUpdateLights +vmoveto $x_coord $y_coord set x_coord 105 set y_coord 340 checkcolor $x_coord $y_coord 0 1 1 -QASetViewCharac 60.6309 7.07107 4.08248 0.592163 -0.60038 -0.537482 0.369921 -0.390032 0.843228 -3.28175 3.38875 3.0464 +vviewparams 60.6309 7.07107 4.08248 0.592163 -0.60038 -0.537482 0.369921 -0.390032 0.843228 -3.28175 3.38875 3.0464 set x_coord 105 set y_coord 340 diff --git a/tests/bugs/vis/bug137_9 b/tests/bugs/vis/bug137_9 old mode 100644 new mode 100755 index 4064e99b9b..68cc5f3649 --- a/tests/bugs/vis/bug137_9 +++ b/tests/bugs/vis/bug137_9 @@ -22,10 +22,9 @@ vdisplay a vfit vsetdispmode 1 -QASetChoiceMode FACE ON +vselmode FACE ON set x 170 set y 80 -QASelect $x $y -QASelect $x $y +vselect $x $y set only_screen 1 diff --git a/tests/bugs/vis/bug173_1 b/tests/bugs/vis/bug173_1 index dcc9f0e6fd..6dcfd86af7 100755 --- a/tests/bugs/vis/bug173_1 +++ b/tests/bugs/vis/bug173_1 @@ -20,8 +20,6 @@ vsetdispmode result 1 set x_coord 175 set y_coord 195 -QAUpdateLights - checkcolor $x_coord $y_coord 1 0.75 0.15 if { $stat != 1 } { @@ -31,8 +29,6 @@ if { $stat != 1 } { ######################################################## vsetmaterial result COPPER -QAUpdateLights - checkcolor $x_coord $y_coord 0.77 0.32 0.23 if { $stat != 1 } { diff --git a/tests/bugs/vis/bug173_2 b/tests/bugs/vis/bug173_2 index fcc6bbb0bc..2c6a746942 100755 --- a/tests/bugs/vis/bug173_2 +++ b/tests/bugs/vis/bug173_2 @@ -24,7 +24,6 @@ regexp {BLUE +: +([-0-9.+eE]+)} $color1 full bl1 vsetmaterial result ALUMINIUM -QAUpdateLights set color2 [QAGetPixelColor 175 195] regexp {RED +: +([-0-9.+eE]+)} $color2 full rd2 regexp {GREEN +: +([-0-9.+eE]+)} $color2 full gr2 diff --git a/tests/bugs/vis/bug173_3 b/tests/bugs/vis/bug173_3 index f99919b26a..bca8b0e07c 100755 --- a/tests/bugs/vis/bug173_3 +++ b/tests/bugs/vis/bug173_3 @@ -26,7 +26,6 @@ regexp {BLUE +: +([-0-9.+eE]+)} $color1 full bl1 ######################################################## vsettransparency result 0.5 -QAUpdateLights set color2 [QAGetPixelColor 175 195] regexp {RED +: +([-0-9.+eE]+)} $color2 full rd2 regexp {GREEN +: +([-0-9.+eE]+)} $color2 full gr2 diff --git a/tests/bugs/vis/bug185 b/tests/bugs/vis/bug185 index 1d72e5ca70..c75e15277f 100755 --- a/tests/bugs/vis/bug185 +++ b/tests/bugs/vis/bug185 @@ -17,7 +17,6 @@ set x_coord 235 set y_coord 214 vsetdispmode result 1 -QAUpdateLights checkcolor $x_coord $y_coord 0.78 0.55 0.9 @@ -27,8 +26,6 @@ if { $stat != 1 } { vsetdispmode result 0 -QAUpdateLights - checkcolor $x_coord $y_coord 0 1 0 if { $stat != 1 } { diff --git a/tests/bugs/vis/bug2066 b/tests/bugs/vis/bug2066 old mode 100644 new mode 100755 index a7931331eb..1c7ddc1c5d --- a/tests/bugs/vis/bug2066 +++ b/tests/bugs/vis/bug2066 @@ -14,7 +14,7 @@ vfit verase b set CollectorToo 1 -if [catch {QAPurgeDisplay $CollectorToo} result] { +if [catch {vpurgedisplay $CollectorToo} result] { puts "Faulty OCC2066" } else { puts "OK OCC2066" diff --git a/tests/bugs/vis/bug215 b/tests/bugs/vis/bug215 index 04bec5bb56..6429417877 100755 --- a/tests/bugs/vis/bug215 +++ b/tests/bugs/vis/bug215 @@ -23,7 +23,7 @@ set at_X -5.88607025146484 set at_Y 28.6973209381104 set at_Z -12.5332689285278 -QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} +vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} set x_coord 229 set y_coord 94 diff --git a/tests/bugs/vis/bug218 b/tests/bugs/vis/bug218 index fd56661c97..0f24ecbe3c 100755 --- a/tests/bugs/vis/bug218 +++ b/tests/bugs/vis/bug218 @@ -25,15 +25,13 @@ set at_Z -0.0881031528115273 set x_coord 388 set y_coord 28 -QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} +vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} OCC218 trihedron1 b_1 X Y -QAUpdateLights checkcolor $x_coord $y_coord 0 0 0 OCC218 trihedron1 b_1 my___axis___1 my___axis2 -QAUpdateLights checkcolor $x_coord $y_coord 0.85 0.85 0 diff --git a/tests/bugs/vis/bug223 b/tests/bugs/vis/bug223 old mode 100644 new mode 100755 index c81c62338e..643113f55f --- a/tests/bugs/vis/bug223 +++ b/tests/bugs/vis/bug223 @@ -28,7 +28,6 @@ vsetcolor face GREEN1 vsetdispmode cylinder 1 vsetcolor cylinder RED1 -QAUpdateLights set ColorList [QAGetPixelColor $Start_X $Start_Y] regexp {RED +: +([-0-9.+eE]+)} $ColorList full R_START_POINT regexp {GREEN +: +([-0-9.+eE]+)} $ColorList full G_START_POINT @@ -38,7 +37,6 @@ puts "R_START_POINT=$R_START_POINT ; G_START_POINT=$G_START_POINT ; B_START_ set IsGood 1 for {set count 0} {${count} <= 11} {incr count 1} { - QAUpdateLights checkcolor $Start_X $Start_Y $R_START_POINT $G_START_POINT $B_START_POINT if {$stat != 1} { set IsGood 0 diff --git a/tests/bugs/vis/bug232 b/tests/bugs/vis/bug232 index 405a041105..8bb8dee270 100755 --- a/tests/bugs/vis/bug232 +++ b/tests/bugs/vis/bug232 @@ -47,8 +47,7 @@ catch {QAGetPixelColor $x6 $y6 $Yellow_R $Yellow_G $Yellow_B} result16 # Move a mouse puts "Move a mouse" -QAMoveTo $x2 $y2 -QAMoveTo $x2 $y2 +vmoveto $x2 $y2 # Second box of first CompSolid is selected puts "Second box of first CompSolid is selected" @@ -62,7 +61,6 @@ if { [array get env os_type] != "" } { set os $env(os_type) } if { [string compare $os "windows"] != 0 } { - QAUpdateLights catch {QAGetPixelColor $x2 $y2 $Cyan_R $Cyan_G $Cyan_B} result31 } diff --git a/tests/bugs/vis/bug23539_1 b/tests/bugs/vis/bug23539_1 new file mode 100644 index 0000000000..fb04b5f18a --- /dev/null +++ b/tests/bugs/vis/bug23539_1 @@ -0,0 +1,28 @@ +puts "============" +puts "CR23539" +puts "============" +puts "" +###################################################### +# Test case for polygonal selection +###################################################### + +box b 10 10 10 +vinit +vdisplay b +vfit +vselmode 2 1 +vselect 1 1 1 407 407 407 407 1 + +set NbSelected1 [vnbselected] +if { ${NbSelected1} != 12 } { + puts "Error : Bad number of selected edges after polygonal selection of all edges" +} + +vselect 10 10 10 20 20 20 20 10 + +set NbSelected2 [vnbselected] +if { ${NbSelected2} != 0 } { + puts "Error : Bad number of selected edges after polyginal selection of empty space" +} + +set only_screen 1 \ No newline at end of file diff --git a/tests/bugs/vis/bug23539_2 b/tests/bugs/vis/bug23539_2 new file mode 100644 index 0000000000..c4769d0fb5 --- /dev/null +++ b/tests/bugs/vis/bug23539_2 @@ -0,0 +1,31 @@ +puts "============" +puts "CR23539" +puts "============" +puts "" +############################# +## Test case for polygonal shift selection +############################# + +box a 10 10 10 +box b 50 50 50 10 10 10 +vinit +vdisplay a b +vfit +vselmode 2 1 +vselect 0 0 +vselect 60 300 +vselect 300 200 300 60 400 60 407 150 1 + +set NbSelected1 [vnbselected] +if { ${NbSelected1} != 13 } { + puts "Error : Polygonal shift selection doesn't work properly" +} + +vselect 350 120 1 + +set NbSelected1 [vnbselected] +if { ${NbSelected1} != 12 } { + puts "Error : (case 2)" +} + +set only_screen 1 \ No newline at end of file diff --git a/tests/bugs/vis/bug23652 b/tests/bugs/vis/bug23652 index 7c638215ca..fd172cd845 100755 --- a/tests/bugs/vis/bug23652 +++ b/tests/bugs/vis/bug23652 @@ -24,7 +24,7 @@ set at_X 0 set at_Y 0 set at_Z 0 -QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} +vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} set x_coord 36 set y_coord 201 @@ -32,5 +32,3 @@ set y_coord 201 checkcolor $x_coord $y_coord 0.6 0.6 0.6 set only_screen 1 - - diff --git a/tests/bugs/vis/bug270_1 b/tests/bugs/vis/bug270_1 old mode 100644 new mode 100755 index 6f86447e8f..095fc2bd48 --- a/tests/bugs/vis/bug270_1 +++ b/tests/bugs/vis/bug270_1 @@ -12,16 +12,14 @@ vsetdispmode 1 set x1 172 set y1 223 -QAUpdateLights checkcolor ${x1} ${y1} 1 0 0 -QASetZClippingMode FRONT -set ZClippingMode [lindex [QAGetZClippingMode] 2] +vzclipping FRONT +set ZClippingMode [lindex [vzclipping] 2] if {${ZClippingMode} != "FRONT"} { puts "OCC270: Error (ZClippingMode != FRONT)" } -QAUpdateLights checkcolor ${x1} ${y1} 1 0 0 vfit diff --git a/tests/bugs/vis/bug270_2 b/tests/bugs/vis/bug270_2 old mode 100644 new mode 100755 index 1fbe12488e..b09acdd806 --- a/tests/bugs/vis/bug270_2 +++ b/tests/bugs/vis/bug270_2 @@ -12,16 +12,14 @@ vsetdispmode 0 set x1 172 set y1 223 -QAUpdateLights checkcolor ${x1} ${y1} 1 0 0 -QASetZClippingMode FRONT -set ZClippingMode [lindex [QAGetZClippingMode] 2] +vzclipping FRONT +set ZClippingMode [lindex [vzclipping] 2] if {${ZClippingMode} != "FRONT"} { puts "OCC270: Error (ZClippingMode != FRONT)" } -QAUpdateLights checkcolor ${x1} ${y1} 1 0 0 vfit diff --git a/tests/bugs/vis/bug280_2 b/tests/bugs/vis/bug280_2 index e516ded0ee..dd56ccd695 100755 --- a/tests/bugs/vis/bug280_2 +++ b/tests/bugs/vis/bug280_2 @@ -21,10 +21,7 @@ checkcolor $x_coord $y_coord 1 1 0 # Move a mouse puts "Move a mouse" -QAMoveTo $x_coord $y_coord -QAMoveTo $x_coord $y_coord - -QAUpdateLights +vmoveto $x_coord $y_coord # There is a selection puts "There is a selection" diff --git a/tests/bugs/vis/bug280_3 b/tests/bugs/vis/bug280_3 index 390a184614..d7f8977d88 100755 --- a/tests/bugs/vis/bug280_3 +++ b/tests/bugs/vis/bug280_3 @@ -14,14 +14,12 @@ set x_coord 10 set y_coord 240 puts "Before View->FitAll()" -QAUpdateLights checkcolor $x_coord $y_coord 0 0 0 vfit puts "After View->FitAll()" -QAUpdateLights checkcolor $x_coord $y_coord 0.78 0.55 0.9 diff --git a/tests/bugs/vis/bug281_1 b/tests/bugs/vis/bug281_1 old mode 100644 new mode 100755 index fc680ed1c3..85fd2f001f --- a/tests/bugs/vis/bug281_1 +++ b/tests/bugs/vis/bug281_1 @@ -21,7 +21,7 @@ set at_X 0 set at_Y 0 set at_Z 0 -QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} +vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} OCC281 ${x} ${y} ${TypeOfMarker} OCC281 ${x} ${y} ${TypeOfMarker} diff --git a/tests/bugs/vis/bug319 b/tests/bugs/vis/bug319 index 0d2aefda4e..6ec9b5ef9b 100755 --- a/tests/bugs/vis/bug319 +++ b/tests/bugs/vis/bug319 @@ -37,7 +37,7 @@ set at_X 8.22575855255127 set at_Y -2.95449280738831 set at_Z 3.08669567108154 -QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} +vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} set info [trinfo result] regexp { +([-0-9.+eE]+) +triangles} $info full tri diff --git a/tests/bugs/vis/bug349 b/tests/bugs/vis/bug349 old mode 100644 new mode 100755 index bd2f4f3469..76abf42759 --- a/tests/bugs/vis/bug349 +++ b/tests/bugs/vis/bug349 @@ -86,7 +86,6 @@ set y12 284 # # -QAUpdateLights checkcolor ${x1} ${y1} 1 1 0 checkcolor ${x2} ${y2} 1 1 0 checkcolor ${x3} ${y3} 1 1 0 diff --git a/tests/bugs/vis/bug362 b/tests/bugs/vis/bug362 old mode 100644 new mode 100755 index bb9b8f12ac..fff62e2298 --- a/tests/bugs/vis/bug362 +++ b/tests/bugs/vis/bug362 @@ -6,5 +6,4 @@ puts "========" smallview box b 10 10 10 sphere s -30 -30 -30 20 -QAwzoom 1 -86 -72 -13 10 - +wzoom 1 -86 -72 -13 10 diff --git a/tests/bugs/vis/bug443 b/tests/bugs/vis/bug443 index 0461af9413..388478382b 100755 --- a/tests/bugs/vis/bug443 +++ b/tests/bugs/vis/bug443 @@ -15,8 +15,6 @@ vfit set x_coord 31 set y_coord 304 -QAUpdateLights - checkcolor $x_coord $y_coord 0 0 0 set only_screen 1 diff --git a/tests/bugs/vis/bug544 b/tests/bugs/vis/bug544 old mode 100644 new mode 100755 index a5f2ecdf06..f865077ae5 --- a/tests/bugs/vis/bug544 +++ b/tests/bugs/vis/bug544 @@ -29,7 +29,7 @@ set at_X 241.985 set at_Y 329.911 set at_Z 390.356 -QASetViewCharac ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} +vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z} set x1 300 set y1 70 @@ -40,11 +40,8 @@ set y2 110 set x3 220 set y3 110 -QAMoveTo ${x1} ${y1} -QAMoveTo ${x1} ${y1} +vmoveto ${x1} ${y1} -QAUpdateLights checkcolor $x3 $y3 0.04 0.04 0.5 set only_screen 1 - diff --git a/tests/bugs/vis/bug591 b/tests/bugs/vis/bug591 index c2ff934634..0e1792045f 100755 --- a/tests/bugs/vis/bug591 +++ b/tests/bugs/vis/bug591 @@ -11,7 +11,6 @@ vfit vsetdispmode result 1 vsettransparency result .5 -QAUpdateLights set x_coord 250 set y_coord 115 diff --git a/tests/bugs/vis/bug597_1 b/tests/bugs/vis/bug597_1 index cce24f1aaa..8f807f4a87 100755 --- a/tests/bugs/vis/bug597_1 +++ b/tests/bugs/vis/bug597_1 @@ -22,9 +22,7 @@ checkshape result BUC60569 result vfit -QAMoveTo 250 190 -QASelect 250 190 -QAUpdateLights +vselect 250 190 set x_coord 335 set y_coord 331 @@ -35,8 +33,7 @@ if {$stat != 1} { puts "Error : The right face is NOT Selected by Select command." } -QAShiftSelect 180 350 -QAUpdateLights +vselect 180 350 1 set x_coord 101 set y_coord 347 diff --git a/tests/bugs/vis/bug597_2 b/tests/bugs/vis/bug597_2 index 361e55bca6..377e28e79f 100755 --- a/tests/bugs/vis/bug597_2 +++ b/tests/bugs/vis/bug597_2 @@ -23,11 +23,9 @@ checkshape result BUC60569 result vfit -QAMoveTo 250 190 -QASelect 250 190 -QAShiftSelect 180 350 -QAMoveTo 250 190 -QAUpdateLights +vselect 250 190 +vselect 180 350 1 +vmoveto 250 190 set x_coord 335 set y_coord 331 diff --git a/tests/bugs/vis/bug597_3 b/tests/bugs/vis/bug597_3 index aa3430f5e9..2148c26f04 100755 --- a/tests/bugs/vis/bug597_3 +++ b/tests/bugs/vis/bug597_3 @@ -26,12 +26,10 @@ checkshape result BUC60569 result vfit -QAMoveTo 250 190 -QASelect 250 190 -QAShiftSelect 180 350 -QAMoveTo 250 190 -QAMoveTo 180 350 -QAUpdateLights +vselect 250 190 +vselect 180 350 1 +vmoveto 250 190 +vmoveto 180 350 set x_coord 101 set y_coord 347 diff --git a/tests/bugs/vis/bug597_4 b/tests/bugs/vis/bug597_4 index 7befdc918f..64a59bb2bc 100755 --- a/tests/bugs/vis/bug597_4 +++ b/tests/bugs/vis/bug597_4 @@ -25,14 +25,12 @@ checkshape result BUC60569 result vfit -QAMoveTo 250 190 -QASelect 250 190 -QAShiftSelect 180 350 -QAMoveTo 250 190 -QAMoveTo 180 350 -QASelect 390 390 -QAUpdateLights +vselect 250 190 +vselect 180 350 1 +vmoveto 250 190 +vmoveto 180 350 +vselect 390 390 set x_coord 335 set y_coord 331 diff --git a/tests/bugs/vis/bug597_5 b/tests/bugs/vis/bug597_5 index 70f8ce6969..db2ebaf050 100755 --- a/tests/bugs/vis/bug597_5 +++ b/tests/bugs/vis/bug597_5 @@ -25,14 +25,13 @@ checkshape result BUC60569 result vfit -QAMoveTo 250 190 -QASelect 250 190 -QAShiftSelect 180 350 -QAMoveTo 250 190 -QAMoveTo 180 350 -QASelect 390 390 -QAShiftSelect 250 190 -QAUpdateLights + +vselect 250 190 +vselect 180 350 1 +vmoveto 250 190 +vmoveto 180 350 +vselect 390 390 +vselect 250 190 1 set x_coord 335 set y_coord 331 @@ -43,8 +42,7 @@ if {$stat != 1} { puts "Error : The right face is NOT Selected by Shift Select command" } -QAShiftSelect 180 350 -QAUpdateLights +vselect 180 350 1 set x_coord 101 set y_coord 347 diff --git a/tests/bugs/vis/bug597_6 b/tests/bugs/vis/bug597_6 index e8d632e169..895451a887 100755 --- a/tests/bugs/vis/bug597_6 +++ b/tests/bugs/vis/bug597_6 @@ -26,16 +26,14 @@ checkshape result BUC60569 result vfit -QAMoveTo 250 190 -QASelect 250 190 -QAShiftSelect 180 350 -QAMoveTo 250 190 -QAMoveTo 180 350 -QASelect 390 390 -QAShiftSelect 250 190 -QAShiftSelect 180 350 -QAMoveTo 250 190 -QAUpdateLights +vselect 250 190 +vselect 180 350 1 +vmoveto 250 190 +vmoveto 180 350 +vselect 390 390 +vselect 250 190 1 +vselect 180 350 1 +vmoveto 250 190 set x_coord 335 set y_coord 331 diff --git a/tests/bugs/vis/bug597_7 b/tests/bugs/vis/bug597_7 index 88a331ae94..38cf6a60fb 100755 --- a/tests/bugs/vis/bug597_7 +++ b/tests/bugs/vis/bug597_7 @@ -27,16 +27,15 @@ checkshape result BUC60569 result vfit -QAMoveTo 250 190 -QASelect 250 190 -QAShiftSelect 180 350 -QAMoveTo 250 190 -QAMoveTo 180 350 -QASelect 390 390 -QAShiftSelect 250 190 -QAShiftSelect 180 350 -QAMoveTo 250 190 -QAMoveTo 180 350 +vselect 250 190 +vselect 180 350 1 +vmoveto 250 190 +vmoveto 180 350 +vselect 390 390 +vselect 250 190 1 +vselect 180 350 1 +vmoveto 250 190 +vmoveto 180 350 set x_coord 335 set y_coord 331 diff --git a/tests/bugs/vis/bug60 b/tests/bugs/vis/bug60 old mode 100644 new mode 100755 index ec25189197..bf3cffd71b --- a/tests/bugs/vis/bug60 +++ b/tests/bugs/vis/bug60 @@ -12,7 +12,6 @@ vfit set x_coord 83 set y_coord 337 -QAUpdateLights checkcolor $x_coord $y_coord 1 1 0 set xmin 1 @@ -28,7 +27,6 @@ set Selection_R 0.8 set Selection_G 0.8 set Selection_B 0.8 -QAUpdateLights checkcolor $x_coord $y_coord 0.8 0.8 0.8 set only_screen 1 diff --git a/tests/bugs/vis/bug61 b/tests/bugs/vis/bug61 old mode 100644 new mode 100755 index 64bea8ed11..e669ccb9ef --- a/tests/bugs/vis/bug61 +++ b/tests/bugs/vis/bug61 @@ -10,7 +10,6 @@ vtrihedron trihedron set x_coord 205 set y_coord 205 -QAUpdateLights checkcolor $x_coord $y_coord 0.43 0.48 0.54 set xmin 1 @@ -22,7 +21,6 @@ set ymax 205 OCC60 ${xmin} ${ymin} ${xmax} ${ymax} OCC60 ${xmin} ${ymin} ${xmax} ${ymax} -QAUpdateLights checkcolor $x_coord $y_coord 0.8 0.8 0.8 set only_screen 1 diff --git a/tests/bugs/vis/bug6145 b/tests/bugs/vis/bug6145 index c60a6112e8..7757a12fa8 100755 --- a/tests/bugs/vis/bug6145 +++ b/tests/bugs/vis/bug6145 @@ -29,7 +29,6 @@ vinit vsetdispmode 1 vdisplay r vfit -QAUpdateLights set x_coord 270 set y_coord 230 @@ -37,7 +36,6 @@ set y_coord 230 checkcolor $x_coord $y_coord 0.78 0.55 0.09 vsettransparency r 0.5 -QAUpdateLights checkcolor $x_coord $y_coord 0.8 0.56 0.1 diff --git a/tests/bugs/vis/bug64 b/tests/bugs/vis/bug64 index 88d62fff36..af499fd043 100755 --- a/tests/bugs/vis/bug64 +++ b/tests/bugs/vis/bug64 @@ -11,8 +11,7 @@ vinit vtrihedron tri vtri_orig tri -QAMoveTo 205 205 -QAUpdateLights +vmoveto 205 205 checkcolor $x_coord $y_coord 0 1 1 diff --git a/tests/bugs/vis/bug6652 b/tests/bugs/vis/bug6652 index b573011a71..8e0a7e043b 100755 --- a/tests/bugs/vis/bug6652 +++ b/tests/bugs/vis/bug6652 @@ -14,9 +14,9 @@ meshfromstl result [locate_data_file OCC6652.stl] meshdispmode result 3 meshselmode result 8 -QASelectRectangle 5 5 400 400 +vselect 5 5 400 400 -if {[QANbSelected] != 26966} { +if {[vnbselected] != 26966} { puts "Faulty ${BugNumber}" } diff --git a/tests/bugs/vis/bug71 b/tests/bugs/vis/bug71 old mode 100644 new mode 100755 index 8fdebc1231..6670015a6f --- a/tests/bugs/vis/bug71 +++ b/tests/bugs/vis/bug71 @@ -33,8 +33,7 @@ checkcolor ${Shape_X} ${Shape_Y} 0.78 0.54 0.09 checkcolor ${Triedron_X} ${Triedron_Y} 1 1 1 # Select box -QASelect ${Shape_X} ${Shape_Y} -QASelect ${Shape_X} ${Shape_Y} +vselect ${Shape_X} ${Shape_Y} # Check box color checkcolor ${Shape_X} ${Shape_Y} 0.78 0.54 0.09 @@ -43,8 +42,7 @@ checkcolor ${Shape_X} ${Shape_Y} 0.78 0.54 0.09 checkcolor ${Triedron_X} ${Triedron_Y} 1 1 1 # Select empty view -QASelect 1 1 -QASelect 1 1 +vselect 1 1 # Check box color checkcolor ${Shape_X} ${Shape_Y} 0.78 0.54 0.09 diff --git a/tests/bugs/vis/bug7186 b/tests/bugs/vis/bug7186 index bf51b3d83b..65cf2b11a2 100755 --- a/tests/bugs/vis/bug7186 +++ b/tests/bugs/vis/bug7186 @@ -15,20 +15,19 @@ box b 10 10 10 vinit vdisplay b vfit -QAUpdateLights vselmode 2 1 -QASelectRectangle 1 1 407 407 +vselect 1 1 407 407 -set NbSelected1 [QANbSelected] +set NbSelected1 [vnbselected] if { ${NbSelected1} != 12 } { puts "Bad number of selected edges after rectangle selection all edges" set mistake 1 } -QASelectRectangle 10 10 20 20 +vselect 10 10 20 20 -set NbSelected2 [QANbSelected] +set NbSelected2 [vnbselected] if { ${NbSelected2} != 0 } { puts "Error : Bad number of selected edges after rectangle selection an empty space" set mistake 1 @@ -39,7 +38,6 @@ set x [list 125 204 283 29 111 298 379 125 204 283 125 283] set y [list 47 100 47 200 150 150 200 250 300 250 361 361] -QAUpdateLights puts "" for {set i 0} {$i < 12} {incr i} { set x_coord [lindex ${x} $i] diff --git a/tests/bugs/vis/bug727 b/tests/bugs/vis/bug727 index 6d9b1b697e..0faff0222c 100755 --- a/tests/bugs/vis/bug727 +++ b/tests/bugs/vis/bug727 @@ -19,18 +19,18 @@ set y1 300 set x2 350 set y2 120 -QASelect 0 0 -QASelect ${x1} ${y1} -QAShiftSelect ${x2} ${y2} +vselect 0 0 +vselect ${x1} ${y1} +vselect ${x2} ${y2} 1 -set NbSelected1 [QANbSelected] +set NbSelected1 [vnbselected] if { ${NbSelected1} != 2 } { puts "Error : (case 1)" } -QAShiftSelect ${x2} ${y2} +vselect ${x2} ${y2} 1 -set NbSelected1 [QANbSelected] +set NbSelected1 [vnbselected] if { ${NbSelected1} != 1 } { puts "Error : (case 2)" } diff --git a/tests/bugs/vis/bug74 b/tests/bugs/vis/bug74 old mode 100644 new mode 100755 index 2513852004..b1582aeb27 --- a/tests/bugs/vis/bug74 +++ b/tests/bugs/vis/bug74 @@ -37,8 +37,6 @@ box b 10 10 10 vdisplay b vfit -QAUpdateLights - ### FIRST PART # Check Shape color @@ -65,8 +63,7 @@ checkcolor ${Solid_X} ${Solid_Y} 1 1 0 ### SECOND PART # Check Shape color -QAMoveTo 1 1 -QAMoveTo 1 1 +vmoveto 1 1 set SetSelectMode 0 OCC74_set b ${SetSelectMode} set GetSelectMode [OCC74_get b] @@ -74,15 +71,12 @@ if { ${GetSelectMode} != ${SetSelectMode} } { puts "Select Mode = ${GetSelectMode}" puts "OCC74: Get Select Mode Error " } -QAMoveTo ${Shape_X} ${Shape_Y} -QAMoveTo ${Shape_X} ${Shape_Y} +vmoveto ${Shape_X} ${Shape_Y} -QAUpdateLights checkcolor ${Shape_X} ${Shape_Y} 0 1 1 # Check Vertex color -QAMoveTo 1 1 -QAMoveTo 1 1 +vmoveto 1 1 set SetSelectMode 1 OCC74_set b ${SetSelectMode} set GetSelectMode [OCC74_get b] @@ -90,15 +84,12 @@ if { ${GetSelectMode} != ${SetSelectMode} } then { puts "Select Mode = ${GetSelectMode}" puts "OCC74: Get Select Mode Error " } -QAMoveTo ${Vertex_X} ${Vertex_Y} -QAMoveTo ${Vertex_X} ${Vertex_Y} +vmoveto ${Vertex_X} ${Vertex_Y} -QAUpdateLights checkcolor ${Vertex_X} ${Vertex_Y} 0 1 1 # Check Edge color -QAMoveTo 1 1 -QAMoveTo 1 1 +vmoveto 1 1 set SetSelectMode 2 OCC74_set b ${SetSelectMode} set GetSelectMode [OCC74_get b] @@ -106,15 +97,12 @@ if { ${GetSelectMode} != ${SetSelectMode} } then { puts "Select Mode = ${GetSelectMode}" puts "OCC74: Get Select Mode Error " } -QAMoveTo ${Edge_X} ${Edge_Y} -QAMoveTo ${Edge_X} ${Edge_Y} +vmoveto ${Edge_X} ${Edge_Y} -QAUpdateLights checkcolor ${Edge_X} ${Edge_Y} 0 1 1 # Check Wire color -QAMoveTo 1 1 -QAMoveTo 1 1 +vmoveto 1 1 set SetSelectMode 3 OCC74_set b ${SetSelectMode} set GetSelectMode [OCC74_get b] @@ -122,15 +110,12 @@ if { ${GetSelectMode} != ${SetSelectMode} } then { puts "Select Mode = ${GetSelectMode}" puts "OCC74: Get Select Mode Error " } -QAMoveTo ${Wire_X} ${Wire_Y} -QAMoveTo ${Wire_X} ${Wire_Y} +vmoveto ${Wire_X} ${Wire_Y} -QAUpdateLights checkcolor ${Wire_X} ${Wire_Y} 0 1 1 # Check Face color -QAMoveTo 1 1 -QAMoveTo 1 1 +vmoveto 1 1 set SetSelectMode 4 OCC74_set b ${SetSelectMode} set GetSelectMode [OCC74_get b] @@ -138,15 +123,12 @@ if { ${GetSelectMode} != ${SetSelectMode} } then { puts "Select Mode = ${GetSelectMode}" puts "OCC74: Get Select Mode Error " } -QAMoveTo ${Face_X} ${Face_Y} -QAMoveTo ${Face_X} ${Face_Y} +vmoveto ${Face_X} ${Face_Y} -QAUpdateLights checkcolor ${Face_X} ${Face_Y} 0 1 1 # Check Shell color -QAMoveTo 1 1 -QAMoveTo 1 1 +vmoveto 1 1 set SetSelectMode 5 OCC74_set b ${SetSelectMode} set GetSelectMode [OCC74_get b] @@ -154,15 +136,12 @@ if { ${GetSelectMode} != ${SetSelectMode} } then { puts "Select Mode = ${GetSelectMode}" puts "OCC74: Get Select Mode Error " } -QAMoveTo ${Shell_X} ${Shell_Y} -QAMoveTo ${Shell_X} ${Shell_Y} +vmoveto ${Shell_X} ${Shell_Y} -QAUpdateLights checkcolor ${Shell_X} ${Shell_Y} 0 1 1 # Check Solid color -QAMoveTo 1 1 -QAMoveTo 1 1 +vmoveto 1 1 set SetSelectMode 6 OCC74_set b ${SetSelectMode} set GetSelectMode [OCC74_get b] @@ -170,10 +149,8 @@ if { ${GetSelectMode} != ${SetSelectMode} } then { puts "Select Mode = ${GetSelectMode}" puts "OCC74: Get Select Mode Error " } -QAMoveTo ${Solid_X} ${Solid_Y} -QAMoveTo ${Solid_X} ${Solid_Y} +vmoveto ${Solid_X} ${Solid_Y} -QAUpdateLights checkcolor ${Solid_X} ${Solid_Y} 0 1 1 ### THIRD PART @@ -187,66 +164,45 @@ if { ${GetSelectMode} != ${SetSelectMode} } then { } # Check Shape color -QAMoveTo 1 1 -QAMoveTo 1 1 -QAMoveTo ${Shape_X} ${Shape_Y} -QAMoveTo ${Shape_X} ${Shape_Y} +vmoveto 1 1 +vmoveto ${Shape_X} ${Shape_Y} -QAUpdateLights checkcolor ${Shape_X} ${Shape_Y} 1 1 0 # Check Vertex color -QAMoveTo 1 1 -QAMoveTo 1 1 -QAMoveTo ${Vertex_X} ${Vertex_Y} -QAMoveTo ${Vertex_X} ${Vertex_Y} +vmoveto 1 1 +vmoveto ${Vertex_X} ${Vertex_Y} -QAUpdateLights checkcolor ${Vertex_X} ${Vertex_Y} 1 1 0 # Check Edge color -QAMoveTo 1 1 -QAMoveTo 1 1 -QAMoveTo ${Edge_X} ${Edge_Y} -QAMoveTo ${Edge_X} ${Edge_Y} +vmoveto 1 1 +vmoveto ${Edge_X} ${Edge_Y} -QAUpdateLights checkcolor ${Edge_X} ${Edge_Y} 1 1 0 # Check Wire color -QAMoveTo 1 1 -QAMoveTo 1 1 -QAMoveTo ${Wire_X} ${Wire_Y} -QAMoveTo ${Wire_X} ${Wire_Y} +vmoveto 1 1 +vmoveto ${Wire_X} ${Wire_Y} -QAUpdateLights checkcolor ${Wire_X} ${Wire_Y} 1 1 0 # Check Face color -QAMoveTo 1 1 -QAMoveTo 1 1 -QAMoveTo ${Face_X} ${Face_Y} -QAMoveTo ${Face_X} ${Face_Y} +vmoveto 1 1 +vmoveto ${Face_X} ${Face_Y} -QAUpdateLights checkcolor ${Face_X} ${Face_Y} 1 1 0 # Check Shell color -QAMoveTo 1 1 -QAMoveTo 1 1 -QAMoveTo ${Shell_X} ${Shell_Y} -QAMoveTo ${Shell_X} ${Shell_Y} +vmoveto 1 1 +vmoveto ${Shell_X} ${Shell_Y} -QAUpdateLights checkcolor ${Shell_X} ${Shell_Y} 1 1 0 # Check Solid color -QAMoveTo 1 1 -QAMoveTo 1 1 -QAMoveTo ${Solid_X} ${Solid_Y} -QAMoveTo ${Solid_X} ${Solid_Y} +vmoveto 1 1 +vmoveto ${Solid_X} ${Solid_Y} -QAUpdateLights checkcolor ${Solid_X} ${Solid_Y} 1 1 0 set only_screen 1 diff --git a/tests/bugs/vis/bug85_1 b/tests/bugs/vis/bug85_1 index ae8e489e80..d6f7cb0101 100755 --- a/tests/bugs/vis/bug85_1 +++ b/tests/bugs/vis/bug85_1 @@ -46,8 +46,6 @@ AISDisplay D 0:1:4 set x_coord 273 set y_coord 115 -QAUpdateLights - checkcolor $x_coord $y_coord 0.78 0.55 0.9 set only_screen 1 diff --git a/tests/bugs/vis/ger61351_1 b/tests/bugs/vis/ger61351_1 index 62b89343a6..d0f3a4765a 100755 --- a/tests/bugs/vis/ger61351_1 +++ b/tests/bugs/vis/ger61351_1 @@ -6,7 +6,6 @@ puts "==================================" vinit GER61351 RED2 -QAUpdateLights set x_coord 200 set y_coord 200 diff --git a/tests/bugs/vis/ger61351_2 b/tests/bugs/vis/ger61351_2 index 50964299f5..e4f4dc8b7e 100755 --- a/tests/bugs/vis/ger61351_2 +++ b/tests/bugs/vis/ger61351_2 @@ -10,7 +10,6 @@ puts "==================================" vinit GER61351 0 255 0 -QAUpdateLights set x_coord 200 set y_coord 200 diff --git a/tests/bugs/vis/ger61351_3 b/tests/bugs/vis/ger61351_3 index 221fef770c..1fd5046109 100755 --- a/tests/bugs/vis/ger61351_3 +++ b/tests/bugs/vis/ger61351_3 @@ -8,7 +8,6 @@ vinit box b 10 20 30 GER61351 b RED2 vfit -QAUpdateLights set x_coord 89 set y_coord 363 diff --git a/tests/bugs/vis/ger61351_4 b/tests/bugs/vis/ger61351_4 index c35f22e044..6652210be9 100755 --- a/tests/bugs/vis/ger61351_4 +++ b/tests/bugs/vis/ger61351_4 @@ -16,7 +16,6 @@ vinit box b 30 20 10 GER61351 b 0 0 255 vfit -QAUpdateLights set x_coord 89 set y_coord 363 diff --git a/tests/bugs/vis/ger61351_5 b/tests/bugs/vis/ger61351_5 index 8536571436..6baad389ff 100755 --- a/tests/bugs/vis/ger61351_5 +++ b/tests/bugs/vis/ger61351_5 @@ -16,7 +16,6 @@ vinit box b 20 10 30 GER61351 b 0 255 255 vfit -QAUpdateLights set x_coord 89 set y_coord 363 diff --git a/tests/bugs/vis/ger61351_6 b/tests/bugs/vis/ger61351_6 index d616613ab5..3a41b0b082 100755 --- a/tests/bugs/vis/ger61351_6 +++ b/tests/bugs/vis/ger61351_6 @@ -8,7 +8,6 @@ vinit box b 20 10 30 GER61351 b CYAN3 vfit -QAUpdateLights set x_coord 88 set y_coord 316 diff --git a/tests/bugs/xde/bug23193 b/tests/bugs/xde/bug23193 index 70c26b67b1..5d4a707438 100755 --- a/tests/bugs/xde/bug23193 +++ b/tests/bugs/xde/bug23193 @@ -16,7 +16,7 @@ writestl a_1 ${aFile} 0 meshfromstl m1 ${aFile} meshcolors m1 elem2 1 -QARotateV3dView 4 0 0 1 +vrotate 4 0 0 vfit set x_coord 189