Skip to content

Commit

Permalink
Here it still worked?
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Dec 24, 2016
1 parent e10030b commit 072436f
Show file tree
Hide file tree
Showing 13 changed files with 1,233 additions and 23 deletions.
735 changes: 730 additions & 5 deletions BoostGraphTutorial/boost_graph_tutorial.pri

Large diffs are not rendered by default.

439 changes: 437 additions & 2 deletions BoostGraphTutorial/boost_graph_tutorial_test.pri

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions BoostGraphTutorial/boost_graph_tutorial_test_no_graphviz.pro
@@ -1,6 +1,9 @@
include(any_test.pri)
include(boost_graph_tutorial_no_graphviz.pri)
include(boost_graph_tutorial_test_no_graphviz.pri)

DEFINES += BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ

include(boost_graph_tutorial.pri)
include(boost_graph_tutorial_test.pri)

#LIBS += -lboost_regex

Expand Down
1 change: 1 addition & 0 deletions BoostGraphTutorial/bundled_edges_writer.cpp
@@ -0,0 +1 @@
#include "custom_and_selectable_vertices_writer.h"
4 changes: 4 additions & 0 deletions BoostGraphTutorial/bundled_edges_writer.h
@@ -1,6 +1,10 @@
#ifndef BUNDLED_EDGES_WRITER_H
#define BUNDLED_EDGES_WRITER_H

#ifndef BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ

#include "bundled_edges_writer.impl"

#endif //BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ

#endif // BUNDLED_EDGES_WRITER_H
3 changes: 3 additions & 0 deletions BoostGraphTutorial/convert_dot_to_svg.cpp
@@ -1,3 +1,6 @@
#include "convert_dot_to_svg.h"

#ifndef BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ
#include "convert_dot_to_svg.impl"
#endif // BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ

2 changes: 2 additions & 0 deletions BoostGraphTutorial/convert_dot_to_svg.h
@@ -1,11 +1,13 @@
#ifndef CONVERT_DOT_TO_SVG_H
#define CONVERT_DOT_TO_SVG_H

#ifndef BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ
#include <string>

void convert_dot_to_svg(
const std::string& dot_filename,
const std::string& svg_filename
);
#endif // BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ

#endif // CONVERT_DOT_TO_SVG_H
4 changes: 4 additions & 0 deletions BoostGraphTutorial/convert_dot_to_svg_test.cpp
@@ -1,10 +1,14 @@
#include "convert_dot_to_svg.h"
#include <boost/test/unit_test.hpp>

#ifndef BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ

BOOST_AUTO_TEST_CASE(test_convert_dot_to_svg)
{
BOOST_CHECK_THROW(
convert_dot_to_svg("dont_exists.dot", "dont_exists.svg"),
std::invalid_argument
);
}

#endif // BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ
Expand Up @@ -76,7 +76,6 @@ BOOST_AUTO_TEST_CASE(create_all_direct_neighbour_custom_and_selectable_edges_and
}, { false, true, false }
)
);

