From 27af30526d6b81e5229e0a19c960cc9727ec27f4 Mon Sep 17 00:00:00 2001 From: isk Date: Mon, 7 Sep 2015 16:17:29 +0300 Subject: [PATCH] 0025777: the standard views are defined incorrectly and mismatch the old display. Old vright equals new vfront, old vfront equals new vright, old vleft equals new vback, old vback equals new vleft. --- samples/tcl/pathtrace.tcl | 2 +- src/DrawResources/StandardViews.tcl | 48 ++++---- src/ViewerTest/ViewerTest_ViewerCommands.cxx | 22 ++-- tests/3rdparty/fonts/B4 | 2 +- tests/3rdparty/fonts/B5 | 2 +- tests/bugs/modalg_5/bug24842_back | 2 +- tests/bugs/modalg_5/bug24842_front | 2 +- tests/bugs/modalg_5/bug24842_left | 2 +- tests/bugs/modalg_5/bug24842_right | 2 +- tests/bugs/modalg_5/bug25841 | 2 +- tests/bugs/vis/bug23253 | 8 +- tests/bugs/vis/bug24351_1 | 4 +- tests/bugs/vis/bug24351_2 | 4 +- tests/bugs/vis/bug24351_3 | 4 +- tests/bugs/vis/bug24351_4 | 4 +- tests/bugs/vis/bug24714 | 2 +- tests/bugs/vis/bug25103 | 2 +- tests/bugs/vis/bug25178 | 2 +- tests/bugs/vis/bug25230 | 2 +- tests/bugs/vis/bug25777 | 114 +++++++++++++++++++ tests/bugs/vis/bug26028 | 2 +- tests/v3d/raytrace/refraction | 2 +- tests/v3d/raytrace/textures | 2 +- 23 files changed, 176 insertions(+), 62 deletions(-) create mode 100644 tests/bugs/vis/bug25777 diff --git a/samples/tcl/pathtrace.tcl b/samples/tcl/pathtrace.tcl index 82abdc3532..713295a370 100644 --- a/samples/tcl/pathtrace.tcl +++ b/samples/tcl/pathtrace.tcl @@ -16,7 +16,7 @@ box b 1 1 1 explode b FACE vdisplay b_1 b_2 b_3 b_5 b_6 -vright +vfront vfit vsetmaterial b_1 plastic diff --git a/src/DrawResources/StandardViews.tcl b/src/DrawResources/StandardViews.tcl index 8ef716f1ee..dbbb3be428 100644 --- a/src/DrawResources/StandardViews.tcl +++ b/src/DrawResources/StandardViews.tcl @@ -105,19 +105,19 @@ proc axo {} { view 1 AXON 465 20 800 800 # } } -help axo ", One axonometric view" "DRAW Graphic Commands" +help axo ", One axonometric view. Orientation +X-Y+Z" "DRAW Graphic Commands" proc haxo {} { delete view 1 AXON 465 20 800 800*20.4/29.1 } -help haxo ", One axonometric horizontal view" "DRAW Graphic Commands" +help haxo ", One axonometric horizontal view. Orientation +X-Y+Z" "DRAW Graphic Commands" proc vaxo {} { delete view 1 AXON 705 20 800*20.4/29.1 800 } -help vaxo ", One axonometric vertical view" "DRAW Graphic Commands" +help vaxo ", One axonometric vertical view. Orientation +X-Y+Z" "DRAW Graphic Commands" proc pers {} { delete @@ -141,109 +141,109 @@ proc front {} { delete view 1 +X+Z 465 20 800 800 } -help front ", One front view" "DRAW Graphic Commands" +help front ", One front view. Orientation +X+Z" "DRAW Graphic Commands" proc hfront {} { delete view 1 +X+Z 465 20 800 800*20.4/29.1 } -help hfront ", One front horizontal view" "DRAW Graphic Commands" +help hfront ", One front horizontal view. Orientation +X+Z" "DRAW Graphic Commands" proc vfront {} { delete view 1 +X+Z 705 20 800*20.4/29.1 800 } -help vfront ", One front vertical view" "DRAW Graphic Commands" +help vfront ", One front vertical view. Orientation +X+Z" "DRAW Graphic Commands" proc top {} { delete view 1 +X+Y 465 20 800 800 } -help top ", One top view" "DRAW Graphic Commands" +help top ", One top view. Orientation +X+Y" "DRAW Graphic Commands" proc htop {} { delete view 1 +X+Y 465 20 800 800*20.4/29.1 } -help htop ", One top horizontal view" "DRAW Graphic Commands" +help htop ", One top horizontal view. Orientation +X+Y" "DRAW Graphic Commands" proc vtop {} { delete view 1 +X+Y 705 20 800*20.4/29.1 800 } -help vtop ", One top vertical view" "DRAW Graphic Commands" +help vtop ", One top vertical view. Orientation +X+Y" "DRAW Graphic Commands" proc left {} { delete view 1 -Y+Z 465 20 800 800 } -help left ", One left view" "DRAW Graphic Commands" +help left ", One left view. Orientation -Y+Z" "DRAW Graphic Commands" proc hleft {} { delete view 1 -Y+Z 465 20 800 800*20.4/29.1 } -help hleft ", One left horizontal view" "DRAW Graphic Commands" +help hleft ", One left horizontal view. Orientation -Y+Z" "DRAW Graphic Commands" proc vleft {} { delete view 1 -Y+Z 705 20 800*20.4/29.1 800 } -help vleft ", One left vertical view" "DRAW Graphic Commands" +help vleft ", One left vertical view. Orientation -Y+Z" "DRAW Graphic Commands" proc back {} { delete view 1 -X+Z 465 20 800 800 } -help back ", One back view" "DRAW Graphic Commands" +help back ", One back view. Orientation -X+Z" "DRAW Graphic Commands" proc hback {} { delete view 1 -X+Z 465 20 800 800*20.4/29.1 } -help hback ", One back horizontal view" "DRAW Graphic Commands" +help hback ", One back horizontal view. Orientation -X+Z" "DRAW Graphic Commands" proc vback {} { delete view 1 -X+Z 705 20 800*20.4/29.1 800 } -help vback ", One back vertical view" "DRAW Graphic Commands" +help vback ", One back vertical view. Orientation -X+Z" "DRAW Graphic Commands" proc right {} { delete view 1 +Y+Z 465 20 800 800 } -help right ", One right view" "DRAW Graphic Commands" +help right ", One right view. Orientation +Y+Z" "DRAW Graphic Commands" proc hright {} { delete view 1 +Y+Z 465 20 800 800*20.4/29.1 } -help hright ", One right horizontal view" "DRAW Graphic Commands" +help hright ", One right horizontal view. Orientation +Y+Z" "DRAW Graphic Commands" proc vright {} { delete view 1 +Y+Z 705 20 800*20.4/29.1 800 } -help vright ", One right vertical view" "DRAW Graphic Commands" +help vright ", One right vertical view. Orientation +Y+Z" "DRAW Graphic Commands" proc bottom {} { delete - view 1 +X-Z 465 20 800 800 + view 1 +X-Y 465 20 800 800 } -help bottom ", One bottom view" "DRAW Graphic Commands" +help bottom ", One bottom view. Orientation +X-Y" "DRAW Graphic Commands" proc hbottom {} { delete - view 1 +X-Z 465 20 800 800*20.4/29.1 + view 1 +X-Y 465 20 800 800*20.4/29.1 } -help hbottom ", One bottom horizontal view" "DRAW Graphic Commands" +help hbottom ", One bottom horizontal view. Orientation +X-Y" "DRAW Graphic Commands" proc vbottom {} { delete - view 1 +X-Z 705 20 800*20.4/29.1 800 + view 1 +X-Y 705 20 800*20.4/29.1 800 } -help vbottom ", One bottom vertical view" "DRAW Graphic Commands" +help vbottom ", One bottom vertical view. Orientation +X-Y" "DRAW Graphic Commands" proc v2d {} { delete diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index d472054a0e..7bf30e58ca 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -1804,7 +1804,7 @@ static int VBottom(Draw_Interpretor& di, Standard_Integer , const char** ) static int VLeft(Draw_Interpretor& di, Standard_Integer , const char** ) { - return ViewProject(di, V3d_Ypos); + return ViewProject(di, V3d_Xneg); } //============================================================================== @@ -1815,7 +1815,7 @@ static int VLeft(Draw_Interpretor& di, Standard_Integer , const char** ) static int VRight(Draw_Interpretor& di, Standard_Integer , const char** ) { - return ViewProject(di, V3d_Yneg); + return ViewProject(di, V3d_Xpos); } //============================================================================== @@ -1826,7 +1826,7 @@ static int VRight(Draw_Interpretor& di, Standard_Integer , const char** ) static int VFront(Draw_Interpretor& di, Standard_Integer , const char** ) { - return ViewProject(di, V3d_Xpos); + return ViewProject(di, V3d_Yneg); } //============================================================================== @@ -1837,7 +1837,7 @@ static int VFront(Draw_Interpretor& di, Standard_Integer , const char** ) static int VBack(Draw_Interpretor& di, Standard_Integer , const char** ) { - return ViewProject(di, V3d_Xneg); + return ViewProject(di, V3d_Ypos); } //============================================================================== @@ -8729,25 +8729,25 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands) "vhelp : display help on the viewer commands", __FILE__,VHelp,group); theCommands.Add("vtop" , - "vtop or : Top view" , + "vtop or : Top view. Orientation +X+Y" , __FILE__,VTop,group); theCommands.Add("vbottom" , - "vbottom : Bottom view" , + "vbottom : Bottom view. Orientation +X-Y" , __FILE__,VBottom,group); theCommands.Add("vleft" , - "vleft : Left view" , + "vleft : Left view. Orientation -Y+Z" , __FILE__,VLeft,group); theCommands.Add("vright" , - "vright : Right view" , + "vright : Right view. Orientation +Y+Z" , __FILE__,VRight,group); theCommands.Add("vaxo" , - " vaxo or : Axonometric view ", + " vaxo or : Axonometric view. Orientation +X-Y+Z", __FILE__,VAxo,group); theCommands.Add("vfront" , - "vfront : Front view" , + "vfront : Front view. Orientation +X+Z" , __FILE__,VFront,group); theCommands.Add("vback" , - "vback : Back view" , + "vback : Back view. Orientation -X+Z" , __FILE__,VBack,group); theCommands.Add("vpick" , "vpick : vpick X Y Z [shape subshape] ( all variables as string )", diff --git a/tests/3rdparty/fonts/B4 b/tests/3rdparty/fonts/B4 index 9014f7577a..57d3f4510a 100644 --- a/tests/3rdparty/fonts/B4 +++ b/tests/3rdparty/fonts/B4 @@ -5,7 +5,7 @@ puts "============" puts "" vtrihedron trihedr -vright +vfront vsetdispmode 1 diff --git a/tests/3rdparty/fonts/B5 b/tests/3rdparty/fonts/B5 index ed6882bffe..f9ada11383 100644 --- a/tests/3rdparty/fonts/B5 +++ b/tests/3rdparty/fonts/B5 @@ -5,7 +5,7 @@ puts "============" puts "" vtrihedron trihedr -vright +vfront vsetdispmode 1 diff --git a/tests/bugs/modalg_5/bug24842_back b/tests/bugs/modalg_5/bug24842_back index b850774277..68bbaeb835 100644 --- a/tests/bugs/modalg_5/bug24842_back +++ b/tests/bugs/modalg_5/bug24842_back @@ -11,7 +11,7 @@ restore [locate_data_file bug24842_10265.brep] b vinit vdisplay b -vback +vleft vfit vhlr on diff --git a/tests/bugs/modalg_5/bug24842_front b/tests/bugs/modalg_5/bug24842_front index 7e83493df0..c9ff176d22 100644 --- a/tests/bugs/modalg_5/bug24842_front +++ b/tests/bugs/modalg_5/bug24842_front @@ -11,7 +11,7 @@ restore [locate_data_file bug24842_10265.brep] b vinit vdisplay b -vfront +vright vfit vhlr on diff --git a/tests/bugs/modalg_5/bug24842_left b/tests/bugs/modalg_5/bug24842_left index 68bbaeb835..b850774277 100644 --- a/tests/bugs/modalg_5/bug24842_left +++ b/tests/bugs/modalg_5/bug24842_left @@ -11,7 +11,7 @@ restore [locate_data_file bug24842_10265.brep] b vinit vdisplay b -vleft +vback vfit vhlr on diff --git a/tests/bugs/modalg_5/bug24842_right b/tests/bugs/modalg_5/bug24842_right index c9ff176d22..7e83493df0 100644 --- a/tests/bugs/modalg_5/bug24842_right +++ b/tests/bugs/modalg_5/bug24842_right @@ -11,7 +11,7 @@ restore [locate_data_file bug24842_10265.brep] b vinit vdisplay b -vright +vfront vfit vhlr on diff --git a/tests/bugs/modalg_5/bug25841 b/tests/bugs/modalg_5/bug25841 index 44aba6c215..0d9e56d709 100644 --- a/tests/bugs/modalg_5/bug25841 +++ b/tests/bugs/modalg_5/bug25841 @@ -9,7 +9,7 @@ puts "" restore [locate_data_file OCC25841_Curve_2.brep] a vinit vclear -vfront +vright vdisplay a vfit set only_screen 1 diff --git a/tests/bugs/vis/bug23253 b/tests/bugs/vis/bug23253 index e573886c76..912c405839 100755 --- a/tests/bugs/vis/bug23253 +++ b/tests/bugs/vis/bug23253 @@ -45,7 +45,7 @@ set y2 200 checkcolor $x2 $y2 1 1 0.94 ##### -vleft +vback ##### set x1 120 @@ -57,7 +57,7 @@ set y2 170 checkcolor $x2 $y2 1 1 0.94 ##### -vright +vfront ##### set x1 120 @@ -69,7 +69,7 @@ set y2 170 checkcolor $x2 $y2 1 1 0.94 ##### -vfront +vright ##### set x1 120 @@ -81,7 +81,7 @@ set y2 170 checkcolor $x2 $y2 1 1 0.94 ##### -vback +vleft ##### set x1 120 diff --git a/tests/bugs/vis/bug24351_1 b/tests/bugs/vis/bug24351_1 index 933431b60d..c2e327b971 100644 --- a/tests/bugs/vis/bug24351_1 +++ b/tests/bugs/vis/bug24351_1 @@ -10,7 +10,7 @@ pload VISUALIZATION vfont add [locate_data_file DejaVuSans.ttf] SansFont vinit -vright +vfront set hpos "left hcenter right" set vpos "above vcenter below" @@ -50,7 +50,7 @@ vfit # ------------------------------------------------ vinit Viewer2/View2 -vright +vfront set idx 0 for {set r 0} {$r < 3} {incr r} { diff --git a/tests/bugs/vis/bug24351_2 b/tests/bugs/vis/bug24351_2 index aa58735f60..3f654747e5 100644 --- a/tests/bugs/vis/bug24351_2 +++ b/tests/bugs/vis/bug24351_2 @@ -10,7 +10,7 @@ pload VISUALIZATION vfont add [locate_data_file DejaVuSans.ttf] SansFont vinit -vright +vfront set hpos "left hcenter right" set vpos "above vcenter below" @@ -54,7 +54,7 @@ vfit # ------------------------------------------------ vinit Viewer2/View2 -vright +vfront set idx 0 for {set r 0} {$r < 3} {incr r} { diff --git a/tests/bugs/vis/bug24351_3 b/tests/bugs/vis/bug24351_3 index b9bbcbce27..9d33b650b8 100644 --- a/tests/bugs/vis/bug24351_3 +++ b/tests/bugs/vis/bug24351_3 @@ -10,7 +10,7 @@ pload VISUALIZATION vfont add [locate_data_file DejaVuSans.ttf] SansFont vinit -vright +vfront set hpos "left hcenter" set vpos "above vcenter below" @@ -53,7 +53,7 @@ vfit # ------------------------------------------------ vinit Viewer2/View2 -vright +vfront set idx 0 for {set r 0} {$r < 3} {incr r} { diff --git a/tests/bugs/vis/bug24351_4 b/tests/bugs/vis/bug24351_4 index c5fbde222a..daea82079b 100644 --- a/tests/bugs/vis/bug24351_4 +++ b/tests/bugs/vis/bug24351_4 @@ -10,7 +10,7 @@ pload VISUALIZATION vfont add [locate_data_file DejaVuSans.ttf] SansFont vinit -vright +vfront set hpos "left hcenter right" set vpos "above vcenter below" @@ -51,7 +51,7 @@ vfit # ------------------------------------------------ vinit Viewer2/View2 -vright +vfront set idx 0 for {set r 0} {$r < 3} {incr r} { diff --git a/tests/bugs/vis/bug24714 b/tests/bugs/vis/bug24714 index aade48c6a1..e1cec1bb65 100644 --- a/tests/bugs/vis/bug24714 +++ b/tests/bugs/vis/bug24714 @@ -14,7 +14,7 @@ vclear box b 10 10 10 vdisplay b -vright +vfront vfit vviewparams -size 22 diff --git a/tests/bugs/vis/bug25103 b/tests/bugs/vis/bug25103 index edbfd9eabc..3a8a5cc32a 100644 --- a/tests/bugs/vis/bug25103 +++ b/tests/bugs/vis/bug25103 @@ -28,7 +28,7 @@ vsetmaterial wall3 pewter vsetcolor wall1 red vsetcolor wall2 green -vright +vfront vturnview 0 -0.3 0 vfit diff --git a/tests/bugs/vis/bug25178 b/tests/bugs/vis/bug25178 index a232618cb0..11c306b4ab 100644 --- a/tests/bugs/vis/bug25178 +++ b/tests/bugs/vis/bug25178 @@ -10,7 +10,7 @@ restore [locate_data_file bug25179_nurbs-with-partial-seam.brep] a vinit vdisplay a -vback +vleft vfit set only_screen 1 diff --git a/tests/bugs/vis/bug25230 b/tests/bugs/vis/bug25230 index f84544848f..68d6707e17 100644 --- a/tests/bugs/vis/bug25230 +++ b/tests/bugs/vis/bug25230 @@ -29,7 +29,7 @@ for {set x 0} {$x<7} {incr x} { vtop vcamera -persp vfit -vback +vleft vtop #check rectagle selection diff --git a/tests/bugs/vis/bug25777 b/tests/bugs/vis/bug25777 new file mode 100644 index 0000000000..63cd7813d0 --- /dev/null +++ b/tests/bugs/vis/bug25777 @@ -0,0 +1,114 @@ +puts "============" +puts "OCC25777: Draw Harness, ViewerTest - make commands defining standard views to match their names" +puts "============" +puts "" + +pload MODELING VISUALIZATION + +box b0 -70 -70 -70 140 140 140 + +# Top View +text2brep top Top -height 30 -aspect bold -halign center -valign center -pos 0 30 70 -plane 0 0 1 1 0 0 -composite on +explode top Sh +prism ptop top 0 0 -10 + +# Bottom View +text2brep bottom Bottom -height 30 -aspect bold -halign center -valign center -pos 0 -30 -70 -plane 0 0 -1 1 0 0 -composite on +explode bottom Sh +prism pbottom bottom 0 0 10 + +# Front View +text2brep front Front -height 30 -aspect bold -halign left -valign top -pos -70 -70 65 -plane 0 -1 0 1 0 0 -composite on +explode front Sh +prism pfront front 0 10 0 + +# Back View +text2brep back Back -height 30 -aspect bold -halign left -valign bottom -pos 70 70 -60 -plane 0 1 0 -1 0 0 -composite on +explode back Sh +prism pback back 0 -10 0 + +# Right View +text2brep right Right -height 30 -aspect bold -halign left -valign top -pos 70 -60 65 -plane 1 0 0 0 1 0 -composite on +explode right Sh +prism pright right -10 0 0 + +# Left View +text2brep left Left -height 30 -aspect bold -halign left -valign bottom -pos -70 60 -60 -plane -1 0 0 0 -1 0 -composite on +explode left Sh +prism pleft left 10 0 0 + +# Cut operations +bcut cutbox b0 ptop +bcut cutbox cutbox pbottom +bcut cutbox cutbox pfront +bcut cutbox cutbox pback +bcut cutbox cutbox pleft +bcut cutbox cutbox pright + +vclear +vclose all +vinit + +vtrihedron tr +vdisplay cutbox + +vfit + +# Axo View +vaxo +vdump $imagedir/${casename}_new_0_axo.png + +axo +fit +xwd $imagedir/${casename}_old_0_axo.png + +vsetdispmode 1 +vmoveto 200 200 + +# Front View +vfront +vdump $imagedir/${casename}_new_1_front.png + +front +fit +xwd $imagedir/${casename}_old_1_front.png + +# Back View +vback +vdump $imagedir/${casename}_new_2_back.png + +back +fit +xwd $imagedir/${casename}_old_2_back.png + +# Right View +vright +vdump $imagedir/${casename}_new_3_right.png + +right +fit +xwd $imagedir/${casename}_old_3_right.png + +# Left View +vleft +vdump $imagedir/${casename}_new_4_left.png + +left +fit +xwd $imagedir/${casename}_old_4_left.png + +# Top View +vtop +vdump $imagedir/${casename}_new_5_top.png + +top +fit +xwd $imagedir/${casename}_old_5_top.png + +# Bottom View +vbottom +vdump $imagedir/${casename}_new_6_bottom.png + +bottom +fit +xwd $imagedir/${casename}_old_6_bottom.png diff --git a/tests/bugs/vis/bug26028 b/tests/bugs/vis/bug26028 index 07c0e763ba..0c4f4292be 100644 --- a/tests/bugs/vis/bug26028 +++ b/tests/bugs/vis/bug26028 @@ -15,7 +15,7 @@ set anImage2 $imagedir/${casename}_Closed.png vinit meshfromstl aMesh [locate_data_file sh1.stl] vsetdispmode aMesh 2 -vright +vfront vfit vclipplane create aClipPlane diff --git a/tests/v3d/raytrace/refraction b/tests/v3d/raytrace/refraction index c60be190de..c43452dc1d 100644 --- a/tests/v3d/raytrace/refraction +++ b/tests/v3d/raytrace/refraction @@ -67,7 +67,7 @@ vsettransparency B1 0.8 vsettransparency B2 0.8 vsettransparency B3 0.8 -vright +vfront vturnview 0 -0.3 0 vfit vlight change 0 pos 1 1 1 diff --git a/tests/v3d/raytrace/textures b/tests/v3d/raytrace/textures index f58f0729f3..67dcc40710 100644 --- a/tests/v3d/raytrace/textures +++ b/tests/v3d/raytrace/textures @@ -67,7 +67,7 @@ vsetmaterial wall3 pewter vsetcolor wall1 red vsetcolor wall2 green -vright +vfront vturnview 0 -0.3 0 vfit vlight change 0 pos 1 1 1 -- 2.20.1