Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChimeraTK Mirror
ApplicationCore
Commits
b2766ecd
Commit
b2766ecd
authored
7 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
allow creation of a dot graph containing the variable model
parent
dde7837d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/EntityOwner.h
+6
-0
6 additions, 0 deletions
include/EntityOwner.h
src/EntityOwner.cc
+46
-0
46 additions, 0 deletions
src/EntityOwner.cc
with
52 additions
and
0 deletions
include/EntityOwner.h
+
6
−
0
View file @
b2766ecd
...
...
@@ -109,6 +109,12 @@ namespace ChimeraTK {
/** Print the full hierarchy to stdout. */
void
dump
(
const
std
::
string
&
prefix
=
""
)
const
;
/** Create Graphviz dot graph write to file */
void
dumpGraph
(
const
std
::
string
&
fileName
=
"graph.dot"
)
const
;
/** Create Graphviz dot graph write to stream, excluding the surrounding digraph command */
void
dumpGraphInternal
(
std
::
ostream
&
stream
)
const
;
protected
:
...
...
This diff is collapsed.
Click to expand it.
src/EntityOwner.cc
+
46
−
0
View file @
b2766ecd
...
...
@@ -146,6 +146,52 @@ namespace ChimeraTK {
/*********************************************************************************************************************/
void
EntityOwner
::
dumpGraph
(
const
std
::
string
&
fileName
)
const
{
std
::
fstream
file
(
fileName
,
std
::
ios_base
::
out
);
file
<<
"digraph G {"
<<
std
::
endl
;
dumpGraphInternal
(
file
);
file
<<
"}"
<<
std
::
endl
;
file
.
close
();
std
::
cout
<<
"HIER "
<<
fileName
<<
std
::
endl
;
}
/*********************************************************************************************************************/
void
EntityOwner
::
dumpGraphInternal
(
std
::
ostream
&
stream
)
const
{
std
::
string
myDotNode
=
getQualifiedName
();
std
::
replace
(
myDotNode
.
begin
(),
myDotNode
.
end
(),
'/'
,
'_'
);
stream
<<
myDotNode
<<
"[label=
\"
"
<<
getName
()
<<
"
\"
]"
<<
std
::
endl
;
for
(
auto
&
node
:
getAccessorList
())
{
std
::
string
dotNode
=
node
.
getQualifiedName
();
std
::
replace
(
dotNode
.
begin
(),
dotNode
.
end
(),
'/'
,
'_'
);
stream
<<
dotNode
<<
"[label=
\"
{"
<<
node
.
getName
()
<<
"| {"
;
bool
first
=
true
;
for
(
auto
tag
:
node
.
getTags
())
{
if
(
!
first
)
{
stream
<<
"|"
;
}
else
{
first
=
false
;
}
stream
<<
tag
;
}
stream
<<
"}}
\"
, shape=record]"
<<
std
::
endl
;
stream
<<
" "
<<
myDotNode
<<
" -> "
<<
dotNode
<<
std
::
endl
;
}
for
(
auto
&
submodule
:
getSubmoduleList
())
{
std
::
string
dotNode
=
submodule
->
getQualifiedName
();
std
::
replace
(
dotNode
.
begin
(),
dotNode
.
end
(),
'/'
,
'_'
);
stream
<<
" "
<<
myDotNode
<<
" -> "
<<
dotNode
<<
std
::
endl
;
submodule
->
dumpGraphInternal
(
stream
);
}
}
/*********************************************************************************************************************/
void
EntityOwner
::
addTag
(
const
std
::
string
&
tag
)
{
for
(
auto
&
node
:
getAccessorList
())
node
.
addTag
(
tag
);
for
(
auto
&
submodule
:
getSubmoduleList
())
submodule
->
addTag
(
tag
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment