Menu

Puzzled by the "plugin"...

Help
cLockey
2014-12-05
2014-12-17
  • cLockey

    cLockey - 2014-12-05

    Hello, I'm a newbie with Tulip. The "plugin" is puzzling me so much, I do not know what role it plays in tulip, and what's the connection between plugins and algorithms. Moreover, how to use a plugin? I want to use the google map in my project(I'm using tulip-4_4_0 in vs2010 with C++), I just load a plugin by doing this:
    tlp::PluginLibraryLoader::loadPluginLibrary("GeographicView-4_4_0.dll");

    What should be the next steps? Is there any demos about using plugins? I didn't find demos about this in homepage of tulip..

     
  • Adam Miller

    Adam Miller - 2014-12-05

    Well, in tulip, all of the various features are plugins, since Tulip is both a provided program and a library for development of visualizations. If you buy "API Design for C++", it tells you about the PIMPL idiom and other important design considerations. You might want to upgrade your tulip to the latest version and take advantage of any bug fixes.

    By "using plugins" I'm pretty sure that you mean that you want to use the GUI, and not author your own, right?

     
    • cLockey

      cLockey - 2014-12-08

      Thanks Adam, but are you telling me that I should use the "tulip-gui.dll" in tulip_src?
      Actually, I'm in a hurry to do this two things:
      First, show Google Map in my program.
      Second, add interactors to my program.

      Can you just tell me what to do after loadPluginLibrary("GeographicView-4_4_0.dll")? Maybe this will help me to understand the "plugin".
      And I added an interactor through this sentence:
      MyWidget.installEventFilter(MouseElementDeleter);
      Can all interactors be added in this way?

       
  • Adam Miller

    Adam Miller - 2014-12-08

    Um, I have absolutely no idea what dll to use. If you use CMake, you can just consume tulip as a dependency, and then it won't matter. You'll just point to the libs dir, and include whatever you need. CMake will determine your dependencies automatically and link shit for you.

    I've not used or designed the GeographicView plugin; I don't know that I would be of much help. I think what you want is to be able to use it in a gui, but the tulip gui demonstrates most of the things in the tulip library, the geographic view included. You can switch to it, do you know how? Do you need some kind of custom functionality?

    Um, I don't know much about the interactors model. To understand what can be passed where, I suggest you review the graphviz generated documentation of the class hierarchy. It gets complicated and difficult when you don't understand the source you're working with.
    http://tulip.labri.fr/Documentation/current/doxygen/html/inherits.html

    Also, there are some examples here:http://tulip.labri.fr/Documentation/current/doxygen/html/examples.html

    Have you seen those?

     
    • cLockey

      cLockey - 2014-12-10

      Thank you so much for guiding me. Now I have known what a "plugin" actually do. Well, there's still a question, I know that "Algorithm plugins" can be applied to a graph by this:
      myGraph->applyPropertyAlgorithm("Dag Level", &dagLevel, errorMessage);
      But when it comes to the "View plugins"(maybe GeographicView or ScatterPlot2DView), what should be the correct way to put a graph on a view? I did this in my program:
      GoogleMapsView *gmv;
      if(PluginLister::pluginExists(pluginName))
      {
      gmv = dynamic_cast<GoogleMapsView*>(tlp::PluginLister::getPluginObject(pluginName, NULL));
      }
      gmv->setupUi();
      gmv->setGraph(myGraph);
      A runtime error occured when it went to the sentence: gmv->setGraph(myGraph);
      If I delete this sentence, the view shows up but any interation will cause an error. I believe there's something I missed when using the view plugin. Is there some demos about using view plugins?
      I searched in this forum and knew that you had used the "ScatterPlot2DView" plugin, can you give me an example about using "ScatterPlot2dView"?

       
  • Adam Miller

    Adam Miller - 2014-12-10

    Well, I know for sure that the tulip gui certainly demonstrates it's use. You just have to find an instance of some call in the source. If you were to just download the source from SF here where we're commenting, you could use Facebook's pfff code indexing and exploration to construct some queries to intelligently try and narrow that down.

    And yeah, the tulip software is full of critical, denial of service, crash-causing bugs. Even just interacting with the gui itself will reveal corners of execution unaccounted for in unit tests. Sorry to say it, but that's the honest truth.

    Why not debug your program by giving it debug symbols, and finding a backtrace by letting it crash-that would give us useful information. Compose several backtraces please.

    I don't know that I ever wrote any code that consumed the ScatterPlot2DView, but if you could point me to the forum response maybe that would jar my memory.

     
    • cLockey

      cLockey - 2014-12-12

      Thank you Adam. Well, I didn't post the errors here because I don't know how to access to the view plugins until now.
      As far as I know, the "ControllerViewsManager" can be used to create views of "view plugins"(the plugins in the "view" folder in tulip 3.5 source files).
      Well, I'm now using tulip 4.4, but there's no "ControllerViewsManager" anymore, I'd like to know which is the alternative?

       
  • Adam Miller

    Adam Miller - 2014-12-12

    I've other ever bothered to familiarize myself with the Tulip version that corresponds to the SVN repo and what's available to download as the main gui.

    I couldn't tell you anything about Tulip 3.5 because I don't have the time to familiarize myself with that either. And honestly, Tulip has gone through major revisions, it's probably best not to confuse or muddle major versions of the source. Just use the svn/tulip directory, and then I can help you.

     
  • Antoine Lambert

    Antoine Lambert - 2014-12-17

    Hi, sorry for the late answer

    Please find attached the sources of a sample standalone program that
    creates, initializes and displays a Tulip Geographic view.
    You should be able to adapt that code to fit your needs.
    I tested it successfully on Windows with MinGW 4.9.2 and Visual Studio 2013.

    To benefits from the latest Tulip udates, I truly advised you
    to compile Tulip yourself from the svn trunk. Some optimisations
    and bug fixes have recently been committed to the Geographic view.

    Cheers

     

Log in to post a comment.