MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030484Open CASCADE[OCCT] OCCT:Visualizationpublic2019-02-07 12:032019-09-04 17:35
Reporternds 
Assigned Tonds 
PrioritynormalSeverityminor 
StatusnewResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 7.3.0 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0030484: Visualization, SelectMgr_ViewerSelector - Graphic3d_TMF_2d persistence sorting issues
DescriptionSelectMgr_ViewerSelector relies on the following SelectMgr_SortCriterion properties for sorting picking results, which might be invalid in case of 2D persistent (Graphic3d_TMF_2d) presentations:
- Distance to the geometry center (SelectBasics_PickResult::DistToGeomCenter()).
  This property has no much sense for 2D objects.
- Depth from eye with tolerance.
  The tolerance can have a negative sign for transformation-persistence objects
  leading to invalid comparison results for objects having equal depth.
Steps To Reproduce
pload MODELING VISUALIZATION
vclear
vinit View1
vselprops dynHighlight -dispMode 1 -color WHITE

box b1  75 -250 0 200 200 200
box b2 175 -300 0 200 200 200

vdisplay b1 -2d topLeft -top -dispmode 1
vsetmaterial b1  PLASTIC
vsetcolor    b1 DEEPPINK2

vdisplay b2 -2d topLeft -top -dispmode 1
vsetmaterial b2 PLASTIC
vsetcolor    b2 PALEGREEN2

vmoveto 205 170

if { [vreadpixel 205 170 rgb name] != "WHITE" } { puts "Error: common area should be highlighted" 
}
if { [vreadpixel 150 170 rgb name] == "WHITE" } { puts "Error: box b1 should NOT be highlighted" 
}
if { [vreadpixel 330 170 rgb name] != "WHITE" } { puts "Error: box b2 should be highlighted" 
}
TagsNo tags attached.
Test case number
Attached Filespng file icon 30484_wrong_highlight.png (11,792 bytes) 2019-02-07 13:55

- Relationships
related to 0030686closedbugmaster Visualization, SelectMgr_ViewerSelector - sorting issues of transformation-persistent objects 

-  Notes
(0082063)
git (administrator)
2019-02-07 15:36

Branch CR30484 has been created by nds.

SHA-1: d812a0899284f8dc807f087cd77d6f68768924d7


Detailed log of new commits:

Author: nds
Date: Thu Feb 7 15:31:50 2019 +0300

    0030484: Visualization - 2d persistent: order of detection doesn't coincide with order of objects creation
(0084087)
kgv (developer)
2019-05-01 12:24
edited on: 2019-05-01 12:36

Zeroing MinDist for 2D objects is not really helpful - it can provide desired effect only within limited usage scenarios, while in other cases result will become worse.

Consider extending your test case with removal/redisplay of first box:
pload MODELING VISUALIZATION
vclear
vinit View1
vselprops dynHighlight -dispMode 1 -color WHITE

box b1  75 -250 0 200 200 200
box b2 175 -300 0 200 200 200

vdisplay b1 -2d topLeft -top -dispmode 1
vsetmaterial b1  PLASTIC
vsetcolor    b1 DEEPPINK2

vdisplay b2 -2d topLeft -top -dispmode 1
vsetmaterial b2 PLASTIC
vsetcolor    b2 PALEGREEN2

vremove b1
vdisplay b1 -2d topLeft -top -dispmode 1
vsetmaterial b1  PLASTIC
vsetcolor    b1 DEEPPINK2

The result will be that b1 will now visually overlap b2, but highlighting (with patch applied) will tend to highlight b2 behind b1.

The root cause of the issue is an attempt to display two overlapping 2D objects with the same depth, which in general case produce undefined behavior for both - selection and visualization.

OCCT visualization does NOT guarantee rendering order for objects within a single ZLayer and having the same rendering priority - the actual rendering order following the order of displaying objects in AIS_InteractiveContext is a side effect of usage of collections with well-defined ordering in memory like to achieve reproducibility of visual results, and easily messed up after objects movements in context (like selecting/deselecting objects leading to movements from one Priority to another).

So that in this particular use case it is really desired displaying objects with extra information (different display Priority, different ZLayer, artificially different Z) for producing coherent visual and selection results. Note that since Selection currently ignores Display Priority, this property still wouldn't help (although selection itself has its own independent Selection Priorities actually used for sorting).


- Issue History
Date Modified Username Field Change
2019-02-07 12:03 nds New Issue
2019-02-07 12:03 nds Assigned To => kgv
2019-02-07 13:55 nds File Added: 30484_wrong_highlight.png
2019-02-07 13:55 nds Assigned To kgv => nds
2019-02-07 15:36 git Note Added: 0082063
2019-05-01 12:00 kgv Product Version => 7.3.0
2019-05-01 12:00 kgv Summary Visualization - 2d persistent: order of detection doesn't coincide with order of objects creation => Visualization, SelectMgr_ViewerSelector - Graphic3d_TMF_2d persistence sorting issues
2019-05-01 12:00 kgv Description Updated View Revisions
2019-05-01 12:10 kgv Steps to Reproduce Updated View Revisions
2019-05-01 12:24 kgv Note Added: 0084087
2019-05-01 12:29 kgv Relationship added related to 0030686
2019-05-01 12:36 kgv Note Edited: 0084087 View Revisions
2019-09-04 17:35 kgv Target Version 7.4.0 => 7.5.0*


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker