1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0023200: Visualization - prevent multiple triangulating of a shape that already has been triangulated

Add new flag IsAutoTriangulated to Prs3d_Drawer. It is True by default.
If this flag is True automatic re-triangulation with deflection-check logic will be applied.
Else this feature will be disable and triangulation is expected to be computed by application itself.

Change the syntax of vdefalts command.
Add new parameter -autoTriang for check of AutoTriangulated functionality.

Adjust camera position in test case bugs/xde/bug23969
This commit is contained in:
osa
2015-03-05 14:48:42 +03:00
committed by bugmaster
parent 5149c3f34b
commit 4c5133866b
19 changed files with 280 additions and 76 deletions

View File

@@ -7,7 +7,7 @@ puts "=================================="
# set rough meshing parameters
vinit
vdefaults absDefl=10 devCoeff=0.1
vdefaults -absDefl 10 -devCoeff 0.1
puts "Displaying two equal cones, one with Phong shader"
pcone p_gouraud 10 100 100

54
tests/bugs/vis/bug23200 Normal file
View File

@@ -0,0 +1,54 @@
puts "============"
puts "CR23200"
puts "Check that the shape is automatic re-triangulated with deflection-check logic"
puts "in case of enabled auto triangulation feature (its own triangulation can be lost)."
puts "And it keeps its already computed triangulation"
puts "in case of disabled auto triangulation feature."
puts "============"
puts ""
set aDefaultShape $imagedir/${casename}_shape.png
set aShapeAutoTr $imagedir/${casename}_shape_auto_triangulation.png
set aShapeNotAutoTr $imagedir/${casename}_shape_not_auto_triangulation.png
vinit View1
vclear
vaxo
vsetdispmode 1
vdefaults -autoTriang on
psphere s 0.5
vdisplay s
vfit
vdump $aDefaultShape
vclear
tclean s
incmesh s 0.1 -a 45
set tri_info [trinfo s]
regexp { +([-0-9.+eE]+) +triangles} $tri_info full triIncmesh1
vdisplay s
set tri_info [trinfo s]
regexp { +([-0-9.+eE]+) +triangles} $tri_info full triAutoTrShape
vfit
vdump $aShapeAutoTr
vclear
vdefaults -autoTriang off
tclean s
incmesh s 0.1 -a 45
set tri_info [trinfo s]
regexp { +([-0-9.+eE]+) +triangles} $tri_info full triIncmesh2
vdisplay s
set tri_info [trinfo s]
regexp { +([-0-9.+eE]+) +triangles} $tri_info full triNotAutoTrShape
vfit
vdump $aShapeNotAutoTr
if {${triIncmesh1} == ${triAutoTrShape}} {
puts "ERROR : Test failed. Incorrect triangulation in case of enabled auto triangulation feature."
}
if {${triIncmesh2} != ${triNotAutoTrShape}} {
puts "ERROR : Test failed. Incorrect triangulation in case of disabled auto triangulation feature."
}

23
tests/bugs/vis/bug23200_1 Normal file
View File

@@ -0,0 +1,23 @@
puts "============"
puts "CR23200"
puts "Check that the shape doesn't have a shading presentation"
puts "due to its triangulation isn't computed in case of disabled auto triangulation feature."
puts "But in this case the shape should have special wireframe presentation."
puts "============"
puts ""
vinit View1
vclear
vaxo
vsetdispmode 1
vdefaults -autoTriang off
pcone c 0 5 10
vdisplay c
vfit
set aColor [vreadpixel 200 77 rgb name]
vdump $imagedir/${casename}_shape_pres.png
if {"$aColor" != "GRAY75"} {
puts "Error: shading presentation of shape is incorrect"
}

View File

@@ -12,7 +12,7 @@ vinit
vdisplay s
vfit
vdefaults angDefl=1
vdefaults -angDefl 1
vsetdispmode s 1
vdump ${imagedir}/${casename}_1.png

View File

@@ -12,7 +12,7 @@ vinit
vdisplay s
vfit
vdefaults angDefl=1
vdefaults -angDefl 1
vsetdispmode s 1
vdump ${imagedir}/${casename}_1.png

View File

@@ -12,7 +12,7 @@ vinit
vdisplay s
vfit
vdefaults angDefl=1
vdefaults -angDefl 1
vsetdispmode s 1
vdump ${imagedir}/${casename}_1.png

View File

@@ -12,7 +12,11 @@ XGetOneShape res_1 D_First
vinit
vsetdispmode 1
vdisplay res_1
vfit
vdump $::imagedir/${::casename}_fit.png
vviewparams -eye 106.849 -177.049 169.775 -at -70.2 -5.456e-015 -7.274 -up -0.408 0.408 0.816 -scale 3.048
set ver_color [vreadpixel 157 104]
if {$ver_color == "0 0 0 0"} {
@@ -34,5 +38,6 @@ set ver_color [vreadpixel 243 323]
if {$ver_color == "0 0 0 0"} {
puts "ERROR: OCC23969 is reproduced"
}
vdump $::imagedir/${::casename}_center.png
set 3dviewer 1

View File

@@ -10,7 +10,7 @@ box b 2 0 0 1 0.5 0.25
# draw box
vinit View1
vclear
vdefaults absDefl=0.5
vdefaults -absDefl 0.5
vsetdispmode 1
vaxo
vdisplay f

View File

@@ -9,7 +9,7 @@ tclean f
# draw box
vinit View1
vclear
vdefaults absDefl=0.5
vdefaults -absDefl 0.5
vsetdispmode 1
vaxo
vdisplay f

View File

@@ -9,7 +9,7 @@ tclean f
# draw box
vinit View1
vclear
vdefaults absDefl=0.5
vdefaults -absDefl 0.5
vsetdispmode 1
vaxo
vdisplay f