Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
ac460e8b
Commit
ac460e8b
authored
Mar 22, 2005
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Draw the actual obstacles from the obstacles table, including the label.
parent
c2ba6995
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
vis/floormap.in
vis/floormap.in
+36
-0
No files found.
vis/floormap.in
View file @
ac460e8b
...
...
@@ -617,6 +617,8 @@ sub dofloor($$)
my
$y1
=
$obrow
{
"
y1
"
};
my
$y2
=
$obrow
{
"
y2
"
};
my
$descr
=
$obrow
{
"
description
"
};
my
$label
=
$obrow
{
"
label
"
};
my
$drawit
=
$obrow
{
"
draw
"
};
my
$props
= {};
$props
->{
"
X1
"
} =
$x1
;
...
...
@@ -627,6 +629,40 @@ sub dofloor($$)
$props
->{
"
ISOBS
"
} = 1;
$areamap
->{
"
$id
"
} =
$props
;
if (
$drawit
) {
$err
=
$baseimage
->Draw(primitive=>'rectangle',
points=>
"
$x1
,
$y1
$x2
,
$y2
"
,
stroke=>'Black',
strokewidth=>'2');
warn
"
$err
"
if
"
$err
"
;
}
if (defined(
$label
) &&
$label
ne
""
&& (
$drawit
||
$show_exclusion
)) {
my
$pointsize
= 12;
my
$strlen
= length(
$label
);
my
$pointlen
= ((
$pointsize
* 0.45) *
$strlen
);
#
# Initially, lets try to put the label right in the middle.
#
my
$dlx
=
$x1
+ ((
$x2
-
$x1
)/2) - (
$pointlen
/ 2);
my
$dly
=
$y1
+ ((
$y2
-
$y1
)/2);
#
# If the label looks too big along the X axis, then
# move it below the box. Yep, very simplistic ...
#
if (
$dlx
<=
$x1
|| (
$dlx
+
$pointlen
) >=
$x2
) {
$dly
=
$y2
+
$pointsize
;
}
$err
=
$baseimage
->Annotate(fill=>'black',
x=>
$dlx
, y=>
$dly
,
pointsize=>
$pointsize
,
text=>
"
$label
"
);
warn
"
$err
"
if
"
$err
"
;
}
if (
$show_exclusion
) {
my
$obstacle_buffer
= 23; # XXX
my
$xmin
=
$x1
-
$obstacle_buffer
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment