]> OCCT Git - occt.git/commitdiff
0032001: Visualization - moving dump of selection owner from sensitive to selection...
authornds <nds@opencascade.com>
Wed, 16 Dec 2020 09:19:17 +0000 (12:19 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 18 Dec 2020 16:48:03 +0000 (19:48 +0300)
src/Select3D/Select3D_SensitiveEntity.cxx
src/SelectMgr/SelectMgr_Selection.cxx

index 95d94d6300fc78ef9d0df3ea9a11777a2f1a16ac..97bc6a36841e107efb6eead7f748fc05d9906f9a 100644 (file)
@@ -39,7 +39,7 @@ void Select3D_SensitiveEntity::DumpJson (Standard_OStream& theOStream, Standard_
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myOwnerId.get())
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwnerId.get())
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySFactor)
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbSubElements());
index d31eeafd3bdd61bbc4a44b887fb3298886497d5c..61f3d2e90907bec8287d5cdf0e4ba165456769ca 100644 (file)
@@ -124,6 +124,21 @@ void SelectMgr_Selection::DumpJson (Standard_OStream& theOStream, Standard_Integ
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
+  NCollection_Map<Handle(SelectMgr_EntityOwner)> anOwners;
+  for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator anIterator (myEntities); anIterator.More(); anIterator.Next())
+  {
+    const Handle(SelectMgr_SensitiveEntity)& anEntity = anIterator.Value();
+    if (anEntity.IsNull() || anEntity->BaseSensitive().IsNull())
+    {
+      continue;
+    }
+    const Handle(SelectMgr_EntityOwner)& anOwner = anEntity->BaseSensitive()->OwnerId();
+    if (anOwners.Add (anOwner))
+    {
+      OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anOwner.get())
+    }
+  }
+
   for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator anIterator (myEntities); anIterator.More(); anIterator.Next())
   {
     const Handle(SelectMgr_SensitiveEntity)& anEntity = anIterator.Value();