Revision: 54992
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54992&view=rev
Author:   tbrowder2
Date:     2013-03-30 23:41:13 +0000 (Sat, 30 Mar 2013)
Log Message:
-----------
add code to use latest adaptagrams code (its API changed last summer); note 
that the current version of adaptagrams may not work without changes (my 
changes will be sent to the upstream author)

Modified Paths:
--------------
    brlcad/trunk/src/libged/dag.cpp

Modified: brlcad/trunk/src/libged/dag.cpp
===================================================================
--- brlcad/trunk/src/libged/dag.cpp     2013-03-30 03:12:09 UTC (rev 54991)
+++ brlcad/trunk/src/libged/dag.cpp     2013-03-30 23:41:13 UTC (rev 54992)
@@ -129,7 +129,18 @@
 {
     double new_x, new_y, new_x1, new_y1;
 
+#define LIBAVOID_LATEST_API
+#if defined LIBAVOID_LATEST_API
+    #define LIBX 0
+    #define LIBY 1
+    Box bbox = child->polygon().offsetBoundingBox(0);
+    new_x  = bbox.min[LIBX];
+    new_y  = bbox.min[LIBY];
+    new_x1 = bbox.max[LIBX];
+    new_y1 = bbox.max[LIBY];
+#else
     child->polygon().getBoundingRect(&new_x, &new_y, &new_x1, &new_y1);
+#endif
 
     /* If it has a parent it means that is not the root node.
      * Therefore, set the child's position depending on the parent's position.
@@ -137,8 +148,15 @@
     if (has_parent) {
        double parent_x, parent_y, parent_x1, parent_y1;
 
+#if defined LIBAVOID_LATEST_API
+        Box parent_bbox = parent->polygon().offsetBoundingBox(0);
+        parent_x  = bbox.min[LIBX];
+        parent_y  = bbox.min[LIBY];
+        parent_x1 = bbox.max[LIBX];
+        parent_y1 = bbox.max[LIBY];
+#else
        parent->polygon().getBoundingRect(&parent_x, &parent_y, &parent_x1, 
&parent_y1);
-
+#endif
        /* If the child node is not already on that level. Reset its y 
coordinate. */
        if (!NEAR_EQUAL(new_y, parent_y + POSITION_COORDINATE, 0.001)) {
            new_y = parent_y + POSITION_COORDINATE;
@@ -519,7 +537,11 @@
     dag->object_types = bu_create_hash_tbl(1);
 
     /* Sets a spacing distance for overlapping orthogonal connectors to be 
nudged apart. */
+#if defined LIBAVOID_LATEST_API
+    dag->router->setRoutingParameter(idealNudgingDistance, 25);
+#else
     dag->router->setOrthogonalNudgeDistance(25);
+#endif
 
     /* Number of Avoid::ShapeRef objects in the graph. These corresponds to 
the ones in the database. */
     dag->object_nr = 0;
@@ -646,8 +668,15 @@
        unsigned long idx;
        struct bu_hash_entry *hsh_entry = bu_find_hash_entry(dag->ids, 
(unsigned char *)id, strlen(id) + 1, &prev, &idx);
        if(hsh_entry) {
+#if defined LIBAVOID_LATEST_API
+          Box bbox = (*it)->polygon().offsetBoundingBox(0);
+          minX = bbox.min[LIBX];
+          minY = bbox.min[LIBY];
+          maxX = bbox.max[LIBX];
+          maxY = bbox.max[LIBY];
+#else
            (*it)->polygon().getBoundingRect(&minX, &minY, &maxX, &maxY);
-
+#endif
            prev = NULL;
            struct bu_hash_entry *hsh_entry_type = 
bu_find_hash_entry(dag->object_types, hsh_entry->value,
                                                                      
strlen((char *)hsh_entry->value) + 1, &prev, &idx);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to