[gegl/soc-2013-n-point-deformation: 25/28] libs: npd: add npd_print_model debug function



commit 71456658783d944a300ccadeab7e1f6664080f3b
Author: Marek Dvoroznak <dvoromar gmail com>
Date:   Sat Oct 19 21:08:57 2013 +0200

    libs: npd: add npd_print_model debug function

 libs/npd/npd_common.c |   27 +++++++++++++++++++++++++++
 libs/npd/npd_common.h |    2 ++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/libs/npd/npd_common.c b/libs/npd/npd_common.c
index 90dc104..327bb0c 100644
--- a/libs/npd/npd_common.c
+++ b/libs/npd/npd_common.c
@@ -491,6 +491,33 @@ npd_reset_weights (NPDHiddenModel *hm)
 }
 
 void
+npd_print_model (NPDModel        *model,
+                 gboolean         print_control_points)
+{
+  gint i;
+  g_printf ("NPDModel:\n");
+  g_printf ("control point radius: %f\n", model->control_point_radius);
+  g_printf ("control points visible: %d\n", model->control_points_visible);
+  g_printf ("mesh visible: %d\n", model->mesh_visible);
+  g_printf ("texture visible: %d\n", model->texture_visible);
+  g_printf ("mesh square size: %d\n", model->mesh_square_size);
+
+  npd_print_hidden_model (model->hidden_model, FALSE, FALSE);
+
+  if (print_control_points)
+    {
+      g_printf ("%d control points:\n", model->control_points->len);
+      for (i = 0; i < model->control_points->len; i++)
+        {
+          NPDControlPoint *cp = &g_array_index (model->control_points,
+                                                NPDControlPoint,
+                                                i);
+          npd_print_point (&cp->point, TRUE);
+        }
+    }
+}
+
+void
 npd_print_hidden_model (NPDHiddenModel *hm,
                         gboolean        print_bones,
                         gboolean        print_overlapping_points)
diff --git a/libs/npd/npd_common.h b/libs/npd/npd_common.h
index b43d2b2..917dc13 100644
--- a/libs/npd/npd_common.h
+++ b/libs/npd/npd_common.h
@@ -140,6 +140,8 @@ void             npd_set_deformation_type       (NPDModel        *model,
 void             npd_compute_MLS_weights        (NPDModel        *model);
 void             npd_reset_weights              (NPDHiddenModel  *hidden_model);
 
+void             npd_print_model                (NPDModel        *model,
+                                                 gboolean         print_control_points);
 void             npd_print_hidden_model         (NPDHiddenModel  *hm,
                                                  gboolean         print_bones,
                                                  gboolean         print_overlapping_points);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]