Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ncphp
/
mcClasses
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cb42af21
authored
Jan 18, 2014
by
sn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Svg Klasse
1 parent
91fb10c7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
file/class_mcSvg.inc.php
include.php
file/class_mcSvg.inc.php
0 → 100644
View file @
cb42af2
<?php
class
mcSvg
{
public
static
function
getGraticuleAsDomElement
(
DOMElement
$param_domelement
,
$param_x
=
0
,
$param_y
=
0
,
$param_lenght
=
10
,
$param_disableCircleIfSmallAs
=
false
)
{
$group
=
new
DOMElement
(
'g'
);
$group
=
$param_domelement
->
appendChild
(
$group
);
if
(
$param_disableCircleIfSmallAs
&&
$param_lenght
>=
$param_disableCircleIfSmallAs
)
{
// <circle cx ="40" cy ="40" r ="20" />
$circle
=
$group
->
appendChild
(
new
DOMElement
(
'circle'
));
$circle
->
setAttribute
(
'cx'
,
$param_x
);
$circle
->
setAttribute
(
'cy'
,
$param_y
);
$circle
->
setAttribute
(
'r'
,
$param_lenght
/
3
);
$circle
->
setAttribute
(
'style'
,
'fill:#FFFFFF; stroke:black; stroke-width:.01cm;'
);
}
// <line x1="5" y1="5" x2="200" y2="100" style="stroke:black;stroke-width:3;" />
$line_vertikal
=
$group
->
appendChild
(
new
DOMElement
(
'line'
));
$line_vertikal
->
setAttribute
(
'x1'
,
$param_x
);
$line_vertikal
->
setAttribute
(
'y1'
,
$param_y
-
(
$param_lenght
/
2
));
$line_vertikal
->
setAttribute
(
'x2'
,
$param_x
);
$line_vertikal
->
setAttribute
(
'y2'
,
$param_y
+
(
$param_lenght
/
2
));
$line_vertikal
->
setAttribute
(
'style'
,
'stroke:black; stroke-width:.01cm;'
);
$line_horizontal
=
$group
->
appendChild
(
new
DOMElement
(
'line'
));
$line_horizontal
->
setAttribute
(
'x1'
,
$param_x
-
(
$param_lenght
/
2
));
$line_horizontal
->
setAttribute
(
'y1'
,
$param_y
);
$line_horizontal
->
setAttribute
(
'x2'
,
$param_x
+
(
$param_lenght
/
2
));
$line_horizontal
->
setAttribute
(
'y2'
,
$param_y
);
$line_horizontal
->
setAttribute
(
'style'
,
'stroke:black; stroke-width:.01cm;'
);
return
$group
;
}
}
?>
include.php
View file @
cb42af2
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
require_once
$__PATH_to_mcClasses
.
'class_mcMail.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'class_mcMail.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'class_mcConfig.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'class_mcConfig.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcFile.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcFile.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcSvg.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcInkscape.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcInkscape.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcCairoSvg.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcCairoSvg.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcImage.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'file/class_mcImage.inc.php'
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment