View Issue Details

IDProjectCategoryView StatusLast Update
0023422CommunityOCCT:Visualizationpublic2014-11-11 12:57
ReporteraplAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformAOSL 
Product Version6.5.3 
Target Version6.8.0Fixed in Version6.8.0 
Summary0023422: Selection problems when using SetLocation.
DescriptionThe bug was originally reported on the forum:
http://www.opencascade.org/org/forum/thread_20788/?forum=3

When using SetLocation for AIS objects, the desired location is not applied to sensitive entities as expected. While the presentation moves to the desired position, it can be picked only in its previous or identity location.
The bug is a result of logical mistakes and numerous references in code that deals with HasLocation() and Location() in Select3D_SensitiveEntity and SelectMgr_EntitiyOwner.

As reported on the forum, it is necessary to call SetLocation(...) method with similar arguments at least twice. Moreover, after recomputing the selection for AIS object, the sensitives are located at identity.

==============================================================================

Originally, the problem is produced by invalid comparison of locations in code of Select3D_SensitiveEntity:

//---------------------------------------------------------------------------
void Select3D_SensitiveEntity::UpdateLocation(const TopLoc_Location& aLoc)
{
  if(aLoc.IsIdentity() || aLoc == Location()) return;
  if(!HasLocation())
    SetLocation(aLoc);
  ...

The first statement is always true, as the aLoc corresponds to the updated location of AIS_InteractiveObject (and Prs3d_PresentableObject), while the Location() returns the same location by referencing it from SelectMgr_EntitiyOwner and, thereby, from AIS_InteractiveObject.

The Select3D_SensitiveEntity::SetLocation() (which is never called) is redefined in Select3D_SensitiveGroup, Select3D_SensitiveTriangulation, Select3D_SensitiveWire, so the entities don't work as expected.

The code above is called right after Prs3d_PresentableObject::SetLocation (inherited by AIS_InteractiveObject) is invoked, so the location for the object updated first and thus the comparison fails.

===============================================================================

The location logic is very complicated, with a lot references, so corresponding code should be refactored to avoid expansion of such a mistakes.
Steps To Reproduce-------------------------------------------------------------------------------
Handle(AIS_InteractiveContext) aContext = ...;
Handle(AIS_Shape) aShape = ...;

aContext->Display (aShape);

gp_Trsf aTrsf1;
aTrsf1.SetTranslation (gp_Vec (10.0, 10.0, 10.0));
TopLoc_Location aLoc1 (aTrsf1);

aContext->SetLocation (aShape, aLoc1);
aContext->Redisplay (aShape);
-----------------------------------------------------------------------------
Bug: the shape can be picked in identity location, while it is displayed as translated.
TagsNo tags attached.
Test case numberbugs vis(004) bug23422

Attached Files

  • selection.png (38,679 bytes)

Relationships

related to 0024623 closedbugmaster Open CASCADE Visualization - improve selection mechanism 
related to 0024837 closedbugmaster Open CASCADE Visualization - revise design and implementation of connected Interactive Objects 

Activities

apl

2012-09-06 18:11

developer  

selection.png (38,679 bytes)

san

2014-08-20 13:04

developer   ~0030928

Can you please check if this issue is resolved by the patch for 0024837?

san

2014-08-21 10:05

developer   ~0030970

Should be fixed by the patch for 0024837, please test with branch CR24837 and close.

NOTE: vsetlocation command can be used for testing instead of the C++ reproducer.

bugmaster

2014-08-21 10:09

administrator   ~0030973

Dear MKV,

Please recheck and if all OK create testing case

mkv

2014-08-26 14:00

tester   ~0031091

Dear duv,
test case bugs vis(004) bug23422 was created and pushed to git branch CR24837 0024837
Could you please review it.

duv

2014-08-26 15:05

developer   ~0031094

Dear mkv,

Test case reviewed without remarks.

bugmaster

2014-08-28 14:36

administrator   ~0031156

Waiting fix for 24837

duv

2014-08-29 12:12

developer   ~0031181

Dear bugmaster,

CR24837 is tested.

bugmaster

2014-09-02 12:09

administrator   ~0031265

Last edited: 2014-09-02 12:09

Test case has been integrated with fix for 0024837

Issue History

Date Modified Username Field Change
2012-09-06 18:06 apl New Issue
2012-09-06 18:06 apl Assigned To => san
2012-09-06 18:11 apl File Added: selection.png
2012-10-23 15:10 abv Target Version 6.5.4 => 6.6.0
2013-02-26 18:33 san Target Version 6.6.0 => 6.7.0
2013-12-12 11:06 san Target Version 6.7.0 => 6.7.1
2014-02-17 15:20 kgv Relationship added related to 0024623
2014-04-04 18:09 abv Target Version 6.7.1 => 6.8.0
2014-08-20 13:02 san Relationship added related to 0024837
2014-08-20 13:04 san Note Added: 0030928
2014-08-20 13:04 san Assigned To san => duv
2014-08-20 13:04 san Status new => feedback
2014-08-21 10:03 san Status feedback => assigned
2014-08-21 10:05 san Note Added: 0030970
2014-08-21 10:05 san Assigned To duv => bugmaster
2014-08-21 10:05 san Status assigned => feedback
2014-08-21 10:09 bugmaster Note Added: 0030973
2014-08-21 10:09 bugmaster Assigned To bugmaster => mkv
2014-08-26 14:00 mkv Note Added: 0031091
2014-08-26 14:01 mkv Test case number => bugs vis(004) bug23422
2014-08-26 14:01 mkv Assigned To mkv => duv
2014-08-26 15:05 duv Note Added: 0031094
2014-08-26 15:05 duv Assigned To duv => mkv
2014-08-26 15:05 duv Status feedback => reviewed
2014-08-26 15:26 mkv Assigned To mkv => bugmaster
2014-08-26 15:26 mkv Status reviewed => tested
2014-08-28 14:36 bugmaster Note Added: 0031156
2014-08-28 14:36 bugmaster Assigned To bugmaster => duv
2014-08-28 14:36 bugmaster Status tested => assigned
2014-08-29 12:12 duv Note Added: 0031181
2014-08-29 12:12 duv Status assigned => feedback
2014-08-29 12:51 duv Assigned To duv => bugmaster
2014-09-02 12:08 bugmaster Status feedback => tested
2014-09-02 12:09 bugmaster Note Added: 0031265
2014-09-02 12:09 bugmaster Status tested => verified
2014-09-02 12:09 bugmaster Resolution open => fixed
2014-09-02 12:09 bugmaster Note Edited: 0031265
2014-11-11 12:45 aiv Fixed in Version => 6.8.0
2014-11-11 12:57 aiv Status verified => closed