mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
OpenGL rendering is now done into sRGB framebuffer. OpenGl_ShaderManager::prepareStdProgramFboBlit() has been extended by programs resolving MSAA texture and applying gamma correction as fallbacks. Quantity_Color definition has been modified to store RGB components in linear color space within Quantity_TOC_RGB type. Standard colors defined by Quantity_NameOfColor enumeration has been updated accordingly. New Quantity_TOC_sRGB type has been introduced to handle RGB components in non-linear sRGB color space. OpenGl_TextureFormat class definition has been moved to dedicated files. New method OpenGl_TextureFormat::FindFormat() replaces OpenGl_Texture::GetDataFormat(). New method OpenGl_TextureFormat::FindSizedFormat() replaces OpenGl_FrameBuffer::getColorDataFormat() and OpenGl_FrameBuffer::getDepthDataFormat(). Graphic3d_TextureRoot::IsColorMap() - introduced new property defining if RGB(A)8 image formats should be loaded as sRGB(A) textures or as data RGB(A) textures. OpenGl_Texture initialization methods have been extended with new theIsColorMap argument. vreadpixel - added argument -sRGB printing color in sRGB color space. Test cases have been updated to new sRGB rendered results.
105 lines
2.9 KiB
Plaintext
105 lines
2.9 KiB
Plaintext
puts "========"
|
|
puts "Allow 3D objects with Graphic3d_TMF_2d flag"
|
|
puts "========"
|
|
|
|
pload MODELING VISUALIZATION
|
|
|
|
# four rectangles
|
|
box b4 -175 -125 -5 350 250 1
|
|
box b3 -150 -100 -4 300 200 1
|
|
box b2 -125 -75 -3 250 150 1
|
|
box b1 -100 -50 -2 200 100 1
|
|
|
|
# text label
|
|
text2brep t "texT | Text\ntexT | Text" -height 50
|
|
bounding t -save xx yy zz aTX aTY zz
|
|
ttranslate t -0.5*aTX -0.5*aTY 1
|
|
|
|
# sphere
|
|
psphere s 50
|
|
|
|
# clock marks
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 1} {incr i} { vertex p1_$i [expr 75+5*$i] 86 1; lappend aPnts p1_$i }
|
|
compound {*}$aPnts p1
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 2} {incr i} { vertex p2_$i [expr 130+5*$i] 86 1; lappend aPnts p2_$i }
|
|
compound {*}$aPnts p2
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 3} {incr i} { vertex p3_$i [expr 130+5*$i] 0 1; lappend aPnts p3_$i }
|
|
compound {*}$aPnts p3
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 4} {incr i} { vertex p4_$i [expr 120+5*$i] -85 1; lappend aPnts p4_$i }
|
|
compound {*}$aPnts p4
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 5} {incr i} { vertex p5_$i [expr 55+5*$i] -85 1; lappend aPnts p5_$i }
|
|
compound {*}$aPnts p5
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 6} {incr i} { vertex p6_$i [expr -18+5*$i] -85 1; lappend aPnts p6_$i }
|
|
compound {*}$aPnts p6
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 7} {incr i} { vertex p7_$i [expr -85+5*$i] -85 1; lappend aPnts p7_$i }
|
|
compound {*}$aPnts p7
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 8} {incr i} { vertex p8_$i [expr -160+5*$i] -85 1; lappend aPnts p8_$i }
|
|
compound {*}$aPnts p8
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <= 9} {incr i} { vertex p9_$i [expr -160+5*$i] 0 1; lappend aPnts p9_$i }
|
|
compound {*}$aPnts p9
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <=10} {incr i} { vertex p10_$i [expr -165+5*$i] 86 1; lappend aPnts p10_$i }
|
|
compound {*}$aPnts p10
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <=11} {incr i} { vertex p11_$i [expr -100+5*$i] 86 1; lappend aPnts p11_$i }
|
|
compound {*}$aPnts p11
|
|
|
|
set aPnts {}
|
|
for {set i 1} {$i <=12} {incr i} { vertex p12_$i [expr -30+5*$i] 86 1; lappend aPnts p12_$i }
|
|
compound {*}$aPnts p12
|
|
|
|
# entire list of 2d presentations
|
|
set aList {b1 b2 b3 b4 s t p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12}
|
|
|
|
vclear
|
|
vinit View1
|
|
vdisplay -dispMode 1 -highMode 1 -2d -trsfPersPos 0 0 {*}$aList
|
|
vsetmaterial b1 b2 b3 b4 t PLASTIC
|
|
vsetcolor b1 RED
|
|
vsetcolor b2 GREEN
|
|
vsetcolor b3 BLUE
|
|
vsetcolor b4 MAGENTA
|
|
vsetcolor t GOLD
|
|
vsetlocation s 0 0 -1
|
|
|
|
box bb 1000 1000 1000
|
|
vdisplay -dispMode 0 bb
|
|
vfit
|
|
vdump $imagedir/${casename}_center.png
|
|
|
|
vdisplay -dispMode 1 -highMode 1 -2d -trsfPersPos -1 1 {*}$aList
|
|
vdump $imagedir/${casename}_tl.png
|
|
|
|
vdisplay -dispMode 1 -highMode 1 -2d -trsfPersPos 1 1 {*}$aList
|
|
vdump $imagedir/${casename}_tr.png
|
|
|
|
vdisplay -dispMode 1 -highMode 1 -2d -trsfPersPos 1 -1 {*}$aList
|
|
vdump $imagedir/${casename}_br.png
|
|
|
|
vdisplay -dispMode 1 -highMode 1 -2d -trsfPersPos -1 -1 {*}$aList
|
|
vdump $imagedir/${casename}_bl.png
|
|
|
|
vmoveto 110 385
|
|
vselect 110 385
|
|
set aColor [vreadpixel 110 385 rgb name]
|
|
if { $aColor != "GRAY89" } { puts "Error: wrong object is highlighted" }
|