| 1 | package yEd::Edge::QuadCurveEdge; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use yEd::PropertyBasedObject; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use base qw(yEd::Edge); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | yEd::Edge::QuadCurveEdge - quadratic curve Edge | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | Creates an Edge with quadratic curving. | ||
| 14 | |||
| 15 | It can have multiple waypoints which may actually lie outside the Edge depending on 'straightness'. | ||
| 16 | |||
| 17 | A 'straightness' set to 1 will look like a Polyline Edge without smoohting. | ||
| 18 | |||
| 19 | Make sure to have a look at L<yEd::Edge>, the properties and functions described there will not be repeated here. | ||
| 20 | |||
| 21 | =head1 SUPPORTED FEATURES | ||
| 22 | |||
| 23 | The type specific features are fully supported. | ||
| 24 | |||
| 25 | For basic Edge type feature support and which Edge types are supported see L<yEd::Edge>. | ||
| 26 | |||
| 27 | =head1 PROPERTIES | ||
| 28 | |||
| 29 | =head2 all properties from base class | ||
| 30 | |||
| 31 | L<yEd::Edge> | ||
| 32 | |||
| 33 | =head2 straightness | ||
| 34 | |||
| 35 | Type: ratio (ufloat [0-1]) | ||
| 36 | |||
| 37 | Default: 0.1 | ||
| 38 | |||
| 39 | The straightness. | ||
| 40 | |||
| 41 | =head1 SUBROUTINES/METHODS | ||
| 42 | |||
| 43 | =head2 all functions from base class | ||
| 44 | |||
| 45 | L<yEd::Edge> | ||
| 46 | |||
| 47 | =cut | ||
| 48 | |||
| 49 | |||
| 50 | sub new { | ||
| 51 | 0 | ▶ | my ($class, @args) = @_; |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 52 | 0 | my $self = bless {}, $class; | |
| 53 | 0 | return $self->_init(@args); | |
| 54 | } | ||
| 55 | |||
| 56 | sub _init { | ||
| 57 | 0 | ▶ | my ($self, @args) = @_; |
|
Subroutine
_init: not called CC=1 SCAR=6.9
| |||
| 58 | 0 | $self->straightness(0.1); | |
| 59 | 0 | $self->SUPER::_init(@args); | |
| 60 | 0 | return $self; | |
| 61 | } | ||
| 62 | |||
| 63 | sub straightness { | ||
| 64 | 0 | ▶ | return _PROPERTY($match{'ratio'}, @_); |
|
Subroutine
straightness: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 65 | } | ||
| 66 | |||
| 67 | sub _addTypeNode { | ||
| 68 | 0 | ▶ | my ($self, $node) = @_; |
|
Subroutine
_addTypeNode: not called CC=1 SCAR=6.9
| |||
| 69 | 0 | my $type = $node->addNewChild('', 'y:QuadCurveEdge'); | |
| 70 | 0 | $type->setAttribute('straightness', $self->straightness()); | |
| 71 | 0 | return $type; | |
| 72 | } | ||
| 73 | |||
| 74 | =head1 SEE ALSO | ||
| 75 | |||
| 76 | L<yEd::Document> for further informations about the whole package | ||
| 77 | |||
| 78 | L<yEd::PropertyBasedObject> for further basic information about properties and their additional functions | ||
| 79 | |||
| 80 | L<yEd::Edge> for information about the Edge base class and which other Edge types are currently supported | ||
| 81 | |||
| 82 | =cut | ||
| 83 | |||
| 84 | 1 | 1; | |