# t00041 - Context diagram filter test
## Config
```yaml
compilation_database_dir: ..
output_directory: puml
diagrams:
  t00041_class:
    type: class
    generate_packages: false
    glob:
      - ../../tests/t00041/t00041.cc
    using_namespace:
      - clanguml::t00041
    include:
      namespaces:
        - clanguml::t00041
      context:
        - clanguml::t00041::RR
      subclasses:
        - clanguml::t00041::ns1::N
    exclude:
      namespaces:
        - clanguml::t00041::detail
      relationships:
        - dependency
```
## Source code
File t00041.cc
```cpp
namespace clanguml::t00041 {

struct B { };

struct A { };

class AA : public A { };

struct R { };

struct RR;

struct D {
    RR *rr;
};

struct E { };

struct F { };

namespace detail {
struct G { };
} // namespace detail

struct H { };

struct RR : public R {
    E *e;
    F *f;
    detail::G *g;

    void foo(H *h) { }
};

struct RRR : public RR { };

namespace ns1 {
struct N { };

struct NN : public N { };

struct NM : public N { };
}

} // namespace clanguml::t00041

```
## Generated UML diagrams
![t00041_class](./t00041_class.svg "Context diagram filter test")
## Generated JSON models
```json
{
  "diagram_type": "class",
  "elements": [
    {
      "bases": [],
      "display_name": "clanguml::t00041::R",
      "id": "775317088453163919",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "R",
      "namespace": "clanguml::t00041",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 9
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00041::D",
      "id": "1798851434286108347",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "rr",
          "source_location": {
            "file": "../../tests/t00041/t00041.cc",
            "line": 14
          },
          "type": "clanguml::t00041::RR *"
        }
      ],
      "methods": [],
      "name": "D",
      "namespace": "clanguml::t00041",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 13
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00041::E",
      "id": "2158730167547707264",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "E",
      "namespace": "clanguml::t00041",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 17
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00041::F",
      "id": "430600213408545846",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "F",
      "namespace": "clanguml::t00041",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 19
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "775317088453163919",
          "is_virtual": false,
          "name": "clanguml::t00041::R"
        }
      ],
      "display_name": "clanguml::t00041::RR",
      "id": "175608867682236642",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "e",
          "source_location": {
            "file": "../../tests/t00041/t00041.cc",
            "line": 28
          },
          "type": "clanguml::t00041::E *"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "f",
          "source_location": {
            "file": "../../tests/t00041/t00041.cc",
            "line": 29
          },
          "type": "clanguml::t00041::F *"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "g",
          "source_location": {
            "file": "../../tests/t00041/t00041.cc",
            "line": 30
          },
          "type": "detail::G *"
        }
      ],
      "methods": [
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "foo",
          "parameters": [
            {
              "name": "h",
              "type": "clanguml::t00041::H *"
            }
          ],
          "type": "void"
        }
      ],
      "name": "RR",
      "namespace": "clanguml::t00041",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 27
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "175608867682236642",
          "is_virtual": false,
          "name": "clanguml::t00041::RR"
        }
      ],
      "display_name": "clanguml::t00041::RRR",
      "id": "819254010294444715",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "RRR",
      "namespace": "clanguml::t00041",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 35
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00041::ns1::N",
      "id": "220253364661036147",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "N",
      "namespace": "clanguml::t00041::ns1",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 38
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "220253364661036147",
          "is_virtual": false,
          "name": "clanguml::t00041::ns1::N"
        }
      ],
      "display_name": "clanguml::t00041::ns1::NN",
      "id": "618038667214398895",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "NN",
      "namespace": "clanguml::t00041::ns1",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 40
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [
        {
          "access": "public",
          "id": "220253364661036147",
          "is_virtual": false,
          "name": "clanguml::t00041::ns1::N"
        }
      ],
      "display_name": "clanguml::t00041::ns1::NM",
      "id": "1206750351408617127",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "NM",
      "namespace": "clanguml::t00041::ns1",
      "source_location": {
        "file": "../../tests/t00041/t00041.cc",
        "line": 42
      },
      "template_parameters": [],
      "type": "class"
    }
  ],
  "metadata": {
    "clang_uml_version": "0.3.5-27-g81c7ce7",
    "llvm_version": "Ubuntu clang version 15.0.6",
    "schema_version": 1
  },
  "name": "t00041_class",
  "relationships": [
    {
      "access": "public",
      "destination": "175608867682236642",
      "label": "rr",
      "source": "1798851434286108347",
      "type": "association"
    },
    {
      "access": "public",
      "destination": "648827958379389524",
      "source": "175608867682236642",
      "type": "dependency"
    },
    {
      "access": "public",
      "destination": "2158730167547707264",
      "label": "e",
      "source": "175608867682236642",
      "type": "association"
    },
    {
      "access": "public",
      "destination": "430600213408545846",
      "label": "f",
      "source": "175608867682236642",
      "type": "association"
    },
    {
      "access": "public",
      "destination": "775317088453163919",
      "source": "175608867682236642",
      "type": "extension"
    },
    {
      "access": "public",
      "destination": "175608867682236642",
      "source": "819254010294444715",
      "type": "extension"
    },
    {
      "access": "public",
      "destination": "220253364661036147",
      "source": "618038667214398895",
      "type": "extension"
    },
    {
      "access": "public",
      "destination": "220253364661036147",
      "source": "1206750351408617127",
      "type": "extension"
    }
  ],
  "using_namespace": "clanguml::t00041"
}
```
