Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
qgv
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
Container Registry
Model registry
Operate
Environments
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
Gepetto
qgv
Commits
1c769d0c
Commit
1c769d0c
authored
8 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow to render to file and add setNodePositionAttribute
parent
c8361a96
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
QGVCore/QGVNode.cpp
+8
-0
8 additions, 0 deletions
QGVCore/QGVNode.cpp
QGVCore/QGVNode.h
+2
-0
2 additions, 0 deletions
QGVCore/QGVNode.h
QGVCore/QGVScene.cpp
+14
-0
14 additions, 0 deletions
QGVCore/QGVScene.cpp
QGVCore/QGVScene.h
+3
-0
3 additions, 0 deletions
QGVCore/QGVScene.h
with
27 additions
and
0 deletions
QGVCore/QGVNode.cpp
+
8
−
0
View file @
1c769d0c
...
...
@@ -100,6 +100,14 @@ QString QGVNode::getAttribute(const QString &name) const
return
QString
();
}
QString
QGVNode
::
posToAttributeString
()
const
{
qreal
gheight
=
QGVCore
::
graphHeight
(
_scene
->
_graph
->
graph
());
qreal
width
=
ND_width
(
_node
->
node
())
*
DotDefaultDPI
;
qreal
height
=
ND_height
(
_node
->
node
())
*
DotDefaultDPI
;
return
QGVCore
::
qtToGvPos
(
QGVCore
::
centerToOrigin
(
pos
(),
-
width
,
-
height
),
gheight
);
}
void
QGVNode
::
setIcon
(
const
QImage
&
icon
)
{
_icon
=
icon
;
...
...
This diff is collapsed.
Click to expand it.
QGVCore/QGVNode.h
+
2
−
0
View file @
1c769d0c
...
...
@@ -43,6 +43,8 @@ public:
void
setAttribute
(
const
QString
&
label
,
const
QString
&
value
);
QString
getAttribute
(
const
QString
&
name
)
const
;
QString
posToAttributeString
()
const
;
void
setIcon
(
const
QImage
&
icon
);
enum
{
Type
=
UserType
+
2
};
...
...
This diff is collapsed.
Click to expand it.
QGVCore/QGVScene.cpp
+
14
−
0
View file @
1c769d0c
...
...
@@ -120,6 +120,14 @@ void QGVScene::setRootNode(QGVNode *node)
agset
(
_graph
->
graph
(),
root
,
node
->
label
().
toLocal8Bit
().
data
());
}
void
QGVScene
::
setNodePositionAttribute
()
{
foreach
(
QGVNode
*
node
,
_nodes
)
{
node
->
setAttribute
(
"pos"
,
node
->
posToAttributeString
().
toLocal8Bit
().
constData
());
node
->
setAttribute
(
"pin"
,
"true"
);
}
}
void
QGVScene
::
loadLayout
(
const
QString
&
text
)
{
_graph
->
setGraph
(
QGVCore
::
agmemread2
(
text
.
toLocal8Bit
().
constData
()));
...
...
@@ -199,6 +207,12 @@ void QGVScene::render (const QString &algorithm) {
algorithm
.
toLocal8Bit
().
data
(),
NULL
);
}
void
QGVScene
::
render
(
const
QString
algorithm
,
const
QString
filename
)
{
gvRenderFilename
(
_context
->
context
(),
_graph
->
graph
(),
algorithm
.
toLocal8Bit
().
data
(),
filename
.
toLocal8Bit
().
data
());
}
void
QGVScene
::
freeLayout
()
{
gvFreeLayout
(
_context
->
context
(),
_graph
->
graph
());
}
...
...
This diff is collapsed.
Click to expand it.
QGVCore/QGVScene.h
+
3
−
0
View file @
1c769d0c
...
...
@@ -50,9 +50,12 @@ public:
void
setRootNode
(
QGVNode
*
node
);
void
setNodePositionAttribute
();
void
loadLayout
(
const
QString
&
text
);
void
applyLayout
(
const
QString
&
algorithm
=
"dot"
);
void
render
(
const
QString
&
algorithm
);
void
render
(
const
QString
algorithm
,
const
QString
file
);
void
freeLayout
();
void
clear
();
...
...
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