<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi Miguel,<br>
    <br>
    the A and B points are indeed forced by the current RoutingWidget.
    This is ugly for a programming interface, so I'll change it soon.
    For the time being you can call setPosition(0, source) and
    setPosition(1, destination) instead of appending to the route
    request.<br>
    <br>
    I hope I'll find some time in the next days to improve it and write
    a little techbase tutorial on it.<br>
    <br>
    Regards,<br>
    Dennis<br>
    <br>
    On 08.10.2010 07:48, Miguel Chavez Gamboa wrote:
    <blockquote
      cite="mid:AANLkTimeY_BoriagABQYeVVsDJ2iy8KfQCDZfRjdHfG2@mail.gmail.com"
      type="cite">Hi again, i hope this mail does not get splitted like
      the others.
      <div><br>
      </div>
      <div>I modified the CMakeList.txt, to install the missing headers.
        Used the next code, but on the map the route is not shown, just
        the source (A) and Destination (B) Points are drawn. </div>
      <div><br>
      </div>
      <div>---Code---</div>
      <div><br>
      </div>
      <div>connect(theMap-&gt;model()-&gt;routingManager()-&gt;routingModel(),
        SIGNAL(routeCalculated(int)), SLOT(routeCalculated(int)));</div>
      <div>connect(theMap-&gt;model()-&gt;routingManager(),
        SIGNAL(routeRetrieved(GeoDataDocument*)),
        SLOT(routeRetrieved(GeoDataDocument*)));</div>
      <div><br>
      </div>
      <div>
        <div>RouteRequest * request =
          theMap-&gt;model()-&gt;routingManager()-&gt;routeRequest();</div>
        <div>request-&gt;setRoutePreference(RouteRequest::Pedestrian);</div>
        <div>GeoDataCoordinates source( -118.14498, 34.0259, 0.0,
          GeoDataCoordinates::Degree );</div>
        <div>request-&gt;append(source);</div>
        <div>GeoDataCoordinates destination( -118.0918, 34.0230, 0.0,
          GeoDataCoordinates::Degree );</div>
        <div>request-&gt;append(destination);</div>
        <div>theMap-&gt;model()-&gt;routingManager()-&gt;retrieveRoute(
          request );</div>
        <div>int routeCount =
theMap-&gt;model()-&gt;routingManager()-&gt;routingModel()-&gt;rowCount();</div>
      </div>
      <div><br>
      </div>
      <div>---Code---</div>
      <div><br>
      </div>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>
        The routeRetrieved signal from ther RoutingManager is emitted,
        the routeCount gets 0, and routingModel's signal
        routeCalculated(int) is not emitted. </div>
      <div>Why? Am I missing something to calcuate the route?</div>
      <div>
        <br>
      </div>
      <div>If I use the MarbleControlBox and I enable its routing tab,
        in the routing tab, i can see four "points", A,B,C and D, I
        suppose because of the RouteRequest-&gt;Add(). And if I remove
        by hand the A and B which are not drawn (i cant see them in all
        the globe), everything works fine.</div>
      <div><br>
      </div>
      <div>But if i do not remove the A and B points (sources and
        destination that I think are set by the MarbleControlBox), and
        set the work Offline (of the RoutingManager) as:</div>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>
        <br>
      </div>
      <div>1.- setWorkOffline(true): I can see the "Get Directions"
        button with a couple of circles spinning, which i can think it
        is busy getting the route directions, and it never finishes, it
        gets the street names, city,etc... A and B are empty, my added
        points are C and D, which i think this is the reason.</div>
      <div><br>
      </div>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>2.- setWorkOffline(false), It gets a "0.0 km (Yours)", it
        gets the street names, city,etc... but no route is calculated
        (again, A and B are empty, B and C are my added points).</div>
      <div><br>
      </div>
      <div>How can i programatically remove the empty positions A and B
        or replace the empty ones by the source and destination
        coordinates i created? I tried with RouteRequest-&gt;remove()
        but did not worked.</div>
      <div><br>
      </div>
      <div>My intention is not to use the MarbleControlBox, because user
        intervention is not needed in my application, the source and
        destination points are taken from a database and should be set
        programatically.</div>
      <div><br>
      </div>
      <div>Thanks for your help.<br>
        <br>
        <div class="gmail_quote">On Thu, Oct 7, 2010 at 1:07 AM, Dennis
          Nienhüser <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:earthwings@gentoo.org">earthwings@gentoo.org</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">Hi,<br>
            <br>
            the routing related classes are not yet exported: There'll
            be some API changes<br>
            in them in the near future that will change the way route
            request options are<br>
            set and some other changes to make it easily usable from the
            outside. I want<br>
            to export them for KDE 4.6, however, to support that kind of
            usage.<br>
            <br>
            If you're willing to adapt your code to any API changes, you
            can manually<br>
            export the missing headers (RoutingModel, RoutingManager,
            RouteRequest may be<br>
            enough) now. I haven't fully tested that yet, YMMV. It's
            probably a good idea<br>
            to CC yourself to bug 248086 [1] which I'll update with the
            progress on this.<br>
            Note that the code posted in comment #1 in that bug is
            already a bit outdated,<br>
            RouteSkeleton is now RouteRequest and shouldn't be created
            on its own, but<br>
            requested from the RoutingManager.<br>
            <br>
            Regards,<br>
            Dennis<br>
            <br>
            [1] <a moz-do-not-send="true"
              href="https://bugs.kde.org/show_bug.cgi?id=248086"
              target="_blank">https://bugs.kde.org/show_bug.cgi?id=248086</a><br>
            <br>
            Am Donnerstag, 7. Oktober 2010, um 06:03:50 schrieb Miguel
            Chavez Gamboa:<br>
            <div>
              <div class="h5">&gt; Hi,<br>
                &gt;<br>
                &gt;<br>
                &gt; Sorry for the inconvenience caused by my previous
                mail with formated text,<br>
                &gt; this goes in plain text.<br>
                &gt;<br>
                &gt;<br>
                &gt; Im trying to incorporate marble and its new offline
                routing capabilities in<br>
                &gt; my own project, and Im reading the marble source
                code and the<br>
                &gt; documentation. From the marble source code, i got
                some code to start and<br>
                &gt; experiment.<br>
                &gt;<br>
                &gt; The next code (adapted from marble source) is
                causing me some troubles.<br>
                &gt;<br>
                &gt; RoutingManager *routingManager =
                theMap-&gt;model()-&gt;routingManager();<br>
                &gt; RoutingModel   *routingModel   =
                routingManager-&gt;routingModel();<br>
                &gt; bool hasRoute = routingModel-&gt;rowCount(); //here
                is the problem<br>
                &gt;<br>
                &gt; My includes are:<br>
                &gt;<br>
                &gt; #include &lt;marble/global.h&gt;<br>
                &gt; #include &lt;marble/MarbleModel.h&gt;<br>
                &gt; #include &lt;marble/RoutingManager.h&gt;<br>
                &gt;<br>
                &gt; The third line (getting the rowCount), causes the
                compilation to fail with<br>
                &gt; the error:<br>
                &gt; error: invalid use of incomplete type ‘struct
                Marble::RoutingModel’<br>
                &gt; As I have seen, the RoutingModel Class is defined
                (as Class RoutingModel;)<br>
                &gt;  in RoutingManager.h, but included in the
                ControlView.cpp file as '<br>
                &gt; #include "routing/RoutingModel.h" ' .<br>
                &gt;<br>
                &gt; Are the "routing"-folder headers  inside the marble
                lib sources not<br>
                &gt; installed (at /usr/include/marble) ?<br>
                &gt; Is this intentional, only for the Marble
                application (not the library) ?<br>
                &gt;<br>
                &gt; What is the correct way to incorporate routing
                capabilities to another<br>
                &gt; application? What Classes to use? The
                RoutingManager?<br>
                &gt;<br>
                &gt;<br>
                &gt; Im using the marble code from the anonymous kde svn
                repository (svn://<br>
                &gt; <a moz-do-not-send="true"
                  href="http://anonsvn.kde.org/home/kde/trunk/KDE/kdeedu/marble/src"
                  target="_blank">anonsvn.kde.org/home/kde/trunk/KDE/kdeedu/marble/src</a>).<br>
                &gt;<br>
                &gt; Thanks in advance,<br>
                <br>
              </div>
            </div>
            _______________________________________________<br>
            Marble-devel mailing list<br>
            <a moz-do-not-send="true" href="mailto:Marble-devel@kde.org">Marble-devel@kde.org</a><br>
            <a moz-do-not-send="true"
              href="https://mail.kde.org/mailman/listinfo/marble-devel"
              target="_blank">https://mail.kde.org/mailman/listinfo/marble-devel</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        Miguel Chavez Gamboa<br>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>