View Issue Details

IDProjectCategoryView StatusLast Update
0027796Open CASCADEOCCT:Visualizationpublic2016-12-09 16:39
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.1.0Fixed in Version7.1.0 
Summary0027796: Visualization - allow 3D objects with Graphic3d_TMF_2d flag
DescriptionCurrent implementation of Graphic3d_TMF_2d defines custom projection matrix unrelated to camera definition. This makes rendering of objects with this flag completely independent.

As a side effect, this flag disallow usage of any 3D objects due to clipping issues.

It will provide more flexibility if implementation will allow such option.
Steps To Reproduce
pload MODELING VISUALIZATION

# four rectangles
box b4 -175 -125 -4 350 250 1
box b3 -150 -100 -3 300 200 1
box b2 -125 -75  -2 250 150 1
box b1 -100 -50  -1 200 100 1

# text label
text2brep t "texT | Text\ntexT | Text" -height 50
set aTB [bounding t]
set aTX [expr [lindex $aTB 3] * -0.5]
set aTY [expr [lindex $aTB 4] * -0.5]
ttranslate t $aTX $aTY 1

# sphere
psphere s 50

# entire list of 2d presentations
set aList {b1 b2 b3 b4 s t}

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 BLUE1
vsetcolor b4 MAGENTA1
vsetcolor t  GOLD
vsetlocation s 0 0 -0.5

box bb 1000 1000 1000
vdisplay -dispMode 0 bb
vfit

vdisplay -dispMode 1 -highMode 1 -2d -trsfPersPos -1 -1 {*}$aList
TagsNo tags attached.
Test case numberbugs vis bug27796

Attached Files

  • bug27796_bl.png (7,173 bytes)

Relationships

has duplicate 0026921 closedbugmaster Open CASCADE Visualization - handle Graphic3d_TMF_2d objects within selection 
related to 0027860 closedkgv Open CASCADE Visualization - clean up Transformation Persistence API 

Activities

git

2016-08-20 19:38

administrator   ~0056900

Branch CR27796 has been created by kgv.

SHA-1: 4c6ee271992217a87613dc06597c24358619f9c7


Detailed log of new commits:

Author: kgv
Date: Sat Aug 20 19:37:56 2016 +0300

    0027796: Visualization - allow 3D objects with Graphic3d_TMF_2d flag
    
    Graphic3d_TransformPers::Apply() now does not reset projection matrix
    for objects with Graphic3d_TMF_2d flag.
    
    Useless flag Graphic3d_TMF_2d_IsTopDown has been removed.
    SelectMgr_SelectableObjectTrsfPersSet now does not skip Graphic3d_TMF_2d presentations.
    OpenGl_Layer::BoundingBox() now takes into account Graphic3d_TMF_2d presentations for proper Z-fit.

kgv

2016-08-20 19:38

developer  

bug27796_bl.png (7,173 bytes)

kgv

2016-08-20 19:42

developer   ~0056901

Last edited: 2016-08-20 19:45

Proposed patch has been pushed to the branch CR27796.

The benefit of this solution is a consistent projection camera / common Z-fit (alternatively, dedicated Z-fit might be performed for such objects for their orthographic projection matrix).

The drawback of this approach is that rendering of 2D elements inherits issues of the main camera in corner cases (e.g. when 3D view become buggy due to precision issues, 2D elements might also blink). This can be technically further improved by additional camera management tricks (e.g. to compensate precision issues like in case of 3D objects).

git

2016-08-21 22:01

administrator   ~0056907

Branch CR27796 has been updated forcibly by kgv.

SHA-1: d006eba9b65d65d246045a19c5ad134cd9894d80

git

2016-08-21 22:22

administrator   ~0056909

Branch CR27796 has been updated forcibly by kgv.

SHA-1: e5795c2b7cf7717e1b0aa5353af40dd4c9a0303d

san

2016-08-22 23:10

developer   ~0056943

Branch CR27796 reviewed without remarks, ready for testing.

git

2016-08-22 23:10

administrator   ~0056944

Branch CR27796 has been updated forcibly by kgv.

SHA-1: d79abe60cdc391f0bf8aba63d47301e06ca76e67

git

2016-08-23 17:14

administrator   ~0056992

Branch CR27796 has been updated forcibly by kgv.

SHA-1: bd10a2172138dbb6a8ad37d36a964cc3f6a8cf93

kgv

2016-08-23 17:15

developer   ~0056993

Patch has been rebased onto updated #0027793.

mkv

2016-08-24 15:05

tester   ~0057031

Dear BugMaster,
Branch CR27796 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: bd10a2172138dbb6a8ad37d36a964cc3f6a8cf93

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1133

Regressions/Differences/Improvements:
http://occt-tests/CR27796-master-OCCT/Debian70-64/bugs/vis/bug26344.html
http://occt-tests/CR27796-master-OCCT/Windows-64-VC10/bugs/vis/bug26344.html
bugs vis bug26344: FAILED - inheritance of #27793

