examples/graph/main.cpp
Go to the documentation of this file.
1 // Examples
2 #include "GraphExamples.h"
3 
4 // TerraLib
8 #include <terralib/core/plugin.h>
9 
10 
11 // STL
12 #include <cstdlib>
13 #include <iostream>
14 #include <locale>
15 
16 
17 int main()
18 {
19  setlocale(LC_ALL,"C");
20 
21  try
22  {
23  //startup terralib
25 
26  //create a progress bar
27  std::unique_ptr<te::common::ConsoleProgressViewer> cpv(new te::common::ConsoleProgressViewer());
28 
29  //load all necessary modules
30  LoadModules();
31 
32  //-----------------------------------------------------------------------------------------------------
33  bool draw = true;
34 
35  //create ldd graph
36  CreateMSTGraph(draw);
37 
38  //-----------------------------------------------------------------------------------------------------
39 
40  //unload modules
42 
43  //finalize terralib
45  }
46  catch(const std::exception& e)
47  {
48  std::cout << std::endl << "An exception has occurred in the Graph examples: " << e.what() << std::endl;
49 
50  return EXIT_FAILURE;
51  }
52  catch(...)
53  {
54  std::cout << std::endl << "An unexpected exception has occurred in the Graph examples!" << std::endl;
55 
56  return EXIT_FAILURE;
57  }
58 
59  return EXIT_SUCCESS;
60 }
void CreateMSTGraph(bool draw)
Creates a MST GRAPH.
An utility class to control the startup and cleanup of the TerraLib Platform and its resources...
Include files for Core Plugin Library.
A singleton class used to manage tasks progresses and their viewers.
A progress viewer implementation for the console.
static PluginManager & instance()
Access the singleton.
void finalize()
It finalizes the TerraLib Platform.
static TerraLib & getInstance()
It returns a reference to the singleton instance.
void initialize()
It initializes the TerraLib Platform.
int main()
These routines show how to use the Graph module.
void clear()
Stop and unload all plugins, then clear the internal list of plugins.
void LoadModules()
Load terralib modules.