0028988: Visualization - AIS_InteractiveContext::SetLocation() does not reset locatio...
authorkgv <kgv@opencascade.com>
Wed, 7 Mar 2018 18:22:16 +0000 (21:22 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 16 Mar 2018 11:56:28 +0000 (14:56 +0300)
SelectMgr_SelectionManager - removed broken HasTransformation() checks.

src/SelectMgr/SelectMgr_SelectableObject.cxx
src/SelectMgr/SelectMgr_SelectionManager.cxx
tests/bugs/vis/bug28988 [new file with mode: 0644]

index dc3126d..14f4d61 100644 (file)
@@ -265,11 +265,6 @@ void SelectMgr_SelectableObject::UpdateTransformation()
 void SelectMgr_SelectableObject::UpdateTransformations (const Handle(SelectMgr_Selection)& theSel)
 {
   const TopLoc_Location aSelfLocation (Transformation());
-  if (aSelfLocation.IsIdentity())
-  {
-    return;
-  }
-
   for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSel->Entities()); aSelEntIter.More(); aSelEntIter.Next())
   {
     if (Handle(Select3D_SensitiveEntity) aSensEntity = Handle(Select3D_SensitiveEntity)::DownCast (aSelEntIter.Value()->BaseSensitive()))
index a730aa4..86e34a1 100644 (file)
@@ -345,10 +345,7 @@ void SelectMgr_SelectionManager::Activate (const Handle(SelectMgr_SelectableObje
     Standard_FALLTHROUGH
     case SelectMgr_TOU_Partial:
     {
-      if(theObject->HasTransformation())
-      {
-        theObject->UpdateTransformations (aSelection);
-      }
+      theObject->UpdateTransformations (aSelection);
       theSelector->RebuildObjectsTree();
       break;
     }
@@ -846,11 +843,8 @@ void SelectMgr_SelectionManager::Update (const Handle(SelectMgr_SelectableObject
         Standard_FALLTHROUGH
         case SelectMgr_TOU_Partial:
         {
-          if (theObject->HasTransformation())
-          {
-            theObject->UpdateTransformations (aSelection);
-            theSelector->RebuildObjectsTree();
-          }
+          theObject->UpdateTransformations (aSelection);
+          theSelector->RebuildObjectsTree();
           break;
         }
         default:
diff --git a/tests/bugs/vis/bug28988 b/tests/bugs/vis/bug28988
new file mode 100644 (file)
index 0000000..3712dfc
--- /dev/null
@@ -0,0 +1,22 @@
+puts "=================="
+puts "0028988: Visualization - AIS_InteractiveContext::SetLocation() does not reset location properly"
+puts "=================="
+puts ""
+
+pload MODELING VISUALIZATION
+
+box b 1 2 3
+vclear
+vinit View1
+vaxo
+vdisplay -dispMode 1 -highMode 1 b
+vfit
+vmoveto 110 110
+if { "[vreadpixel 110 110 rgb name]" != "DARKTURQUOISE" } { puts "Error: shape is not selected!" }
+
+vlocation b -translate 1 0 0
+vmoveto 110 110
+vlocation b -reset
+vmoveto 110 110
+vreadpixel 110 110 rgb name
+if { "[vreadpixel 110 110 rgb name]" != "DARKTURQUOISE" } { puts "Error: resetted shape is not selected!" }