Fix node tree logging 44/258744/2
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 25 May 2021 05:23:36 +0000 (14:23 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 27 May 2021 00:54:51 +0000 (09:54 +0900)
Change-Id: I7d01d54fee9dae84f2e2ae9364b4e0a8066104ac

dali/internal/update/manager/update-manager-debug.cpp
dali/internal/update/manager/update-manager.cpp

index e543e6c..dd956f8 100644 (file)
@@ -47,14 +47,6 @@ static Debug::Filter* gNodeLogFilter = Debug::Filter::New(Debug::Verbose, false,
  */
 void PrintNodes(const Node& node, BufferIndex updateBufferIndex, int level)
 {
-  const Vector3&    position = node.GetPosition(updateBufferIndex);
-  const Vector3&    scale    = node.GetScale(updateBufferIndex);
-  const Vector3&    fullPos  = node.GetWorldPosition(updateBufferIndex);
-  const Quaternion& rotation = node.GetOrientation(updateBufferIndex);
-  Vector3           axis;
-  Radian            angle;
-  rotation.ToAxisAngle(axis, angle);
-
   std::string nodeName = DALI_LOG_GET_OBJECT_STRING((&node));
 
   {
@@ -64,26 +56,15 @@ void PrintNodes(const Node& node, BufferIndex updateBufferIndex, int level)
     mask |= std::ios_base::fixed;
     oss << std::setprecision(2) << std::setiosflags(mask)
         << std::setw(level * 2) << std::setfill(' ') << "";
+
     oss << "Node " << nodeName << " " << &node
-        << "  Position (" << position.x << ", " << position.y << ", " << position.z << ")"
-        << "  WorldPosition (" << fullPos.x << ", " << fullPos.y << ", " << fullPos.z << ")"
-        << "  Orientation (" << Degree(angle).degree << "degrees <" << axis.x << ", " << axis.y << ", " << axis.z << ">)"
-        << "  Scale (" << scale.x << ", " << scale.y << ", " << scale.z << ")"
+        << " Position: " << node.GetPosition(updateBufferIndex)
+        << " WorldPosition: " << node.GetWorldPosition(updateBufferIndex)
+        << " Size: " << node.GetSize(updateBufferIndex)
+        << " Visible: " << node.IsVisible(updateBufferIndex)
         << std::endl;
 
-    DALI_LOG_INFO(gNodeLogFilter, Debug::Verbose, "%s\n", oss.str().c_str());
-  }
-
-  {
-    std::ostringstream      oss;
-    std::ios_base::fmtflags mask = oss.flags();
-    mask &= ~std::ios_base::scientific;
-    mask |= std::ios_base::fixed;
-    oss << std::setprecision(2) << std::setiosflags(mask)
-        << std::setw(level * 2) << std::setfill(' ') << "";
-
-    std::string trafoMatrix = Debug::MatrixToString(node.GetWorldMatrix(updateBufferIndex), 2, level * 2);
-    DALI_LOG_INFO(gNodeLogFilter, Debug::Verbose, "%s\n", trafoMatrix.c_str());
+    DALI_LOG_INFO(gNodeLogFilter, Debug::Verbose, "%s", oss.str().c_str());
   }
 
   ++level;
index 4240fa0..7f8eca8 100644 (file)
 //#define NODE_TREE_LOGGING 1
 
 #if(defined(DEBUG_ENABLED) && defined(NODE_TREE_LOGGING))
-#define SNAPSHOT_NODE_LOGGING                                                       \
-  const uint32_t FRAME_COUNT_TRIGGER = 16;                                          \
-  if(mImpl->frameCounter >= FRAME_COUNT_TRIGGER)                                    \
-  {                                                                                 \
-    for(auto&& scene : mImpl->scenes)                                               \
-    {                                                                               \
-      if(scene && scene->root)                                                      \
-      {                                                                             \
-        mImpl->frameCounter = 0;                                                    \
-        PrintNodeTree(*scene->root, mSceneGraphBuffers.GetUpdateBufferIndex(), ""); \
-      }                                                                             \
-    }                                                                               \
-  }
-mImpl->frameCounter++;
+#define SNAPSHOT_NODE_LOGGING                                                   \
+  const uint32_t FRAME_COUNT_TRIGGER = 16;                                      \
+  if(mImpl->frameCounter >= FRAME_COUNT_TRIGGER)                                \
+  {                                                                             \
+    for(auto&& scene : mImpl->scenes)                                           \
+    {                                                                           \
+      if(scene && scene->root)                                                  \
+      {                                                                         \
+        mImpl->frameCounter = 0;                                                \
+        PrintNodes(*scene->root, mSceneGraphBuffers.GetUpdateBufferIndex(), 0); \
+      }                                                                         \
+    }                                                                           \
+  }                                                                             \
+  mImpl->frameCounter++;
 #else
 #define SNAPSHOT_NODE_LOGGING
 #endif