1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-07-30 13:05:50 +03:00
occt/tests/bugs/vis/bug1174
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

70 lines
1.6 KiB
Plaintext
Executable File

puts "================"
puts "OCC1174"
puts "================"
puts ""
########################################################################################
# puts "Impossible to set different properties for different sides of a (sur)face"
########################################################################################
set x 200
set y 200
set Black_R 0
set Black_G 0
set Black_B 0
restore [locate_data_file OCC1174.brep] a
vinit
OCC1174_1 a
vdisplay a
vfit
set scale 2.50501
set proj_X 0.672033
set proj_Y -0.721033
set proj_Z 0.168771
set up_X -0.131494
set up_Y 0.108095
set up_Z 0.985406
set at_X 102.061817325836
set at_Y 169.436979868935
set at_Z 70.7572056943368
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set x_GREEN 300
set y_GREEN 180
set x_BLUE 180
set y_BLUE 250
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
regexp {BLUE +: +([-0-9.+eE]+)} $ColorList1 full BLUE_1
set ColorList2 [QAGetPixelColor ${x_BLUE} ${y_BLUE}]
regexp {RED +: +([-0-9.+eE]+)} $ColorList2 full RED_2
regexp {GREEN +: +([-0-9.+eE]+)} $ColorList2 full GREEN_2
regexp {BLUE +: +([-0-9.+eE]+)} $ColorList2 full BLUE_2
if {${RED_1} == 0 && ${GREEN_1} > 0 && ${BLUE_1} == 0} {
set IsGreen 1
} else {
set IsGreen 0
}
if {${RED_2} == 0 && ${GREEN_2} == 0 && ${BLUE_2} > 0} {
set IsBlue 1
} else {
set IsBlue 0
}
if {${IsGreen} == 1 && ${IsBlue} == 1} {
puts "OCC1174: OK"
} else {
puts "OCC1174: Error"
}
set only_screen 1