Skip to content

Commit

Permalink
feat(util): Add GraphViz helper types (#3635)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger authored Sep 20, 2024
1 parent 76a8f79 commit 4aa7d19
Show file tree
Hide file tree
Showing 5 changed files with 452 additions and 0 deletions.
110 changes: 110 additions & 0 deletions Core/include/Acts/Utilities/GraphViz.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// This file is part of the Acts project.
//
// Copyright (C) 2024 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

#include <ostream>
#include <vector>

namespace Acts::GraphViz {

enum class Shape {
Box,
Polygon,
Ellipse,
Oval,
Circle,
Point,
Egg,
Triangle,
Plaintext,
Plain,
Diamond,
Trapezium,
Parallelogram,
House,
Pentagon,
Hexagon,
Septagon,
Octagon,
DoubleCircle,
DoubleOctagon,
TripleOctagon,
InvTriangle,
InvTrapezium,
InvHouse,
Mdiamond,
Msquare,
Mcircle,
Rect,
Rectangle,
Square,
Star,
None,
Underline,
Cylinder,
Note,
Tab,
Folder,
Box3d,
Component,
Promoter,
Cds,
Terminator,
Utr,
PrimerSite,
RestrictionSite,
FivePOverhang,
ThreePOverhang,
NOverhang,
Assembly,
Signature,
Insulator,
Ribosite,
RNAStab,
ProteaseSite,
ProteinStab,
RPromoter,
RArrow,
LArrow,
LPromoter
};

std::ostream& operator<<(std::ostream& os, const Shape& shape);

enum class Style {
Filled,
Invisible,
Diagonals,
Rounded,
Dashed,
Dotted,
Solid,
Bold
};

std::ostream& operator<<(std::ostream& os, const Style& style);

struct Node {
std::string id;
std::string label;
Shape shape = Shape::Ellipse;
std::vector<Style> style = {Style::Solid};
};

std::ostream& operator<<(std::ostream& os, const Node& node);

struct Edge {
Node from;
Node to;
Style style = Style::Solid;
};

std::ostream& operator<<(std::ostream& os, const Edge& node);

} // namespace Acts::GraphViz
1 change: 1 addition & 0 deletions Core/src/Utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ target_sources(
TrackHelpers.cpp
BinningType.cpp
Intersection.cpp
GraphViz.cpp
)
Loading

0 comments on commit 4aa7d19

Please sign in to comment.