first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,55 @@
<?php namespace RedeyeVentures\GeoPattern\SVGElements;
abstract class Base
{
protected $tag;
protected $elements;
protected $args;
function __construct($args)
{
$this->args = $args;
}
public function elementsToString()
{
$string = ' ';
foreach ($this->elements as $key => $value)
{
$string .= "$key=\"$value\" ";
}
return $string;
}
public function argsToString()
{
$string = '';
foreach ($this->args as $key => $value)
{
if (is_array($value))
{
$string .= "$key=\"";
foreach ($value as $k => $v)
{
$string .= "$k:$v;";
}
$string .= '" ';
}
else
{
$string .= "$key=\"$value\" ";
}
}
return $string;
}
public function getString()
{
return "<{$this->tag}{$this->elementsToString()}{$this->argsToString()}/>";
}
function __toString()
{
return $this->getString();
}
}
@@ -0,0 +1,16 @@
<?php namespace RedeyeVentures\GeoPattern\SVGElements;
class Circle extends Base
{
protected $tag = 'circle';
function __construct($cx, $cy, $r, $args=array())
{
$this->elements = [
'cx' => $cx,
'cy' => $cy,
'r' => $r,
];
parent::__construct($args);
}
}
@@ -0,0 +1,38 @@
<?php namespace RedeyeVentures\GeoPattern\SVGElements;
class Group extends Base
{
protected $tag = 'g';
protected $items;
function __construct($items=array(), $args=array())
{
$this->items = $items;
$this->args = $args;
}
function addItem($item)
{
$this->items[] = $item;
return $this;
}
function setArgs($args)
{
$this->args = $args;
return $this;
}
function getString()
{
$svgString = '';
$svgString .= "<{$this->tag} {$this->argsToString($this->args)}>";
foreach ($this->items as $item)
{
$svgString .= $item;
}
$svgString .= "</{$this->tag}>";
return $svgString;
}
}
@@ -0,0 +1,14 @@
<?php namespace RedeyeVentures\GeoPattern\SVGElements;
class Path extends Base
{
protected $tag = 'path';
function __construct($d, $args=array())
{
$this->elements = [
'd' => $d,
];
parent::__construct($args);
}
}
@@ -0,0 +1,14 @@
<?php namespace RedeyeVentures\GeoPattern\SVGElements;
class Polyline extends Base
{
protected $tag = 'polyline';
function __construct($points, $args=array())
{
$this->elements = [
'points' => $points,
];
parent::__construct($args);
}
}
@@ -0,0 +1,17 @@
<?php namespace RedeyeVentures\GeoPattern\SVGElements;
class Rectangle extends Base
{
protected $tag = 'rect';
function __construct($x, $y, $width, $height, $args=array())
{
$this->elements = [
'x' => $x,
'y' => $y,
'width' => $width,
'height' => $height,
];
parent::__construct($args);
}
}