View Issue Details

IDProjectCategoryView StatusLast Update
0030484Open CASCADEOCCT:Visualizationpublic2023-09-11 16:49
Reporternds Assigned Tomzernova  
PriorityhighSeveritymajor 
Status newResolutionopen 
Product Version7.3.0 
Target Version7.8.0 
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 Files

  • 30484_wrong_highlight.png (11,792 bytes)

Relationships

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

Activities

nds

2019-02-07 13:55

developer  

30484_wrong_highlight.png (11,792 bytes)

git

2019-02-07 15:36

administrator   ~0082063

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

kgv

2019-05-01 12:24

developer   ~0084087

Last edited: 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
2019-05-01 12:10 kgv Steps to Reproduce Updated
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
2019-09-04 17:35 kgv Target Version 7.4.0 => 7.5.0
2020-09-21 10:18 nds Target Version 7.5.0 => 7.6.0
2021-08-24 14:21 kgv Target Version 7.6.0 => 7.7.0
2022-08-17 11:57 kgv Target Version 7.7.0 => 7.8.0
2023-08-01 15:09 dpasukhi Target Version 7.8.0 => Unscheduled
2023-09-11 16:48 eugeny.belousov_162739 Assigned To nds => mzernova
2023-09-11 16:49 eugeny.belousov_162739 Priority normal => high
2023-09-11 16:49 eugeny.belousov_162739 Severity minor => major
2023-09-11 16:49 eugeny.belousov_162739 Target Version Unscheduled => 7.8.0