1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0023253: Additional viewer 3d draw-commands vleft, vfront, ...

New draw-commands vleft, vright, vbottom, vback and vfront.
This commit is contained in:
vro 2012-07-10 11:21:58 +04:00
parent a15d6aceb6
commit 44b8f2d659

View File

@ -653,6 +653,23 @@ void ViewerTest::GetMousePosition(Standard_Integer& Xpix,Standard_Integer& Ypix)
Xpix = X_Motion;Ypix=Y_Motion;
}
//==============================================================================
//function : ViewProject: implements VAxo, VTop, VLeft, ...
//purpose : Switches to an axonometric, top, left and other views
//==============================================================================
static int ViewProject(Draw_Interpretor& di, const V3d_TypeOfOrientation ori)
{
if ( ViewerTest::CurrentView().IsNull() )
{
di<<"Call vinit before this command, please"<<"\n";
return 1;
}
ViewerTest::CurrentView()->SetProj(ori);
return 0;
}
//==============================================================================
//function : VAxo
//purpose : Switch to an Axonometric view
@ -660,14 +677,8 @@ void ViewerTest::GetMousePosition(Standard_Integer& Xpix,Standard_Integer& Ypix)
//==============================================================================
static int VAxo(Draw_Interpretor& di, Standard_Integer , const char** )
{ if ( ViewerTest::CurrentView().IsNull() ) {
di<<"La commande vinit n'a pas ete appele avant"<<"\n";
// VInit(di, argc, argv);
}
ViewerTest::CurrentView()->SetProj(V3d_XposYnegZpos);
return 0;
{
return ViewProject(di, V3d_XposYnegZpos);
}
//==============================================================================
@ -678,16 +689,62 @@ return 0;
static int VTop(Draw_Interpretor& di, Standard_Integer , const char** )
{
return ViewProject(di, V3d_Zpos);
}
if ( ViewerTest::CurrentView().IsNull() ) {
di<<"La commande vinit n'a pas ete appele avant"<<"\n";
//==============================================================================
//function : VBottom
//purpose : Switch to a Bottom View
//Draw arg : No args
//==============================================================================
// VInit(di, , argv);
}
static int VBottom(Draw_Interpretor& di, Standard_Integer , const char** )
{
return ViewProject(di, V3d_Zneg);
}
ViewerTest::CurrentView()->SetProj(V3d_Zpos);
return 0;
//==============================================================================
//function : VLeft
//purpose : Switch to a Left View
//Draw arg : No args
//==============================================================================
static int VLeft(Draw_Interpretor& di, Standard_Integer , const char** )
{
return ViewProject(di, V3d_Ypos);
}
//==============================================================================
//function : VRight
//purpose : Switch to a Right View
//Draw arg : No args
//==============================================================================
static int VRight(Draw_Interpretor& di, Standard_Integer , const char** )
{
return ViewProject(di, V3d_Yneg);
}
//==============================================================================
//function : VFront
//purpose : Switch to a Front View
//Draw arg : No args
//==============================================================================
static int VFront(Draw_Interpretor& di, Standard_Integer , const char** )
{
return ViewProject(di, V3d_Xpos);
}
//==============================================================================
//function : VBack
//purpose : Switch to a Back View
//Draw arg : No args
//==============================================================================
static int VBack(Draw_Interpretor& di, Standard_Integer , const char** )
{
return ViewProject(di, V3d_Xneg);
}
//==============================================================================
@ -2960,11 +3017,26 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"vhelp : display help on the viewer commands",
__FILE__,VHelp,group);
theCommands.Add("vtop" ,
"vtop or <T> : Top view" ,
"vtop or <T> : Top view" ,
__FILE__,VTop,group);
theCommands.Add("vbottom" ,
"vbottom : Bottom view" ,
__FILE__,VBottom,group);
theCommands.Add("vleft" ,
"vleft : Left view" ,
__FILE__,VLeft,group);
theCommands.Add("vright" ,
"vright : Right view" ,
__FILE__,VRight,group);
theCommands.Add("vaxo" ,
" vaxo or <A> : Axonometric view ",
__FILE__,VAxo,group);
theCommands.Add("vfront" ,
"vfront : Front view" ,
__FILE__,VFront,group);
theCommands.Add("vback" ,
"vback : Back view" ,
__FILE__,VBack,group);
theCommands.Add("vpick" ,
"vpick : vpick X Y Z [shape subshape] ( all variables as string )",
VPick,group);