MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0023422Community[OCCT] OCCT:Visualizationpublic2012-09-06 18:062014-11-11 12:57
Reporterapl 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformAOSLOS VersionL
Product Version[OCCT] 6.5.3 
Target Version[OCCT] 6.8.0Fixed in Version[OCCT] 6.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 Filespng file icon selection.png (38,679 bytes) 2012-09-06 18:11

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

-  Notes
(0030928)
san (developer)
2014-08-20 13:04

Can you please check if this issue is resolved by the patch for 0024837?
(0030970)
san (developer)
2014-08-21 10:05

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.
(0030973)
bugmaster (administrator)
2014-08-21 10:09

Dear MKV,

Please recheck and if all OK create testing case
(0031091)
mkv (tester)
2014-08-26 14:00

Dear duv,
test case bugs vis(004) bug23422 was created and pushed to git branch CR24837 0024837
Could you please review it.
(0031094)
duv (developer)
2014-08-26 15:05

Dear mkv,

Test case reviewed without remarks.
(0031156)
bugmaster (administrator)
2014-08-28 14:36

Waiting fix for 24837
(0031181)
duv (developer)
2014-08-29 12:12

Dear bugmaster,

CR24837 is tested.
(0031265)
bugmaster (administrator)
2014-09-02 12:09
edited on: 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 View Revisions
2014-11-11 12:45 user533 Fixed in Version => 6.8.0
2014-11-11 12:57 user533 Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker