1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00
occt/tests/bugs/vis/bug349_1
apl 197ac94e72 0024413: Visualization - get rid of projection shift from orthographic camera definition
From now on, the panning behavior of V3d_View completely corresponds to equal operations with camera. There is no more confusing "Center" property and "ProjectionShift" which were used to introduce composite panning, while respecting view referential points: At, Eye unchanged. The V3d_View::FitAll approach has been rewritten to do "fit all" geometrically, operating with frustum, to make it working for both orthographic and perspective projections.

1) Getting rid of ProjectionShift and Center property:
- Removed ProjectionShift property of Graphic3d_Camera.
- Removed confusing Center property of V3d_View (related to projection shift).
- Removed redundant code related to the Center property of V3d_View.
- Removed WindowLimit method of Graphic3d_Camera - no more used.

2) Improvements of fit all and selector:
- Improved FitAll operation of V3d_View and reused it in NIS_View - the perspective projection is now handled correctly.
- Revised code of Select3D_Projector class - can be defined with any given projection and model-view matrices.
- Modified StdSelect_ViewerSelector3d and ensured that panning, zooming and going into the view do not lead to unwanted re-projection of sensitives. The handling of perspective selection is revised.
- Take into account graphical boundaries of infinite structure on ZFitAll.

3) Improvements of camera:
- Introduced new z range scale parameter for V3d_View::AutoZFit. See, V3d_View::AutoZFitMode.
- Allow negative ZNear, ZFar for orthographic camera to avoid clipping of viewed model.
- Moved camera ZNear, ZFar validity checks to V3d_View level.
- Use more meaningful Standard_ShortReal relative precision for ZNear, ZFar ranges computed by ZFitAll.
- Use Standard_Real type for camera projection and orientation matrices.
- Extended camera to generate both Standard_Real and Standard_ShortReal transformation matrices using the same matrix evaluation methods and converted input parameters.

Correcting picking tests for perspective view

Modify v3d face test cases for 1px changes in face picking

Modified test cases for new arguments of vviewparams DRAWEXE command
2014-03-06 15:50:33 +04:00

111 lines
2.7 KiB
Plaintext
Executable File

puts "========"
puts "OCC349"
puts "========"
puts ""
puts "2. Fitall with hidden line removal algorithm works incorrect in the perspective view"
vinit
box b 100 900 300
vdisplay b
OCC280 1 1
vfit
set x1 135
set y1 119
set x2 387
set y2 33
set x3 172
set y3 144
set x4 28
set y4 190
set x5 160
set y5 257
set x6 365
set y6 150
set x7 212
set y7 272
set x8 60
set y8 343
set x9 26
set y9 255
set x10 353
set y10 99
set x11 389
set y11 113
set x12 60
set y12 276
set Black_R 0
set Black_G 0
set Black_B 0
set Yellow_R 1
set Yellow_G 1
set Yellow_B 0
#
# ___________2________________
# /| /|
# / | / |
# / | / |
# / | / |
# / | / |
# 1 | 3 |
# / | / |
# / | / |
# / | / |
# / | / |
# ----------------4------------ |
# | | | |
# | | | |
# | | | |
# | 10 | 11
# | | | |
# | | | |
# | | | |
# | | | |
# | | | |
# 9 | 12 |
# | |___________6____|__________|
# | / | /
# | / | /
# | / | /
# | / | /
# | 5 | /
# | / | 7
# | / | /
# | / | /
# | / | /
# |/ |/
# |--------------8------------|
#
#
checkcolor ${x1} ${y1} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x2} ${y2} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x3} ${y3} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x4} ${y4} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x7} ${y7} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x8} ${y8} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x9} ${y9} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x11} ${y11} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x12} ${y12} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x5} ${y5} ${Black_R} ${Black_G} ${Black_B}
checkcolor ${x6} ${y6} ${Black_R} ${Black_G} ${Black_B}
checkcolor ${x10} ${y10} ${Black_R} ${Black_G} ${Black_B}
set only_screen 0