const int sz{3};
BOOST_CHECK(sz == static_cast<int>(v.size()));
for (int i=0; i!=sz; ++i)
Expand Down
Expand Up @@ -69,6 +69,29 @@ BOOST_AUTO_TEST_CASE(create_all_direct_neighbour_named_edges_and_vertices_subgra
);
const int sz{3};
BOOST_CHECK(sz == static_cast<int>(v.size()));
#ifndef BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ
for (int i=0; i!=sz; ++i)
{
const auto g = v[i];
const std::string base_filename{"create_all_direct_neighbour_named_edges_and_vertices_subgraphs_" + std::to_string(i)};
const std::string dot_filename{base_filename + ".dot"};
const std::string svg_filename{base_filename + ".svg"};
save_named_edges_and_vertices_graph_to_dot(g, dot_filename);
convert_dot_to_svg(dot_filename, svg_filename);
copy_file(
dot_filename,
"../BoostGraphTutorial/" + dot_filename,
copy_file_mode::allow_overwrite
);
copy_file(
svg_filename,
"../BoostGraphTutorial/" + svg_filename,
copy_file_mode::allow_overwrite
);
std::remove(dot_filename.c_str());
std::remove(svg_filename.c_str());
}
#endif // BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ
}
//Petersen Graph
{
Expand Down
@@ -1,4 +1,3 @@
#ifndef BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ
#include "create_nasty_directed_custom_and_selectable_edges_and_vertices_graph.h"

#include <boost/test/unit_test.hpp>
Expand All @@ -20,6 +19,7 @@
#include "add_custom_and_selectable_vertex.h"


#ifndef BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ
BOOST_AUTO_TEST_CASE(create_nasty_directed_custom_and_selectable_edges_and_vertices_graph_through)
{
//Create the .dot and .svg of the 'create_nasty_directed_custom_and_selectable_edges_and_vertices_graph' chapter
Expand Down
3 changes: 3 additions & 0 deletions BoostGraphTutorial/is_valid_dot_file_test.cpp
@@ -1,5 +1,6 @@
#include "is_valid_dot_file.h"

#include <fstream>
#include <boost/test/unit_test.hpp>
#include "create_empty_directed_graph.h"
#include "create_empty_undirected_graph.h"
Expand All @@ -10,6 +11,7 @@
#include "file_to_vector.h"
#include "is_regular_file.h"

#ifndef BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ
BOOST_AUTO_TEST_CASE(is_valid_dot_file_empty_undirected_graph)
{
//An empty undirected graph should be convertable to a valid .dot file
Expand Down Expand Up @@ -57,6 +59,7 @@ BOOST_AUTO_TEST_CASE(is_valid_dot_file_k3_graph)
BOOST_CHECK(is_valid_dot_file(filename));
std::remove(filename.c_str());
}
#endif // BOOST_GRAPH_TUTORIAL_NO_GRAPHVIZ

BOOST_AUTO_TEST_CASE(is_valid_dot_file_20160319)
{
Expand Down
32 changes: 20 additions & 12 deletions README.md
Expand Up @@ -26,25 +26,33 @@ This tutorial offers examples to use Boost.Graph that are:

Boost.Graph is a C++ library that is part of [Boost](http://www.boost.org).

## Usage
## I want to contribute!

In your `.pro` file, add:
Awesome! As I am aware, that there are some corners in the manual that are unfinished.

```
include([your_path]/BoostGraphTutorial/BoostGraphTutorial/boost_graph_tutorial.pri)
```
You can:

Where [your_path] is the folder above the `BoostGraphTutorial` folder.
* Fix an existing Issue
* Add an Issue
* Submit a Pull Request
* Send me an email

If you cannot install GraphViz, instead use:
Also typo's and writing suggestions are welcome.

```
include([your_path]/BoostGraphTutorial/BoostGraphTutorial/boost_graph_tutorial_no_graphviz.pri)
```
When writing code, please follow the coding standards and patterns used
in this project.

## I want to contribute!
For example, take the function `f`:

See [CONTRIBUTING.md](CONTRIBUTING.md)
* `f` will be defined in `f.impl`. This file will be shown in the LyX document
* If `f` is a template function, `f` its definition will be reachable from `f.h`, by `#include "f.impl"`
* If `f` is a non-template function, `f` its definition will be reachable from `f.cpp`, by `#include "f.impl"`
* The function `f_demo` will demonstrate the use of `f`. This file will be shown in the LyX document
* The function `void f_demo() noexcept` will be defined in `f_demo.impl`.
* The function `f_test` will test `f` and also call the function `f_demo`
* The function `void f_test() noexcept` will be declared in `f.h`
* The function `void f_test() noexcept` will be defined in `f.cpp`
* The function `f_test` will be called in the `main` function

## Other resources

Expand Down

0 comments on commit 072436f

Please sign in to comment.