Testing cases:
http://occt-tests/CR27796-master-OCCT/Debian70-64/bugs/vis/bug27796.html
http://occt-tests/CR27796-master-OCCT/Windows-64-VC10/bugs/vis/bug27796.html
bugs vis bug27796: OK

Testing on Linux:
occt component :
Total MEMORY difference: 89734310 / 89508217 [+0.25%]
Total CPU difference: 19330.019999999942 / 19494.630000000107 [-0.84%]
products component :
Total MEMORY difference: 30060582 / 30056025 [+0.02%]
Total CPU difference: 5102.639999999977 / 5078.86999999998 [+0.47%]

Testing on Windows:
occt component :
Total MEMORY difference: 57171035 / 57158685 [+0.02%]
Total CPU difference: 18153.727169298865 / 18084.493925498853 [+0.38%]
products component :
Total MEMORY difference: 21297979 / 21261546 [+0.17%]
Total CPU difference: 4892.004158799947 / 4849.696687599947 [+0.87%]

There are following differences in images found by testdiff.
http://occt-tests/CR27796-master-OCCT/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR27796-master-OCCT/Windows-64-VC10/diff-Windows-64-VC10-image.html
IMAGE 3rdparty fonts A1: A1.png differs
IMAGE bugs vis bug22819: bug22819.png differs
IMAGE bugs vis bug12584: bug12584.png differs
IMAGE bugs vis bug22632: bug22632_1.png differs
IMAGE bugs vis bug22632: bug22632_3.png differs
IMAGE bugs vis bug22632: bug22632_6.png differs
IMAGE bugs vis bug22632: bug22632_5.png differs
IMAGE bugs vis bug22632: bug22632_2.png differs
IMAGE bugs vis bug22632: bug22632_4.png differs
IMAGE bugs vis bug26312: bug26312_View1.png differs
IMAGE bugs vis bug26312: bug26312_View2.png differs
IMAGE bugs vis bug26312: bug26312_View3.png differs
IMAGE bugs vis bug21091_1: bug21091_1.png differs
IMAGE bugs vis bug25136: bug25136_1.png differs
IMAGE bugs vis bug25136: bug25136_4.png differs
IMAGE bugs vis bug25136: bug25136_2.png differs
IMAGE bugs vis bug25136: bug25136_3.png differs
IMAGE bugs vis bug25027: bug25027.png differs

mkv

2016-08-24 15:05

tester   ~0057032

Dear kgv,
Branch CR27796 has been rejected due to:
- differences in images

git

2016-08-24 21:36

administrator   ~0057044

Branch CR27796 has been updated forcibly by kgv.

SHA-1: 61cea2d3ccecda2aa1621caa6133a0b18545f81b

git

2016-08-24 21:39

administrator   ~0057045

Branch CR27796 has been updated forcibly by kgv.

SHA-1: 56b5557c650d15db19c1ab7f2564396a45b2645a

kgv

2016-08-24 21:40

developer   ~0057046

AIS_ColorScale has been corrected - please check updated branch.

git

2016-08-26 14:36

administrator   ~0057094

Branch CR27796 has been updated forcibly by mkv.

SHA-1: 5784be4b58253ed7226a5d6fc8930dbeadebb4ea

git

2016-08-26 15:33

administrator   ~0057102

Branch CR27796 has been updated by kgv.

SHA-1: 545d304037f1a40b693fa4b6789594b2160a9ccc


Detailed log of new commits:

Author: kgv
Date: Thu Aug 25 22:22:35 2016 +0300

    OpenGl_Layer::updateBVH() now updates myAlwaysRenderedMap to handle
    dynamic transformation persistence flag change without redisplaying the object.

kgv

2016-08-26 15:34

developer   ~0057103

CR27796 has been updated to handle one bug (existed before this patch), not covered by test cases.

mkv

2016-08-29 13:52

tester   ~0057255

Dear BugMaster,
Branch CR27796 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 545d304037f1a40b693fa4b6789594b2160a9ccc

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1147

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR27796-master-OCCT/Debian70-64/bugs/vis/bug27796.html
http://occt-tests/CR27796-master-OCCT/Windows-64-VC10/bugs/vis/bug27796.html
bugs vis bug27796: OK

Testing on Linux:
occt component :
Total MEMORY difference: 89932143 / 89950428 [-0.02%]
Total CPU difference: 19226.979999999847 / 19308.599999999937 [-0.42%]
products component :
Total MEMORY difference: 30006787 / 30015953 [-0.03%]
Total CPU difference: 5098.539999999966 / 5043.729999999974 [+1.09%]

Testing on Windows:
occt component :
Total MEMORY difference: 57093847 / 57104361 [-0.02%]
Total CPU difference: 18210.85473549878 / 18053.48092669886 [+0.87%]
products component :
Total MEMORY difference: 21258938 / 21223623 [+0.17%]
Total CPU difference: 4891.380154799948 / 4857.465537399941 [+0.70%]

There are no differences in images found by testdiff.

mkv

2016-08-29 13:53

tester   ~0057256

Dear BugMaster,
Branch CR27796 is TESTED.

git

2016-10-28 21:48

administrator   ~0059563

Branch CR27796 has been deleted by kgv.

SHA-1: 545d304037f1a40b693fa4b6789594b2160a9ccc

Related Changesets

occt: master 150ed3d5

2016-08-20 16:37:56

kgv


Committer: bugmaster Details Diff
0027796: Visualization - allow 3D objects with Graphic3d_TMF_2d flag

Graphic3d_TransformPers::Apply() now does not reset projection matrix
for objects with Graphic3d_TMF_2d flag.

Useless flag Graphic3d_TMF_2d_IsTopDown has been removed.
SelectMgr_SelectableObjectTrsfPersSet now does not skip Graphic3d_TMF_2d presentations.
OpenGl_Layer::BoundingBox() now takes into account Graphic3d_TMF_2d presentations for proper Z-fit.

AIS_ColorScale now uses "lazy" mode for rendering labels
(considering 2D persistence to be already defined within entire structure).

OpenGl_Layer::updateBVH() now updates myAlwaysRenderedMap to handle
dynamic transformation persistence flag change without redisplaying the object.
Affected Issues
0027796
mod - src/AIS/AIS_ColorScale.cxx Diff File
mod - src/Graphic3d/Graphic3d_CView.cxx Diff File
mod - src/Graphic3d/Graphic3d_TransformPers.hxx Diff File
mod - src/Graphic3d/Graphic3d_TransModeFlags.hxx Diff File
mod - src/OpenGl/OpenGl_Layer.cxx Diff File
mod - src/OpenGl/OpenGl_Layer.hxx Diff File
mod - src/SelectMgr/SelectMgr_SelectableObjectTrsfPersSet.cxx Diff File
mod - src/StdSelect/StdSelect_ViewerSelector3d.cxx Diff File
mod - src/ViewerTest/ViewerTest.cxx Diff File
rm - tests/bugs/vis/bug25783_2 Diff File
add - tests/bugs/vis/bug27796 Diff File

Issue History

Date Modified Username Field Change
2016-08-20 19:30 kgv New Issue
2016-08-20 19:30 kgv Assigned To => kgv
2016-08-20 19:38 git Note Added: 0056900
2016-08-20 19:38 kgv File Added: bug27796_bl.png
2016-08-20 19:42 kgv Note Added: 0056901
2016-08-20 19:42 kgv Assigned To kgv => san
2016-08-20 19:42 kgv Status new => feedback
2016-08-20 19:45 kgv Note Edited: 0056901
2016-08-21 22:01 git Note Added: 0056907
2016-08-21 22:22 git Note Added: 0056909
2016-08-22 23:10 san Note Added: 0056943
2016-08-22 23:10 san Assigned To san => bugmaster
2016-08-22 23:10 san Status feedback => reviewed
2016-08-22 23:10 git Note Added: 0056944
2016-08-23 10:32 mkv Assigned To bugmaster => mkv
2016-08-23 17:05 kgv Assigned To mkv => kgv
2016-08-23 17:05 kgv Status reviewed => assigned
2016-08-23 17:14 git Note Added: 0056992
2016-08-23 17:15 kgv Note Added: 0056993
2016-08-23 17:15 kgv Assigned To kgv => bugmaster
2016-08-23 17:15 kgv Status assigned => resolved
2016-08-23 17:15 kgv Status resolved => reviewed
2016-08-23 17:47 mkv Assigned To bugmaster => mkv
2016-08-24 15:05 mkv Note Added: 0057031
2016-08-24 15:05 mkv Note Added: 0057032
2016-08-24 15:05 mkv Assigned To mkv => kgv
2016-08-24 15:05 mkv Status reviewed => feedback
2016-08-24 15:06 mkv Test case number => bugs vis bug27796
2016-08-24 21:36 git Note Added: 0057044
2016-08-24 21:39 git Note Added: 0057045
2016-08-24 21:40 kgv Note Added: 0057046
2016-08-24 21:40 kgv Assigned To kgv => bugmaster
2016-08-24 21:40 kgv Status feedback => reviewed
2016-08-26 14:36 git Note Added: 0057094
2016-08-26 15:33 git Note Added: 0057102
2016-08-26 15:34 kgv Note Added: 0057103
2016-08-26 15:40 mkv Assigned To bugmaster => mkv
2016-08-29 13:52 mkv Note Added: 0057255
2016-08-29 13:53 mkv Note Added: 0057256
2016-08-29 13:53 mkv Assigned To mkv => bugmaster
2016-08-29 13:53 mkv Status reviewed => tested
2016-09-02 10:27 bugmaster Changeset attached => occt master 150ed3d5
2016-09-02 10:27 bugmaster Status tested => verified
2016-09-02 10:27 bugmaster Resolution open => fixed
2016-09-10 14:35 kgv Relationship added related to 0027860
2016-10-13 16:07 kgv Relationship added has duplicate 0026921
2016-10-28 21:48 git Note Added: 0059563
2016-12-09 16:30 aiv Status verified => closed
2016-12-09 16:39 aiv Fixed in Version => 7.1.0